Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

synch: add button for finding bundle files

gtk.FileChooserDialog does not seem to support searching for a file or directory in
the same dialog instance, so I had to make a separate button for doing *.hg searches.
Would be nice if this dialog supported drag-drop of *.hg files.

Changeset 6ca9cfd890f8

Parent d09bf95cd58a

by Steve Borho

Changes to one file · Browse files at 6ca9cfd890f8 Showing diff from parent d09bf95cd58a Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​synch.py Stacked
 
110
111
112
113
 
114
115
 
 
 
 
 
 
116
117
118
 
149
150
151
152
153
154
155
 
314
315
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
318
319
 
110
111
112
 
113
114
115
116
117
118
119
120
121
122
123
124
 
155
156
157
 
158
159
160
 
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
@@ -110,9 +110,15 @@
    # revision input   revbox = gtk.HBox() - lbl = gtk.Button("Remote Path:") + lbl = gtk.Button("Repo:")   lbl.unset_flags(gtk.CAN_FOCUS)   lbl.connect('clicked', self._btn_remotepath_clicked) + revbox.pack_start(lbl, False, False) + + lbl = gtk.Button("Bundle:") + lbl.unset_flags(gtk.CAN_FOCUS) + lbl.connect('clicked', self._btn_bundlepath_clicked) + revbox.pack_start(lbl, False, False)     # revisions combo box   self.pathlist = gtk.ListStore(str) @@ -149,7 +155,6 @@
  else:   self._use_proxy.set_sensitive(False)   - revbox.pack_start(lbl, False, False)   revbox.pack_start(self._pathbox, True, True)   revbox.pack_end(self._use_proxy, False, False)   vbox.pack_start(revbox, False, False, 2) @@ -314,6 +319,23 @@
  if response == gtk.RESPONSE_OK:   self._pathtext.set_text(dialog.get_filename())   dialog.destroy() + + def _btn_bundlepath_clicked(self, button): + """ select bundle to read from """ + dialog = gtk.FileChooserDialog(title="Select Bundle", + action=gtk.FILE_CHOOSER_ACTION_OPEN, + buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, + gtk.STOCK_OPEN,gtk.RESPONSE_OK)) + dialog.set_default_response(gtk.RESPONSE_OK) + dialog.set_current_folder(self.root) + filter = gtk.FileFilter() + filter.set_name("Bundle (*.hg") + filter.add_pattern("*.hg") + dialog.add_filter(filter) + response = dialog.run() + if response == gtk.RESPONSE_OK: + self._pathtext.set_text(dialog.get_filename()) + dialog.destroy()     def _close_clicked(self, toolbutton, data=None):   self._do_close()