[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Fri Jan 21 20:26:49 CET 2005
CVS commit by staikos:
only allow editting of RVectors
M +7 -7 vectorselector.ui 1.10
M +10 -7 vectorselector.ui.h 1.11
--- kdeextragear-2/kst/kst/vectorselector.ui #1.9:1.10
@@ -93,10 +93,4 @@
<connections>
<connection>
- <sender>VectorSelector</sender>
- <signal>selectionChanged(const QString&)</signal>
- <receiver>VectorSelector</receiver>
- <slot>selectionWatcher(const QString&)</slot>
- </connection>
- <connection>
<sender>_newVector</sender>
<signal>clicked()</signal>
@@ -110,4 +104,10 @@
<slot>editVector()</slot>
</connection>
+ <connection>
+ <sender>VectorSelector</sender>
+ <signal>selectionChanged(const QString&)</signal>
+ <receiver>VectorSelector</receiver>
+ <slot>selectionWatcher(const QString&)</slot>
+ </connection>
</connections>
<includes>
@@ -124,5 +124,5 @@
<signal>newVectorCreated(const QString&)</signal>
<signal>selectionChanged(const QString&)</signal>
- <signal>selectionChangedLabel(const QString& label)</signal>
+ <signal>selectionChangedLabel(const QString&)</signal>
</signals>
<slots>
--- kdeextragear-2/kst/kst/vectorselector.ui.h #1.10:1.11
@@ -53,9 +53,8 @@ void VectorSelector::update()
}
blockSignals(false);
- if (KST::vectorList.count()>0) {
- _editVector->setEnabled(true);
- } else {
- _editVector->setEnabled(false);
- }
+ KST::vectorList.lock().readLock();
+ KstRVectorPtr rvp = kst_cast<KstRVector>(*KST::vectorList.findTag(_vector->currentText()));
+ KST::vectorList.lock().readUnlock();
+ _editVector->setEnabled(rvp);
}
@@ -65,5 +64,5 @@ void VectorSelector::init()
_provideNoneVector = false;
update();
- connect(_vector, SIGNAL(activated(const QString&)), this, SIGNAL(selectionChanged(const QString&)));
+ connect(_vector, SIGNAL(activated(const QString&)), this, SIGNAL(selectionChanged(const QString&))); // annoying that signal->signal doesn't seem to work in .ui files
}
@@ -83,6 +82,10 @@ void VectorSelector::createNewVector()
void VectorSelector::selectionWatcher( const QString & tag )
{
- QString label = "["+tag+"]";
+ QString label = "[" + tag + "]";
emit selectionChangedLabel(label);
+ KST::vectorList.lock().readLock();
+ KstRVectorPtr rvp = kst_cast<KstRVector>(*KST::vectorList.findTag(tag));
+ KST::vectorList.lock().readUnlock();
+ _editVector->setEnabled(rvp);
}
More information about the Kst
mailing list