/b-gtk/fix-viz

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