[Uml-devel] KDE/kdesdk/umbrello/umbrello/dialogs

Sharan Rao sharanrao at gmail.com
Fri Nov 28 08:16:03 UTC 2008


SVN commit 889981 by sharan:

When changing the focus in the attribute list in the class properties
dialog box, the description was not changing as the  signal-slot
connection was only for mouse clicks. 

Fixed that bug, and changed the name of the slot to a more generic name.


 M  +9 -10     classifierlistpage.cpp  
 M  +4 -4      classifierlistpage.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classifierlistpage.cpp #889980:889981
@@ -63,7 +63,7 @@
     enableWidgets(false);//disable widgets until an att is chosen
     m_pOldListItem = 0;
 
-    connect(m_pItemListLB, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(slotClicked(QListWidgetItem*)));
+    connect(m_pItemListLB, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(slotActivateItem(QListWidgetItem*)));
     connect(m_pItemListLB, SIGNAL(itemDoubleClicked( QListWidgetItem*)), this, SLOT(slotDoubleClick(QListWidgetItem*)));
     connect(m_pItemListLB, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(slotRightButtonPressed(const QPoint&)));
 
@@ -257,7 +257,7 @@
     m_pPropertiesButton->setEnabled(true);
 }
 
-void ClassifierListPage::slotClicked(QListWidgetItem* item)
+void ClassifierListPage::slotActivateItem(QListWidgetItem* item)
 {
     //if not first time an item is highlighted
     //save old highlighted item first
@@ -310,7 +310,7 @@
 {
     saveCurrentItemDocumentation();
     QListWidgetItem* i = m_pItemListLB->currentItem();
-    slotClicked(i);
+    slotActivateItem(i);
 }
 
 void ClassifierListPage::slotListItemCreated(UMLObject* object)
@@ -331,7 +331,7 @@
     // now select the new item, so that the user can go on adding doc or calling
     // the property dialog
     m_pItemListLB->setCurrentRow(index);
-    slotClicked(m_pItemListLB->item(index));
+    slotActivateItem(m_pItemListLB->item(index));
     connect( object, SIGNAL( modified() ), this, SLOT( slotListItemModified() ) );
 }
 
@@ -482,7 +482,7 @@
     uDebug() << currentAtt->getName() << ": peer index in UMLCanvasItem::m_List is " << index;
     addClassifier(currentAtt, 0);
     printItemList("itemList after change: ");
-    slotClicked(item);
+    slotActivateItem(item);
 }
 
 void ClassifierListPage::slotUpClicked()
@@ -516,7 +516,7 @@
         index = 0;
     addClassifier(currentAtt, index);
     printItemList("itemList after change: ");
-    slotClicked(item);
+    slotActivateItem(item);
 }
 
 void ClassifierListPage::slotDownClicked()
@@ -549,7 +549,7 @@
         index++;   // because we want to go _after_ the following peer item
     addClassifier(currentAtt, index);
     printItemList("itemList after change: ");
-    slotClicked(item);
+    slotActivateItem(item);
 }
 
 void ClassifierListPage::slotBottomClicked()
@@ -580,7 +580,7 @@
     uDebug() << currentAtt->getName() << ": peer index in UMLCanvasItem::m_List is " << index;
     addClassifier(currentAtt, getItemList().count());
     printItemList("itemList after change: ");
-    slotClicked(item);
+    slotActivateItem(item);
 }
 
 void ClassifierListPage::slotDoubleClick( QListWidgetItem* item )
@@ -616,7 +616,7 @@
     m_pDoc->removeUMLObject(selectedItem);
     m_pItemListLB->takeItem( m_pItemListLB->currentRow());
     m_pOldListItem = 0;
-    slotClicked(NULL);
+    slotActivateItem(NULL);
 }
 
 void ClassifierListPage::slotProperties()
@@ -742,6 +742,5 @@
     m_pBottomArrowB->setVisible(state) ;
 }
 
-
 #include "classifierlistpage.moc"
 
--- trunk/KDE/kdesdk/umbrello/umbrello/dialogs/classifierlistpage.h #889980:889981
@@ -190,7 +190,7 @@
     virtual int relativeIndexOf(QListWidgetItem* item) {
         return m_pItemListLB->row(item);
     }
-
+    
     Uml::Object_Type m_itemType;
     UMLClassifier* m_pClassifier;
     UMLClassifierListItem* m_pLastObjectCreated;
@@ -201,13 +201,13 @@
 
     bool m_bSigWaiting;
 
-public slots:
+protected slots:
 
     /**
-     * Called when list view is clicked on
+     * Called whenever the list item needs to be activated
      * calls enableWidgets().
      */
-    void slotClicked(QListWidgetItem* item);
+    void slotActivateItem(QListWidgetItem* item);
 
     /**
      * Called when an item is selected in a right click menu.




More information about the umbrello-devel mailing list