[Uml-devel] KDE/kdesdk/umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Fri Apr 6 06:14:07 UTC 2012
SVN commit 1288359 by fischer:
Differences to soc-branch reduced.
M +24 -4 listpopupmenu.cpp
M +3 -3 listpopupmenu.h
M +3 -3 umlscene.cpp
M +1 -1 umlscene.h
--- trunk/KDE/kdesdk/umbrello/umbrello/listpopupmenu.cpp #1288358:1288359
@@ -30,9 +30,10 @@
#include "statewidget.h"
#include "uml.h"
#include "umldoc.h"
+#include "umlscene.h"
#include "umlview.h"
-#include "umlwidget.h"
#include "widget_utils.h"
+#include "widgetbase.h"
// kde includes
#include <klocale.h>
@@ -53,9 +54,26 @@
m_TriggerObject.m_View = view;
m_TriggerObjectType = tot_View;
setupMenu(type);
+ setupActionsData();
}
/**
+ * Constructs the popup menu for a WidgetBase with customized menu type.
+ *
+ * @param parent The parent to ListPopupMenu.
+ * @param type The type of menu to display.
+ * @param object The WidgetBase object.
+ */
+ListPopupMenu::ListPopupMenu(QWidget *parent, MenuType type, WidgetBase *widget)
+ : KMenu(parent)
+{
+ m_TriggerObject.m_Widget = widget;
+ m_TriggerObjectType = tot_Widget;
+ setupMenu(type);
+ setupActionsData();
+}
+
+/**
* Constructs the popup menu for a tree list view item.
*
* @param parent The parent to ListPopupMenu.
@@ -247,18 +265,19 @@
break;
}
setupMenu(mt);
+ setupActionsData();
}
/**
* Constructs the popup menu for a canvas widget.
*
* @param parent The parent to ListPopupMenu.
- * @param object The UMLWidget to represent a menu for.
+ * @param object The WidgetBase to represent a menu for.
* @param multi True if multiple items are selected.
* @param unique True if multiple selected items all have
* the same type (e.g. Class, Interface)
*/
-ListPopupMenu::ListPopupMenu(QWidget * parent, UMLWidget * object,
+ListPopupMenu::ListPopupMenu(QWidget * parent, WidgetBase * object,
bool multi, bool unique)
: KMenu(parent)
{
@@ -268,7 +287,7 @@
//make menu for logical view
if (!object)
return;
- UMLWidget::WidgetType type = object->baseType();
+ WidgetBase::WidgetType type = object->baseType();
// uDebug() << "ListPopupMenu created with multi=" << multi << " , unique="
// << unique << " for WidgetType=" << type;
@@ -572,6 +591,7 @@
setActionEnabled( mt_Cut, bCutState );
setActionEnabled( mt_Copy, bCutState );
setActionEnabled( mt_Paste, false );
+ setupActionsData();
}
/**
--- trunk/KDE/kdesdk/umbrello/umbrello/listpopupmenu.h #1288358:1288359
@@ -24,7 +24,6 @@
class UMLView;
class ClassifierWidget;
class UMLCategory;
-class UMLWidget;
/**
* A popup menu that depending on what type it is set to will
@@ -226,8 +225,9 @@
static QString toString(MenuType menu);
explicit ListPopupMenu(QWidget* parent, MenuType type = mt_Undefined, UMLView* view = 0);
+ explicit ListPopupMenu(QWidget* parent, MenuType type, WidgetBase *widget);
ListPopupMenu(QWidget* parent, UMLListViewItem::ListViewType type, UMLObject* object);
- ListPopupMenu(QWidget* parent, UMLWidget* object, bool multi = false, bool unique = false);
+ ListPopupMenu(QWidget* parent, WidgetBase* object, bool multi = false, bool unique = false);
~ListPopupMenu();
@@ -277,7 +277,7 @@
union TriggerObject { ///< The List Popup Menu is triggered either by right clicking on the View, a ListViewItem (Object), or a widget.
UMLView* m_View;
UMLObject* m_Object;
- UMLWidget* m_Widget;
+ WidgetBase* m_Widget;
};
enum TriggerObjectType { ///< Enum to keep track on TriggerObject Type.
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.cpp #1288358:1288359
@@ -107,7 +107,7 @@
using namespace Uml;
/**
- * Constructor
+ * Constructor.
*/
UMLScene::UMLScene(UMLFolder *parentFolder, UMLView *view)
: m_nLocalID(Uml::id_None),
@@ -174,7 +174,7 @@
}
/**
- * Destructor
+ * Destructor.
*/
UMLScene::~UMLScene()
{
@@ -1746,7 +1746,7 @@
/**
* Paint diagram to the paint device
*/
-void UMLScene::getDiagram(const QRect &area, QPainter &painter)
+void UMLScene::getDiagram(const UMLSceneRect &area, QPainter & painter)
{
DEBUG(DBG_SRC) << "area=" << area << ", painter=" << painter.window();
//TODO unselecting and selecting later doesn't work now as the selection is
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.h #1288358:1288359
@@ -126,7 +126,7 @@
void setTextColor(const QColor& color);
const QColor& gridDotColor() const;
- void setGridDotColor(const QColor &gridColor);
+ void setGridDotColor(const QColor& color);
void setSize(int width, int height);
More information about the umbrello-devel
mailing list