Hi,
in the class widget context menu - menu entry "show" there are several
options to control the display of attributes/methods and others for a
specific class [1].
Except the "Public Only" option these options are also available for all
classes of a specific class diagram [2] (class tab of class diagramm
properties) and in the umbrello settings [3] (Extras->Settings->class tab).
The appended patch adds the "Public Only" option to [2] and [3].
If are there no objections I would apply this patch to trunk and
branches/kde 4.2.
Ralf
Index: umbrello/umbrello/dialogs/classoptionspage.cpp
===================================================================
--- umbrello/umbrello/dialogs/classoptionspage.cpp (revision 910451)
+++ umbrello/umbrello/dialogs/classoptionspage.cpp (working copy)
@@ -49,6 +49,7 @@
m_pShowAttsCB = NULL;
m_pShowAttSigCB = NULL;
m_pShowAttribAssocsCB = NULL;
+ m_pShowPublicOnlyCB = NULL;
m_pDrawAsCircleCB = NULL;
}
@@ -113,6 +114,11 @@
m_pShowAttSigCB->setChecked(sig);
visibilityLayout->addWidget(m_pShowAttSigCB, 3, 0);
+ m_pShowPublicOnlyCB = new QCheckBox(i18n("&Public Only"),
m_pVisibilityGB);
+ m_pShowPublicOnlyCB->setChecked(m_pWidget->getShowPublicOnly());
+ visibilityLayout->addWidget(m_pShowPublicOnlyCB, 2, 3);
+
+
} else if (type == Uml::wt_Interface) {
m_pDrawAsCircleCB = new QCheckBox(i18n("Draw as circle"),
m_pVisibilityGB);
m_pDrawAsCircleCB->setChecked( m_pWidget->getDrawAsCircle() );
@@ -164,6 +170,10 @@
m_pShowAttribAssocsCB = new QCheckBox(i18n("&Attribute associations"),
m_pVisibilityGB);
m_pShowAttribAssocsCB->setChecked(m_options->classState.showAttribAssocs);
visibilityLayout->addWidget(m_pShowAttribAssocsCB, 3, 1);
+
+ m_pShowPublicOnlyCB = new QCheckBox(i18n("&Public Only"), m_pVisibilityGB);
+ m_pShowPublicOnlyCB->setChecked(m_options->classState.showPublicOnly);
+ visibilityLayout->addWidget(m_pShowPublicOnlyCB, 4, 1);
}
void ClassOptionsPage::updateUMLWidget()
@@ -186,6 +196,7 @@
m_pWidget->setShowStereotype( m_pShowStereotypeCB->isChecked() );
m_pWidget->setShowAtts( m_pShowAttsCB->isChecked() );
m_pWidget->setShowAttSigs( m_pShowAttSigCB->isChecked() );
+ m_pWidget->setShowPublicOnly( m_pShowPublicOnlyCB->isChecked() );
} else if (type == Uml::wt_Interface) {
if (m_pDrawAsCircleCB)
m_pWidget->setDrawAsCircle( m_pDrawAsCircleCB->isChecked() );
@@ -206,4 +217,5 @@
if (m_pShowAttSigCB)
m_options->classState.showAttSig = m_pShowAttSigCB->isChecked();
m_options->classState.showOpSig = m_pShowOpSigCB->isChecked();
+ m_options->classState.showPublicOnly = m_pShowPublicOnlyCB->isChecked();
}
Index: umbrello/umbrello/dialogs/classoptionspage.h
===================================================================
--- umbrello/umbrello/dialogs/classoptionspage.h (revision 910451)
+++ umbrello/umbrello/dialogs/classoptionspage.h (working copy)
@@ -91,7 +91,7 @@
QGroupBox * m_pVisibilityGB;
QCheckBox * m_pShowVisibilityCB, * m_pShowAttSigCB;
QCheckBox * m_pShowOpSigCB, * m_pShowAttsCB, * m_pShowOpsCB;
- QCheckBox * m_pShowStereotypeCB, * m_pShowPackageCB;
+ QCheckBox * m_pShowStereotypeCB, * m_pShowPackageCB, * m_pShowPublicOnlyCB;
QCheckBox * m_pShowAttribAssocsCB;
QCheckBox * m_pDrawAsCircleCB;
Index: umbrello/umbrello/dialogs/settingsdlg.cpp
===================================================================
--- umbrello/umbrello/dialogs/settingsdlg.cpp (revision 910451)
+++ umbrello/umbrello/dialogs/settingsdlg.cpp (working copy)
@@ -274,6 +274,10 @@
m_ClassWidgets.showOpSigCB = new QCheckBox( i18n("Show operation
signature"), m_ClassWidgets.visibilityGB );
m_ClassWidgets.showOpSigCB->setChecked(
m_pOptionState->classState.showOpSig );
visibilityLayout->addWidget( m_ClassWidgets.showOpSigCB, 3, 0 );
+
+ m_ClassWidgets.showPublicOnlyCB = new QCheckBox( i18n("Show Public Only"),
m_ClassWidgets.visibilityGB );
+ m_ClassWidgets.showPublicOnlyCB->setChecked(
m_pOptionState->classState.showPublicOnly );
+ visibilityLayout->addWidget( m_ClassWidgets.showPublicOnlyCB, 3, 1 );
visibilityLayout->setRowStretch( 3, 1 );
m_ClassWidgets.scopeGB = new QGroupBox( i18n("Starting Scope"), page );
Index: umbrello/umbrello/dialogs/settingsdlg.h
===================================================================
--- umbrello/umbrello/dialogs/settingsdlg.h (revision 910451)
+++ umbrello/umbrello/dialogs/settingsdlg.h (working copy)
@@ -117,6 +117,7 @@
QCheckBox * showStereotypeCB;
QCheckBox * showAttSigCB;
QCheckBox * showPackageCB;
+ QCheckBox * showPublicOnlyCB;
QCheckBox * showOpSigCB;
Index: umbrello/umbrello/optionstate.h
===================================================================
--- umbrello/umbrello/optionstate.h (revision 910451)
+++ umbrello/umbrello/optionstate.h (working copy)
@@ -63,6 +63,7 @@
bool showOpSig;
bool showPackage;
bool showAttribAssocs;
+ bool showPublicOnly;
Uml::Visibility defaultAttributeScope;
Uml::Visibility defaultOperationScope;
};
Index: umbrello/umbrello/umbrello.kcfg
===================================================================
--- umbrello/umbrello/umbrello.kcfg (revision 910451)
+++ umbrello/umbrello/umbrello.kcfg (working copy)
@@ -154,6 +154,11 @@
<whatisthis>Show Attribute Associations</whatisthis>
<default>true</default>
</entry>
+ <entry name="showPublicOnly" type="Bool">
+ <label>Show Public Only</label>
+ <whatisthis>Enables/Disables showing of public
attributes/operations</whatisthis>
+ <default>true</default>
+ </entry>
<entry name="showAttSig" type="Bool">
<label>Show Attribute Signature</label>
<whatisthis>Show Attribute Signature</whatisthis>
Index: umbrello/umbrello/uml.cpp
===================================================================
--- umbrello/umbrello/uml.cpp (revision 910451)
+++ umbrello/umbrello/uml.cpp (working copy)
@@ -745,6 +745,7 @@
UmbrelloSettings::setShowOpSig( optionState.classState.showOpSig );
UmbrelloSettings::setShowPackage( optionState.classState.showPackage );
UmbrelloSettings::setShowAttribAssocs(
optionState.classState.showAttribAssocs );
+ UmbrelloSettings::setShowPublicOnly(
optionState.classState.showPublicOnly );
UmbrelloSettings::setDefaultAttributeScope(
optionState.classState.defaultAttributeScope);
UmbrelloSettings::setDefaultOperationScope(
optionState.classState.defaultOperationScope);
@@ -1463,6 +1464,7 @@
optionState.classState.showOpSig = UmbrelloSettings::showOpSig();
optionState.classState.showPackage = UmbrelloSettings::showPackage();
optionState.classState.showAttribAssocs =
UmbrelloSettings::showAttribAssocs();
+ optionState.classState.showPublicOnly =
UmbrelloSettings::showPublicOnly();
optionState.classState.defaultAttributeScope =
UmbrelloSettings::defaultAttributeScope();
optionState.classState.defaultOperationScope =
UmbrelloSettings::defaultOperationScope();
Index: umbrello/umbrello/umlview.cpp
===================================================================
--- umbrello/umbrello/umlview.cpp (revision 910451)
+++ umbrello/umbrello/umlview.cpp (working copy)
@@ -3144,6 +3144,7 @@
viewElement.setAttribute("showops", m_Options.classState.showOps);
viewElement.setAttribute("showpackage", m_Options.classState.showPackage);
viewElement.setAttribute("showattribassocs",
m_Options.classState.showAttribAssocs);
+ viewElement.setAttribute("showpubliconly",
m_Options.classState.showPublicOnly);
viewElement.setAttribute("showscope", m_Options.classState.showVisibility);
viewElement.setAttribute("showstereotype",
m_Options.classState.showStereoType);
//misc
@@ -3239,6 +3240,8 @@
m_Options.classState.showVisibility = (bool)temp.toInt();
temp = qElement.attribute("showstereotype", "0");
m_Options.classState.showStereoType = (bool)temp.toInt();
+ temp = qElement.attribute("showpubliconly", "0");
+ m_Options.classState.showPublicOnly = (bool)temp.toInt();
//misc
QString showgrid = qElement.attribute("showgrid", "0");
m_bShowSnapGrid = (bool)showgrid.toInt();
_______________________________________________
Kde-windows mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-windows