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