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

thgconfig: add 'Browse...' button for selecting local folder

Changeset b68e858bdd55

Parent d5ba2538c25d

by Yuki KODAMA

Changes to one file · Browse files at b68e858bdd55 Showing diff from parent d5ba2538c25d Diff from another changeset...

 
256
257
258
259
 
260
261
262
263
 
 
 
264
265
266
 
401
402
403
 
 
 
 
 
 
 
 
 
 
404
405
406
 
256
257
258
 
259
260
261
262
263
264
265
266
267
268
269
 
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
@@ -256,11 +256,14 @@
  toptable = gtk.Table(2, 2)   self.vbox.pack_start(toptable, False, False, 2)   - ## alias + ## alias (and 'Browse...' button)   toptable.attach(self.entries['Alias'][1], 0, 1, 0, 1, gtk.FILL, 0, 4, 2)   hbox = gtk.HBox()   hbox.pack_start(self.entries['Alias'][0], False, False)   hbox.pack_start(gtk.Label('')) + browse = gtk.Button(_('Browse...')) + browse.connect('clicked', self.browse_clicked) + hbox.pack_start(browse, False, False)   toptable.attach(hbox, 1, 2, 0, 1, gtk.FILL|gtk.EXPAND, 0, 4, 2)     ## final URL @@ -401,6 +404,16 @@
  self.settings.set_value('expanded', expanded)   self.settings.write()   + def browse_clicked(self, button): + if self.protcombo.get_active_text() == 'local': + initial = self.entries['URL'][0].get_text() + else: + initial = None + path = gtklib.NativeFolderSelectDialog(initial=initial, + title=_('Select Local Folder')).run() + if path: + self.entries['URL'][0].set_text(path) +   def changed(self, combo):   newurl = self.buildurl()   self.sethandlers(False)