[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Wed Nov 23 20:00:36 CET 2005
SVN commit 482669 by staikos:
- data wizard time conversions were backward
- enable/disable the units along with the input
- disable absolute time for range
M +0 -2 datarangewidget.ui
M +18 -23 datarangewidget.ui.h
M +3 -5 datawizard.ui.h
M +0 -4 kstchangenptsdialog_i.cpp
M +0 -16 kstvectordialog_i.cpp
--- trunk/extragear/graphics/kst/kst/datarangewidget.ui #482668:482669
@@ -317,11 +317,9 @@
<function returnType="double">f0Value()</function>
<function returnType="double">nValue()</function>
<function returnType="ExtDateTime">f0DateTimeValue()</function>
- <function returnType="ExtDateTime">nDateTimeValue()</function>
<function specifier="non virtual" returnType="bool">isStartRelativeTime()</function>
<function specifier="non virtual" returnType="bool">isStartAbsoluteTime()</function>
<function specifier="non virtual" returnType="bool">isRangeRelativeTime()</function>
- <function specifier="non virtual" returnType="bool">isRangeAbsoluteTime()</function>
</functions>
<exportmacro>KST_EXPORT</exportmacro>
<layoutdefaults spacing="6" margin="11"/>
--- trunk/extragear/graphics/kst/kst/datarangewidget.ui.h #482668:482669
@@ -18,10 +18,13 @@
{
if (CountFromEnd->isChecked()) {
N->setEnabled(true);
+ _rangeUnits->setEnabled(true);
F0->setEnabled(false);
+ _startUnits->setEnabled(false);
ReadToEnd->setChecked(false);
} else {
F0->setEnabled(true);
+ _startUnits->setEnabled(true);
}
}
@@ -29,10 +32,13 @@
{
if (ReadToEnd->isChecked()) {
F0->setEnabled(true);
+ _startUnits->setEnabled(true);
N->setEnabled(false);
+ _rangeUnits->setEnabled(false);
CountFromEnd->setChecked(false);
} else {
N->setEnabled(true);
+ _rangeUnits->setEnabled(true);
}
}
@@ -58,14 +64,20 @@
if (CountFromEnd->isChecked()) {
N->setEnabled(true);
+ _rangeUnits->setEnabled(true);
F0->setEnabled(false);
+ _startUnits->setEnabled(false);
ReadToEnd->setChecked(false);
} else if (ReadToEnd->isChecked()) {
F0->setEnabled(true);
+ _startUnits->setEnabled(true);
N->setEnabled(false);
+ _rangeUnits->setEnabled(false);
} else {
N->setEnabled(true);
+ _rangeUnits->setEnabled(true);
F0->setEnabled(true);
+ _startUnits->setEnabled(true);
}
}
@@ -96,7 +108,9 @@
if (_time) {
for (int i = 1; KST::timeDefinitions[i].name; ++i) {
_startUnits->insertItem(i18n(KST::timeDefinitions[i].name, KST::timeDefinitions[i].description));
- _rangeUnits->insertItem(i18n(KST::timeDefinitions[i].name, KST::timeDefinitions[i].description));
+ if (i != KST::dateTimeEntry) {
+ _rangeUnits->insertItem(i18n(KST::timeDefinitions[i].name, KST::timeDefinitions[i].description));
+ }
}
}
}
@@ -132,13 +146,9 @@
double KstDataRange::nValue()
{
- const int cur = _rangeUnits->currentItem();
- if (cur == KST::dateTimeEntry) {
- ExtDateTime edt = KST::parsePlanckDate(N->text());
- if (edt.isNull()) {
- return KST::NOPOINT;
- }
- return KST::extDateTimeToMilliseconds(edt);
+ int cur = _rangeUnits->currentItem();
+ if (cur >= KST::dateTimeEntry) {
+ --cur; // we don't allow "date"
}
return ::d2i(interpret(N->text().latin1()) * KST::timeDefinitions[cur].factor);
}
@@ -153,16 +163,6 @@
return edt;
}
-ExtDateTime KstDataRange::nDateTimeValue()
-{
- const int cur = _rangeUnits->currentItem();
- ExtDateTime edt;
- if (cur == KST::dateTimeEntry) {
- edt = KST::parsePlanckDate(N->text());
- }
- return edt;
-}
-
bool KstDataRange::isStartRelativeTime()
{
return _startUnits->currentItem() > KST::dateTimeEntry;
@@ -178,9 +178,4 @@
return _rangeUnits->currentItem() > KST::dateTimeEntry;
}
-bool KstDataRange::isRangeAbsoluteTime()
-{
- return _rangeUnits->currentItem() == KST::dateTimeEntry;
-}
-
// vim: ts=8 sw=4 noet
--- trunk/extragear/graphics/kst/kst/datawizard.ui.h #482668:482669
@@ -493,16 +493,14 @@
ds->writeLock();
int f0Value, nValue;
if (_kstDataRange->isStartAbsoluteTime()) {
- f0Value = ds->sampleForTime(_kstDataRange->f0Value());
- } else if (_kstDataRange->isStartRelativeTime()) {
f0Value = ds->sampleForTime(_kstDataRange->f0DateTimeValue());
+ } else if (_kstDataRange->isStartRelativeTime()) {
+ f0Value = ds->sampleForTime(_kstDataRange->f0Value());
} else {
f0Value = int(_kstDataRange->f0Value());
}
- if (_kstDataRange->isRangeAbsoluteTime()) {
+ if (_kstDataRange->isRangeRelativeTime()) {
nValue = ds->sampleForTime(_kstDataRange->nValue());
- } else if (_kstDataRange->isRangeRelativeTime()) {
- nValue = ds->sampleForTime(_kstDataRange->nDateTimeValue());
} else {
nValue = int(_kstDataRange->nValue());
}
--- trunk/extragear/graphics/kst/kst/kstchangenptsdialog_i.cpp #482668:482669
@@ -110,10 +110,6 @@
vector->dataSource()->readLock();
n = vector->dataSource()->sampleForTime(_kstDataRange->nValue());
vector->dataSource()->readUnlock();
- } else if (_kstDataRange->isRangeAbsoluteTime() && vector->dataSource()) {
- vector->dataSource()->readLock();
- n = vector->dataSource()->sampleForTime(_kstDataRange->nDateTimeValue());
- vector->dataSource()->readUnlock();
} else {
n = int(_kstDataRange->nValue());
}
--- trunk/extragear/graphics/kst/kst/kstvectordialog_i.cpp #482668:482669
@@ -365,14 +365,6 @@
if (_w->_kstDataRange->isRangeRelativeTime()) {
n = file->sampleForTime(_w->_kstDataRange->nValue());
- } else if (_w->_kstDataRange->isRangeAbsoluteTime()) {
- bool ok = false;
- n = file->sampleForTime(_w->_kstDataRange->nDateTimeValue(), &ok);
- if (!ok) {
- file->readUnlock();
- KMessageBox::sorry(this, i18n("The requested field or file could not use the specified date."));
- return false;
- }
} else {
n = int(_w->_kstDataRange->nValue());
}
@@ -517,14 +509,6 @@
if (_nDirty) {
if (_w->_kstDataRange->isRangeRelativeTime()) {
n = file->sampleForTime(_w->_kstDataRange->nValue());
- } else if (_w->_kstDataRange->isRangeAbsoluteTime()) {
- bool ok = false;
- n = file->sampleForTime(_w->_kstDataRange->nDateTimeValue(), &ok);
- if (!ok) {
- file->writeUnlock();
- KMessageBox::sorry(this, i18n("The requested field or file could not use the specified date."));
- return false;
- }
} else {
n = int(_w->_kstDataRange->nValue());
}
More information about the Kst
mailing list