Bug report #12511

Allow selecting either a directory or a file in the processing settings

Added by Ricardo Silva almost 9 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:2.8.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:20657

Description

Custom processing providers would benefit from being able to explicitly choose between a QFileDialog that allows picking a directory or a file. The current implementation seems very counter-intuitive. Please check the method:

processing.gui.ConfigDialog.SettingDelegate:createEditor()

Basically, if the previously selected path is a file, Processing presents the user with a dialog for selecting a file. Otherwise, it produces a dialog for selecting a directory. So if the user never manually types some valid file path in the line edit, (s)he will never be presented with a file selection dialog.

There seems to be some intent in supporting a more explicit behavior in:

processing.core.ProcessingConfig.Setting

Instances of the Setting class actually have a valuetype attribute. Presumably this would take a value of either Setting.FILE or Setting.FOLDER and the SettingDelegate.createEditor() method would use it to create the appropriate dialog.

Associated revisions

Revision b80a1bca
Added by Victor Olaya over 8 years ago

[processing] fixed handling of folders and files in settings

fixes #12511

History

#1 Updated by Giovanni Manghi almost 9 years ago

  • Target version changed from Version 2.8.2 to Version 2.10

#2 Updated by Victor Olaya over 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF