[Kst] branches/work/kst/1.5/kst/src/libkstapp
Andrew Walker
arwalker at sumusltd.com
Fri Jul 27 22:31:48 CEST 2007
SVN commit 693376 by arwalker:
correctly set output type and window function in multiple edit mode for PSDs
M +21 -12 kstpsddialog_i.cpp
--- branches/work/kst/1.5/kst/src/libkstapp/kstpsddialog_i.cpp #693375:693376
@@ -61,7 +61,7 @@
_w = new PSDDialogWidget(_contents);
setMultiple(true);
connect(_w->_vector, SIGNAL(newVectorCreated(const QString&)), this, SIGNAL(modified()));
-
+
//for multiple edit mode
connect(_w->_kstFFTOptions->Apodize, SIGNAL(clicked()), this, SLOT(setApodizeDirty()));
connect(_w->_kstFFTOptions->RemoveMean, SIGNAL(clicked()), this, SLOT(setRemoveMeanDirty()));
@@ -303,11 +303,15 @@
}
if (_apodizeFxnDirty) {
- psPtr->setApodizeFxn(ApodizeFunction(_w->_kstFFTOptions->ApodizeFxn->currentItem()));
+ if (_editMultipleMode) {
+ psPtr->setApodizeFxn(ApodizeFunction(_w->_kstFFTOptions->ApodizeFxn->currentItem()-1));
+ } else {
+ psPtr->setApodizeFxn(ApodizeFunction(_w->_kstFFTOptions->ApodizeFxn->currentItem()));
+ }
}
if (_gaussianSigmaDirty) {
- psPtr->setGaussianSigma(_editMultipleMode ? _w->_kstFFTOptions->Sigma->value() - 1 :
+ psPtr->setGaussianSigma(_editMultipleMode ? _w->_kstFFTOptions->Sigma->value() - 1 :
_w->_kstFFTOptions->Sigma->value());
}
@@ -320,7 +324,11 @@
}
if (_outputDirty) {
- psPtr->setOutput(PSDType(_w->_kstFFTOptions->Output->currentItem()));
+ if (_editMultipleMode) {
+ psPtr->setOutput(PSDType(_w->_kstFFTOptions->Output->currentItem()-1));
+ } else {
+ psPtr->setOutput(PSDType(_w->_kstFFTOptions->Output->currentItem()));
+ }
}
if (_interpolateHolesDirty) {
@@ -344,14 +352,15 @@
bool KstPsdDialogI::editObject() {
// if the user selected no vector, treat it as non-dirty
_vectorDirty = _w->_vector->_vector->currentItem() != 0;
- _apodizeDirty = _w->_kstFFTOptions->ApodizeFxn->currentItem() != 0;
+ _apodizeDirty = _w->_kstFFTOptions->Apodize->state() != QButton::NoChange;
+ _apodizeFxnDirty = _w->_kstFFTOptions->ApodizeFxn->currentItem() != 0;
_fFTLenDirty = _w->_kstFFTOptions->FFTLen->text() != " ";
_sampRateDirty = !_w->_kstFFTOptions->SampRate->text().isEmpty();
_vectorUnitsDirty = !_w->_kstFFTOptions->VectorUnits->text().isEmpty();
_rateUnitsDirty = !_w->_kstFFTOptions->RateUnits->text().isEmpty();
- _outputDirty = !_w->_kstFFTOptions->Output->currentItem() != 0;
+ _outputDirty = _w->_kstFFTOptions->Output->currentItem() != 0;
KstPSDList psList = kstObjectSubList<KstDataObject,KstPSD>(KST::dataObjectList);
-
+
// if editing multiple objects, edit each one
if (_editMultipleMode) {
bool didEdit = false;
@@ -362,9 +371,9 @@
if (psIter == psList.end()) {
return false;
}
-
+
KstPSDPtr psPtr = *psIter;
-
+
if (!editSingleObject(psPtr)) {
return false;
}
@@ -383,11 +392,11 @@
_tagName->setFocus();
return false;
}
-
+
pp->writeLock();
pp->setTagName(KstObjectTag(tag_name, pp->tag().context())); // FIXME: doesn't allow changing tag context
pp->unlock();
-
+
// then edit the object
_vectorDirty = true;
_apodizeDirty = true;
@@ -434,7 +443,7 @@
_w->_kstFFTOptions->Sigma->setValue(_w->_kstFFTOptions->Sigma->minValue());
_w->_kstFFTOptions->Output->insertItem("", 0);
_w->_kstFFTOptions->Output->setCurrentItem(0);
-
+
_tagName->setText("");
_tagName->setEnabled(false);
More information about the Kst
mailing list