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

Andi Fischer andi.fischer at hispeed.ch
Tue May 29 20:04:23 UTC 2012


SVN commit 1297149 by fischer:

Difference to trunk reduced.

 M  +2 -0      layouts/activity-export.desktop  
 M  +2 -0      layouts/class-export.desktop  
 M  +1 -0      layouts/class-horizontal.desktop  
 M  +1 -0      layouts/class-vertical.desktop  
 M  +2 -0      layouts/state-export.desktop  
 M  +2 -0      layouts/usecase-default.desktop  
 M  +10 -3     umllistview.cpp  
 M  +9 -4      umlscene.cpp  
 M  +11 -9     widgets/widget_factory.cpp  


--- branches/work/soc-umbrello/umbrello/layouts/activity-export.desktop #1297148:1297149
@@ -12,6 +12,7 @@
 Name[sv]=Exportera layout
 Name[uk]=Компонування експортованих даних
 Name[x-test]=xxExport Layoutxx
+Name[zh_CN]=导出布局
 Name[zh_TW]=匯出佈局
 Comment=Export Layout for Activity Diagrams
 Comment[ca]=Exporta la disposició dels diagrames d'activitat
@@ -24,6 +25,7 @@
 Comment[sv]=Exportera layout av aktivitetsdiagram
 Comment[uk]=Компонування для експортування діаграм дій
 Comment[x-test]=xxExport Layout for Activity Diagramsxx
+Comment[zh_CN]=导出活动图布局
 Comment[zh_TW]=活動圖片的匯出佈局
 
 [X-UMBRELLO-Dot-Nodes]
--- branches/work/soc-umbrello/umbrello/layouts/class-export.desktop #1297148:1297149
@@ -12,6 +12,7 @@
 Name[sv]=Exportera layout
 Name[uk]=Компонування експортованих даних
 Name[x-test]=xxExport Layoutxx
+Name[zh_CN]=导出布局
 Name[zh_TW]=匯出佈局
 Comment=Export Layout for Class Diagrams
 Comment[ca]=Exporta la disposició dels diagrames de classe
@@ -24,6 +25,7 @@
 Comment[sv]=Exportera layout av klassdiagram
 Comment[uk]=Компонування для експортування діаграм класів
 Comment[x-test]=xxExport Layout for Class Diagramsxx
+Comment[zh_CN]=导出类图布局
 Comment[zh_TW]=類別圖片的匯出佈局
 
 [X-UMBRELLO-Dot-Nodes]
--- branches/work/soc-umbrello/umbrello/layouts/class-horizontal.desktop #1297148:1297149
@@ -12,6 +12,7 @@
 Name[tr]=Yatay Düzen
 Name[uk]=Горизонтальне компонування
 Name[x-test]=xxHorizontal Layoutxx
+Name[zh_CN]=水平布局
 Name[zh_TW]=水平佈局
 Comment=Layout which renders Horizontal
 Comment[ca]=DIsposició que renderitza horitzontalment
--- branches/work/soc-umbrello/umbrello/layouts/class-vertical.desktop #1297148:1297149
@@ -13,6 +13,7 @@
 Name[tr]=Dikey Düzen
 Name[uk]=Вертикальне компонування
 Name[x-test]=xxVertical Layoutxx
+Name[zh_CN]=垂直布局
 Name[zh_TW]=垂直佈局
 Comment=Layout which renders vertical
 Comment[ca]=DIsposició que renderitza verticalment
--- branches/work/soc-umbrello/umbrello/layouts/state-export.desktop #1297148:1297149
@@ -12,6 +12,7 @@
 Name[sv]=Exportera layout
 Name[uk]=Компонування експортованих даних
 Name[x-test]=xxExport Layoutxx
+Name[zh_CN]=导出布局
 Name[zh_TW]=匯出佈局
 Comment=Export Layout for State Diagrams
 Comment[ca]=Exporta la disposició dels diagrames d'estat
@@ -24,6 +25,7 @@
 Comment[sv]=Exportera layout av tillståndsdiagram
 Comment[uk]=Компонування для експортування діаграм станів
 Comment[x-test]=xxExport Layout for State Diagramsxx
+Comment[zh_CN]=导出状态图布局
 Comment[zh_TW]=狀態圖片的匯出佈局
 
 [X-UMBRELLO-Dot-Nodes]
--- branches/work/soc-umbrello/umbrello/layouts/usecase-default.desktop #1297148:1297149
@@ -11,6 +11,7 @@
 Name[sv]=Standardlayout för användarfall
 Name[uk]=Типове компонування випадку використання
 Name[x-test]=xxUseCase Default Layoutxx
+Name[zh_CN]=用例默认布局
 Name[zh_TW]=UseCase 預設佈局
 Comment=Usecase Default Layout
 Comment[ca]=Disposició per omissió de casos d'ús
@@ -23,6 +24,7 @@
 Comment[sv]=Standardlayout för användarfall
 Comment[uk]=Типове компонування випадку використання
 Comment[x-test]=xxUsecase Default Layoutxx
+Comment[zh_CN]=用例默认布局
 Comment[zh_TW]=Usecase 預設佈局
 
 [X-UMBRELLO-Dot-Nodes]
--- branches/work/soc-umbrello/umbrello/umllistview.cpp #1297148:1297149
@@ -178,11 +178,13 @@
         if (m_editItem && m_bRenameInProgress) {
             if (m_editItem == currItem) {
                 // clicked on the item which is just edited
+                DEBUG(DBG_SRC) << "performing endRename";
                 endRename(currItem);
             }
             else {
                 // other item was selected during editing
                 cancelRename(m_editItem);
+                DEBUG(DBG_SRC) << "performing cancelRename";
             }
         }
     }
