Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef OPENMS_VISUAL_APPLICATIONS_TOPPASBASE_H
00036 #define OPENMS_VISUAL_APPLICATIONS_TOPPASBASE_H
00037
00038
00039 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
00040 #include <OpenMS/VISUAL/TOPPASTreeView.h>
00041
00042
00043 #include <QtGui/QMainWindow>
00044 #include <QtGui/QWorkspace>
00045 #include <QtGui/QButtonGroup>
00046 #include <QtCore/QProcess>
00047 #include <QtGui/QSplashScreen>
00048
00049 class QToolBar;
00050 class QListWidget;
00051 class QTextEdit;
00052 class QWorkspace;
00053 class QLabel;
00054 class QWidget;
00055 class QTreeWidget;
00056 class QTreeWidgetItem;
00057 class QWebView;
00058 class QNetworkAccessManager;
00059 class QNetworkReply;
00060
00061 namespace OpenMS
00062 {
00063 class TOPPASWidget;
00064 class TOPPASScene;
00065 class TOPPASTabBar;
00066 class TOPPASLogWindow;
00067 class TOPPASResources;
00068
00074 class OPENMS_GUI_DLLAPI TOPPASBase :
00075 public QMainWindow,
00076 public DefaultParamHandler
00077 {
00078 Q_OBJECT
00079
00080 public:
00081
00083 TOPPASBase(QWidget* parent = 0);
00085 virtual ~TOPPASBase();
00086
00092 void loadPreferences(String filename = "");
00094 void savePreferences();
00096 void loadFiles(const StringList& list, QSplashScreen* splash_screen);
00097
00098 public slots:
00100 void addTOPPASFile(const String& file_name, bool in_new_window = true);
00102 void openFileDialog();
00104 void openExampleDialog();
00106 void newPipeline(const int id = -1);
00108 void includePipeline();
00110 void saveCurrentPipelineAs();
00112 void savePipeline();
00114 void exportAsImage();
00116 void loadPipelineResourceFile();
00118 void savePipelineResourceFile();
00120 void openOnlinePipelineRepository();
00122 void preferencesDialog();
00124 void updateCurrentPath();
00126 void updateTabBar(QWidget* w);
00128 void showAboutDialog();
00130 void showURL();
00137 void showStatusMessage(std::string msg, OpenMS::UInt time);
00139 void showCursorStatus(double x, double y);
00141 void closeFile();
00143 void updateToolBar();
00145 void runPipeline();
00147 void abortPipeline();
00149 void toolStarted();
00151 void toolFinished();
00153 void toolCrashed();
00155 void toolFailed();
00157 void outputVertexFinished(const String& file);
00159 void updateTOPPOutputLog(const QString& out);
00161 void showPipelineFinishedLogMessage();
00163 void saveToClipboard(TOPPASScene* scene);
00165 void sendClipboardContent();
00167 void refreshParameters();
00169 void openFilesInTOPPView(QStringList all_files);
00171 void openToppasFile(QString filename);
00172 protected slots:
00173
00177
00178 void closeByTab(int id);
00180 void focusByTab(int id);
00182
00184 void updateMenu();
00186 void showAsWindow_(TOPPASWidget* sw, const String& caption, const int special_id = -1);
00188 void insertNewVertex_(double x, double y, QTreeWidgetItem* item = 0);
00190 void insertNewVertexInCenter_(QTreeWidgetItem* item);
00191
00193 void downloadTOPPASfromHomepage_(const QUrl& url);
00195 void toppasFileDownloaded_(QNetworkReply* r);
00196
00198 void descriptionUpdated_();
00199
00200 protected:
00201
00203 TOPPASLogWindow* log_;
00205 QTextEdit* desc_;
00206
00210 QToolBar* tool_bar_;
00212
00214 QWorkspace* ws_;
00215
00217 QWebView* webview_;
00219 QNetworkAccessManager* network_manager_;
00220
00222 TOPPASTabBar* tab_bar_;
00223
00225 QTreeWidget* tools_tree_view_;
00227 QListWidget* blocks_list_;
00228
00232
00233 QLabel* message_label_;
00235
00237 TOPPASWidget* window_(int id) const;
00238
00239
00242 String current_path_;
00243
00245 String tmp_path_;
00246
00248 static int node_offset_;
00249
00251 static qreal z_value_;
00252
00254 TOPPASWidget* activeWindow_() const;
00255
00257
00258 void closeEvent(QCloseEvent* event);
00259 void keyPressEvent(QKeyEvent* e);
00261
00263 enum LogState
00264 {
00265 LS_NOTICE,
00266 LS_WARNING,
00267 LS_ERROR
00268 };
00270 void showLogMessage_(LogState state, const String& heading, const String& body);
00271
00273 TOPPASScene* clipboard_scene_;
00274
00275
00276 public:
00278 static int const IDINITIALUNTITLED = 1000;
00279
00281
00282
00283 static TOPPASTreeView* createTOPPToolsTreeWidget(QWidget* parent_widget = 0);
00284
00287 static QString savePipelineAs(TOPPASWidget* w, QString current_path);
00288
00290 static QString loadPipelineResourceFile(TOPPASWidget* w, QString current_path);
00291
00293 static QString savePipelineResourceFile(TOPPASWidget* w, QString current_path);
00294
00296 static QString refreshPipelineParameters(TOPPASWidget* tw, QString current_path);
00298 };
00299
00300 }
00301
00302 #endif // OPENMS_APPLICATIONS_TOPPASBASE_H