Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
a widget that holds snippets and serializes the snippets to a certain places More...
#include <QmitkPythonSnippets.h>
Public Types | |
typedef QMap< QString, QString > | QStringMap |
typedef for string map More... | |
Signals | |
void | PasteCommandRequested (const QString &command) |
this class whishes to paste sth command More... | |
Public Member Functions | |
QmitkPythonSnippets (const QString &_AutoSaveFileName="", QWidget *parent=nullptr) | |
~QmitkPythonSnippets () override | |
delete d pointer More... | |
Static Public Member Functions | |
static bool | LoadStringMap (const QString &filename, QStringMap &oldMap) |
read string map from xml file More... | |
Static Public Attributes | |
static const QString | DEFAULT_SNIPPET_FILE |
static const QString | SNIPPETS_ROOT_XML_ELEMENT_NAME |
static const QString | SNIPPETS_XML_ELEMENT_NAME |
Protected Slots | |
void | on_PasteSnippet_triggered (bool checked=false) |
emits PasteCommandRequested signal More... | |
void | on_RenameSnippet_triggered (bool checked=false) |
ask for name as long as it exists, call update() More... | |
void | on_AddSnippet_triggered (bool checked=false) |
ask for name, create snippet, call update() More... | |
void | on_RemoveSnippet_triggered (bool checked=false) |
remove the current snippet, call update() More... | |
void | on_RestoreDefaultSnippets_triggered (bool checked=false) |
call LoadStringMap with d->m_DefaultSnippetsAutoSaveFileName More... | |
void | on_Name_currentIndexChanged (int i) |
update action state (enable/disable), update text box More... | |
void | on_Content_textChanged () |
save changed snippet More... | |
void | on_SaveSnippets_triggered (bool checked=false) |
ask for file, save snippets More... | |
void | on_LoadSnippets_triggered (bool checked=false) |
ask for file, load snippets (do not replace) More... | |
Protected Member Functions | |
void | SaveStringMap (const QString &filename, const QStringMap &map) const |
write string map to xml file More... | |
QString | CreateUniqueName (const QString &name) const |
creates a name which does not exist in the list More... | |
void | Update (const QString &name="") |
a widget that holds snippets and serializes the snippets to a certain places
Definition at line 23 of file QmitkPythonSnippets.h.
typedef QMap<QString, QString> QmitkPythonSnippets::QStringMap |
typedef for string map
Definition at line 33 of file QmitkPythonSnippets.h.
QmitkPythonSnippets::QmitkPythonSnippets | ( | const QString & | _AutoSaveFileName = "" , |
QWidget * | parent = nullptr |
||
) |
build ui here the snippets will be loaded from _AutoSaveFileName if not empty and readable otherwise the default snippets will be loaded
Definition at line 60 of file QmitkPythonSnippets.cpp.
References DEFAULT_SNIPPET_FILE, LoadStringMap(), and Update().
|
override |
delete d pointer
Definition at line 154 of file QmitkPythonSnippets.cpp.
|
protected |
creates a name which does not exist in the list
Definition at line 226 of file QmitkPythonSnippets.cpp.
Referenced by on_AddSnippet_triggered().
|
static |
read string map from xml file
Definition at line 344 of file QmitkPythonSnippets.cpp.
References mitk::ImageMappingHelper::map(), MITK_DEBUG, MITK_ERROR, and SNIPPETS_XML_ELEMENT_NAME.
Referenced by on_LoadSnippets_triggered(), on_RestoreDefaultSnippets_triggered(), and QmitkPythonSnippets().
|
protectedslot |
ask for name, create snippet, call update()
Definition at line 205 of file QmitkPythonSnippets.cpp.
References CreateUniqueName(), MITK_DEBUG, SaveStringMap(), and Update().
|
protectedslot |
save changed snippet
Definition at line 446 of file QmitkPythonSnippets.cpp.
References MITK_DEBUG, and SaveStringMap().
|
protectedslot |
ask for file, load snippets (do not replace)
Definition at line 469 of file QmitkPythonSnippets.cpp.
References LoadStringMap(), SaveStringMap(), and Update().
|
protectedslot |
update action state (enable/disable), update text box
Definition at line 273 of file QmitkPythonSnippets.cpp.
References MITK_DEBUG.
|
protectedslot |
emits PasteCommandRequested signal
Definition at line 159 of file QmitkPythonSnippets.cpp.
References PasteCommandRequested().
|
protectedslot |
remove the current snippet, call update()
Definition at line 239 of file QmitkPythonSnippets.cpp.
References SaveStringMap(), and Update().
|
protectedslot |
ask for name as long as it exists, call update()
Definition at line 164 of file QmitkPythonSnippets.cpp.
References SaveStringMap(), and Update().
|
protectedslot |
call LoadStringMap with d->m_DefaultSnippetsAutoSaveFileName
Definition at line 257 of file QmitkPythonSnippets.cpp.
References DEFAULT_SNIPPET_FILE, LoadStringMap(), SaveStringMap(), and Update().
|
protectedslot |
ask for file, save snippets
Definition at line 459 of file QmitkPythonSnippets.cpp.
References SaveStringMap().
|
signal |
this class whishes to paste sth command
Referenced by on_PasteSnippet_triggered().
|
protected |
write string map to xml file
Definition at line 292 of file QmitkPythonSnippets.cpp.
References MITK_DEBUG, MITK_WARN, SNIPPETS_ROOT_XML_ELEMENT_NAME, and SNIPPETS_XML_ELEMENT_NAME.
Referenced by on_AddSnippet_triggered(), on_Content_textChanged(), on_LoadSnippets_triggered(), on_RemoveSnippet_triggered(), on_RenameSnippet_triggered(), on_RestoreDefaultSnippets_triggered(), and on_SaveSnippets_triggered().
|
protected |
update combo box if name is passed, the according element will be selected
Definition at line 422 of file QmitkPythonSnippets.cpp.
References MITK_DEBUG.
Referenced by on_AddSnippet_triggered(), on_LoadSnippets_triggered(), on_RemoveSnippet_triggered(), on_RenameSnippet_triggered(), on_RestoreDefaultSnippets_triggered(), and QmitkPythonSnippets().
|
static |
Definition at line 28 of file QmitkPythonSnippets.h.
Referenced by on_RestoreDefaultSnippets_triggered(), and QmitkPythonSnippets().
|
static |
Definition at line 29 of file QmitkPythonSnippets.h.
Referenced by SaveStringMap().
|
static |
Definition at line 30 of file QmitkPythonSnippets.h.
Referenced by LoadStringMap(), and SaveStringMap().