OpenMS  3.0.0
ToolsDialog.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2022.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg $
32 // $Authors: Marc Sturm $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // OpenMS_GUI config
38 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
39 
42 
43 class QLabel;
44 class QComboBox;
45 class QPushButton;
46 class QString;
47 
48 #include <QtWidgets/QDialog>
49 
50 namespace OpenMS
51 {
52  class ParamEditor;
53  class TVToolDiscovery;
54 
69  class OPENMS_GUI_DLLAPI ToolsDialog :
70  public QDialog
71  {
72  Q_OBJECT
73 
74 public:
85  ToolsDialog(QWidget * parent, const Param& params, String ini_file, String default_dir, LayerDataBase::DataType layer_type, const String& layer_name, TVToolDiscovery* tool_scanner);
87  ~ToolsDialog() override;
88 
90  String getOutput();
92  String getInput();
94  String getTool();
95 
96 private:
100  QLabel * tool_desc_;
102  QComboBox * tools_combo_;
106  QComboBox * input_combo_;
108  QComboBox * output_combo_;
114  QPushButton * ok_button_;
120  QString filename_;
122  std::map<String, LayerDataBase::DataType> tool_map_;
131 
133  void disable_();
135  void enable_();
137  std::vector<LayerDataBase::DataType> getTypesFromParam_(const Param& p) const;
139  void setInputOutputCombo_(const Param& p);
141  QStringList createToolsList_();
142 
143 protected slots:
144 
146  void ok_();
148  void setTool_(int i);
150  void createINI_();
152  void loadINI_();
154  void storeINI_();
156  void reloadPlugins_();
157  };
158 
159 }
OpenMS::ToolsDialog::tool_desc_
QLabel * tool_desc_
tools description label
Definition: ToolsDialog.h:100
OpenMS::ToolsDialog::output_combo_
QComboBox * output_combo_
for choosing an output parameter
Definition: ToolsDialog.h:108
OpenMS::ToolsDialog::tool_map_
std::map< String, LayerDataBase::DataType > tool_map_
Mapping of file extension to layer type to determine the type of a tool.
Definition: ToolsDialog.h:122
OpenMS::ToolsDialog::input_combo_
QComboBox * input_combo_
for choosing an input parameter
Definition: ToolsDialog.h:106
OpenMS::ToolsDialog::plugin_params_
Param plugin_params_
Param object containing all plugin params.
Definition: ToolsDialog.h:126
OpenMS::ToolsDialog::reload_plugins_button_
QPushButton * reload_plugins_button_
Button to rerun the automatic plugin detection.
Definition: ToolsDialog.h:104
OpenMS::ToolsDialog::ok_button_
QPushButton * ok_button_
ok-button connected with slot ok_()
Definition: ToolsDialog.h:114
OpenMS::ToolsDialog::editor_
ParamEditor * editor_
ParamEditor for reading ini-files.
Definition: ToolsDialog.h:98
OpenMS::TVToolDiscovery
Scans for tools/utils and generates a param for each asynchronously.
Definition: TVToolDiscovery.h:62
OpenMS::String
A more convenient string class.
Definition: String.h:58
QDialog
OpenMS::ToolsDialog::default_dir_
String default_dir_
default-dir of ini-file to open
Definition: ToolsDialog.h:118
OpenMS::ToolsDialog::tools_combo_
QComboBox * tools_combo_
ComboBox for choosing a TOPP-tool.
Definition: ToolsDialog.h:102
QWidget
OpenMS::LayerDataBase::DataType
DataType
Definition: LayerDataBase.h:104
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::ToolsDialog::layer_type_
LayerDataBase::DataType layer_type_
The layer type of the current layer to determine all usable plugins.
Definition: ToolsDialog.h:130
OpenMS::ToolsDialog::filename_
QString filename_
name of ini-file
Definition: ToolsDialog.h:120
Param.h
LayerDataBase.h
OpenMS::ToolsDialog::ini_file_
String ini_file_
Location of the temporary INI file this dialog works on.
Definition: ToolsDialog.h:116
OpenMS::ToolsDialog
TOPP tool selection dialog.
Definition: ToolsDialog.h:69
OpenMS::ToolsDialog::arg_param_
Param arg_param_
Param for loading the ini-file.
Definition: ToolsDialog.h:110
OpenMS::ToolsDialog::tool_params_
Param tool_params_
Param object containing all TOPP tool/util params.
Definition: ToolsDialog.h:124
OpenMS::ParamEditor
A GUI for editing or viewing a Param object.
Definition: ParamEditor.h:178
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:69
OpenMS::ToolsDialog::tool_scanner_
TVToolDiscovery * tool_scanner_
Pointer to the tool scanner for access to the plugins and to rerun the plugins detection.
Definition: ToolsDialog.h:128
OpenMS::ToolsDialog::vis_param_
Param vis_param_
Param for loading configuration information in the ParamEditor.
Definition: ToolsDialog.h:112