Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
TOPPASBase.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-2017.
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: Johannes Veit $
32 // $Authors: Johannes Junker, Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_VISUAL_APPLICATIONS_TOPPASBASE_H
36 #define OPENMS_VISUAL_APPLICATIONS_TOPPASBASE_H
37 
38 // OpenMS_GUI config
39 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
40 
41 //OpenMS
44 
45 //QT
46 #include <QtGui/QMainWindow>
47 #include <QtGui/QWorkspace>
48 #include <QtGui/QButtonGroup>
49 #include <QtCore/QProcess>
50 #include <QtGui/QSplashScreen>
51 #include <QNetworkReply>
52 
53 class QToolBar;
54 class QListWidget;
55 class QTextEdit;
56 class QWorkspace;
57 class QLabel;
58 class QWidget;
59 class QTreeWidget;
60 class QTreeWidgetItem;
61 class QWebView;
62 class QNetworkAccessManager;
63 
64 
65 namespace OpenMS
66 {
67  class TOPPASWidget;
68  class TOPPASScene;
69  class TOPPASTabBar;
70  class TOPPASLogWindow;
71  class TOPPASResources;
72 
78  class OPENMS_GUI_DLLAPI TOPPASBase :
79  public QMainWindow,
80  public DefaultParamHandler
81  {
82  Q_OBJECT
83 
84 public:
85 
87  TOPPASBase(QWidget* parent = 0);
89  virtual ~TOPPASBase();
90 
96  void loadPreferences(String filename = "");
98  void savePreferences();
100  void loadFiles(const StringList& list, QSplashScreen* splash_screen);
101 
102 public slots:
104  void addTOPPASFile(const String& file_name, bool in_new_window = true);
106  void openFileDialog();
108  void openExampleDialog();
110  void newPipeline(const int id = -1);
112  void includePipeline();
114  void saveCurrentPipelineAs();
116  void savePipeline();
118  void exportAsImage();
120  void loadPipelineResourceFile();
122  void savePipelineResourceFile();
124  void openOnlinePipelineRepository();
126  void preferencesDialog();
128  void updateCurrentPath();
130  void updateTabBar(QWidget* w);
132  void showAboutDialog();
134  void showURL();
141  void showStatusMessage(std::string msg, OpenMS::UInt time);
143  void showCursorStatus(double x, double y);
145  void closeFile();
147  void updateToolBar();
149  void runPipeline();
151  void abortPipeline();
153  void toolStarted();
155  void toolFinished();
157  void toolCrashed();
159  void toolFailed();
161  void outputVertexFinished(const String& file);
163  void updateTOPPOutputLog(const QString& out);
165  void showPipelineFinishedLogMessage();
167  void saveToClipboard(TOPPASScene* scene);
169  void sendClipboardContent();
171  void refreshParameters();
173  void openFilesInTOPPView(QStringList all_files);
175  void openToppasFile(QString filename);
176 protected slots:
177 
181  void closeByTab(int id);
184  void focusByTab(int id);
186 
188  void updateMenu();
190  void showAsWindow_(TOPPASWidget* sw, const String& caption, const int special_id = -1);
192  void insertNewVertex_(double x, double y, QTreeWidgetItem* item = 0);
194  void insertNewVertexInCenter_(QTreeWidgetItem* item);
195 
197  void downloadTOPPASfromHomepage_(const QUrl& url);
199  void toppasFileDownloaded_(QNetworkReply* r);
201  void TOPPASreadyRead();
202 
204  void descriptionUpdated_();
205 
206 protected:
207 
212 
216  QToolBar* tool_bar_;
218 
221 
223  QWebView* webview_;
225  QNetworkAccessManager* network_manager_;
227  QNetworkReply* network_reply_;
228 
231 
236 
240  QLabel* message_label_;
243 
245  TOPPASWidget* window_(int id) const;
246 
247 
251 
254 
256  static int node_offset_;
257 
259  static qreal z_value_;
260 
262  TOPPASWidget* activeWindow_() const;
263 
265 
266  void closeEvent(QCloseEvent* event);
267  void keyPressEvent(QKeyEvent* e);
269 
271  enum LogState
272  {
275  LS_ERROR
276  };
278  void showLogMessage_(LogState state, const String& heading, const String& body);
279 
282 
283 
284 public:
286  static int const IDINITIALUNTITLED = 1000;
287 
289 
290  static TOPPASTreeView* createTOPPToolsTreeWidget(QWidget* parent_widget = 0);
292 
295  static QString savePipelineAs(TOPPASWidget* w, QString current_path);
296 
298  static QString loadPipelineResourceFile(TOPPASWidget* w, QString current_path);
299 
301  static QString savePipelineResourceFile(TOPPASWidget* w, QString current_path);
302 
304  static QString refreshPipelineParameters(TOPPASWidget* tw, QString current_path);
306  }; //class
307 
308 } //namespace
309 
310 #endif // OPENMS_APPLICATIONS_TOPPASBASE_H
A container for all visual items of a TOPPAS workflow.
Definition: TOPPASScene.h:86
A more convenient string class.
Definition: String.h:57
QWorkspace * ws_
Main workspace.
Definition: TOPPASBase.h:220
Tree view implementation for the list of TOPP tools.
Definition: TOPPASTreeView.h:55
unsigned int UInt
Unsigned integer type.
Definition: Types.h:95
Warning.
Definition: TOPPASBase.h:274
QNetworkAccessManager * network_manager_
download .toppas files from homepage
Definition: TOPPASBase.h:225
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
static qreal z_value_
z-value counter for new inserted nodes (new nodes should be on top)
Definition: TOPPASBase.h:259
QNetworkReply * network_reply_
the content of the network request
Definition: TOPPASBase.h:227
String tmp_path_
The path for temporary files.
Definition: TOPPASBase.h:253
LogState
Log message states.
Definition: TOPPASBase.h:271
Widget visualizing and allowing to edit TOPP pipelines.
Definition: TOPPASWidget.h:61
QToolBar * tool_bar_
Definition: TOPPASBase.h:216
Notice.
Definition: TOPPASBase.h:273
Main window of the TOPPAS tool.
Definition: TOPPASBase.h:78
TOPPASLogWindow * log_
Log output window.
Definition: TOPPASBase.h:209
TOPPASScene * clipboard_scene_
The clipboard.
Definition: TOPPASBase.h:281
QListWidget * blocks_list_
List of ready analysis pipelines.
Definition: TOPPASBase.h:235
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:74
TOPPASTabBar * tab_bar_
Tab bar. The address of the corresponding window to a tab is stored as an int in tabData() ...
Definition: TOPPASBase.h:230
QTextEdit * desc_
Workflow Description window.
Definition: TOPPASBase.h:211
String current_path_
Definition: TOPPASBase.h:250
QWebView * webview_
OpenMS homepage workflow browser.
Definition: TOPPASBase.h:223
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
QTextEdit implementation with a "clear" button in the context menu.
Definition: TOPPASLogWindow.h:51
QTreeWidget * tools_tree_view_
Tree view of all available TOPP tools.
Definition: TOPPASBase.h:233
Convenience tab bar implementation.
Definition: TOPPASTabBar.h:60
static int node_offset_
Offset counter for new inserted nodes (to avoid invisible stacking)
Definition: TOPPASBase.h:256

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:04 using doxygen 1.8.13