OpenMS
ToolsDialog.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, 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:
59  ToolsDialog(QWidget * parent, const Param& params, String ini_file, String default_dir, LayerDataBase::DataType layer_type, const String& layer_name, TVToolDiscovery* tool_scanner);
61  ~ToolsDialog() override;
62 
69 
70 private:
74  QLabel * tool_desc_;
76  QComboBox * tools_combo_;
78  QPushButton* reload_plugins_button_;
80  QComboBox * input_combo_;
82  QComboBox * output_combo_;
88  QPushButton * ok_button_;
94  QString filename_;
96  std::map<String, LayerDataBase::DataType> tool_map_;
105 
107  void disable_();
109  void enable_();
111  std::vector<LayerDataBase::DataType> getTypesFromParam_(const Param& p) const;
113  void setInputOutputCombo_(const Param& p);
115  QStringList createToolsList_();
116 
117 protected slots:
118 
120  void ok_();
122  void setTool_(int i);
124  void createINI_();
126  void loadINI_();
128  void storeINI_();
131  };
132 
133 }
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:84
QPushButton * reload_plugins_button_
Button to rerun the automatic plugin detection.
Definition: ToolsDialog.h:78
Param vis_param_
Param for loading configuration information in the ParamEditor.
Definition: ToolsDialog.h:86
Param plugin_params_
Param object containing all plugin params.
Definition: ToolsDialog.h:100
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:82
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:94
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:104
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:102
QComboBox * input_combo_
for choosing an input parameter
Definition: ToolsDialog.h:80
String ini_file_
Location of the temporary INI file this dialog works on.
Definition: ToolsDialog.h:90
std::map< String, LayerDataBase::DataType > tool_map_
Mapping of file extension to layer type to determine the type of a tool.
Definition: ToolsDialog.h:96
QLabel * tool_desc_
tools description label
Definition: ToolsDialog.h:74
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:92
~ToolsDialog() override
Destructor.
QPushButton * ok_button_
ok-button connected with slot ok_()
Definition: ToolsDialog.h:88
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:98
ParamEditor * editor_
ParamEditor for reading ini-files.
Definition: ToolsDialog.h:72
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:76
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
DataType
Definition: LayerDataBase.h:73