[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Fri May 16 05:07:18 CEST 2003
CVS commit by staikos:
more plugin work. starting to integrate them into the app.
Using KSharedPtr<> instead of homebrew ref counting.
A kstplugin.cpp 1.1
A kstplugin.h 1.1
A kstpluginlist.cpp 1.1
A kstpluginlist.h 1.1
M +2 -0 Makefile.am 1.15
M +4 -0 kstdoc.h 1.7
M +4 -4 kstequationcurvelist.cpp 1.2
M +19 -11 kstplugindialog_i.cpp 1.9
M +1 -2 kstplugindialog_i.h 1.5
--- kdeextragear-2/kst/kst/Makefile.am #1.14:1.15
@@ -20,4 +20,6 @@
kst_SOURCES = \
+ kstplugin.cpp \
+ kstpluginlist.cpp \
kstplugindialog_i.cpp \
plugin.cpp \
--- kdeextragear-2/kst/kst/kstdoc.h #1.6:1.7
@@ -34,4 +34,5 @@
#include "kstvcurvelist.h"
#include "kstplotlist.h"
+#include "kstpluginlist.h"
//#include "kstplotdialog_i.h"
@@ -119,4 +120,7 @@ public:
/** The list of Scalars which have been generated */
KstScalarList scalarList;
+
+ /** The list of plugins which are in use */
+ KstPluginList pluginList;
KApplication *app;
--- kdeextragear-2/kst/kst/kstequationcurvelist.cpp #1.1.1.1:1.2
@@ -40,9 +39,10 @@ KstEquationCurve* KstEquationCurveList::
KstEquationCurve *tmp;
- for (tmp = first(); tmp!=0; tmp=next()) {
+ for (tmp = first(); tmp != 0; tmp = next()) {
if (tag == tmp->tagName()) {
- return (tmp);
+ return tmp;
}
}
- return((KstEquationCurve*)0);
+ return 0L;
}
+
--- kdeextragear-2/kst/kst/kstplugindialog_i.cpp #1.8:1.9
@@ -51,10 +51,4 @@ KstPluginDialogI::~KstPluginDialogI() {
}
-void KstPluginDialogI::show_I() {
- update();
- updatePluginList();
- show();
- raise();
-}
void KstPluginDialogI::show_I(const QString &field) {
@@ -62,9 +56,11 @@ void KstPluginDialogI::show_I(const QStr
unsigned i;
-// for (i = 0; i < doc->pluginList.countV(); i++) {
-// if (doc->pluginList.atV(i)->tagName() == field) {
-// new_index = i;
-// }
-// }
+ if (field != QString::null) {
+ for (i = 0; i < doc->pluginList.count(); i++) {
+ if (doc->pluginList.at(i)->tagName() == field) {
+ new_index = i;
+ }
+ }
+ }
update(new_index);
@@ -110,4 +106,16 @@ void KstPluginDialogI::show_New() {
void KstPluginDialogI::update(int new_index) {
+ // fill the Select combo with curve tags
+ Select->clear();
+ for (int i = 0; i < doc->pluginList.count(); i++) {
+ Select->insertItem(doc->pluginList.at(i)->tagName());
+ }
+
+ if (new_index == -1) {
+ Select->insertItem(i18n("<P%1-New_Plugin>").arg(doc->pluginList.count()+1));
+ } else if (new_index >= 0 && new_index < Select->count()) {
+ Select->setCurrentItem(new_index);
+ }
+
_pluginFrame->resize(_pluginFrame->minimumSizeHint());
resize(minimumSizeHint());
--- kdeextragear-2/kst/kst/kstplugindialog_i.h #1.4:1.5
@@ -20,6 +20,5 @@ public slots:
/** Calls update(), then shows/raises the dialog */
- void show_I();
- void show_I(const QString &field);
+ void show_I(const QString &field = QString::null);
void show_New();
More information about the Kst
mailing list