Presenter for a CamiTK extension file model. More...
#include <CamiTKExtensionModelPresenter.h>
Public Slots | |
| void | modelUpdated () |
| called when the model has changed, the GUI/JSON is to be updated | |
| void | plusButtonClicked () |
| called when the user clicks on the "+" button to add an action tab | |
| void | tabCloseRequest (int index) |
| called when a tab is closed (only action tabs are closable) | |
Signals | |
| void | dataModelUpdated () |
| emitted when the data model was updated by the user | |
| void | showMessage (const QString &message, int durationMilliseconds=2000, bool warning=false) |
| emitted when a message has to be displayed to the user | |
Public Member Functions | |
| CamiTKExtensionModelPresenter (const QString &camitkFilePath, const QString &newExtensionName, const QString &language=QString(), const QString &cppGenerationType=QString(), QWidget *parent=nullptr) | |
| constructor If the camitkFilePath does not have a valid model, this will create a new one | |
| void | emitShowMessage (const QString &message, int durationMilliseconds=2000, bool warning=false) |
| make the presenter emit the show message signal | |
| QString | getExtensionName () |
| get current extension name | |
| bool | isHotPlug () |
| is the current model a hot plug extension | |
| bool | isModified () |
| is the current model modified (unsaved) | |
| bool | isPython () |
| is the current model a python extension | |
| void | saveExtensionFile (const QFile &file) |
| save the data model | |
| ~CamiTKExtensionModelPresenter () | |
| destructor | |
Presenter for a CamiTK extension file model.
This creates
| CamiTKExtensionModelPresenter::CamiTKExtensionModelPresenter | ( | const QString & | camitkFilePath, |
| const QString & | newExtensionName, | ||
| const QString & | language = QString(), | ||
| const QString & | cppGenerationType = QString(), | ||
| QWidget * | parent = nullptr ) |
constructor If the camitkFilePath does not have a valid model, this will create a new one
| camitkFilePath | path to the CamiTK extension file to edit |
| newExtensionName | the extension name ("action", "component", or "viewer"), needed for creating of a new extension |
| parent | (optional) |
References isPython(), plusButtonClicked(), VariantDataModel::size(), and tabCloseRequest().
| CamiTKExtensionModelPresenter::~CamiTKExtensionModelPresenter | ( | ) |
destructor
|
signal |
emitted when the data model was updated by the user
Referenced by CamiTKExtensionEditor::CamiTKExtensionEditor(), and modelUpdated().
| void CamiTKExtensionModelPresenter::emitShowMessage | ( | const QString & | message, |
| int | durationMilliseconds = 2000, | ||
| bool | warning = false ) |
make the presenter emit the show message signal
References showMessage().
| QString CamiTKExtensionModelPresenter::getExtensionName | ( | ) |
get current extension name
| bool CamiTKExtensionModelPresenter::isHotPlug | ( | ) |
is the current model a hot plug extension
Referenced by CppExtensionTabPresenter::CppExtensionTabPresenter().
| bool CamiTKExtensionModelPresenter::isModified | ( | ) |
is the current model modified (unsaved)
| bool CamiTKExtensionModelPresenter::isPython | ( | ) |
is the current model a python extension
References VariantDataModel::isValid(), and VariantDataModel::toString().
Referenced by CamiTKExtensionModelPresenter(), and plusButtonClicked().
|
slot |
called when the model has changed, the GUI/JSON is to be updated
References dataModelUpdated().
Referenced by plusButtonClicked(), and tabCloseRequest().
|
slot |
called when the user clicks on the "+" button to add an action tab
References VariantDataModel::append(), CustomInputDialog::getInput(), isPython(), VariantDataModel::last(), modelUpdated(), showMessage(), and VariantDataModel::size().
Referenced by CamiTKExtensionModelPresenter().
| void CamiTKExtensionModelPresenter::saveExtensionFile | ( | const QFile & | file | ) |
save the data model
|
signal |
emitted when a message has to be displayed to the user
Referenced by CamiTKExtensionEditor::CamiTKExtensionEditor(), emitShowMessage(), plusButtonClicked(), and tabCloseRequest().
|
slot |
called when a tab is closed (only action tabs are closable)
References ExtensionTypeTabPresenter::getDataModel(), ExtensionTypeTabPresenter::getExtensionType(), VariantDataModel::isValid(), modelUpdated(), VariantDataModel::remove(), and showMessage().
Referenced by CamiTKExtensionModelPresenter().