コード例 #1
0
 def _on_path_select_clicked(self):
     # Workaround for QFileDialog.getExistingDirectory because it do not
     # select the configuration folder in the dialog
     self.dialog = QFileDialog(self, caption='Select a new settings folder')
     self.dialog.setOption(QFileDialog.HideNameFilterDetails, True)
     self.dialog.setFileMode(QFileDialog.Directory)
     self.dialog.setDirectory(self.path)
     if self.dialog.exec_():
         fileNames = self.dialog.selectedFiles()
         path = fileNames[0]
         if os.path.isfile(path):
             path = os.path.basename(path)
         self._lineedit.setText(path)
         self.path = dir
         self.editing_finished_signal.emit()