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>
|
0.8.29
by Szilveszter Farkas (Phanatic)
Implemented Status window; some code cleanups. |
2 |
#
|
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
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.
|
|
0.8.29
by Szilveszter Farkas (Phanatic)
Implemented Status window; some code cleanups. |
7 |
#
|
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
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.
|
|
0.8.29
by Szilveszter Farkas (Phanatic)
Implemented Status window; some code cleanups. |
12 |
#
|
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
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.22
by Szilveszter Farkas (Phanatic)
2006-07-31 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
34 |
from checkout import OliveCheckout |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
35 |
from commit import OliveCommit |
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
36 |
from dialog import OliveDialog |
0.8.28
by Szilveszter Farkas (Phanatic)
Statistics menu added |
37 |
from diff import OliveDiff |
0.8.24
by Szilveszter Farkas (Phanatic)
Implemented context menu for the file list. |
38 |
from menu import OliveMenu |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
39 |
from push import OlivePush |
40 |
from remove import OliveRemove |
|
0.8.29
by Szilveszter Farkas (Phanatic)
Implemented Status window; some code cleanups. |
41 |
from status import OliveStatus |
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
42 |
|
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
43 |
class OliveHandler: |
44 |
""" Signal handler class for Olive. """ |
|
0.8.15
by Szilveszter Farkas (Phanatic)
2006-07-18 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
45 |
def __init__(self, gladefile, comm): |
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
46 |
self.gladefile = gladefile |
0.8.15
by Szilveszter Farkas (Phanatic)
2006-07-18 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
47 |
self.comm = comm |
48 |
||
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
49 |
self.dialog = OliveDialog(self.gladefile) |
0.8.24
by Szilveszter Farkas (Phanatic)
Implemented context menu for the file list. |
50 |
|
51 |
self.menu = OliveMenu(self.gladefile, self.comm, self.dialog) |
|
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
52 |
|
53 |
def on_about_activate(self, widget): |
|
54 |
self.dialog.about() |
|
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
55 |
|
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
56 |
def on_menuitem_add_files_activate(self, widget): |
57 |
""" Add file(s)... menu handler. """ |
|
58 |
add = OliveAdd(self.gladefile, self.comm) |
|
59 |
add.display() |
|
60 |
||
0.8.22
by Szilveszter Farkas (Phanatic)
2006-07-31 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
61 |
def on_menuitem_branch_get_activate(self, widget): |
62 |
""" Branch/Get... menu handler. """ |
|
0.8.15
by Szilveszter Farkas (Phanatic)
2006-07-18 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
63 |
branch = OliveBranch(self.gladefile, self.comm) |
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
64 |
branch.display() |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
65 |
|
0.8.22
by Szilveszter Farkas (Phanatic)
2006-07-31 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
66 |
def on_menuitem_branch_checkout_activate(self, widget): |
67 |
""" Branch/Checkout... menu handler. """ |
|
68 |
checkout = OliveCheckout(self.gladefile, self.comm) |
|
69 |
checkout.display() |
|
70 |
||
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
71 |
def on_menuitem_branch_commit_activate(self, widget): |
72 |
""" Branch/Commit... menu handler. """ |
|
73 |
commit = OliveCommit(self.gladefile, self.comm) |
|
74 |
commit.display() |
|
75 |
||
76 |
def on_menuitem_branch_push_activate(self, widget): |
|
77 |
""" Branch/Push... menu handler. """ |
|
78 |
push = OlivePush(self.gladefile, self.comm) |
|
79 |
push.display() |
|
80 |
||
0.8.29
by Szilveszter Farkas (Phanatic)
Implemented Status window; some code cleanups. |
81 |
def on_menuitem_branch_status_activate(self, widget): |
82 |
""" Branch/Status... menu handler. """ |
|
83 |
status = OliveStatus(self.gladefile, self.comm) |
|
84 |
status.display() |
|
85 |
||
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
86 |
def on_menuitem_branch_initialize_activate(self, widget): |
87 |
""" Initialize current directory. """ |
|
88 |
import olive.backend.init as init |
|
89 |
||
90 |
try: |
|
91 |
init.init(self.comm.get_path()) |
|
92 |
except errors.AlreadyBranchError, errmsg: |
|
93 |
self.dialog.error_dialog('Directory is already a branch: %s' % errmsg) |
|
94 |
except errors.BranchExistsWithoutWorkingTree, errmsg: |
|
95 |
self.dialog.error_dialog('Branch exists without a working tree: %s' % errmsg) |
|
96 |
else: |
|
97 |
self.dialog.info_dialog('Directory successfully initialized.') |
|
98 |
self.comm.refresh_right() |
|
99 |
||
100 |
def on_menuitem_remove_file_activate(self, widget): |
|
101 |
""" Remove (unversion) selected file. """ |
|
102 |
remove = OliveRemove(self.gladefile, self.comm) |
|
103 |
remove.display() |
|
104 |
||
0.8.28
by Szilveszter Farkas (Phanatic)
Statistics menu added |
105 |
def on_menuitem_stats_diff_activate(self, widget): |
106 |
""" Statistics/Differences... menu handler. """ |
|
107 |
diff = OliveDiff(self.gladefile, self.comm) |
|
108 |
diff.display() |
|
109 |
||
0.8.24
by Szilveszter Farkas (Phanatic)
Implemented context menu for the file list. |
110 |
def on_treeview_right_button_press_event(self, widget, event): |
111 |
""" Occurs when somebody right-clicks in the file list. """ |
|
112 |
if event.button == 3: |
|
113 |
self.menu.right_context_menu().popup(None, None, None, 0, |
|
114 |
event.time) |
|
115 |
||
0.8.18
by Szilveszter Farkas (Phanatic)
2006-07-20 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
116 |
def on_treeview_right_row_activated(self, treeview, path, view_column): |
117 |
""" Occurs when somebody double-clicks or enters an item in the |
|
118 |
file list. """
|
|
119 |
import os.path |
|
120 |
||
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
121 |
newdir = self.comm.get_selected_right() |
0.8.18
by Szilveszter Farkas (Phanatic)
2006-07-20 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
122 |
|
123 |
if newdir == '..': |
|
124 |
self.comm.set_path(os.path.split(self.comm.get_path())[0]) |
|
125 |
else: |
|
126 |
self.comm.set_path(self.comm.get_path() + '/' + newdir) |
|
127 |
||
128 |
self.comm.refresh_right() |
|
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
129 |
|
130 |
def not_implemented(self, widget): |
|
131 |
""" Display a Not implemented error message. """ |
|
132 |
self.dialog.error_dialog('This feature is not yet implemented.') |
|
133 |