Commits

Angel Ezquerra  committed 5ac2cdc

clone: Automatically load the combobox text into the folder browse dialogs

When clicking on the source and destination browse buttons, use the current
text on the corresponding combobox as the starting browsing folder.
If the folder that is currently typed in the combobox does not exist, QT will
automatically chose a valid folder.

  • Participants
  • Parent commits ab815bf
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/clone.py

     def browse_src(self):
         FD = QFileDialog
         caption = _("Select source repository")
-        path = FD.getExistingDirectory(self, caption)
+        path = FD.getExistingDirectory(self, caption, \
+            self.src_combo.currentText(), QFileDialog.ShowDirsOnly)
         if path:
             self.src_combo.setEditText(QDir.toNativeSeparators(path))
             self.src_combo.setFocus()
     def browse_dest(self):
         FD = QFileDialog
         caption = _("Select destination repository")
-        path = FD.getExistingDirectory(self, caption)
+        path = FD.getExistingDirectory(self, caption, \
+            self.dest_combo.currentText(), QFileDialog.ShowDirsOnly)
         if path:
             self.dest_combo.setEditText(QDir.toNativeSeparators(path))
             self.dest_combo.setFocus()