/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: Szilveszter Farkas (Phanatic)
  • Date: 2006-10-25 09:21:40 UTC
  • mfrom: (93.1.7 bzr-gtk.win32.bialix)
  • Revision ID: Szilveszter.Farkas@gmail.com-20061025092140-7a1c9d40d6da87e9
Merged Alexander Belchenko's bugfixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import bzrlib.errors as errors
29
29
 
30
30
from dialog import error_dialog
31
 
from olive import gladefile
 
31
from gladefile import GLADEFILENAME
 
32
 
32
33
 
33
34
class CommitDialog:
34
35
    """ Display Commit dialog and perform the needed actions. """
35
 
    def __init__(self, wt, wtpath):
36
 
        """ Initialize the Commit dialog. """
37
 
        self.glade = gtk.glade.XML(gladefile, 'window_commit', 'olive-gtk')
 
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
        """
 
43
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_commit', 'olive-gtk')
38
44
        
39
45
        self.wt = wt
40
46
        self.wtpath = wtpath
41
47
 
 
48
        self.standalone = standalone
 
49
 
42
50
        # Get some important widgets
43
51
        self.window = self.glade.get_widget('window_commit')
44
52
        self.checkbutton_local = self.glade.get_widget('checkbutton_commit_local')
64
72
        # Dictionary for signal_autoconnect
65
73
        dic = { "on_button_commit_commit_clicked": self.commit,
66
74
                "on_button_commit_cancel_clicked": self.close }
 
75
 
 
76
        if self.standalone:
 
77
            dic["on_button_commit_cancel_clicked"] = self.quit
67
78
        
68
79
        # Connect the signals to the handlers
69
80
        self.glade.signal_autoconnect(dic)
270
281
        except Exception, msg:
271
282
            error_dialog(_('Unknown error'), str(msg))
272
283
            return
273
 
        
274
 
        self.close()
 
284
 
 
285
        if not self.standalone:
 
286
            self.close()
 
287
        else:
 
288
            self.quit()
275
289
        
276
290
    def close(self, widget=None):
277
291
        self.window.destroy()
 
292
 
 
293
    def quit(self, widget=None):
 
294
        self.close(widget)
 
295
        gtk.main_quit()