bzr branch
http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
1 |
# Copyright (C) 2006 by Szilveszter Farkas (Phanatic) <szilveszter.farkas@gmail.com>
|
2 |
||
3 |
# This program is free software; you can redistribute it and/or modify
|
|
4 |
# it under the terms of the GNU General Public License as published by
|
|
5 |
# the Free Software Foundation; either version 2 of the License, or
|
|
6 |
# (at your option) any later version.
|
|
7 |
||
8 |
# This program is distributed in the hope that it will be useful,
|
|
9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 |
# GNU General Public License for more details.
|
|
12 |
||
13 |
# You should have received a copy of the GNU General Public License
|
|
14 |
# along with this program; if not, write to the Free Software
|
|
15 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
16 |
||
17 |
import sys |
|
18 |
||
19 |
try: |
|
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
20 |
import pygtk |
21 |
pygtk.require("2.0") |
|
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
22 |
except: |
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
23 |
pass
|
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
24 |
try: |
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
25 |
import gtk |
26 |
import gtk.glade |
|
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
27 |
except: |
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
28 |
sys.exit(1) |
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
29 |
|
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
30 |
import olive.backend.errors as errors |
31 |
||
32 |
from add import OliveAdd |
|
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
33 |
from branch import OliveBranch |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
34 |
from commit import OliveCommit |
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
35 |
from dialog import OliveDialog |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
36 |
from push import OlivePush |
37 |
from remove import OliveRemove |
|
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
38 |
|
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
39 |
class OliveHandler: |
40 |
""" Signal handler class for Olive. """ |
|
0.8.15
by Szilveszter Farkas (Phanatic)
2006-07-18 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
41 |
def __init__(self, gladefile, comm): |
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
42 |
self.gladefile = gladefile |
0.8.15
by Szilveszter Farkas (Phanatic)
2006-07-18 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
43 |
self.comm = comm |
44 |
||
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
45 |
self.dialog = OliveDialog(self.gladefile) |
46 |
||
47 |
def on_about_activate(self, widget): |
|
48 |
self.dialog.about() |
|
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
49 |
|
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
50 |
def on_menuitem_add_files_activate(self, widget): |
51 |
""" Add file(s)... menu handler. """ |
|
52 |
add = OliveAdd(self.gladefile, self.comm) |
|
53 |
add.display() |
|
54 |
||
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
55 |
def on_menuitem_branch_branch_activate(self, widget): |
0.8.18
by Szilveszter Farkas (Phanatic)
2006-07-20 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
56 |
""" Branch/Branch... menu handler. """ |
0.8.15
by Szilveszter Farkas (Phanatic)
2006-07-18 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
57 |
branch = OliveBranch(self.gladefile, self.comm) |
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
58 |
branch.display() |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
59 |
|
60 |
def on_menuitem_branch_commit_activate(self, widget): |
|
61 |
""" Branch/Commit... menu handler. """ |
|
62 |
commit = OliveCommit(self.gladefile, self.comm) |
|
63 |
commit.display() |
|
64 |
||
65 |
def on_menuitem_branch_push_activate(self, widget): |
|
66 |
""" Branch/Push... menu handler. """ |
|
67 |
push = OlivePush(self.gladefile, self.comm) |
|
68 |
push.display() |
|
69 |
||
70 |
def on_menuitem_branch_initialize_activate(self, widget): |
|
71 |
""" Initialize current directory. """ |
|
72 |
import olive.backend.init as init |
|
73 |
||
74 |
try: |
|
75 |
init.init(self.comm.get_path()) |
|
76 |
except errors.AlreadyBranchError, errmsg: |
|
77 |
self.dialog.error_dialog('Directory is already a branch: %s' % errmsg) |
|
78 |
except errors.BranchExistsWithoutWorkingTree, errmsg: |
|
79 |
self.dialog.error_dialog('Branch exists without a working tree: %s' % errmsg) |
|
80 |
else: |
|
81 |
self.dialog.info_dialog('Directory successfully initialized.') |
|
82 |
self.comm.refresh_right() |
|
83 |
||
84 |
def on_menuitem_remove_file_activate(self, widget): |
|
85 |
""" Remove (unversion) selected file. """ |
|
86 |
remove = OliveRemove(self.gladefile, self.comm) |
|
87 |
remove.display() |
|
88 |
||
0.8.18
by Szilveszter Farkas (Phanatic)
2006-07-20 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
89 |
def on_treeview_right_row_activated(self, treeview, path, view_column): |
90 |
""" Occurs when somebody double-clicks or enters an item in the |
|
91 |
file list. """
|
|
92 |
import os.path |
|
93 |
||
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
94 |
newdir = self.comm.get_selected_right() |
0.8.18
by Szilveszter Farkas (Phanatic)
2006-07-20 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
95 |
|
96 |
if newdir == '..': |
|
97 |
self.comm.set_path(os.path.split(self.comm.get_path())[0]) |
|
98 |
else: |
|
99 |
self.comm.set_path(self.comm.get_path() + '/' + newdir) |
|
100 |
||
101 |
self.comm.refresh_right() |
|
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
102 |
|
103 |
def not_implemented(self, widget): |
|
104 |
""" Display a Not implemented error message. """ |
|
105 |
self.dialog.error_dialog('This feature is not yet implemented.') |
|
106 |