[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Thu Oct 2 09:14:38 CEST 2003
CVS commit by staikos:
fix datamanager button synchronization
M +10 -2 kstdatamanager_i.cpp 1.34
M +1 -0 kstdatamanager_i.h 1.11
--- kdeextragear-2/kst/kst/kstdatamanager_i.cpp #1.33:1.34
@@ -161,4 +161,8 @@ void KstObjectItem::update(bool recursiv
void KstObjectItem::activate() {
+ updateButtons();
+}
+
+void KstObjectItem::updateButtons() {
_dm->Edit->setEnabled(RTTI_OBJ_VECTOR != _rtti);
_dm->Delete->setEnabled(_removable);
@@ -282,6 +286,10 @@ QPtrStack<QListViewItem> trash;
}
- Edit->setEnabled(DataView->currentItem() != 0L);
- Delete->setEnabled(DataView->currentItem() != 0L);
+ if (DataView->selectedItem()) {
+ static_cast<KstObjectItem*>(DataView->currentItem())->updateButtons();
+ } else {
+ Edit->setEnabled(false);
+ Delete->setEnabled(false);
+ }
}
--- kdeextragear-2/kst/kst/kstdatamanager_i.h #1.10:1.11
@@ -66,4 +66,5 @@ class KstObjectItem : public QObject, pu
KstDataObjectPtr dataObject() { return *KST::dataObjectList.findTag(_name); }
bool removable() const { return _removable; }
+ void updateButtons();
protected:
More information about the Kst
mailing list