Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

datamine: close app if the user hits CTRL-W on last tab

fixes issue #493

Changeset f7cd5039ad3f

Parent 869c08446742

by Yuki KODAMA

Changes to 2 files · Browse files at f7cd5039ad3f Showing diff from parent 869c08446742 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​datamine.py Stacked
 
92
93
94
 
 
 
 
 
 
 
 
95
96
97
 
204
205
206
 
 
 
 
 
 
207
208
209
 
423
424
425
426
 
427
428
429
 
92
93
94
95
96
97
98
99
100
101
102
103
104
105
 
212
213
214
215
216
217
218
219
220
221
222
223
 
437
438
439
 
440
441
442
443
@@ -92,6 +92,14 @@
  self.notebook = notebook   vbox.pack_start(self.notebook, True, True, 2)   + accelgroup = gtk.AccelGroup() + self.add_accel_group(accelgroup) + mod = gtklib.get_thg_modifier() + key, modifier = gtk.accelerator_parse(mod+'w') + notebook.add_accelerator('thg-close', accelgroup, key, + modifier, gtk.ACCEL_VISIBLE) + notebook.connect('thg-close', self.close_notebook) +   self.stbar = gtklib.StatusBar()   self.stbar.sttext.set_property('use-markup', True)   vbox.pack_start(self.stbar, False, False, 2) @@ -204,6 +212,12 @@
  iconBox.show()   return button   + def close_notebook(self, notebook): + if notebook.get_n_pages() <= 1: + gtklib.thgexit(self) + else: + self.close_current_page() +   def add_search_page(self):   frame = gtk.Frame()   frame.set_border_width(10) @@ -423,7 +437,7 @@
  self.curpath = fromutf(model[paths][self.COL_PATH])   self.stbar.set_status_text(toutf(model[paths][self.COL_TOOLTIP]))   - def close_current_page(self, window): + def close_current_page(self, window=None):   num = self.notebook.get_current_page()   if num != -1 and self.notebook.get_n_pages():   self.notebook.remove_page(num)
Change 1 of 1 Show Entire File hggtk/​hgtk.py Stacked
 
36
37
38
 
 
39
40
41
 
36
37
38
39
40
41
42
43
@@ -36,6 +36,8 @@
 for sig in ('thg-exit', 'thg-close', 'thg-refresh', 'thg-accept'):   gobject.signal_new(sig, gtk.Window,   gobject.SIGNAL_ACTION, gobject.TYPE_NONE, ()) +gobject.signal_new('thg-close', gtk.Notebook, + gobject.SIGNAL_ACTION, gobject.TYPE_NONE, ())    gtkmainalive = False  def dispatch(args):