OpenMS
ToolsDialog.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Marc Sturm $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS_GUI config
12 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13 
16 
17 class QLabel;
18 class QComboBox;
19 class QPushButton;
20 class QString;
21 
22 #include <QtWidgets/QDialog>
23 
24 namespace OpenMS
25 {
26  class ParamEditor;
27  class TVToolDiscovery;
28 
43  class OPENMS_GUI_DLLAPI ToolsDialog :
44  public QDialog
45  {
46  Q_OBJECT
47 
48 public:
60  ToolsDialog(QWidget * parent, const Param& params, String ini_file, String default_dir, LayerDataBase::DataType layer_type, const String& layer_name, TVToolDiscovery* tool_scanner);
62  ~ToolsDialog() override;
63 
70 
71 private:
75  QLabel * tool_desc_;
77  QComboBox * tools_combo_;
79  QPushButton* reload_plugins_button_;
81  QComboBox * input_combo_;
83  QComboBox * output_combo_;
89  QPushButton * ok_button_;
95  QString filename_;
97  std::map<String, LayerDataBase::DataType> tool_map_;
106 
108  void disable_();
110  void enable_();
112  std::vector<LayerDataBase::DataType> getTypesFromParam_(const Param& p) const;
114  void setInputOutputCombo_(const Param& p);
116  QStringList createToolsList_();
117 
118 protected slots:
119 
121  void ok_();
123  void setTool_(int i);
125  void createINI_();
127  void loadINI_();
129  void storeINI_();
132  };
133 
134 }
A GUI for editing or viewing a Param object.
Definition: ParamEditor.h:154
Management and storage of parameters / INI files.
Definition: Param.h:44
A more convenient string class.
Definition: String.h:34
Scans for tools and generates a param for each asynchronously.
Definition: TVToolDiscovery.h:37
TOPP tool selection dialog.
Definition: ToolsDialog.h:45
Param arg_param_
Param for loading the ini-file.
Definition: ToolsDialog.h:85
QPushButton * reload_plugins_button_
Button to rerun the automatic plugin detection.
Definition: ToolsDialog.h:79
Param vis_param_
Param for loading configuration information in the ParamEditor.
Definition: ToolsDialog.h:87
Param plugin_params_
Param object containing all plugin params.
Definition: ToolsDialog.h:101
QStringList createToolsList_()
Create a list of all TOPP tool/util/plugins that are compatible with the active layer type.
QComboBox * output_combo_
for choosing an output parameter
Definition: ToolsDialog.h:83
void disable_()
Disables the ok button and input/output comboboxes.
void setInputOutputCombo_(const Param &p)
Fill input_combo_ and output_combo_ box with the appropriate entries from the specified param object.
void storeINI_()
stores an ini-file from the editor
QString filename_
name of ini-file
Definition: ToolsDialog.h:95
void ok_()
if ok button pressed show the tool output in a new layer, a new window or standard output as messageb...
LayerDataBase::DataType layer_type_
The layer type of the current layer to determine all usable plugins.
Definition: ToolsDialog.h:105
std::vector< LayerDataBase::DataType > getTypesFromParam_(const Param &p) const
Determine all types a tool is compatible with by mapping each file extensions in a tools param.
void enable_()
Enables the ok button and input/output comboboxes.
TVToolDiscovery * tool_scanner_
Pointer to the tool scanner for access to the plugins and to rerun the plugins detection.
Definition: ToolsDialog.h:103
QComboBox * input_combo_
for choosing an input parameter
Definition: ToolsDialog.h:81
String ini_file_
Location of the temporary INI file this dialog works on.
Definition: ToolsDialog.h:91
std::map< String, LayerDataBase::DataType > tool_map_
Mapping of file extension to layer type to determine the type of a tool.
Definition: ToolsDialog.h:97
QLabel * tool_desc_
tools description label
Definition: ToolsDialog.h:75
void createINI_()
Slot that retrieves and displays the defaults.
String getTool()
to get the currently selected tool-name
void loadINI_()
loads an ini-file into the editor
ToolsDialog(QWidget *parent, const Param &params, String ini_file, String default_dir, LayerDataBase::DataType layer_type, const String &layer_name, TVToolDiscovery *tool_scanner)
Constructor.
String default_dir_
default-dir of ini-file to open
Definition: ToolsDialog.h:93
~ToolsDialog() override
Destructor.
QPushButton * ok_button_
ok-button connected with slot ok_()
Definition: ToolsDialog.h:89
String getInput()
to get the parameter name for input
void setTool_(int i)
Slot that handles changing of the tool.
Param tool_params_
Param object containing all TOPP tool/util params.
Definition: ToolsDialog.h:99
ParamEditor * editor_
ParamEditor for reading ini-files.
Definition: ToolsDialog.h:73
String getOutput()
to get the parameter name for output. Empty if no output was selected.
void reloadPlugins_()
rerun the automatic plugin detection
QComboBox * tools_combo_
ComboBox for choosing a TOPP-tool.
Definition: ToolsDialog.h:77
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
DataType
Definition: LayerDataBase.h:73