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.53
by Szilveszter Farkas (Phanatic)
Set sensitivity of menus and toolbuttons. |
30 |
from olive.backend.info import is_branch |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
31 |
import olive.backend.errors as errors |
32 |
||
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
33 |
from dialog import OliveDialog |
0.8.24
by Szilveszter Farkas (Phanatic)
Implemented context menu for the file list. |
34 |
from menu import OliveMenu |
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
35 |
|
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
36 |
class OliveHandler: |
37 |
""" Signal handler class for Olive. """ |
|
0.8.15
by Szilveszter Farkas (Phanatic)
2006-07-18 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
38 |
def __init__(self, gladefile, comm): |
0.8.12
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
39 |
self.gladefile = gladefile |
0.8.15
by Szilveszter Farkas (Phanatic)
2006-07-18 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
40 |
self.comm = comm |
41 |
||
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
42 |
self.dialog = OliveDialog(self.gladefile) |
0.8.24
by Szilveszter Farkas (Phanatic)
Implemented context menu for the file list. |
43 |
|
44 |
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> |
45 |
|
46 |
def on_about_activate(self, widget): |
|
47 |
self.dialog.about() |
|
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
48 |
|
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
49 |
def on_menuitem_add_files_activate(self, widget): |
50 |
""" Add file(s)... menu handler. """ |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
51 |
from add import OliveAdd |
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
52 |
add = OliveAdd(self.gladefile, self.comm, self.dialog) |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
53 |
add.display() |
54 |
||
0.8.22
by Szilveszter Farkas (Phanatic)
2006-07-31 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
55 |
def on_menuitem_branch_get_activate(self, widget): |
56 |
""" Branch/Get... menu handler. """ |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
57 |
from branch import OliveBranch |
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
58 |
branch = OliveBranch(self.gladefile, self.comm, self.dialog) |
0.8.14
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
59 |
branch.display() |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
60 |
|
0.8.22
by Szilveszter Farkas (Phanatic)
2006-07-31 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
61 |
def on_menuitem_branch_checkout_activate(self, widget): |
62 |
""" Branch/Checkout... menu handler. """ |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
63 |
from checkout import OliveCheckout |
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
64 |
checkout = OliveCheckout(self.gladefile, self.comm, self.dialog) |
0.8.22
by Szilveszter Farkas (Phanatic)
2006-07-31 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
65 |
checkout.display() |
66 |
||
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
67 |
def on_menuitem_branch_commit_activate(self, widget): |
68 |
""" Branch/Commit... menu handler. """ |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
69 |
from commit import OliveCommit |
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
70 |
commit = OliveCommit(self.gladefile, self.comm, self.dialog) |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
71 |
commit.display() |
72 |
||
0.8.66
by Szilveszter Farkas (Phanatic)
Implemented Missing revisions functionality. |
73 |
def on_menuitem_branch_missing_revisions_activate(self, widget): |
74 |
""" Branch/Missing revisions menu handler. """ |
|
75 |
import olive.backend.update as update |
|
76 |
||
77 |
self.comm.set_busy(self.comm.window_main) |
|
78 |
||
79 |
try: |
|
80 |
ret = update.missing(self.comm.get_path()) |
|
81 |
except errors.NotBranchError: |
|
82 |
self.dialog.error_dialog(_('Directory is not a branch'), |
|
83 |
_('You can perform this action only in a branch.')) |
|
84 |
except errors.ConnectionError: |
|
85 |
self.dialog.error_dialog(_('Connection error'), |
|
86 |
_('Cannot connect to remote location.\nPlease try again later.')) |
|
87 |
except errors.NoLocationKnown: |
|
88 |
self.dialog.error_dialog(_('Parent location is unknown'), |
|
89 |
_('Cannot determine missing revisions if no parent location is known.')) |
|
90 |
else: |
|
91 |
if ret > 0: |
|
92 |
self.dialog.info_dialog(_('There are missing revisions'), |
|
93 |
_('%d revision(s) missing.') % ret) |
|
94 |
else: |
|
95 |
self.dialog.info_dialog(_('Local branch up to date'), |
|
96 |
_('There are no missing revisions.')) |
|
97 |
||
98 |
self.comm.set_busy(self.comm.window_main, False) |
|
99 |
||
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
100 |
def on_menuitem_branch_pull_activate(self, widget): |
101 |
""" Branch/Pull menu handler. """ |
|
102 |
import olive.backend.update as update |
|
103 |
||
104 |
self.comm.set_busy(self.comm.window_main) |
|
105 |
||
106 |
try: |
|
107 |
ret = update.pull(self.comm.get_path()) |
|
108 |
except errors.NotBranchError: |
|
0.8.55
by Szilveszter Farkas (Phanatic)
Gettext support added. |
109 |
self.dialog.error_dialog(_('Directory is not a branch'), |
110 |
_('You can perform this action only in a branch.')) |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
111 |
except errors.NoLocationKnown: |
0.8.55
by Szilveszter Farkas (Phanatic)
Gettext support added. |
112 |
self.dialog.error_dialog(_('Parent location is unknown'), |
113 |
_('Pulling is not possible until there is no parent location.')) |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
114 |
else: |
0.8.55
by Szilveszter Farkas (Phanatic)
Gettext support added. |
115 |
self.dialog.info_dialog(_('Pull successful'), |
116 |
_('%d revision(s) pulled.') % ret) |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
117 |
|
118 |
self.comm.set_busy(self.comm.window_main, False) |
|
119 |
||
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
120 |
def on_menuitem_branch_push_activate(self, widget): |
121 |
""" Branch/Push... menu handler. """ |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
122 |
from push import OlivePush |
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
123 |
push = OlivePush(self.gladefile, self.comm, self.dialog) |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
124 |
push.display() |
125 |
||
0.8.29
by Szilveszter Farkas (Phanatic)
Implemented Status window; some code cleanups. |
126 |
def on_menuitem_branch_status_activate(self, widget): |
127 |
""" Branch/Status... menu handler. """ |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
128 |
from status import OliveStatus |
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
129 |
status = OliveStatus(self.gladefile, self.comm, self.dialog) |
0.8.29
by Szilveszter Farkas (Phanatic)
Implemented Status window; some code cleanups. |
130 |
status.display() |
131 |
||
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
132 |
def on_menuitem_branch_initialize_activate(self, widget): |
133 |
""" Initialize current directory. """ |
|
134 |
import olive.backend.init as init |
|
135 |
||
136 |
try: |
|
137 |
init.init(self.comm.get_path()) |
|
138 |
except errors.AlreadyBranchError, errmsg: |
|
0.8.55
by Szilveszter Farkas (Phanatic)
Gettext support added. |
139 |
self.dialog.error_dialog(_('Directory is already a branch'), |
140 |
_('The current directory (%s) is already a branch.\nYou can start using it, or initialize another directory.') % errmsg) |
|
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
141 |
except errors.BranchExistsWithoutWorkingTree, errmsg: |
0.8.55
by Szilveszter Farkas (Phanatic)
Gettext support added. |
142 |
self.dialog.error_dialog(_('Branch without a working tree'), |
143 |
_('The current directory (%s)\nis a branch without a working tree.') % errmsg) |
|
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
144 |
except: |
145 |
raise
|
|
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
146 |
else: |
0.8.55
by Szilveszter Farkas (Phanatic)
Gettext support added. |
147 |
self.dialog.info_dialog(_('Ininialize successful'), |
148 |
_('Directory successfully initialized.')) |
|
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
149 |
self.comm.refresh_right() |
150 |
||
0.8.37
by Szilveszter Farkas (Phanatic)
Implemented Make directory functionality; some cleanups. |
151 |
def on_menuitem_file_make_directory_activate(self, widget): |
152 |
""" File/Make directory... menu handler. """ |
|
153 |
from mkdir import OliveMkdir |
|
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
154 |
mkdir = OliveMkdir(self.gladefile, self.comm, self.dialog) |
0.8.37
by Szilveszter Farkas (Phanatic)
Implemented Make directory functionality; some cleanups. |
155 |
mkdir.display() |
156 |
||
0.8.38
by Szilveszter Farkas (Phanatic)
Implemented Move functionality; move() backend code refined. |
157 |
def on_menuitem_file_move_activate(self, widget): |
158 |
""" File/Move... menu handler. """ |
|
159 |
from move import OliveMove |
|
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
160 |
move = OliveMove(self.gladefile, self.comm, self.dialog) |
0.8.38
by Szilveszter Farkas (Phanatic)
Implemented Move functionality; move() backend code refined. |
161 |
move.display() |
162 |
||
0.8.40
by Szilveszter Farkas (Phanatic)
Implemented Rename functionality. |
163 |
def on_menuitem_file_rename_activate(self, widget): |
164 |
""" File/Rename... menu handler. """ |
|
165 |
from rename import OliveRename |
|
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
166 |
rename = OliveRename(self.gladefile, self.comm, self.dialog) |
0.8.40
by Szilveszter Farkas (Phanatic)
Implemented Rename functionality. |
167 |
rename.display() |
168 |
||
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
169 |
def on_menuitem_remove_file_activate(self, widget): |
170 |
""" Remove (unversion) selected file. """ |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
171 |
from remove import OliveRemove |
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
172 |
remove = OliveRemove(self.gladefile, self.comm, self.dialog) |
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
173 |
remove.display() |
174 |
||
0.8.28
by Szilveszter Farkas (Phanatic)
Statistics menu added |
175 |
def on_menuitem_stats_diff_activate(self, widget): |
176 |
""" Statistics/Differences... menu handler. """ |
|
0.8.36
by Szilveszter Farkas (Phanatic)
Implemented pull functionality. |
177 |
from diff import OliveDiff |
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
178 |
diff = OliveDiff(self.gladefile, self.comm, self.dialog) |
0.8.28
by Szilveszter Farkas (Phanatic)
Statistics menu added |
179 |
diff.display() |
180 |
||
0.8.42
by Szilveszter Farkas (Phanatic)
Implemented Informations functionality; some bzrlib API changes handled. |
181 |
def on_menuitem_stats_infos_activate(self, widget): |
182 |
""" Statistics/Informations... menu handler. """ |
|
183 |
from info import OliveInfo |
|
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
184 |
info = OliveInfo(self.gladefile, self.comm, self.dialog) |
0.8.42
by Szilveszter Farkas (Phanatic)
Implemented Informations functionality; some bzrlib API changes handled. |
185 |
info.display() |
186 |
||
0.8.43
by Szilveszter Farkas (Phanatic)
Implemented Log functionality (via bzrk). |
187 |
def on_menuitem_stats_log_activate(self, widget): |
188 |
""" Statistics/Log... menu handler. """ |
|
189 |
from log import OliveLog |
|
0.8.46
by Szilveszter Farkas (Phanatic)
Modified OliveDialog class interface; huge cleanups. |
190 |
log = OliveLog(self.gladefile, self.comm, self.dialog) |
0.8.43
by Szilveszter Farkas (Phanatic)
Implemented Log functionality (via bzrk). |
191 |
log.display() |
192 |
||
0.8.49
by Szilveszter Farkas (Phanatic)
Added View menu; implemented Refresh; some TODO changes. |
193 |
def on_menuitem_view_refresh_activate(self, widget): |
194 |
""" View/Refresh menu handler. """ |
|
195 |
# Refresh the left pane
|
|
196 |
self.comm.refresh_left() |
|
197 |
# Refresh the right pane
|
|
198 |
self.comm.refresh_right() |
|
199 |
||
200 |
def on_menuitem_view_show_hidden_files_activate(self, widget): |
|
201 |
""" View/Show hidden files menu handler. """ |
|
202 |
if widget.get_active(): |
|
203 |
# Show hidden files
|
|
204 |
self.comm.pref.set_preference('dotted_files', True) |
|
205 |
self.comm.pref.refresh() |
|
206 |
self.comm.refresh_right() |
|
207 |
else: |
|
208 |
# Do not show hidden files
|
|
209 |
self.comm.pref.set_preference('dotted_files', False) |
|
210 |
self.comm.pref.refresh() |
|
211 |
self.comm.refresh_right() |
|
212 |
||
0.8.33
by Szilveszter Farkas (Phanatic)
Implemented bookmarking. |
213 |
def on_treeview_left_button_press_event(self, widget, event): |
214 |
""" Occurs when somebody right-clicks in the bookmark list. """ |
|
215 |
if event.button == 3: |
|
216 |
self.menu.left_context_menu().popup(None, None, None, 0, |
|
0.8.41
by Szilveszter Farkas (Phanatic)
Main window preferences (size, position) are stored. |
217 |
event.time) |
0.8.33
by Szilveszter Farkas (Phanatic)
Implemented bookmarking. |
218 |
|
219 |
def on_treeview_left_row_activated(self, treeview, path, view_column): |
|
220 |
""" Occurs when somebody double-clicks or enters an item in the |
|
221 |
bookmark list. """
|
|
222 |
self.comm.set_busy(treeview) |
|
223 |
||
224 |
newdir = self.comm.get_selected_left() |
|
225 |
self.comm.set_path(newdir) |
|
226 |
||
227 |
self.comm.refresh_right() |
|
228 |
||
229 |
self.comm.set_busy(treeview, False) |
|
230 |
||
0.8.24
by Szilveszter Farkas (Phanatic)
Implemented context menu for the file list. |
231 |
def on_treeview_right_button_press_event(self, widget, event): |
232 |
""" Occurs when somebody right-clicks in the file list. """ |
|
233 |
if event.button == 3: |
|
0.8.53
by Szilveszter Farkas (Phanatic)
Set sensitivity of menus and toolbuttons. |
234 |
# get the menu items
|
235 |
m_add = self.menu.ui.get_widget('/context_right/add') |
|
236 |
m_remove = self.menu.ui.get_widget('/context_right/remove') |
|
237 |
m_commit = self.menu.ui.get_widget('/context_right/commit') |
|
238 |
m_diff = self.menu.ui.get_widget('/context_right/diff') |
|
239 |
# check if we're in a branch
|
|
240 |
if not is_branch(self.comm.get_path()): |
|
241 |
m_add.set_sensitive(False) |
|
242 |
m_remove.set_sensitive(False) |
|
243 |
m_commit.set_sensitive(False) |
|
244 |
m_diff.set_sensitive(False) |
|
245 |
else: |
|
246 |
m_add.set_sensitive(True) |
|
247 |
m_remove.set_sensitive(True) |
|
248 |
m_commit.set_sensitive(True) |
|
249 |
m_diff.set_sensitive(True) |
|
0.8.24
by Szilveszter Farkas (Phanatic)
Implemented context menu for the file list. |
250 |
self.menu.right_context_menu().popup(None, None, None, 0, |
251 |
event.time) |
|
252 |
||
0.8.18
by Szilveszter Farkas (Phanatic)
2006-07-20 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
253 |
def on_treeview_right_row_activated(self, treeview, path, view_column): |
254 |
""" Occurs when somebody double-clicks or enters an item in the |
|
255 |
file list. """
|
|
256 |
import os.path |
|
257 |
||
0.8.19
by Szilveszter Farkas (Phanatic)
2006-07-21 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
258 |
newdir = self.comm.get_selected_right() |
0.8.18
by Szilveszter Farkas (Phanatic)
2006-07-20 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
259 |
|
260 |
if newdir == '..': |
|
261 |
self.comm.set_path(os.path.split(self.comm.get_path())[0]) |
|
262 |
else: |
|
0.8.54
by Szilveszter Farkas (Phanatic)
Fixed a bug when double-clicking a file. |
263 |
fullpath = self.comm.get_path() + '/' + newdir |
264 |
if os.path.isdir(fullpath): |
|
265 |
# selected item is an existant directory
|
|
266 |
self.comm.set_path(fullpath) |
|
267 |
else: |
|
268 |
if sys.platform == 'win32': |
|
269 |
# open the file with the default application
|
|
270 |
os.startfile(fullpath) |
|
271 |
else: |
|
272 |
# TODO: support other OSes
|
|
273 |
print "DEBUG: double-click on non-Win32 platforms not supported." |
|
0.8.18
by Szilveszter Farkas (Phanatic)
2006-07-20 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
274 |
|
275 |
self.comm.refresh_right() |
|
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
276 |
|
0.8.32
by Szilveszter Farkas (Phanatic)
Implemented OlivePreferences; some wording fixes. |
277 |
def on_window_main_delete_event(self, widget, event=None): |
278 |
""" Do some stuff before exiting. """ |
|
0.8.41
by Szilveszter Farkas (Phanatic)
Main window preferences (size, position) are stored. |
279 |
width, height = self.comm.window_main.get_size() |
280 |
self.comm.pref.set_preference('window_width', width) |
|
281 |
self.comm.pref.set_preference('window_height', height) |
|
282 |
x, y = self.comm.window_main.get_position() |
|
283 |
self.comm.pref.set_preference('window_x', x) |
|
284 |
self.comm.pref.set_preference('window_y', y) |
|
285 |
self.comm.pref.set_preference('paned_position', |
|
286 |
self.comm.hpaned_main.get_position()) |
|
287 |
||
0.8.32
by Szilveszter Farkas (Phanatic)
Implemented OlivePreferences; some wording fixes. |
288 |
self.comm.pref.write() |
289 |
self.comm.window_main.destroy() |
|
290 |
||
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
291 |
def not_implemented(self, widget): |
292 |
""" Display a Not implemented error message. """ |
|
0.8.55
by Szilveszter Farkas (Phanatic)
Gettext support added. |
293 |
self.dialog.error_dialog(_('We feel sorry'), |
294 |
_('This feature is not yet implemented.')) |
|
0.8.13
by Szilveszter Farkas (Phanatic)
2006-07-17 Szilveszter Farkas <Szilveszter.Farkas@gmail.com> |
295 |