Commit 9f7c578d authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Merge remote-tracking branch 'origin/Applications/17.04'

parents 3b777618 e38b2965
......@@ -6,7 +6,7 @@ set (KDE_APPLICATIONS_VERSION_MINOR "07")
set (KDE_APPLICATIONS_VERSION_MICRO "70")
set(UMBRELLO_VERSION_MAJOR "2")
MATH(EXPR UMBRELLO_VERSION_MINOR "18+${KDE_APPLICATIONS_VERSION_MINOR}")
MATH(EXPR UMBRELLO_VERSION_MINOR "15+${KDE_APPLICATIONS_VERSION_MINOR}")
set(UMBRELLO_VERSION_PATCH ${KDE_APPLICATIONS_VERSION_MICRO})
option(BUILD_ICONS "Create icons from svg source" OFF)
......
......@@ -244,10 +244,7 @@ void DocWindow::showDocumentation(AssociationWidget * widget, bool overwrite)
return;
}
if (widget == m_pAssocWidget) {
if (overwrite) {
updateDocumentation(true);
}
else {
if (!overwrite) {
return;
}
}
......@@ -429,28 +426,26 @@ void DocWindow::slotFocusEnabledChanged(int status)
*/
void DocWindow::updateLabel(const QString& name)
{
if (!name.isEmpty()) {
Icon_Utils::IconType icon = Icon_Utils::it_Home;
switch (m_Showing) {
case st_Project:
icon = Icon_Utils::it_Code_Gen_Wizard;
break;
case st_UMLScene:
icon = Icon_Utils::it_Diagram_Class;
break;
case st_UMLObject:
icon = Icon_Utils::it_Object;
break;
case st_UMLWidget:
icon = Icon_Utils::it_Class;
break;
case st_Association:
icon = Icon_Utils::it_Association;
break;
}
m_typeLabel->setPixmap(Icon_Utils::SmallIcon(icon));
m_nameLabel->setText(name);
Icon_Utils::IconType icon = Icon_Utils::it_Home;
switch (m_Showing) {
case st_Project:
icon = Icon_Utils::it_Code_Gen_Wizard;
break;
case st_UMLScene:
icon = Icon_Utils::it_Diagram_Class;
break;
case st_UMLObject:
icon = Icon_Utils::it_Object;
break;
case st_UMLWidget:
icon = WidgetBase::toIcon(m_pUMLWidget->baseType());
break;
case st_Association:
icon = Icon_Utils::it_Association;
break;
}
m_typeLabel->setPixmap(Icon_Utils::SmallIcon(icon));
m_nameLabel->setText(name);
m_modifiedWidget->setModified(isModified());
}
......
......@@ -3762,8 +3762,7 @@ void AssociationWidget::setSelected(bool _select /* = true */)
// overwrites the docwindow, but we want the main association doc
// to win.
if (_select) {
if (m_scene->selectedCount() == 0)
UMLApp::app()->docWindow()->showDocumentation(this, false);
UMLApp::app()->docWindow()->showDocumentation(this, false);
} else
UMLApp::app()->docWindow()->updateDocumentation(true);
......
......@@ -1155,6 +1155,114 @@ QString WidgetBase::toI18nString(WidgetType wt)
return name;
}
/**
* Returns the given enum value as icon type.
* @param wt WidgetType of which an icon type representation is wanted
* @return the WidgetType as icon type
*/
Icon_Utils::IconType WidgetBase::toIcon(WidgetBase::WidgetType wt)
{
Icon_Utils::IconType icon;
switch (wt) {
case wt_Activity:
icon = Icon_Utils::it_Activity;
break;
case wt_Actor:
icon = Icon_Utils::it_Actor;
break;
case wt_Artifact:
icon = Icon_Utils::it_Artifact;
break;
case wt_Association:
icon = Icon_Utils::it_Association;
break;
case wt_Box:
icon = Icon_Utils::it_Box;
break;
case wt_Category:
icon = Icon_Utils::it_Category;
break;
case wt_CombinedFragment:
icon = Icon_Utils::it_Combined_Fragment;
break;
case wt_Component:
icon = Icon_Utils::it_Component;
break;
case wt_Class:
icon = Icon_Utils::it_Class;
break;
case wt_Datatype:
icon = Icon_Utils::it_Datatype;
break;
case wt_Entity:
icon = Icon_Utils::it_Entity;
break;
case wt_Enum:
icon = Icon_Utils::it_Enum;
break;
case wt_FloatingDashLine:
icon = Icon_Utils::it_Association;
break;
case wt_ForkJoin:
icon = Icon_Utils::it_Fork_Join;
break;
case wt_Instance:
icon = Icon_Utils::it_Instance;
break;
case wt_Interface:
icon = Icon_Utils::it_Interface;
break;
case wt_Message:
icon = Icon_Utils::it_Message_Synchronous;
break;
case wt_Node:
icon = Icon_Utils::it_Node;
break;
case wt_Note:
icon = Icon_Utils::it_Note;
break;
case wt_Object:
icon = Icon_Utils::it_Object;
break;
case wt_ObjectNode:
icon = Icon_Utils::it_Object_Node;
break;
case wt_Package:
icon = Icon_Utils::it_Package;
break;
case wt_Pin:
icon = Icon_Utils::it_Pin;
break;
case wt_Port:
icon = Icon_Utils::it_Port;
break;
case wt_Precondition:
icon = Icon_Utils::it_Precondition;
break;
case wt_Region:
icon = Icon_Utils::it_Region;
break;
case wt_Signal:
icon = Icon_Utils::it_Send_Signal;
break;
case wt_State:
icon = Icon_Utils::it_State;
break;
case wt_Text:
icon = Icon_Utils::it_Text;
break;
case wt_UseCase:
icon = Icon_Utils::it_UseCase;
break;
default:
icon = Icon_Utils::it_Home;
uWarning() << "unknown widget type";
break;
}
return icon;
}
#include "activitywidget.h"
#include "actorwidget.h"
#include "artifactwidget.h"
......
......@@ -12,6 +12,7 @@
#define WIDGETBASE_H
#include "basictypes.h"
#include "icon_utils.h"
#include <QColor>
#include <QDomDocument>
......@@ -109,6 +110,7 @@ public:
static QString toString(WidgetType wt);
static QString toI18nString(WidgetType wt);
static Icon_Utils::IconType toIcon(WidgetType wt);
explicit WidgetBase(UMLScene * scene, WidgetType type= wt_UMLWidget);
virtual ~WidgetBase();
......
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