Skip to content
Commit 1258d81a authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

(In reply to comment #6)

> [...]
> Proposed fix: Do the switchover to a new diagram on mouse button _release_
> not on _press_.
> Then, the release event could occur elsewhere than in the tree view; for
> example, on a note widget in the diagram area.

This would create behaviour that is not in line with the rest of Umbrello.
Rather than changing the press/release semantics, here is an implementation
for Copy from UMLListview and Paste onto NoteWidget in diagram:

umbrello/widgets/notewidget.h
- Add static NoteWidget *s_pCurrentNote.
  Putting this here instead of in UMLApp to reduce coupling.

umbrello/clipboard/umldragdata.cpp
- In function decodeClip2(), call UMLDragData::decodeObjects() only if
  NoteWidget::s_pCurrentNote is NULL.
- In function decodeViews() while-loop, if NoteWidget::s_pCurrentNote is non
  NULL then extract attribute "xmi.id" from diagramElement and call
  NoteWidget::s_pCurrentNote->setDiagramLink() with the extracted ID.

umbrello/clipboard/umlclipboard.cpp function pasteClip2()
- After call to UMLDragData::decodeClip2(), if NoteWidget::s_pCurrentNote is
  non NULL then reset it to NULL instead of adding the views to the UMLDoc.

umbrello/listpopupmenu.cpp
- In ctor ListPopupMenu(QWidget*,WidgetBase*,bool,WidgetBase::WidgetType),
  if object is a Note and UMLListView::startedCopy() is true then assign
  object to NoteWidget::s_pCurrentNote and setActionEnabled(mt_Paste, true).

umbrello/widgets/notewidget.cpp
- In function setDiagramLink() add missing final call to update() for
  display of new text.

CCBUG:67062
parent deebc21f
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