/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/handler.py

  • Committer: Jelmer Vernooij
  • Date: 2006-09-27 19:52:46 UTC
  • mto: (0.12.2 olive)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: jelmer@samba.org-20060927195246-9354d7ccf56127f5
Don't pass around gladefile all the time. 
Fix bug in status information when files have been removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
    pygtk.require("2.0")
23
23
except:
24
24
    pass
25
 
try:
26
 
    import gtk
27
 
    import gtk.glade
28
 
except:
29
 
    sys.exit(1)
 
25
 
 
26
import gtk
 
27
import gtk.glade
30
28
 
31
29
import bzrlib.errors as errors
32
30
from bzrlib.branch import Branch
38
36
 
39
37
class OliveHandler:
40
38
    """ Signal handler class for Olive. """
41
 
    def __init__(self, gladefile, comm):
42
 
        self.gladefile = gladefile
 
39
    def __init__(self,  comm):
43
40
        self.comm = comm
44
41
        
45
 
        self.menu = OliveMenu(self.gladefile, self.comm)
 
42
        self.menu = OliveMenu(self.comm)
46
43
    
47
44
    def on_about_activate(self, widget):
48
45
        about()
51
48
        """ Add file(s)... menu handler. """
52
49
        from add import OliveAdd
53
50
        wt, path = WorkingTree.open_containing(self.comm.get_path())
54
 
        add = OliveAdd(self.gladefile, wt, path, 
 
51
        add = OliveAdd(wt, path, 
55
52
                self.comm.get_selected_right())
56
53
        add.display()
57
54
    
58
55
    def on_menuitem_branch_get_activate(self, widget):
59
56
        """ Branch/Get... menu handler. """
60
57
        from branch import OliveBranch
61
 
        branch = OliveBranch(self.gladefile, self.comm)
 
58
        branch = OliveBranch(self.comm)
62
59
        branch.display()
63
60
    
64
61
    def on_menuitem_branch_checkout_activate(self, widget):
65
62
        """ Branch/Checkout... menu handler. """
66
63
        from checkout import OliveCheckout
67
 
        checkout = OliveCheckout(self.gladefile, self.comm)
 
64
        checkout = OliveCheckout(self.comm)
68
65
        checkout.display()
69
66
    
70
67
    def on_menuitem_branch_commit_activate(self, widget):
71
68
        """ Branch/Commit... menu handler. """
72
69
        from commit import OliveCommit
73
70
        wt, path = WorkingTree.open_containing(self.comm.get_path())
74
 
        commit = OliveCommit(self.gladefile, wt, path)
 
71
        commit = OliveCommit(wt, path)
75
72
        commit.display()
76
73
    
77
74
    def on_menuitem_branch_missing_revisions_activate(self, widget):
158
155
    def on_menuitem_branch_push_activate(self, widget):
159
156
        """ Branch/Push... menu handler. """
160
157
        from push import OlivePush
161
 
        push = OlivePush(self.gladefile, self.comm)
 
158
        push = OlivePush(self.comm)
162
159
        push.display()
163
160
    
164
161
    def on_menuitem_branch_status_activate(self, widget):
165
162
        """ Branch/Status... menu handler. """
166
163
        from status import OliveStatus
167
164
        wt, wtpath = WorkingTree.open_containing(self.comm.get_path())
168
 
        status = OliveStatus(self.gladefile, wt, wtpath)
 
165
        status = OliveStatus(wt, wtpath)
169
166
        status.display()
170
167
    
171
168
    def on_menuitem_branch_initialize_activate(self, widget):
206
203
    def on_menuitem_file_make_directory_activate(self, widget):
207
204
        """ File/Make directory... menu handler. """
208
205
        from mkdir import OliveMkdir
209
 
        mkdir = OliveMkdir(self.gladefile, self.comm)
 
206
        mkdir = OliveMkdir(self.comm)
210
207
        mkdir.display()
211
208
    
212
209
    def on_menuitem_file_move_activate(self, widget):
213
210
        """ File/Move... menu handler. """
214
211
        from move import OliveMove
215
 
        move = OliveMove(self.gladefile, self.comm)
 
212
        move = OliveMove(self.comm)
216
213
        move.display()
217
214
    
218
215
    def on_menuitem_file_rename_activate(self, widget):
219
216
        """ File/Rename... menu handler. """
220
217
        from rename import OliveRename
221
 
        rename = OliveRename(self.gladefile, self.comm)
 
218
        rename = OliveRename(self.comm)
222
219
        rename.display()
223
220
 
224
221
    def on_menuitem_remove_file_activate(self, widget):
225
222
        """ Remove (unversion) selected file. """
226
223
        from remove import OliveRemove
227
 
        remove = OliveRemove(self.gladefile, self.comm)
 
224
        remove = OliveRemove(self.comm)
228
225
        remove.display()
229
226
    
230
227
    def on_menuitem_stats_diff_activate(self, widget):
239
236
    def on_menuitem_stats_infos_activate(self, widget):
240
237
        """ Statistics/Informations... menu handler. """
241
238
        from info import OliveInfo
242
 
        info = OliveInfo(self.gladefile, self.comm)
 
239
        info = OliveInfo(self.comm)
243
240
        info.display()
244
241
    
245
242
    def on_menuitem_stats_log_activate(self, widget):
246
243
        """ Statistics/Log... menu handler. """
247
244
        from log import OliveLog
248
 
        log = OliveLog(self.gladefile, self.comm)
 
245
        log = OliveLog(self.comm)
249
246
        log.display()
250
247
    
251
248
    def on_menuitem_view_refresh_activate(self, widget):