[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Fri Oct 24 01:31:59 CEST 2003
CVS commit by staikos:
Implement auto completion immediately.
CCMAIL: 64893-done at bugs.kde.org
M +30 -12 kstquickcurvesdialog_i.cpp 1.26
M +2 -2 kstquickcurvesdialog_i.h 1.11
--- kdeextragear-2/kst/kst/kstquickcurvesdialog_i.cpp #1.25:1.26
@@ -24,4 +24,5 @@
#include <qspinbox.h>
#include <qlabel.h>
+#include <kdebug.h>
#include <kfiledialog.h>
#include <klocale.h>
@@ -49,4 +50,6 @@ KstQuickCurvesDialogI::KstQuickCurvesDia
| KFile::LocalOnly);
+ connect(FileName, SIGNAL(textChanged(const QString&)), this, SLOT(updateCompletion()));
+
_xaxisCompletion = XAxis->completionObject();
XAxis->setAutoDeleteCompletionObject(true);
@@ -65,4 +68,30 @@ void KstQuickCurvesDialogI::showQuickCur
+void KstQuickCurvesDialogI::updateCompletion() {
+ /* put INDEX as a default in the X axis list */
+ XAxis->clear();
+ YAxis->clear();
+
+ /* update filename list and fill axes combo boxes */
+ KstDataSourcePtr ds = *KST::dataSourceList.findFileName(FileName->url());
+ if (!ds) {
+ ds = KstDataSource::loadSource(FileName->url());
+ if (ds) { // FIXME we should eventually make KstDataSource::loadFieldList()
+ KST::dataSourceList.append(ds);
+ }
+ }
+
+ if (ds) {
+ XAxis->insertStringList(ds->fieldList());
+ _xaxisCompletion->insertItems(ds->fieldList());
+ YAxis->insertStringList(ds->fieldList());
+ _yaxisCompletion->insertItems(ds->fieldList());
+ }
+
+ XAxis->setCurrentText("INDEX");
+ YAxis->setCurrentText(QString::null);
+}
+
+
void KstQuickCurvesDialogI::update() {
unsigned int i;
@@ -72,20 +101,9 @@ void KstQuickCurvesDialogI::update() {
KstVCurveList curves = kstObjectSubList<KstDataObject, KstVCurve>(KST::dataObjectList);
- /* put INDEX as a default in the X axis list */
- XAxis->clear();
- YAxis->clear();
-
- /* update filename list and fill axes combo boxes */
j = KST::dataSourceList.count() - 1;
if (j >= 0) {
FileName->setURL(KST::dataSourceList[j]->fileName());
- XAxis->insertStringList(KST::dataSourceList[j]->fieldList());
- _xaxisCompletion->insertItems(KST::dataSourceList[j]->fieldList());
- YAxis->insertStringList(KST::dataSourceList[j]->fieldList());
- _yaxisCompletion->insertItems(KST::dataSourceList[j]->fieldList());
}
-
- XAxis->setCurrentText("INDEX");
- YAxis->setCurrentText(QString::null);
+ updateCompletion();
KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
--- kdeextragear-2/kst/kst/kstquickcurvesdialog_i.h #1.10:1.11
@@ -43,6 +43,6 @@ public slots:
bool addPlot();
private slots:
- bool apply(bool autolabel);
- void apply() { apply(false); }
+ bool apply(bool autolabel = false);
+ void updateCompletion();
signals:
More information about the Kst
mailing list