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

Andi Fischer andi.fischer at hispeed.ch
Wed May 19 19:36:03 UTC 2010


SVN commit 1128623 by fischer:

Remove unused and duplicated files. Set position of created widgets by popup correctly.

 M  +1 -4      CMakeLists.txt  
 D             cmds/cmd_create_umlobject.cpp  
 D             cmds/cmd_create_umlobject.h  
 M  +8 -7      cmds/widget/cmd_create_widget.cpp  
 M  +4 -4      cmds/widget/cmd_create_widget.h  
 M  +1 -1      object_factory.cpp  
 M  +6 -7      umlscene.cpp  


--- branches/work/soc-umbrello/umbrello/CMakeLists.txt #1128622:1128623
@@ -140,7 +140,6 @@
     ${CMAKE_CURRENT_SOURCE_DIR}/codegenerators/java/javacodegenerationformbase.ui
 )
 
-
 set(libdocgenerator_SRCS
     docgenerators/docbookgenerator.cpp
     docgenerators/docbookgeneratorjob.cpp
@@ -148,7 +147,6 @@
     docgenerators/docbook2xhtmlgeneratorjob.cpp
 )
 
-
 set(libdialogs_SRCS
     dialogs/activitydialog.cpp
     dialogs/activitypage.cpp
@@ -201,12 +199,10 @@
     ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/diagrampropertiespage.ui
 )
 
-
 set(librefactoring_SRCS
     refactoring/refactoringassistant.cpp
 )
 
-
 set(libcodegenwizard_SRCS
     codegenwizard/codegenselectpage.cpp
     codegenwizard/codegenoptionspage.cpp
@@ -219,6 +215,7 @@
     ${CMAKE_CURRENT_SOURCE_DIR}/codegenwizard/codegenoptionspage.ui
     ${CMAKE_CURRENT_SOURCE_DIR}/codegenwizard/codegenstatuspage.ui
 )
+
 set(libcodeimport_SRCS
     codeimport/adaimport.cpp
     codeimport/classimport.cpp
--- branches/work/soc-umbrello/umbrello/cmds/widget/cmd_create_widget.cpp #1128622:1128623
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2009                                               *
+ *   copyright (C) 2002-2010                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -12,7 +12,7 @@
 
 // app includes
 #include "umlwidget.h"
-#include "umlview.h"
+#include "umlscene.h"
 
 // kde includes
 #include <klocale.h>
@@ -20,10 +20,11 @@
 namespace Uml
 {
 
-    CmdCreateWidget::CmdCreateWidget(UMLView* view, UMLWidget* w)
-      : m_view(view), m_widget(w)
+    CmdCreateWidget::CmdCreateWidget(UMLScene* scene, UMLWidget* widget)
+      : m_scene(scene),
+        m_widget(widget)
     {
-        setText(i18n("Create widget :") + w->name());
+        setText(i18n("Create widget :") + widget->name());
     }
 
     CmdCreateWidget::~CmdCreateWidget()
@@ -32,7 +33,7 @@
     }
 
     /**
-     * Create the UMLObject.
+     * Create the UMLWidget.
      */
     void CmdCreateWidget::redo()
     {
@@ -40,7 +41,7 @@
     }
 
     /**
-     * Suppress the UMLObject.
+     * Suppress the UMLWidget.
      */
     void CmdCreateWidget::undo()
     {
--- branches/work/soc-umbrello/umbrello/cmds/widget/cmd_create_widget.h #1128622:1128623
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2009                                               *
+ *   copyright (C) 2002-2010                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -14,21 +14,21 @@
 #include <QtGui/QUndoCommand>
 
 class UMLWidget;
-class UMLView;
+class UMLScene;
 
 namespace Uml
 {
     class CmdCreateWidget : public QUndoCommand
     {
         public:
-            CmdCreateWidget(UMLView* view, UMLWidget* w);
+            CmdCreateWidget(UMLScene* scene, UMLWidget* widget);
             ~CmdCreateWidget();
 
             void redo();
             void undo();
 
         private:
-            UMLView*    m_view;
+            UMLScene*   m_scene;
             UMLWidget*  m_widget;
     };
 }
--- branches/work/soc-umbrello/umbrello/object_factory.cpp #1128622:1128623
@@ -158,7 +158,7 @@
  *                        The default is to ask for the new name.
  */
 UMLObject* createUMLObject(Uml::Object_Type type, const QString &n,
-                           UMLPackage *parentPkg /* = NULL */,
+                           UMLPackage *parentPkg /* = 0 */,
                            bool solicitNewName /* = true */)
 {
     UMLDoc *doc = UMLApp::app()->getDocument();
--- branches/work/soc-umbrello/umbrello/umlscene.cpp #1128622:1128623
@@ -507,8 +507,7 @@
     m_WidgetList.append(w);
     m_pDoc->setModified();
 
-    // [PORT]
-    // UMLApp::app()->executeCommand(new CmdCreateWidget(this, w));
+    UMLApp::app()->executeCommand(new CmdCreateWidget(this, w));
 }
 
 /**
@@ -1957,15 +1956,12 @@
     return true;
 }
 
-// Add the association, and its child widgets to this view
-
 /**
- * Adds an association to the view from the given data.
+ * Add the association, and its child widgets to this view from the given data.
  * Use this method when pasting.
  */
 bool UMLScene::addAssociation(AssociationWidget* pAssoc , bool isPasteOperation)
 {
-
     if (!pAssoc) {
         return false;
     }
@@ -2915,6 +2911,9 @@
         widget->contextMenuEvent(event);
     }
     else {
+        // set the position for the eventually created widget
+        setPos(event->scenePos());
+
         setMenu(event->screenPos());
         event->accept();
     }
@@ -3000,7 +2999,7 @@
 void UMLScene::slotMenuSelection(QAction* action)
 {
     ListPopupMenu::Menu_Type sel = ListPopupMenu::mt_Undefined;
-    if (m_pMenu != NULL) {  // popup from this class
+    if (m_pMenu) {  // popup from this class
         sel = m_pMenu->getMenuType(action);
     } else { // popup from umldoc
         sel = m_pDoc->getPopupMenuSelection(action);




More information about the umbrello-devel mailing list