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

status: use native save and folder select dialogs

Changeset 9f49cebfeba3

Parent 095dda5c6376

by Steve Borho

Changes to one file · Browse files at 9f49cebfeba3 Showing diff from parent 095dda5c6376 Diff from another changeset...

Change 1 of 2 Show Entire File hggtk/​status.py Stacked
 
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
 
 
 
 
 
 
 
 
791
792
793
 
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
 
 
 
 
 
1203
1204
1205
 
773
774
775
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
776
777
778
779
780
781
782
783
784
785
786
 
1182
1183
1184
 
 
 
 
 
 
 
 
 
 
 
1185
1186
1187
1188
1189
1190
1191
1192
@@ -773,21 +773,14 @@
  def copy_file(self, stat, wfile):   wfile = self.repo.wjoin(wfile)   fdir, fname = os.path.split(wfile) - dlg = gtk.FileChooserDialog(parent=self, - title=_('Copy file to'), - action=gtk.FILE_CHOOSER_ACTION_SAVE, - buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL, - gtk.STOCK_COPY,gtk.RESPONSE_OK)) - dlg.set_default_response(gtk.RESPONSE_OK) - dlg.set_current_folder(fdir) - dlg.set_current_name(fname) - response = dlg.run() - newfile=wfile - if response == gtk.RESPONSE_OK: - newfile = dlg.get_filename() - dlg.destroy() - if newfile != wfile: - self.hg_copy([wfile, newfile]) + response = gtklib.NativeSaveFileDialogWrapper( + Title=_('Copy file to'), + InitialDir=fdir, + FileName=fname).run() + if not response: + return + if reponse != wfile: + self.hg_copy([wfile, reponse])   return True     @@ -1189,17 +1182,11 @@
  move_list = self.relevant_files('C')   if move_list:   # get destination directory to files into - dlg = gtk.FileChooserDialog(title=_('Move files to diretory...'), - parent=self, - action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, - 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.repo.root) - response = dlg.run() - destdir = dlg.get_filename() - dlg.destroy() - if response != gtk.RESPONSE_OK: + dlg = gtklib.NativeFolderSelectDialog( + title=_('Move files to directory...'), + initial=self.repo.root) + destdir = dlg.run() + if not destdir:   return True     # verify directory