[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Thu Aug 19 19:06:37 CEST 2004
CVS commit by arwalker:
Add the concept of default values for input scalars. At present these always get set to zero, which is sometimes an invalid value.
M +4 -0 kstfilterdialog_i.cpp 1.13
M +4 -0 kstfitdialog_i.cpp 1.37
M +4 -0 kstplugindialog_i.cpp 1.87
M +1 -0 plugin.h 1.26
M +2 -0 pluginxmlparser.cpp 1.24
--- kdeextragear-2/kst/kst/kstfilterdialog_i.cpp #1.12:1.13
@@ -468,4 +468,8 @@ void KstFilterDialogI::generateEntries(c
connect(w->_scalar, SIGNAL(activated(const QString&)), this, SLOT(updateScalarTooltip(const QString&)));
connect(widget, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
+ if (!(*it)._default.isEmpty()) {
+ w->_scalar->insertItem((*it)._default);
+ w->_scalar->setCurrentText((*it)._default);
+ }
KstScalarPtr p = *KST::scalarList.findTag(w->_scalar->currentText());
w->allowDirectEntry( true );
--- kdeextragear-2/kst/kst/kstfitdialog_i.cpp #1.36:1.37
@@ -515,4 +515,8 @@ void KstFitDialogI::generateEntries(bool
connect(w->_scalar, SIGNAL(activated(const QString&)), this, SLOT(updateScalarTooltip(const QString&)));
connect(widget, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
+ if (!(*it)._default.isEmpty()) {
+ w->_scalar->insertItem((*it)._default);
+ w->_scalar->setCurrentText((*it)._default);
+ }
KstScalarPtr p = *KST::scalarList.findTag(w->_scalar->currentText());
w->allowDirectEntry( true );
--- kdeextragear-2/kst/kst/kstplugindialog_i.cpp #1.86:1.87
@@ -546,4 +546,8 @@ QString scalarLabelTemplate, vectorLabel
connect(w->_scalar, SIGNAL(activated(const QString&)), this, SLOT(updateScalarTooltip(const QString&)));
connect(widget, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
+ if (!(*it)._default.isEmpty()) {
+ w->_scalar->insertItem((*it)._default);
+ w->_scalar->setCurrentText((*it)._default);
+ }
KstScalarPtr p = *KST::scalarList.findTag(w->_scalar->currentText());
w->allowDirectEntry( true );
--- kdeextragear-2/kst/kst/plugin.h #1.25:1.26
@@ -85,4 +85,5 @@ public:
ValueSubType _subType;
QString _description;
+ QString _default;
};
--- kdeextragear-2/kst/kst/pluginxmlparser.cpp #1.23:1.24
@@ -69,4 +69,5 @@ static const QString QS_weighted = QStri
static const QString QS_description = QString::fromLatin1("description");
static const QString QS_descr = QString::fromLatin1("descr");
+static const QString QS_default = QString::fromLatin1("default");
static const QString QS_version = QString::fromLatin1("version");
static const QString QS_state = QString::fromLatin1("state");
@@ -322,4 +323,5 @@ QDomNode n = element.firstChild();
iov._name = e.attribute(QS_name);
iov._description = e.attribute(QS_descr);
+ iov._default = e.attribute(QS_default);
QString subtype = e.attribute(QS_type).lower();
if (subtype == QS_float) {
More information about the Kst
mailing list