[Uml-devel] KDE/kdesdk/umbrello/umbrello
Ralf Habacker
ralf.habacker at gmail.com
Sat Mar 24 15:11:37 UTC 2012
SVN commit 1286944 by habacker:
Added separate signal for line color changes.
This reduces the number of duplicated entries in the history.
M +2 -1 umlscene.cpp
M +1 -0 umlscene.h
M +4 -4 widgets/associationline.cpp
M +20 -3 widgets/umlwidget.cpp
M +1 -0 widgets/umlwidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.cpp #1286943:1286944
@@ -942,6 +942,7 @@
disconnect(this, SIGNAL(sigRemovePopupMenu()), o, SLOT(slotRemovePopupMenu()));
disconnect(this, SIGNAL(sigClearAllSelected()), o, SLOT(slotClearAllSelected()));
disconnect(this, SIGNAL(sigColorChanged(Uml::IDType)), o, SLOT(slotColorChanged(Uml::IDType)));
+ disconnect(this, SIGNAL(sigLineColorChanged(Uml::IDType)), o, SLOT(slotLineColorChanged(Uml::IDType)));
disconnect(this, SIGNAL(sigTextColorChanged(Uml::IDType)), o, SLOT(slotTextColorChanged(Uml::IDType)));
if (t == WidgetBase::wt_Message) {
m_MessageList.removeAll(static_cast<MessageWidget*>(o));
@@ -1003,7 +1004,7 @@
void UMLScene::setLineColor(const QColor &color)
{
m_Options.uiState.lineColor = color;
- emit sigColorChanged(getID());
+ emit sigLineColorChanged(getID());
setAllChanged();
}
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.h #1286943:1286944
@@ -718,6 +718,7 @@
signals:
void sigColorChanged( Uml::IDType );
+ void sigLineColorChanged( Uml::IDType );
void sigTextColorChanged( Uml::IDType );
void sigRemovePopupMenu();
void sigClearAllSelected();
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationline.cpp #1286943:1286944
@@ -335,8 +335,8 @@
if (m_associationWidget) {
UMLView * view = (UMLView *)m_associationWidget->parent();
if (view) {
- disconnect(view, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotLineColorChanged(Uml::IDType)));
- disconnect(view, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType)));
+ disconnect(view->umlScene(), SIGNAL(sigLineColorChanged(Uml::IDType)), this, SLOT(slotLineColorChanged(Uml::IDType)));
+ disconnect(view->umlScene(), SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType)));
}
m_associationWidget = 0;
}
@@ -629,8 +629,8 @@
setupParallelLine();
UMLView * view = (UMLView *)m_associationWidget->parent();
if (view) {
- connect(view, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotLineColorChanged(Uml::IDType)));
- connect(view, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType)));
+ connect(view->umlScene(), SIGNAL(sigLineColorChanged(Uml::IDType)), this, SLOT(slotLineColorChanged(Uml::IDType)));
+ connect(view->umlScene(), SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType)));
}
else {
uWarning() << "Parent is null. Can not connect SIGNAL/SLOT.";
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.cpp #1286943:1286944
@@ -332,6 +332,7 @@
connect(m_scene, SIGNAL(sigClearAllSelected()), this, SLOT(slotClearAllSelected()));
connect(m_scene, SIGNAL(sigColorChanged(Uml::IDType)), this, SLOT(slotColorChanged(Uml::IDType)));
+ connect(m_scene, SIGNAL(sigLineColorChanged(Uml::IDType)), this, SLOT(slotLineColorChanged(Uml::IDType)));
connect(m_scene, SIGNAL(sigTextColorChanged(Uml::IDType)), this, SLOT(slotTextColorChanged(Uml::IDType)));
connect(m_scene, SIGNAL(sigLineWidthChanged(Uml::IDType)), this, SLOT(slotLineWidthChanged(Uml::IDType)));
@@ -511,9 +512,6 @@
if (m_usesDiagramFillColor) {
m_FillColor = m_scene->fillColor();
}
- if (m_usesDiagramLineColor) {
- m_LineColor = m_scene->lineColor();
- }
if (m_usesDiagramUseFillColor) {
m_useFillColor = m_scene->useFillColor();
}
@@ -534,7 +532,26 @@
update();
}
+
/**
+ * Captures a line color change signal.
+ *
+ * @param sceneID The id of the object behind the widget.
+ */
+void UMLWidget::slotLineColorChanged(Uml::IDType viewID)
+{
+ //only change if on the diagram concerned
+ if (m_scene->getID() != viewID)
+ return;
+
+ if (m_usesDiagramLineColor) {
+ m_LineColor = m_scene->lineColor();
+ setLineColor( m_lineColor );
+ }
+ update();
+}
+
+/**
* Captures a linewidth change signal.
*
* @param sceneID The id of the object behind the widget.
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/umlwidget.h #1286943:1286944
@@ -375,6 +375,7 @@
virtual void slotMenuSelection(QAction* action);
virtual void slotWidgetMoved(Uml::IDType id);
virtual void slotColorChanged(Uml::IDType viewID);
+ virtual void slotLineColorChanged(Uml::IDType viewID);
virtual void slotTextColorChanged(Uml::IDType viewID);
virtual void slotLineWidthChanged(Uml::IDType viewID);
More information about the umbrello-devel
mailing list