@@ -294,12 +296,17 @@
  */
 void UMLListView::mouseMoveEvent(QMouseEvent* me)
 {
-    if (!(me->buttons() & Qt::LeftButton))
+    if (!(me->buttons() & Qt::LeftButton)) {
+        DEBUG(DBG_SRC) << "not LeftButton (no action)";
         return;
+    }
     if ((me->pos() - m_dragStartPosition).manhattanLength()
-            < QApplication::startDragDistance())
+            < QApplication::startDragDistance()) {
+        DEBUG(DBG_SRC) << "pos change since dragStart is below startDragDistance threshold (no action)";
         return;
+    }
 
+    DEBUG(DBG_SRC) << "initiating drag";
     QDrag* drag = new QDrag(this);
     drag->setMimeData(getDragData());
     drag->exec(Qt::CopyAction);
@@ -1586,7 +1593,7 @@
         }
     }
 
-    //DEBUG(DBG_SRC) << "dstType = " << dstType << ", accept=" << accept;
+    DEBUG(DBG_SRC) << "dstType = " << dstType << ", accept=" << accept;
     return accept;
 }
 
--- branches/work/soc-umbrello/umbrello/umlscene.cpp #1297148:1297149
@@ -83,10 +83,9 @@
 #include <QtAlgorithms>  // for qSort
 #include <QtGui/QAction>
 #include <QtGui/QPainter>
+#include <QtGui/QPixmap>
 #include <QtGui/QPrinter>
-#include <QtGui/QPixmap>
 
-
 // system includes
 #include <cmath>  // for ceil
 
@@ -127,8 +126,6 @@
 
     m_pImageExporter = new UMLViewImageExporter(this);
 
-    DEBUG_REGISTER(DBG_SRC);
-
     // setup signals
     connect(this, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu()));
     connect(UMLApp::app(), SIGNAL(sigCutSuccessful()),
@@ -139,12 +136,15 @@
     // needs a pointer to this object.
     m_pToolBarStateFactory = new ToolBarStateFactory();
     m_pToolBarState = m_pToolBarStateFactory->getState(WorkToolBar::tbb_Arrow, this);
+
     m_doc = UMLApp::app()->document();
 
     // settings for background
     setBackgroundBrush(QColor(195, 195, 195));
     m_layoutGrid = new LayoutGrid();
     addItem(m_layoutGrid);
+
+    DEBUG_REGISTER(DBG_SRC);
 }
 
 /**
@@ -3875,6 +3875,8 @@
     viewElement.setAttribute("snapcsgrid", m_bUseSnapComponentSizeToGrid);
     viewElement.setAttribute("snapx", m_layoutGrid->gridSpacingX());
     viewElement.setAttribute("snapy", m_layoutGrid->gridSpacingY());
+    // FIXME: move to UMLView
+    viewElement.setAttribute("zoom", activeView()->zoom());
     viewElement.setAttribute("canvasheight", height());
     viewElement.setAttribute("canvaswidth", width());
     viewElement.setAttribute("isopen", isOpen());
@@ -3953,6 +3955,9 @@
     QString snapy = qElement.attribute("snapy", "10");
     m_layoutGrid->setGridSpacing(snapx.toInt(), snapy.toInt());
 
+    QString zoom = qElement.attribute("zoom", "100");
+    activeView()->setZoom(zoom.toInt());
+
     QString height = qElement.attribute("canvasheight", QString("%1").arg(defaultCanvasSize));
     qreal canvasHeight = height.toDouble();
 
--- branches/work/soc-umbrello/umbrello/widgets/widget_factory.cpp #1297148:1297149
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2006-2011                                               *
+ *   copyright (C) 2006-2012                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -15,7 +15,6 @@
 #include "debug_utils.h"
 #include "uml.h"
 #include "umldoc.h"
-#include "umlview.h"
 #include "object_factory.h"
 #include "floatingtextwidget.h"
 #include "classifierwidget.h"
@@ -56,7 +55,6 @@
 #include "objectnodewidget.h"
 #include "pinwidget.h"
 #include "categorywidget.h"
-#include "cmds.h"
 #include "umlscene.h"
 
 namespace Widget_Factory {
@@ -154,6 +152,13 @@
     return newWidget;
 }
 
+/**
+ * Create UMLObject with given object type and id.
+ * @param expected   expected object type
+ * @param o          reference to object
+ * @param id         id of object
+ * @return success status if valid object was created
+ */
 bool validateObjType(UMLObject::ObjectType expected, UMLObject* &o, Uml::IDType id)
 {
     if (o == NULL) {
@@ -183,7 +188,7 @@
 UMLWidget* makeWidgetFromXMI(const QString& tag,
                              const QString& idStr, UMLScene *scene)
 {
-    UMLWidget *widget = NULL;
+    UMLWidget *widget = 0;
 
         // Loading of widgets which do NOT represent any UMLObject,
         // just graphic stuff with no real model information
@@ -218,10 +223,8 @@
     } else if (tag == "pinwidget") {
         widget = new PinWidget(NULL, Uml::id_Reserved);
     }
-    else
+    else  // Loading of widgets which represent an UMLObject
     {
-        // Loading of widgets which represent an UMLObject
-
         // Find the UMLObject and create the Widget to represent it
         Uml::IDType id = STR2ID(idStr);
         UMLDoc *umldoc = UMLApp::app()->document();
@@ -275,11 +278,10 @@
     }
 
     if(widget) {
-        uDebug() << "Added";
+        uDebug() << "Added tag=" << tag << " / idStr=" << idStr;
         scene->addItem(widget);
     }
     return widget;
 }
 
 }   // end namespace Widget_Factory
-




More information about the umbrello-devel mailing list