Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

synch: use native file open dialog for bundles

Changeset 0c57710e2add

Parent 6955c0522738

by Steve Borho

Changes to one file · Browse files at 0c57710e2add Showing diff from parent 6955c0522738 Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​synch.py Stacked
 
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
 
 
 
 
 
 
 
 
373
374
375
 
352
353
354
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
355
356
357
358
359
360
361
362
363
364
365
@@ -352,24 +352,14 @@
    def btn_bundlepath_clicked(self, button):   """ select bundle to read from """ - dlg = gtk.FileChooserDialog(title=_('Select Bundle'), - action=gtk.FILE_CHOOSER_ACTION_OPEN, - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, - gtk.STOCK_OPEN,gtk.RESPONSE_OK)) - dlg.set_default_response(gtk.RESPONSE_OK) - dlg.set_current_folder(self.root) - filefilter = gtk.FileFilter() - filefilter.set_name(_('Bundle (*.hg)')) - filefilter.add_pattern("*.hg") - dlg.add_filter(filefilter) - filefilter = gtk.FileFilter() - filefilter.set_name(_('Bundle (*)')) - filefilter.add_pattern("*") - dlg.add_filter(filefilter) - response = dlg.run() - if response == gtk.RESPONSE_OK: - self.pathtext.set_text(dlg.get_filename()) - dlg.destroy() + response = gtklib.NativeSaveFileDialogWrapper( + InitialDir=self.root, + Title=_('Select Bundle'), + Filter=(_('Bundle (*.hg)'), '*.hg', + _('Bundle (*)'), '*.*'), + Open=True).run() + if response: + self.pathtext.set_text(response)     def should_live(self):   if self.cmd_running():