OpenMS
ToolsDialog Class Reference

TOPP tool selection dialog. More...

#include <OpenMS/VISUAL/DIALOGS/ToolsDialog.h>

Inheritance diagram for ToolsDialog:
[legend]
Collaboration diagram for ToolsDialog:
[legend]

Public Member Functions

 ToolsDialog (QWidget *parent, const Param &params, String ini_file, String default_dir, LayerDataBase::DataType layer_type, const String &layer_name, TVToolDiscovery *tool_scanner)
 Constructor. More...
 
 ~ToolsDialog () override
 Destructor. More...
 
String getOutput ()
 to get the parameter name for output. Empty if no output was selected. More...
 
String getInput ()
 to get the parameter name for input More...
 
String getTool ()
 to get the currently selected tool-name More...
 

Protected Slots

void ok_ ()
 if ok button pressed show the tool output in a new layer, a new window or standard output as messagebox More...
 
void setTool_ (int i)
 Slot that handles changing of the tool. More...
 
void createINI_ ()
 Slot that retrieves and displays the defaults. More...
 
void loadINI_ ()
 loads an ini-file into the editor More...
 
void storeINI_ ()
 stores an ini-file from the editor More...
 
void reloadPlugins_ ()
 rerun the automatic plugin detection More...
 

Private Member Functions

void disable_ ()
 Disables the ok button and input/output comboboxes. More...
 
void enable_ ()
 Enables the ok button and input/output comboboxes. More...
 
std::vector< LayerDataBase::DataTypegetTypesFromParam_ (const Param &p) const
 Determine all types a tool is compatible with by mapping each file extensions in a tools param. More...
 
void setInputOutputCombo_ (const Param &p)
 Fill input_combo_ and output_combo_ box with the appropriate entries from the specified param object. More...
 
QStringList createToolsList_ ()
 Create a list of all TOPP tool/util/plugins that are compatible with the active layer type. More...
 

Private Attributes

ParamEditoreditor_
 ParamEditor for reading ini-files. More...
 
QLabel * tool_desc_
 tools description label More...
 
QComboBox * tools_combo_
 ComboBox for choosing a TOPP-tool. More...
 
QPushButton * reload_plugins_button_
 Button to rerun the automatic plugin detection. More...
 
QComboBox * input_combo_
 for choosing an input parameter More...
 
QComboBox * output_combo_
 for choosing an output parameter More...
 
Param arg_param_
 Param for loading the ini-file. More...
 
Param vis_param_
 Param for loading configuration information in the ParamEditor. More...
 
QPushButton * ok_button_
 ok-button connected with slot ok_() More...
 
String ini_file_
 Location of the temporary INI file this dialog works on. More...
 
String default_dir_
 default-dir of ini-file to open More...
 
QString filename_
 name of ini-file More...
 
std::map< String, LayerDataBase::DataTypetool_map_
 Mapping of file extension to layer type to determine the type of a tool. More...
 
Param tool_params_
 Param object containing all TOPP tool/util params. More...
 
Param plugin_params_
 Param object containing all plugin params. More...
 
TVToolDiscoverytool_scanner_
 Pointer to the tool scanner for access to the plugins and to rerun the plugins detection. More...
 
LayerDataBase::DataType layer_type_
 The layer type of the current layer to determine all usable plugins. More...
 

Detailed Description

TOPP tool selection dialog.

In the dialog, the user can

  • select a TOPP tool
  • select the options used for the input and output file

    • and set the parameters for the tool

    This information can then be used to execute the tool.

    The offered tools depend on the data type set in the constructor.

Constructor & Destructor Documentation

◆ ToolsDialog()

ToolsDialog ( QWidget parent,
const Param params,
String  ini_file,
String  default_dir,
LayerDataBase::DataType  layer_type,
const String layer_name,
TVToolDiscovery tool_scanner 
)

Constructor.

Parameters
parentQt parent widget
paramsContaining all TOPP tool/util params
ini_fileThe file name of the temporary INI file created by this dialog
default_dirThe default directory for loading and storing INI files
layer_typeThe type of data (determines the applicable tools)
layer_nameThe name of the selected layer

◆ ~ToolsDialog()

~ToolsDialog ( )
override

Destructor.

Member Function Documentation

◆ createINI_

void createINI_ ( )
protectedslot

Slot that retrieves and displays the defaults.

◆ createToolsList_()

QStringList createToolsList_ ( )
private

Create a list of all TOPP tool/util/plugins that are compatible with the active layer type.

◆ disable_()

void disable_ ( )
private

Disables the ok button and input/output comboboxes.

◆ enable_()

void enable_ ( )
private

Enables the ok button and input/output comboboxes.

◆ getInput()

String getInput ( )

to get the parameter name for input

Referenced by TOPPViewBase::showTOPPDialog_().

◆ getOutput()

String getOutput ( )

to get the parameter name for output. Empty if no output was selected.

Referenced by TOPPViewBase::showTOPPDialog_().

◆ getTool()

String getTool ( )

to get the currently selected tool-name

Referenced by TOPPViewBase::showTOPPDialog_().

◆ getTypesFromParam_()

std::vector<LayerDataBase::DataType> getTypesFromParam_ ( const Param p) const
private

Determine all types a tool is compatible with by mapping each file extensions in a tools param.

◆ loadINI_

void loadINI_ ( )
protectedslot

loads an ini-file into the editor

◆ ok_

void ok_ ( )
protectedslot

if ok button pressed show the tool output in a new layer, a new window or standard output as messagebox

◆ reloadPlugins_

void reloadPlugins_ ( )
protectedslot

rerun the automatic plugin detection

◆ setInputOutputCombo_()

void setInputOutputCombo_ ( const Param p)
private

Fill input_combo_ and output_combo_ box with the appropriate entries from the specified param object.

◆ setTool_

void setTool_ ( int  i)
protectedslot

Slot that handles changing of the tool.

◆ storeINI_

void storeINI_ ( )
protectedslot

stores an ini-file from the editor

Member Data Documentation

◆ arg_param_

Param arg_param_
private

Param for loading the ini-file.

◆ default_dir_

String default_dir_
private

default-dir of ini-file to open

◆ editor_

ParamEditor* editor_
private

ParamEditor for reading ini-files.

◆ filename_

QString filename_
private

name of ini-file

◆ ini_file_

String ini_file_
private

Location of the temporary INI file this dialog works on.

◆ input_combo_

QComboBox* input_combo_
private

for choosing an input parameter

◆ layer_type_

LayerDataBase::DataType layer_type_
private

The layer type of the current layer to determine all usable plugins.

◆ ok_button_

QPushButton* ok_button_
private

ok-button connected with slot ok_()

◆ output_combo_

QComboBox* output_combo_
private

for choosing an output parameter

◆ plugin_params_

Param plugin_params_
private

Param object containing all plugin params.

◆ reload_plugins_button_

QPushButton* reload_plugins_button_
private

Button to rerun the automatic plugin detection.

◆ tool_desc_

QLabel* tool_desc_
private

tools description label

◆ tool_map_

std::map<String, LayerDataBase::DataType> tool_map_
private

Mapping of file extension to layer type to determine the type of a tool.

◆ tool_params_

Param tool_params_
private

Param object containing all TOPP tool/util params.

◆ tool_scanner_

TVToolDiscovery* tool_scanner_
private

Pointer to the tool scanner for access to the plugins and to rerun the plugins detection.

◆ tools_combo_

QComboBox* tools_combo_
private

ComboBox for choosing a TOPP-tool.

◆ vis_param_

Param vis_param_
private

Param for loading configuration information in the ParamEditor.