OpenMS
Loading...
Searching...
No Matches
ToolsDialog.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- 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
17class QLabel;
18class QComboBox;
19class QPushButton;
20class QString;
21
22#include <QtWidgets/QDialog>
23
24namespace OpenMS
25{
26 class ParamEditor;
27 class TVToolDiscovery;
28
43 class OPENMS_GUI_DLLAPI ToolsDialog :
44 public QDialog
45 {
46 Q_OBJECT
47
48public:
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
72
73
74private:
78 QLabel * tool_desc_;
80 QComboBox * tools_combo_;
84 QComboBox * input_combo_;
86 QComboBox * output_combo_;
92 QPushButton * ok_button_;
98 QString filename_;
100 std::map<String, LayerDataBase::DataType> tool_map_;
109
111 void disable_();
113 void enable_();
115 std::vector<LayerDataBase::DataType> getTypesFromParam_(const Param& p) const;
119 QStringList createToolsList_();
120
121protected slots:
122
124 void ok_();
126 void setTool_(int i);
130 void loadINI_();
132 void storeINI_();
135 };
136
137}
A GUI for editing or viewing a Param object.
Definition ParamEditor.h:153
Management and storage of parameters / INI files.
Definition Param.h:46
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:88
QPushButton * reload_plugins_button_
Button to rerun the automatic plugin detection.
Definition ToolsDialog.h:82
Param vis_param_
Param for loading configuration information in the ParamEditor.
Definition ToolsDialog.h:90
Param plugin_params_
Param object containing all plugin params.
Definition ToolsDialog.h:104
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:86
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:98
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:108
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:106
QComboBox * input_combo_
for choosing an input parameter
Definition ToolsDialog.h:84
String ini_file_
Location of the temporary INI file this dialog works on.
Definition ToolsDialog.h:94
std::map< String, LayerDataBase::DataType > tool_map_
Mapping of file extension to layer type to determine the type of a tool.
Definition ToolsDialog.h:100
QLabel * tool_desc_
tools description label
Definition ToolsDialog.h:78
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:96
~ToolsDialog() override
Destructor.
QPushButton * ok_button_
ok-button connected with slot ok_()
Definition ToolsDialog.h:92
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:102
String getExtension()
get the default extension for the output file
ParamEditor * editor_
ParamEditor for reading ini-files.
Definition ToolsDialog.h:76
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:80
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
DataType
Definition LayerDataBase.h:74