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

archive: move all actions to dialog response
dropped unused arguments of 'archive' method.

Changeset 4f7db1ae779e

Parent e66cdc2e1b83

by Yuki KODAMA

Changes to one file · Browse files at 4f7db1ae779e Showing diff from parent e66cdc2e1b83 Diff from another changeset...

 
29
30
31
 
32
33
34
35
36
37
 
 
38
39
40
 
50
51
52
53
 
 
 
54
55
56
 
69
70
71
72
73
74
75
76
77
78
79
80
81
 
128
129
130
 
 
 
 
 
 
 
 
131
132
133
 
176
177
178
179
180
 
 
181
182
183
 
29
30
31
32
33
34
 
 
 
 
35
36
37
38
39
 
49
50
51
 
52
53
54
55
56
57
 
70
71
72
 
 
 
 
 
 
 
73
74
75
 
122
123
124
125
126
127
128
129
130
131
132
133
134
135
 
178
179
180
 
 
181
182
183
184
185
@@ -29,12 +29,11 @@
  gtklib.set_tortoise_keys(self)   self.set_resizable(False)   self.set_has_separator(False) + self.connect('response', self.dialog_response)     # buttons - self.archivebtn = gtk.Button(_('Archive')) - self.action_area.pack_start(self.archivebtn) - self.closebtn = gtk.Button(_('Close')) - self.action_area.pack_start(self.closebtn) + self.archivebtn = self.add_button(_('Archive'), gtk.RESPONSE_OK) + self.closebtn = self.add_button(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)     try:   repo = hg.repository(ui.ui(), path=paths.find_root()) @@ -50,7 +49,9 @@
  hbox.pack_start(lbl, False, False, 2)     # revisions editable combo box - combo = gtk.combo_box_entry_new_text() + self.combo = gtk.combo_box_entry_new_text() + combo = self.combo + combo.child.connect('activate', lambda b: self.response(gtk.RESPONSE_OK))   hbox.pack_start(combo, True, True, 2)   self.vbox.pack_start(hbox, False, False, 10)   if rev: @@ -69,13 +70,6 @@
  self.vbox.add(self.get_destination_container(self.get_default_path()))   self.vbox.add(self.get_type_container())   - # register signal handlers - def archive_handler(*args): - self.archive(self.archivebtn, combo, repo) - self.archivebtn.connect('clicked', archive_handler) - combo.child.connect('activate', archive_handler) - self.closebtn.connect('clicked', lambda b: self.destroy()) -   # prepare to show   self.archivebtn.grab_focus()   @@ -128,6 +122,14 @@
  hbox.pack_end(destbrowse, False, False, 5)   return hbox   + def dialog_response(self, dialog, response_id): + # Archive button + if response_id == gtk.RESPONSE_OK: + self.archive() + self.run() + else: + self.destroy() +   def get_default_path(self):   """Return the default destination path"""   return hglib.toutf(os.getcwd()) @@ -176,8 +178,8 @@
  if response:   self.destentry.set_text(response)   - def archive(self, button, combo, repo): - rev = combo.get_active_text() + def archive(self): + rev = self.combo.get_active_text()     cmdline = ['hg', 'archive', '--verbose']   if rev != _working_dir_parent_: