Commit da5e2cfd authored by Ralf Habacker's avatar Ralf Habacker

Use method showPropertiesDialog() also in class MessageWidget

CCBUG:390507
parent 3c29cb83
......@@ -14,12 +14,14 @@
//app includes
#include "classifier.h"
#include "debug_utils.h"
#include "docwindow.h"
#include "floatingtextwidget.h"
#include "listpopupmenu.h"
#include "objectwidget.h"
#include "operation.h"
#include "uml.h"
#include "umldoc.h"
#include "selectoperationdialog.h"
#include "umlview.h"
#include "uniqueid.h"
#include "idchangelog.h"
......@@ -1318,18 +1320,25 @@ void MessageWidget::setyclicked(int yclick)
}
/**
* Event handler for mouse double click events.
* @param event QGraphicsSceneMouseEvent which triggered the double click event
* Show a properties dialog for an ObjectWidget.
*/
void MessageWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
bool MessageWidget::showPropertiesDialog()
{
Q_UNUSED(event)
DEBUG(DBG_SRC) << "NOT IMPLEMENTED YET!";
if (m_pFText != 0) {
DEBUG(DBG_SRC) << "NOT IMPLEMENTED YET - on floating text widget!";
// QAction* action = m_pMenu->getAction(ListPopupMenu::mt_Select_Operation);
// m_pFText->slotMenuSelection(action);
if (!lwClassifier()) {
uError() << "lwClassifier() returns a NULL classifier";
return false;
}
bool result = false;
UMLApp::app()->docWindow()->updateDocumentation(false);
QPointer<SelectOperationDialog> selectDialog = new SelectOperationDialog(umlScene()->activeView(), lwClassifier(), this);
if (selectDialog->exec()) {
m_pFText->setMessageText();
UMLApp::app()->docWindow()->showDocumentation(this, true);
UMLApp::app()->document()->setModified(true);
result = true;
}
delete selectDialog;
return result;
}
/**
......
......@@ -148,9 +148,9 @@ public:
return m_xclicked;
}
protected:
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
virtual bool showPropertiesDialog();
protected:
virtual void moveWidgetBy(qreal diffX, qreal diffY);
virtual void constrainMovementForAllWidgets(qreal &diffX, qreal &diffY);
......
......@@ -602,15 +602,8 @@ void UMLWidget::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
DEBUG(DBG_SRC) << "widget = " << name() << " / type = " << baseTypeStr();
switch(baseType()) {
case WidgetBase::wt_Message: // will be handled in its class
QGraphicsItem::mouseDoubleClickEvent(event);
break;
default:
showPropertiesDialog();
event->accept();
break;
}
showPropertiesDialog();
event->accept();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment