Bug 111502 - Select Operation Dialog in Sequence Diagram does not preselect current operation
Summary: Select Operation Dialog in Sequence Diagram does not preselect current operation
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-25 18:43 UTC by Peter Soetens
Modified: 2005-08-27 21:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
PATCH Sets current operation selected in Combo Box (1.82 KB, patch)
2005-08-25 18:47 UTC, Peter Soetens
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Soetens 2005-08-25 18:43:11 UTC
Version:           kde-3.5 (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.3 
OS:                Linux

If you open this dialog and wish to change the sequence number,
you also need to reset the operation correctly, since it was 
cleared to the first operation of the class.
Comment 1 Peter Soetens 2005-08-25 18:47:27 UTC
Created attachment 12371 [details]
PATCH Sets current operation selected in Combo Box

Adding a small function to the selectopdlg.h/cpp files, and invoking
it from floatingtext.cpp solves this bug.
Comment 2 Oliver Kellogg 2005-08-27 21:18:07 UTC
SVN commit 454033 by okellogg:

BUG:111502 - From peter.soetens mech kuleuven ac be  2005-08-25 18:47
> Created an attachment (id=12371)
>  --> (http://bugs.kde.org/attachment.cgi?id=12371&action=view)
>  PATCH Sets current operation selected in Combo Box
>  Adding a small function to the selectopdlg.h/cpp files, and invoking
>  it from floatingtext.cpp solves this bug.



 M  +1 -1      ChangeLog  
 M  +13 -0     umbrello/dialogs/selectopdlg.cpp  
 M  +7 -0      umbrello/dialogs/selectopdlg.h  
 M  +4 -1      umbrello/floatingtext.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #454032:454033
@@ -10,7 +10,7 @@
 
 * Bugs fixed / wishes implemented (see http://bugs.kde.org)
  57588  58809  67719  72016  79433  87252  88117  97162 105564 108223
-109591 109636 110216 110231 110379 111470
+109591 109636 110216 110231 110379 111470 111502
 
 Version 1.4.2 (maintenance release)
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/dialogs/selectopdlg.cpp #454032:454033
@@ -110,6 +110,19 @@
     }
 }
 
+bool SelectOpDlg::setClassOp(const QString &op) {
+    for (int i = 1; i!= m_pOpCB->count(); ++i)
+    {
+        if ( m_pOpCB->text(i) == op ) {
+            m_pOpCB->setCurrentItem(i);
+            m_pCustomRB -> setChecked(false);
+            slotSelected(OP);
+            return true;
+        }
+    }
+    return false;
+}
+
 QString SelectOpDlg::getSeqNumber() {
     return m_pSeqLE->text();
 }
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/dialogs/selectopdlg.h #454032:454033
@@ -83,6 +83,13 @@
      *	@param op The operation to set as the custom operation.
      */
     void setCustomOp(const QString &op);
+    /**
+     * Set the class operation text.
+     *
+     *	@param op The operation to set as the class operation.
+     * @return false if no such operation exists.
+     */
+    bool setClassOp(const QString &op);
 private:
     QGroupBox * m_pOpGB;
     QComboBox *	m_pOpCB;
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/floatingtext.cpp #454032:454033
@@ -260,8 +260,11 @@
 
     SelectOpDlg selectDlg(m_pView, c);
     selectDlg.setSeqNumber( seqNum );
-    if (m_pLink->getOperation() == NULL)
+    if (m_pLink->getOperation() == NULL) {
         selectDlg.setCustomOp( opText );
+    } else {
+        selectDlg.setClassOp( opText );
+    }
     int result = selectDlg.exec();
     if(!result) {
         return;