[Uml-devel] branches/work/isi-umbrello/umbrello

Thibault Normand thibault.normand at gmail.com
Mon Jan 29 21:20:29 UTC 2007


SVN commit 628357 by tnormand:

+ Undo/Redo UMLObject & Widget related.
+ Doxyfile for documentation generation

 A             Doxyfile  
 M  +4 -1      umbrello/CMakeLists.txt  
 M  +10 -4     umbrello/cmds.h  
 AM            umbrello/cmds/cmd_create_umlobject.cpp  
 AM            umbrello/cmds/cmd_create_umlobject.h  
 A             umbrello/cmds/generic (directory)  
 A             umbrello/cmds/widget (directory)  
 M  +3 -1      umbrello/object_factory.cpp  
 M  +18 -4     umbrello/umldoc.cpp  
 M  +6 -1      umbrello/umlview.cpp  
 M  +5 -0      umbrello/widget_factory.cpp  
 A             uml.kdevelop  


--- branches/work/isi-umbrello/umbrello/umbrello/CMakeLists.txt #628356:628357
@@ -228,8 +228,11 @@
 	cmds/cmd_create_usecasediag.cpp
 
 	cmds/classdiag/cmd_create_class.cpp
+
+	cmds/generic/cmd_create_umlobject.cpp
 	
-	cmds/widgets/cmd_create_umlobject.cpp
+	cmds/widget/cmd_create_widget.cpp
+	
 	cmds/cmd_moveWidget.cpp
 	cmds/cmd_resizeWidget.cpp
 
--- branches/work/isi-umbrello/umbrello/umbrello/cmds.h #628356:628357
@@ -28,15 +28,21 @@
 #include "cmds/cmd_resizeWidget.h"
 
 /************************************************************
- * Widgets
+ * Class Diagram
  ************************************************************/
 
-#include "cmds/widgets/cmd_create_umlobject.h"
+#include "cmds/classdiag/cmd_create_class.h"
 
 /************************************************************
- * Class Diagram
+ * Generic
  ************************************************************/
 
-#include "cmds/classdiag/cmd_create_class.h"
+#include "cmds/generic/cmd_create_umlobject.h"
 
+/************************************************************
+ * Widgets
+ ************************************************************/
+
+#include "cmds/widget/cmd_create_widget.h"
+
 #endif
** branches/work/isi-umbrello/umbrello/umbrello/cmds/cmd_create_umlobject.cpp #property svn:executable
   + *
** branches/work/isi-umbrello/umbrello/umbrello/cmds/cmd_create_umlobject.h #property svn:executable
   + *
--- branches/work/isi-umbrello/umbrello/umbrello/object_factory.cpp #628356:628357
@@ -43,6 +43,7 @@
 #include "codegenerator.h"
 #include "model_utils.h"
 #include "uniqueid.h"
+#include "cmds.h"
 
 namespace Object_Factory {
 
@@ -117,7 +118,8 @@
     o->setUMLPackage(parentPkg);
     UMLDoc *doc = UMLApp::app()->getDocument();
     parentPkg->addObject(o);
-    doc->signalUMLObjectCreated(o);
+    doc->executeCommand(new Uml::cmdCreateUMLObject(o));
+
     kapp->processEvents();
     return o;
 }
--- branches/work/isi-umbrello/umbrello/umbrello/umldoc.cpp #628356:628357
@@ -73,6 +73,7 @@
 #include "codegenerators/codegenfactory.h"
 #include "listpopupmenu.h"
 #include "version.h"
+#include "cmds.h"
 
 #define XMI_FILE_VERSION UMBRELLO_VERSION
 // For the moment, the XMI_FILE_VERSION changes with each UMBRELLO_VERSION.
@@ -747,6 +748,7 @@
         kDebug() << "UMLDoc::addUMLObject(" << object->getName()
             << "): no parent package set, assuming " << pkg->getName() << endl;
     }
+
     return pkg->addObject(object);
 }
 
