CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkCmdLineModuleExplorerMainWindow.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  Library: CTK
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 =============================================================================*/
21 
22 #ifndef CTKCLIPLUGINEXPLORERMAINWINDOW_H
23 #define CTKCLIPLUGINEXPLORERMAINWINDOW_H
24 
27 #include <ctkCmdLineModuleFuture.h>
28 #include <ctkSettings.h>
29 
30 #include <QMainWindow>
31 #include <QTimer>
32 #include <QFutureWatcher>
33 
37 class ctkSettingsDialog;
39 
40 namespace Ui {
41 class ctkCmdLineModuleExplorerMainWindow;
42 }
43 
48 class ctkCLModuleExplorerMainWindow : public QMainWindow
49 {
50  Q_OBJECT
51 
52 public:
53  explicit ctkCLModuleExplorerMainWindow(QWidget *parent = 0);
55 
56  void addModule(const QUrl &location);
57 
58 protected:
59 
60  void closeEvent(QCloseEvent* event);
61 
62 protected Q_SLOTS:
63 
65  void on_actionPause_toggled(bool toggled);
70 
74 
75  void checkModulePaused();
76  void currentModuleResumed();
77  void currentModuleCanceled();
78  void currentModuleFinished();
79 
81  void checkXMLPressed();
82 
83 private:
84 
85  QScopedPointer<Ui::ctkCmdLineModuleExplorerMainWindow> ui;
86  QScopedPointer<ctkCmdLineModuleExplorerTabList> tabList;
87 
88  ctkCmdLineModuleFrontendFactory* defaultModuleFrontendFactory;
89  QList<ctkCmdLineModuleFrontendFactory*> moduleFrontendFactories;
90  QList<ctkCmdLineModuleBackend*> moduleBackends;
91 
92  ctkCmdLineModuleManager moduleManager;
93 
94  QTimer pollPauseTimer;
95  QFutureWatcher<ctkCmdLineModuleResult> currentFutureWatcher;
97 
98  ctkCmdLineModuleDirectoryWatcher directoryWatcher;
99 
100  ctkSettings settings;
101  ctkSettingsDialog* settingsDialog;
102  ctkCmdLineModuleBackendXMLChecker* xmlCheckerBackEnd;
103 };
104 
105 #endif // CTKCLIPLUGINEXPLORERMAINWINDOW_H
ctkCLModuleExplorerMainWindow::on_actionOptions_triggered
void on_actionOptions_triggered()
ctkCmdLineModuleDirectoryWatcher
Provides directory scanning and file watching via QFileSystemWatcher to automatically load new module...
Definition: ctkCmdLineModuleDirectoryWatcher.h:63
ctkCmdLineModuleManager
Main manager class to handle loading and unloading of modules.
Definition: ctkCmdLineModuleManager.h:71
ctkCLModuleExplorerMainWindow::closeEvent
void closeEvent(QCloseEvent *event)
ctkCmdLineModuleFuture.h
ctkCLModuleExplorerMainWindow::checkXMLPressed
void checkXMLPressed()
QList< ctkCmdLineModuleFrontendFactory * >
ctkCLModuleExplorerMainWindow::ctkCLModuleExplorerMainWindow
ctkCLModuleExplorerMainWindow(QWidget *parent=0)
ctkCmdLineModuleDirectoryWatcher.h
ctkCLModuleExplorerMainWindow::on_actionReload_Modules_triggered
void on_actionReload_Modules_triggered()
ctkCmdLineModuleFrontendFactory
Factory class to create new front-ends.
Definition: ctkCmdLineModuleFrontendFactory.h:40
ctkCmdLineModuleReference
Defines a reference or handle to a module, including location, XML, description and access to the ass...
Definition: ctkCmdLineModuleReference.h:44
ctkCLModuleExplorerMainWindow
Example application main window.
Definition: ctkCmdLineModuleExplorerMainWindow.h:48
ctkCLModuleExplorerMainWindow::currentModuleResumed
void currentModuleResumed()
Ui
Definition: ctkCmdLineModuleExplorerMainWindow.h:40
ctkSettingsDialog
Definition: ctkSettingsDialog.h:37
ctkCLModuleExplorerMainWindow::on_actionRun_triggered
void on_actionRun_triggered()
ctkCLModuleExplorerMainWindow::currentModuleFinished
void currentModuleFinished()
ctkCmdLineModuleBackendXMLChecker
Provides a ctkCmdLineModuleBackend implementation to pretend to run a command line process,...
Definition: ctkCmdLineModuleBackendXMLChecker.h:40
ctkCLModuleExplorerMainWindow::checkModulePaused
void checkModulePaused()
ctkCmdLineModuleFrontend
Abstract base class for all front-end command line module implementations.
Definition: ctkCmdLineModuleFrontend.h:52
QHash< ctkCmdLineModuleFrontend *, QByteArray >
ctkCLModuleExplorerMainWindow::~ctkCLModuleExplorerMainWindow
~ctkCLModuleExplorerMainWindow()
ctkCLModuleExplorerMainWindow::on_actionClear_Cache_triggered
void on_actionClear_Cache_triggered()
ctkCLModuleExplorerMainWindow::on_actionCancel_triggered
void on_actionCancel_triggered()
ctkCmdLineModuleResult
Describes a reported result of a command line module.
Definition: ctkCmdLineModuleResult.h:42
ctkCLModuleExplorerMainWindow::on_actionPause_toggled
void on_actionPause_toggled(bool toggled)
ctkCLModuleExplorerMainWindow::addModule
void addModule(const QUrl &location)
ctkSettings.h
ctkCLModuleExplorerMainWindow::currentModuleCanceled
void currentModuleCanceled()
ctkCLModuleExplorerMainWindow::moduleTabActivated
void moduleTabActivated(ctkCmdLineModuleFrontend *module)
ctkCmdLineModuleExplorerTabList
Example application tab list.
Definition: ctkCmdLineModuleExplorerTabList.h:38
ctkCLModuleExplorerMainWindow::on_actionQuit_triggered
void on_actionQuit_triggered()
ctkCLModuleExplorerMainWindow::on_actionLoad_triggered
void on_actionLoad_triggered()
ctkSettings
Definition: ctkSettings.h:71
ctkCLModuleExplorerMainWindow::on_actionReset_triggered
void on_actionReset_triggered()
ctkCmdLineModuleManager.h