[Uml-devel] branches/work/isi-umbrello/umbrello/umbrello
Thibault Normand
thibault.normand at gmail.com
Tue Feb 13 07:52:50 UTC 2007
SVN commit 633100 by tnormand:
+ Adding macro management for U/R Stack
M +13 -0 uml.cpp
M +15 -0 uml.h
--- branches/work/isi-umbrello/umbrello/umbrello/uml.cpp #633099:633100
@@ -119,6 +119,7 @@
m_doc = new UMLDoc();
m_doc->init();
m_pUndoStack = new KUndoStack(this);
+ m_hasBeginMacro = false;
initActions(); //now calls initStatusBar() because it is affected by setupGUI()
initView();
initClip();
@@ -1883,6 +1884,18 @@
UMLApp::app()->enableUndo(true);
}
+void UMLApp::BeginMacro( const QString & text ) {
+ if(m_hasBegunMacro)
+ return;
+
+ m_pUndoStack->beginMacro(text);
+}
+
+void UMLApp::EndMacro() {
+ if(m_hasBegunMacro)
+ m_pUndoStack->endMacro();
+}
+
//static pointer, holding the unique instance
UMLApp* UMLApp::s_instance;
--- branches/work/isi-umbrello/umbrello/umbrello/uml.h #633099:633100
@@ -347,6 +347,16 @@
*/
void executeCommand(QUndoCommand* cmd);
+ /**
+ * Begin a U/R command macro
+ */
+ void BeginMacro( const QString & text );
+
+ /**
+ * End an U/R command macro
+ */
+ void EndMacro();
+
protected:
virtual void keyPressEvent(QKeyEvent* e);
virtual void keyReleaseEvent(QKeyEvent* e);
@@ -1073,6 +1083,11 @@
*/
KUndoStack* m_pUndoStack;
+ /**
+ * Macro creation flag
+ */
+ bool m_hasBegunMacro;
+
signals:
/**
More information about the umbrello-devel
mailing list