@@ -2161,18 +2163,28 @@
 
 void UMLDoc::undo()
 {
+	kDebug() << "UMLDoc::undo(" << m_pUndoStack->undoText() << ") [" << m_pUndoStack->count() << "]" << endl;
+	m_pUndoStack->undo();
+
 	if(m_pUndoStack->canUndo())
-		m_pUndoStack->undo();
-	else
+		UMLApp::app()->enableUndo(true);
+	else 
 		UMLApp::app()->enableUndo(false);
+	
+	UMLApp::app()->enableRedo(true);
 }
 
 void UMLDoc::redo()
 {
+	kDebug() << "UMLDoc::undo(" << m_pUndoStack->redoText() << ") [" << m_pUndoStack->count() << "]" << endl;
+	m_pUndoStack->redo();
+
 	if(m_pUndoStack->canRedo())
-		m_pUndoStack->redo();
-	else
+		UMLApp::app()->enableRedo(true);
+	else 
 		UMLApp::app()->enableRedo(false);
+	
+	UMLApp::app()->enableUndo(true);
 }
 
 void UMLDoc::executeCommand(QUndoCommand* cmd)
@@ -2180,6 +2192,8 @@
 	if(cmd != NULL)
 		m_pUndoStack->push(cmd);
 
+	kDebug() << "UMLDoc::executeCommand(" << cmd->text() << ") [" << m_pUndoStack->count() << "]" << endl;
+
 	UMLApp::app()->enableUndo(true);
 }
 
--- branches/work/isi-umbrello/umbrello/umbrello/umlview.cpp #628356:628357
@@ -446,6 +446,7 @@
 }
 
 void UMLView::slotObjectCreated(UMLObject* o) {
+    kDebug() << "UMLView::slotObjectCreated( " << o->getName() << ")" << endl;
     m_bPaste = false;
     //check to see if we want the message
     //may be wanted by someone else e.g. list view
@@ -462,7 +463,7 @@
     newWidget->slotColorChanged( getID() );
     newWidget->slotLineWidthChanged( getID() );
     m_bCreateObject = false;
-    m_WidgetList.append(newWidget);
+    //m_WidgetList.append(newWidget);
     switch (o->getBaseType()) {
     case ot_Actor:
     case ot_UseCase:
@@ -492,6 +493,7 @@
 }
 
 void UMLView::slotObjectRemoved(UMLObject * o) {
+    kDebug() << "UMLView::slotObjectRemoved( " << o->getName() << ")" << endl;
     m_bPaste = false;
     Uml::IDType id = o->getID();
     UMLWidgetListIt it( m_WidgetList );
@@ -796,6 +798,8 @@
     if(!o)
         return;
 
+    kDebug() << "UMLView::removeWidget( " << o->getName() << ")" << endl;
+
     emit sigWidgetRemoved(o);
 
     removeAssociations(o);
@@ -1431,6 +1435,7 @@
 }
 
 bool UMLView::addWidget( UMLWidget * pWidget , bool isPasteOperation ) {
+    kDebug() << "UMLView::addWidget( " << pWidget->getName() << ")" << endl;
     if( !pWidget ) {
         return false;
     }
--- branches/work/isi-umbrello/umbrello/umbrello/widget_factory.cpp #628356:628357
@@ -50,6 +50,7 @@
 #include "forkjoinwidget.h"
 #include "activitywidget.h"
 #include "seqlinewidget.h"
+#include "cmds.h"
 
 namespace Widget_Factory {
 
@@ -58,6 +59,7 @@
     int y = pos.y();
     Uml::Diagram_Type diagramType = view->getType();
     Uml::Object_Type type = o->getBaseType();
+    UMLDoc *doc = UMLApp::app()->getDocument();
     UMLWidget *newWidget = NULL;
     switch (type) {
     case Uml::ot_Actor:
@@ -135,7 +137,10 @@
     if (newWidget) {
         newWidget->setX( pos.x() );
         newWidget->setY( y );
+
+    	doc->executeCommand(new Uml::cmdCreateWidget(view, newWidget));
     }
+
     return newWidget;
 }
 




More information about the umbrello-devel mailing list