Bug 111768 - keep visibility in "attribute options" dialog from previous property settings
Summary: keep visibility in "attribute options" dialog from previous property settings
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 1.4.2
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-30 15:16 UTC by greatbunzinni
Modified: 2005-08-30 23:40 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description greatbunzinni 2005-08-30 15:16:23 UTC
Version:           1.4.2 (using KDE KDE 3.4.2)

When the user creates a new class property from the "Properties" dialog, the "Attribute properties" dialog pops up. In that dialog, the default visibility is always set on "private". It would be nice if the visibility depended on the last editing because sometimes the user adds a pile of attributes that share the same visibility and if that visibility isn't "private", the user has to constantly change that option.
Comment 1 Oliver Kellogg 2005-08-30 21:29:36 UTC
SVN commit 455198 by okellogg:

UMLAttributeDialog::apply(): Set the scope as the default in the option state.
BUG:111768


 M  +1 -0      ChangeLog  
 M  +9 -4      umbrello/dialogs/umlattributedialog.cpp  
 M  +3 -0      umbrello/uml.h  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #455197:455198
@@ -11,6 +11,7 @@
 * Bugs fixed / wishes implemented (see http://bugs.kde.org)
  57588  58809  66461  67719  72016  79433  87252  88117  97162 105564
 108223 109591 109636 110216 110231 110379 111088 111470 111502 111759
+111768
 
 Version 1.4.2 (maintenance release)
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/dialogs/umlattributedialog.cpp #455197:455198
@@ -160,13 +160,18 @@
         return false;
     }
     m_pAttribute->setName(name);
+    Uml::Scope scope = Uml::Protected;
     if ( m_pPublicRB->isChecked() ) {
-        m_pAttribute->setScope(Uml::Public);
+        scope = Uml::Public;
     } else if ( m_pPrivateRB -> isChecked() ) {
-        m_pAttribute->setScope(Uml::Private);
-    } else {
-        m_pAttribute->setScope(Uml::Protected);
+        scope = Uml::Private;
     }
+    m_pAttribute->setScope(scope);
+    // Set the scope as the default in the option state
+    Settings::OptionState optionState = UMLApp::app()->getOptionState();
+    optionState.classState.defaultAttributeScope = scope;
+    UMLApp::app()->setOptionState(optionState);
+
     m_pAttribute->setInitialValue( m_pInitialLE->text() );
     m_pAttribute->setStereotype( m_pStereoTypeLE->text() );
     m_pAttribute->setStatic( m_pStaticCB->isChecked() );
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/uml.h #455197:455198
@@ -951,6 +951,9 @@
     Settings::OptionState getOptionState() {
         return m_optionState;
     }
+    void setOptionState(Settings::OptionState optstate) {
+        m_optionState = optstate;
+    }
 
 signals:
 
Comment 2 greatbunzinni 2005-08-30 23:40:02 UTC
wow that was quick! Thanks for the fix, Olivier!