spinetoolbox.widgets.tool_specification_widget
¶
QWidget that is used to create or edit Tool specifications. In the former case it is presented empty, but in the latter it is filled with all the information from the specification being edited.
author: |
|
---|---|
date: | 12.4.2018 |
Module Contents¶
-
class
spinetoolbox.widgets.tool_specification_widget.
ToolSpecificationWidget
(toolbox, tool_specification=None)[source]¶ Bases:
PySide2.QtWidgets.QWidget
A widget to query user’s preferences for a new tool specification.
Parameters: - toolbox (ToolboxUI) – QMainWindow instance
- tool_specification (ToolSpecification) – If given, the form is pre-filled with this specification
-
populate_sourcefile_list
(self, items)[source]¶ List source files in QTreeView. If items is None or empty list, model is cleared.
-
populate_inputfiles_list
(self, items)[source]¶ List input files in QTreeView. If items is None or empty list, model is cleared.
-
populate_inputfiles_opt_list
(self, items)[source]¶ List optional input files in QTreeView. If items is None or empty list, model is cleared.
-
populate_outputfiles_list
(self, items)[source]¶ List output files in QTreeView. If items is None or empty list, model is cleared.
-
browse_main_program
(self, checked=False)[source]¶ Open file browser where user can select the path of the main program file.
-
new_main_program_file
(self)[source]¶ Creates a new blank main program file. Let’s user decide the file name and path. Alternative version using only one getSaveFileName dialog.
-
show_add_source_files_dialog
(self, checked=False)[source]¶ Let user select source files for this tool specification.
-
show_add_source_dirs_dialog
(self, checked=False)[source]¶ Let user select a source directory for this tool specification. All files and sub-directories will be added to the source files.
-
remove_source_files
(self, checked=False)[source]¶ Remove selected source files from include list. Do not remove anything if there are no items selected.
-
add_inputfiles
(self, checked=False)[source]¶ Let user select input files for this tool specification.
-
remove_inputfiles
(self, checked=False)[source]¶ Remove selected input files from list. Do not remove anything if there are no items selected.
-
add_inputfiles_opt
(self, checked=False)[source]¶ Let user select optional input files for this tool specification.
-
remove_inputfiles_opt
(self, checked=False)[source]¶ Remove selected optional input files from list. Do not remove anything if there are no items selected.
-
add_outputfiles
(self, checked=False)[source]¶ Let user select output files for this tool specification.
-
remove_outputfiles
(self, checked=False)[source]¶ Remove selected output files from list. Do not remove anything if there are no items selected.
-
handle_ok_clicked
(self)[source]¶ Checks that everything is valid, creates Tool spec definition dictionary and adds Tool spec to project.
-
call_add_tool_specification
(self)[source]¶ Adds or updates Tool specification according to user’s selections. If the name is the same as an existing tool specification, it is updated and auto-saved to the definition file. (User is editing an existing tool specification.) If the name is not in the tool specification model, creates a new tool specification and offer to save the definition file. (User is creating a new tool specification from scratch or spawning from an existing one).
-
keyPressEvent
(self, e)[source]¶ Close Setup form when escape key is pressed.
Parameters: e (QKeyEvent) – Received key press event.
-
closeEvent
(self, event=None)[source]¶ Handle close window.
Parameters: event (QEvent) – Closing event if ‘X’ is clicked.
Constructs a popup menu for the ‘@@’ button.
-
_insert_spaces_around_tag_in_args_edit
(self, tag_length, restore_cursor_to_tag_end=False)[source]¶ Inserts spaces before/after @@ around cursor position/selection
Expects cursor to be at the end of the tag.
-
_add_cmdline_tag_url_outputs
(self, _)[source]¶ Inserts @@url_outputs@@ tag to command line arguments.