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

clone: use new gtklib.NativeFolderSelectDialog() class

Changeset 1a766d2ecc6d

Parent ecc23800cfaf

by Steve Borho

Changes to one file · Browse files at 1a766d2ecc6d Showing diff from parent ecc23800cfaf Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​clone.py Stacked
 
173
174
175
176
177
178
179
180
181
182
183
184
 
 
 
 
 
185
186
187
188
189
190
191
192
193
194
195
196
 
 
 
 
 
197
198
199
 
173
174
175
 
 
 
 
 
 
 
 
 
176
177
178
179
180
181
182
183
 
 
 
 
 
 
 
 
 
184
185
186
187
188
189
190
191
@@ -173,27 +173,19 @@
    def dest_browse_clicked(self, button):   'select folder as clone destination' - dialog = gtk.FileChooserDialog(title=None, - action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, - gtk.STOCK_OPEN,gtk.RESPONSE_OK)) - dialog.set_default_response(gtk.RESPONSE_OK) - response = dialog.run() - if response == gtk.RESPONSE_OK: - self.destentry.set_text(dialog.get_filename()) - dialog.destroy() + response = gtklib.NativeFolderSelectDialog( + initial=self.destentry.get_text(), + title=_('Select Destination Folder')).run() + if response: + self.destentry.set_text(response)     def source_browse_clicked(self, button):   'select source folder to clone' - dialog = gtk.FileChooserDialog(title=None, - action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, - gtk.STOCK_OPEN,gtk.RESPONSE_OK)) - dialog.set_default_response(gtk.RESPONSE_OK) - response = dialog.run() - if response == gtk.RESPONSE_OK: - self.srcentry.set_text(dialog.get_filename()) - dialog.destroy() + response = gtklib.NativeFolderSelectDialog( + initial=self.destentry.get_text(), + title=_('Select Source Folder')).run() + if response: + self.destentry.set_text(response)     def add_src_to_recent(self, src):   if os.path.exists(src):