ctkCLModuleExplorerMainWindow.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKCLIPLUGINEXPLORERMAINWINDOW_H
  16. #define CTKCLIPLUGINEXPLORERMAINWINDOW_H
  17. #include <ctkCmdLineModuleManager.h>
  18. #include <ctkCmdLineModuleReference.h>
  19. #include <ctkCmdLineModuleResult.h>
  20. #include <QMainWindow>
  21. #include <QHash>
  22. #include <QFutureWatcher>
  23. class ctkCmdLineModuleReference;
  24. namespace Ui {
  25. class ctkCLModuleExplorerMainWindow;
  26. }
  27. class ctkCLModuleExplorerMainWindow : public QMainWindow
  28. {
  29. Q_OBJECT
  30. public:
  31. explicit ctkCLModuleExplorerMainWindow(QWidget *parent = 0);
  32. ~ctkCLModuleExplorerMainWindow();
  33. void addModule(const QString& location);
  34. protected Q_SLOTS:
  35. void on_actionRun_triggered();
  36. void moduleStarted();
  37. void moduleFinished();
  38. void moduleProgressValueChanged(int);
  39. void moduleProgressTextChanged(QString);
  40. protected:
  41. void addModuleTab(const ctkCmdLineModuleReference& moduleRef);
  42. private:
  43. Ui::ctkCLModuleExplorerMainWindow *ui;
  44. ctkCmdLineModuleManager moduleManager;
  45. QFutureWatcher<ctkCmdLineModuleResult>* watcher;
  46. QHash<int, ctkCmdLineModule*> mapTabToModuleRef;
  47. };
  48. #endif // CTKCLIPLUGINEXPLORERMAINWINDOW_H