/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/commit.py

  • Committer: Alexander Belchenko
  • Date: 2006-10-25 09:00:02 UTC
  • mto: (91.1.8 trunk) (66.2.10 trunk)
  • mto: This revision was merged to the branch mainline in revision 104.
  • Revision ID: bialix@ukr.net-20061025090002-03821bc1f4c026a1
Fix gcommit bug 66937 (bzr still running after cancel/commit clicked)

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
class CommitDialog:
35
35
    """ Display Commit dialog and perform the needed actions. """
36
 
    def __init__(self, wt, wtpath):
37
 
        """ Initialize the Commit dialog. """
 
36
    def __init__(self, wt, wtpath, standalone=False):
 
37
        """ Initialize the Commit dialog.
 
38
        @param  wt:         bzr working tree object
 
39
        @param  wtpath:     path to working tree root
 
40
        @param  standalone: when used in gcommit command as standalone window
 
41
                            this argument should be True
 
42
        """
38
43
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_commit', 'olive-gtk')
39
44
        
40
45
        self.wt = wt
41
46
        self.wtpath = wtpath
42
47
 
 
48
        self.standalone = standalone
 
49
 
43
50
        # Get some important widgets
44
51
        self.window = self.glade.get_widget('window_commit')
45
52
        self.checkbutton_local = self.glade.get_widget('checkbutton_commit_local')
65
72
        # Dictionary for signal_autoconnect
66
73
        dic = { "on_button_commit_commit_clicked": self.commit,
67
74
                "on_button_commit_cancel_clicked": self.close }
 
75
 
 
76
        if self.standalone:
 
77
            dic["on_button_commit_cancel_clicked"] = self.quit
68
78
        
69
79
        # Connect the signals to the handlers
70
80
        self.glade.signal_autoconnect(dic)
271
281
        except Exception, msg:
272
282
            error_dialog(_('Unknown error'), str(msg))
273
283
            return
274
 
        
275
 
        self.close()
 
284
 
 
285
        if not self.standalone:
 
286
            self.close()
 
287
        else:
 
288
            self.quit()
276
289
        
277
290
    def close(self, widget=None):
278
291
        self.window.destroy()
 
292
 
 
293
    def quit(self, widget=None):
 
294
        self.close(widget)
 
295
        gtk.main_quit()