Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.4rc2, 0.4rc3, and 0.4rc4

hggtk/synch: recall pull update option state from previous session

Changeset 275dac79437c

Parent 07c8d1e56b87

by TK Soh

Changes to one file · Browse files at 275dac79437c Showing diff from parent 07c8d1e56b87 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​synch.py Stacked
 
276
277
278
 
 
 
 
279
280
281
 
311
312
313
314
315
316
317
318
319
 
 
 
320
321
322
323
 
324
325
 
 
 
 
 
 
 
 
 
326
327
328
 
276
277
278
279
280
281
282
283
284
285
 
315
316
317
 
 
 
 
 
 
318
319
320
321
322
323
324
325
326
 
327
328
329
330
331
332
333
334
335
336
337
338
@@ -276,6 +276,10 @@
  self._pull_update = gtk.CheckMenuItem("Update to new tip")   menu.append(self._pull_update)   + # restore states from previous session + st = self._settings.get_value('_pull_update_state', False) + self._pull_update.set_active(st) +   menu.show_all()   return menu   @@ -311,18 +315,24 @@
  dialog.destroy()     def _close_clicked(self, toolbutton, data=None): - if threading.activeCount() != 1: - error_dialog(self, "Can't close now", "command is running") - else: - gtk.main_quit() - - def _delete(self, widget, event): + self._do_close() + + def _do_close(self):   if threading.activeCount() != 1:   error_dialog(self, "Can't close now", "command is running")   return True   else: + self._save_settings()   gtk.main_quit() - + + def _save_settings(self): + self._settings.set_value('_pull_update_state', + self._pull_update.get_active()) + self._settings.write() + + def _delete(self, widget, event): + self._do_close() +   def _toolbutton(self, stock, label, handler,   menu=None, userdata=None, tip=None):   if menu: