Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
CamiTKExtensionEditor.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6 *
7 * Visit http://camitk.imag.fr for more information
8 *
9 * This file is part of CamiTK.
10 *
11 * CamiTK is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * CamiTK is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22 *
23 * $CAMITK_LICENCE_END$
24 ****************************************************************************/
25
26#ifndef __CAMITK_EXTENSION_EDITOR__
27#define __CAMITK_EXTENSION_EDITOR__
28
31
32#include <QWidget>
33#include <QLabel>
34#include <QTimer>
35#include <QPushButton>
36
50class CamiTKExtensionEditor : public QWidget {
51 Q_OBJECT
52
53public:
59 CamiTKExtensionEditor(const QString& camitkFilePath, const QString& newExtensionName = QString(), const QString& language = QString(), const QString& cppGenerationType = QString(), QWidget* parent = nullptr);
60
62 virtual ~CamiTKExtensionEditor();
63
64signals:
67
68public slots:
70 void saveClicked();
71
73 void closeClicked();
74
76 void initializeClicked();
77
79 void registerClicked();
80
82 void showMessage(const QString& message, int durationMilliseconds = 2000, bool warning = false);
83
85 void dataModelUpdated();
86
87protected:
89 void closeEvent(QCloseEvent* event) override;
90
91private:
94 QLabel* statusBarLabel;
95 QTimer* statusBarTimer;
96 QPushButton* registerButton;
97 QPushButton* initializeButton;
98 bool hasUnsavedChanges;
100
101 // current edited file
102 QString camitkFilePath;
103
104 // the extension editor
105 CamiTKExtensionModelPresenter* extensionPresenter;
106
107 // the cmake project manager presenter (can be nullptr)
108 ExtensionBuilderPresenter* cmakeProjectManagerPresenter;
109
111 void updateButtonStatus(bool initializationWasSuccessful = false);
112};
113
114#endif // __CAMITK_EXTENSION_EDITOR__
Editor of CamiTK extension file.
Definition CamiTKExtensionEditor.h:50
void registerClicked()
called when the user clicks on "Register/Unregister"
Definition CamiTKExtensionEditor.cpp:297
void closeEvent(QCloseEvent *event) override
called when the widget is being closed
Definition CamiTKExtensionEditor.cpp:118
virtual ~CamiTKExtensionEditor()
Destructor.
Definition CamiTKExtensionEditor.cpp:114
void saveClicked()
called when the user clicks on "Save"
Definition CamiTKExtensionEditor.cpp:179
void initializeClicked()
called when the user clicks on "Initialize/Update"
Definition CamiTKExtensionEditor.cpp:256
void extensionGeneratorPresenterClosed()
sent when the window is being closed
void closeClicked()
called when the user clicks on "Close" or use the close button in the window manager title bar
Definition CamiTKExtensionEditor.cpp:250
void showMessage(const QString &message, int durationMilliseconds=2000, bool warning=false)
show a message for the given time (can be a warning that is shown in red)
Definition CamiTKExtensionEditor.cpp:162
void dataModelUpdated()
called when the CamiTK extension model was updated in the GUI (shows a "*" in the title bar)
Definition CamiTKExtensionEditor.cpp:156
Presenter for a CamiTK extension file model.
Definition CamiTKExtensionModelPresenter.h:47
Presenter for ExtensionBuilder.
Definition ExtensionBuilderPresenter.h:45