Esempio n. 1
0
/**
 * Reimplemented from UMLWidget::slotMenuSelection to handle
 * some menu actions.
 */
void NoteWidget::slotMenuSelection(QAction* action)
{
    ListPopupMenu *menu = ListPopupMenu::menuFromAction(action);
    if (!menu) {
        uError() << "Action's data field does not contain ListPopupMenu pointer";
        return;
    }
    ListPopupMenu::MenuType sel = menu->getMenuType(action);
    switch(sel) {
    case ListPopupMenu::mt_Rename:
        {
            umlScene()->updateDocumentation(false);
            NoteDialog * dlg = new NoteDialog(umlScene()->activeView(), this);
            if (dlg->exec()) {
                umlScene()->showDocumentation(this, true);
                umlDoc()->setModified(true);
                update();
            }
            delete dlg;
        }
        break;

    case ListPopupMenu::mt_Clear:
        umlScene()->updateDocumentation(true);
        setDocumentation(QString());
        umlScene()->showDocumentation(this, true);
        umlDoc()->setModified(true);
        update();
        break;

    default:
        UMLWidget::slotMenuSelection(action);
        break;
    }
}
Esempio n. 2
0
void NoteWidget::mouseDoubleClickEvent(UMLSceneMouseEvent *event)
{
    Q_UNUSED(event);
    umlScene()->updateDocumentation(false);
    NoteDialog * dlg = new NoteDialog(umlScene()->activeView(), this);
    if (dlg->exec()) {
        umlScene()->showDocumentation(this, true);
        umlDoc()->setModified(true);
        update();
    }
    delete dlg;
}
Esempio n. 3
0
/**
 * Show a properties dialog for a NoteWidget.
 */
void NoteWidget::showPropertiesDialog()
{
    NoteDialog * dlg = 0;
    UMLApp::app()->docWindow()->updateDocumentation(false);
    dlg = new NoteDialog(umlScene()->activeView(), this);
    if (dlg->exec()) {
        UMLApp::app()->docWindow()->showDocumentation(this, true);
        UMLApp::app()->document()->setModified(true);
        update();
    }
    delete dlg;
}