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

clone: change base class to gtk.Dialog

Changeset 27b56db66d25

Parent 43404d6117e8

by Yuki KODAMA

Changes to one file · Browse files at 27b56db66d25 Showing diff from parent 43404d6117e8 Diff from another changeset...

Change 1 of 6 Show Entire File hggtk/​clone.py Stacked
 
16
17
18
19
 
20
21
22
23
 
 
24
25
26
27
 
 
 
 
 
 
28
29
30
 
39
40
41
42
43
44
45
46
47
 
69
70
71
72
 
73
74
75
 
149
150
151
152
 
153
154
155
 
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
 
342
343
344
345
 
 
346
347
348
 
16
17
18
 
19
20
21
22
 
23
24
25
26
27
 
28
29
30
31
32
33
34
35
36
 
45
46
47
 
 
 
48
49
50
 
72
73
74
 
75
76
77
78
 
152
153
154
 
155
156
157
158
 
192
193
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
196
197
 
320
321
322
 
323
324
325
326
327
@@ -16,15 +16,21 @@
 from thgutil import hglib, shlib, settings  from hggtk import gdialog, gtklib, hgcmd   -class CloneDialog(gtk.Window): +class CloneDialog(gtk.Dialog):   """ Dialog to clone a Mercurial repo """   def __init__(self, repos=[]):   """ Initialize the Dialog """ - gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL) + gtk.Dialog.__init__(self, title=_('TortoiseHg Clone'), + buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))   gtklib.set_tortoise_icon(self, 'menuclone.ico')   gtklib.set_tortoise_keys(self)   self.set_resizable(False) - self.set_title(_('TortoiseHg Clone')) + self.set_has_separator(False) + + # add clone button + clonebutton = gtk.Button(_('Clone')) + clonebutton.connect('clicked', self.clone_clicked) + self.action_area.pack_end(clonebutton)     self.ui = ui.ui()   self.clonesettings = settings.Settings('clone') @@ -39,9 +45,6 @@
  elif len(repos):   srcpath = repos[0]   - mainvbox = gtk.VBox() - self.add(mainvbox) -   # copy from 'thgconfig.py'   def createtable(cols=2):   newtable = gtk.Table(1, cols) @@ -69,7 +72,7 @@
    # layout table for fixed options   table, addrow = createtable() - mainvbox.pack_start(table, True, True, 2) + self.vbox.pack_start(table, True, True, 2)   def setcombosize(combo):   combo.set_size_request(300, -1)   combo.size_request() @@ -149,7 +152,7 @@
    # expander for advanced options   self.expander = expander = gtk.Expander(_('Advanced options')) - mainvbox.pack_start(expander, True, True, 2) + self.vbox.pack_start(expander, True, True, 2)     # layout table for advanced options   table, addrow = createtable() @@ -189,31 +192,6 @@
  addrow(self.optremote)   addrow(self.remotecmdentry)   - ## keyboard accelerators - accelgroup = gtk.AccelGroup() - self.add_accel_group(accelgroup) - mod = gtklib.get_thg_modifier() - - ## bottom buttons - hbbox = gtk.HButtonBox() - hbbox.set_layout(gtk.BUTTONBOX_END) - mainvbox.pack_start(hbbox, False, False, 2) - - close = gtk.Button(_('Cancel')) - close.connect('clicked', lambda x: self.destroy()) - key, modifier = gtk.accelerator_parse('Escape') - close.add_accelerator('clicked', accelgroup, key, 0, - gtk.ACCEL_VISIBLE) - self.close_button = close - hbbox.add(close) - - clone = gtk.Button(_('Clone')) - key, modifier = gtk.accelerator_parse(mod+'Return') - clone.add_accelerator('clicked', accelgroup, key, modifier, - gtk.ACCEL_VISIBLE) - clone.connect('clicked', self.clone_clicked) - hbbox.add(clone) -   # give focus to dest combo   destcombo.grab_focus()   @@ -342,7 +320,8 @@
    self.add_src_to_recent(src)   self.add_dest_to_recent(dest) - self.close_button.grab_focus() + cancel = [b for b in self.action_area if b.get_label() == 'gtk-cancel'][0] + cancel.grab_focus()     if dlg.return_code() == 0:   shlib.shell_notify([dest])