[Uml-devel] KDE/kdesdk/umbrello/umbrello

Ralf Habacker ralf.habacker at gmail.com
Tue Jan 17 13:25:46 UTC 2012


SVN commit 1274084 by habacker:

Select pasted widget.

CCBUG: 291763

 M  +6 -0      clipboard/umlclipboard.cpp  
 M  +6 -0      umlview.cpp  
 M  +11 -6     umlview.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/clipboard/umlclipboard.cpp #1274083:1274084
@@ -593,6 +593,12 @@
         }
     }
 
+    currentView->clearSelected();
+    currentView->selectWidgets(widgets);
+    foreach ( AssociationWidget* assoc, assocs ) {
+        currentView->selectWidgetsOfAssoc(assoc);
+    }
+
     //Activate all the pasted associations and widgets
     currentView->activate();
     currentView->endPartialWidgetPaste();
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #1274083:1274084
@@ -1374,6 +1374,12 @@
     }//end foreach
 }
 
+void UMLView::selectWidgets(UMLWidgetList &widgets)
+{
+    foreach ( UMLWidget* widget, widgets )
+        makeSelected(widget);
+}
+
 void  UMLView::getDiagram(const QRect &rect, QPixmap &diagram)
 {
     DEBUG(DBG_SRC) << "rect=" << rect << ", pixmap=" << diagram.rect();
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.h #1274083:1274084
@@ -439,6 +439,7 @@
 
     /**
      * Sets a widget to a selected state and adds it to a list of selected widgets.
+     * This method also sets the state of the cut and copy menu entries.
      *
      * @param w The widget to set to selected.
      * @param me The mouse event containing the information about the selection.
@@ -876,6 +877,16 @@
     void selectWidgets(int px, int py, int qx, int qy);
 
     /**
+     * Selects all the widgets of the given association widget.
+     */
+    void selectWidgetsOfAssoc (AssociationWidget * a);
+
+    /**
+     * Selects all the widgets from a list.
+     */
+    void selectWidgets(UMLWidgetList &widgets);
+
+    /**
      * Determine whether on a sequence diagram we have clicked on a line
      * of an Object.
      *
@@ -1083,13 +1094,7 @@
      */
     void contentsMousePressEvent(QMouseEvent* mouseEvent);
 
-
     /**
-     * Selects all the widgets of the given association widget.
-     */
-    void selectWidgetsOfAssoc (AssociationWidget * a);
-
-    /**
      * Calls setSelected on the given UMLWidget and enters
      * it into the m_SelectedList while making sure it is
      * there only once.




More information about the umbrello-devel mailing list