widgets.tool_template_widget
¶
QWidget that is used to create or edit Tool Templates. In the former case it is presented empty, but in the latter it is filled with all the information from the template being edited.
author: |
|
---|---|
date: | 12.4.2018 |
Module Contents¶
-
class
widgets.tool_template_widget.
ToolTemplateWidget
(toolbox, tool_template=None)[source]¶ Bases:
PySide2.QtWidgets.QWidget
A widget to query user’s preferences for a new tool template.
-
tool_template
¶ If given, the form is pre-filled with this template
Type: ToolTemplate
-
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]¶ Create a new blank main program file. Let user decide the file name and location.
-
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 template.
-
show_add_source_dirs_dialog
(self, checked=False)[source]¶ Let user select a source directory for this tool template. 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.
-
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 template.
-
remove_inputfiles_opt
(self, checked=False)[source]¶ Remove selected optional input files from list. Do not remove anything if there are no items selected.
-
remove_outputfiles
(self, checked=False)[source]¶ Remove selected output files from list. Do not remove anything if there are no items selected.
-
ok_clicked
(self)[source]¶ Check that everything is valid, create definition dictionary and add template to project.
-
call_add_tool_template
(self)[source]¶ Add or update Tool Template according to user’s selections. If the name is the same as an existing tool template, it is updated and auto-saved to the definition file. (User is editing an existing tool template.) If the name is not in the tool template model, create a new tool template and offer to save the definition file. (User is creating a new tool template from scratch or spawning from an existing one).
-