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-2013.
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 Junker $
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
41 
42 //QT
43 #include <QtGui/QMainWindow>
44 #include <QtGui/QWorkspace>
45 #include <QtGui/QButtonGroup>
46 #include <QtCore/QProcess>
47 #include <QtGui/QSplashScreen>
48 
49 class QToolBar;
50 class QListWidget;
51 class QTextEdit;
52 class QWorkspace;
53 class QLabel;
54 class QWidget;
55 class QTreeWidget;
56 class QTreeWidgetItem;
57 class QWebView;
58 class QNetworkAccessManager;
59 class QNetworkReply;
60 
61 namespace OpenMS
62 {
63  class TOPPASWidget;
64  class TOPPASScene;
65  class TOPPASTabBar;
66  class TOPPASLogWindow;
67  class TOPPASResources;
68 
74  class OPENMS_GUI_DLLAPI TOPPASBase :
75  public QMainWindow,
76  public DefaultParamHandler
77  {
78  Q_OBJECT
79 
80 public:
81 
83  TOPPASBase(QWidget* parent = 0);
85  virtual ~TOPPASBase();
86 
92  void loadPreferences(String filename = "");
94  void savePreferences();
96  void loadFiles(const StringList& list, QSplashScreen* splash_screen);
97 
98 public slots:
100  void addTOPPASFile(const String& file_name, bool in_new_window = true);
102  void openFileDialog();
104  void openExampleDialog();
106  void newPipeline(const int id = -1);
108  void includePipeline();
110  void saveCurrentPipelineAs();
112  void savePipeline();
114  void exportAsImage();
116  void loadPipelineResourceFile();
118  void savePipelineResourceFile();
120  void openOnlinePipelineRepository();
122  void preferencesDialog();
124  void updateCurrentPath();
126  void updateTabBar(QWidget* w);
128  void showAboutDialog();
130  void showURL();
137  void showStatusMessage(std::string msg, OpenMS::UInt time);
139  void showCursorStatus(double x, double y);
141  void closeFile();
143  void updateToolBar();
145  void runPipeline();
147  void abortPipeline();
149  void toolStarted();
151  void toolFinished();
153  void toolCrashed();
155  void toolFailed();
157  void outputVertexFinished(const String& file);
159  void updateTOPPOutputLog(const QString& out);
161  void showPipelineFinishedLogMessage();
163  void saveToClipboard(TOPPASScene* scene);
165  void sendClipboardContent();
167  void refreshParameters();
169  void openFilesInTOPPView(QStringList all_files);
171  void openToppasFile(QString filename);
172 protected slots:
173 
177  void closeByTab(int id);
180  void focusByTab(int id);
182 
184  void updateMenu();
186  void showAsWindow_(TOPPASWidget* sw, const String& caption, const int special_id = -1);
188  void insertNewVertex_(double x, double y, QTreeWidgetItem* item = 0);
190  void insertNewVertexInCenter_(QTreeWidgetItem* item);
191 
193  void downloadTOPPASfromHomepage_(const QUrl& url);
195  void toppasFileDownloaded_(QNetworkReply* r);
196 
198  void descriptionUpdated_();
199 
200 protected:
201 
206 
210  QToolBar* tool_bar_;
212 
215 
217  QWebView* webview_;
219  QNetworkAccessManager* network_manager_;
220 
223 
228 
232  QLabel* message_label_;
235 
237  TOPPASWidget* window_(int id) const;
238 
239 
243 
246 
248  static int node_offset_;
249 
251  static qreal z_value_;
252 
254  TOPPASWidget* activeWindow_() const;
255 
257 
258  void closeEvent(QCloseEvent* event);
259  void keyPressEvent(QKeyEvent* e);
261 
263  enum LogState
264  {
267  LS_ERROR
268  };
270  void showLogMessage_(LogState state, const String& heading, const String& body);
271 
274 
275 
276 public:
278  static int const IDINITIALUNTITLED = 1000;
279 
281 
282  static TOPPASTreeView* createTOPPToolsTreeWidget(QWidget* parent_widget = 0);
284 
287  static QString savePipelineAs(TOPPASWidget* w, QString current_path);
288 
290  static QString loadPipelineResourceFile(TOPPASWidget* w, QString current_path);
291 
293  static QString savePipelineResourceFile(TOPPASWidget* w, QString current_path);
294 
296  static QString refreshPipelineParameters(TOPPASWidget* tw, QString current_path);
298  }; //class
299 
300 } //namespace
301 
302 #endif // OPENMS_APPLICATIONS_TOPPASBASE_H
A container for all visual items of a TOPPAS workflow.
Definition: TOPPASScene.h:84
A more convenient string class.
Definition: String.h:56
QWorkspace * ws_
Main workspace.
Definition: TOPPASBase.h:214
Tree view implementation for the list of TOPP tools.
Definition: TOPPASTreeView.h:54
Warning.
Definition: TOPPASBase.h:266
QNetworkAccessManager * network_manager_
download .toppas files from homepage
Definition: TOPPASBase.h:219
static qreal z_value_
z-value counter for new inserted nodes (new nodes should be on top)
Definition: TOPPASBase.h:251
String tmp_path_
The path for temporary files.
Definition: TOPPASBase.h:245
LogState
Log message states.
Definition: TOPPASBase.h:263
Widget visualizing and allowing to edit TOPP pipelines.
Definition: TOPPASWidget.h:59
QToolBar * tool_bar_
Definition: TOPPASBase.h:210
Notice.
Definition: TOPPASBase.h:265
Main window of the TOPPAS tool.
Definition: TOPPASBase.h:74
TOPPASLogWindow * log_
Log output window.
Definition: TOPPASBase.h:203
TOPPASScene * clipboard_scene_
The clipboard.
Definition: TOPPASBase.h:273
QListWidget * blocks_list_
List of ready analysis pipelines.
Definition: TOPPASBase.h:227
TOPPASTabBar * tab_bar_
Tab bar. The address of the corresponding window to a tab is stored as an int in tabData() ...
Definition: TOPPASBase.h:222
String list.
Definition: StringList.h:56
QTextEdit * desc_
Workflow Description window.
Definition: TOPPASBase.h:205
String current_path_
Definition: TOPPASBase.h:242
QWebView * webview_
OpenMS homepage workflow browser.
Definition: TOPPASBase.h:217
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:90
QTextEdit implementation with a &quot;clear&quot; button in the context menu.
Definition: TOPPASLogWindow.h:52
QTreeWidget * tools_tree_view_
Tree view of all available TOPP tools.
Definition: TOPPASBase.h:225
Convenience tab bar implementation.
Definition: TOPPASTabBar.h:59
static int node_offset_
Offset counter for new inserted nodes (to avoid invisible stacking)
Definition: TOPPASBase.h:248

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:22 using doxygen 1.8.5