[Kst] [Bug 140627] Data manager Data Objects list unclear
Andrew Walker
arwalker at sumusltd.com
Tue May 22 20:54:22 CEST 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=140627
arwalker sumusltd com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From arwalker sumusltd com 2007-05-22 20:54 -------
SVN commit 667413 by arwalker:
BUG:140627 Split the data object list into a data object list and a plugin list
M +24 -5 libkstapp/kstdatamanager_i.cpp
M +1 -0 libkstapp/kstdatamanager_i.h
M +1 -0 libkstmath/kstbasicplugin.h
M +5 -4 libkstmath/kstcplugin.cpp
M +1 -1 libkstmath/kstdataobject.h
--- branches/work/kst/1.5/kst/src/libkstapp/kstdatamanager_i.cpp #667412:667413
@ -633,6 +633,11 @
_data->setOrientation(Qt::Vertical);
_data->setBackgroundMode(PaletteBase);
+ _plugins = new QToolBar(i18n("Create Plugin"), main, this);
+ _plugins->setFrameStyle(QFrame::NoFrame);
+ _plugins->setOrientation(Qt::Vertical);
+ _plugins->setBackgroundMode(PaletteBase);
+
_fits = new QToolBar(i18n("Create Fit"), main, this);
_fits->setFrameStyle(QFrame::NoFrame);
_fits->setOrientation(Qt::Vertical);
@ -651,6 +656,9 @
_data->setUpdatesEnabled(false);
_data->clear();
+ _plugins->setUpdatesEnabled(false);
+ _plugins->clear();
+
_fits->setUpdatesEnabled(false);
_fits->clear();
@ -685,6 +693,10 @
datw->setBackgroundMode(PaletteBase);
_data->setStretchableWidget(datw);
+ QWidget *pluginw = new QWidget(_plugins);
+ pluginw->setBackgroundMode(PaletteBase);
+ _plugins->setStretchableWidget(pluginw);
+
QWidget *fitw = new QWidget(_fits);
fitw->setBackgroundMode(PaletteBase);
_fits->setStretchableWidget(fitw);
@ -697,11 +709,13 @
_primitive->setUpdatesEnabled(true);
_data->setUpdatesEnabled(true);
+ _plugins->setUpdatesEnabled(true);
_fits->setUpdatesEnabled(true);
_filters->setUpdatesEnabled(true);
ToolBox->addItem(_primitive, i18n("Create Primitive"));
ToolBox->addItem(_data, i18n("Create Data Object"));
+ ToolBox->addItem(_plugins, i18n("Create Plugin"));
ToolBox->addItem(_fits, i18n("Create Fit"));
ToolBox->addItem(_filters, i18n("Create Filter"));
}
@ -744,13 +758,17 @
for (; it != newPlugins.end(); ++it) {
KstDataObjectPtr ptr = KstDataObject::plugin(it.key());
- if (!ptr)
+ if (!ptr) {
continue;
+ }
switch(it.data()) {
case KstDataObject::Generic:
createObjectAction(it.key(), _data, ptr, SLOT(showNewDialog()));
break;
+ case KstDataObject::KstPlugin:
+ createObjectAction(it.key(), _plugins, ptr, SLOT(showNewDialog()));
+ break;
case KstDataObject::Primitive:
createObjectAction(it.key(), _primitive, ptr, SLOT(showNewDialog()));
break;
@ -779,12 +797,13 @
QStringList::ConstIterator it = oldPlugins.begin();
for (; it != oldPlugins.end(); ++it) {
if (KstSharedPtr<Plugin> p = PluginCollection::self()->plugin(readable[*it])) {
- if (p->data()._isFit)
+ if (p->data()._isFit) {
createObjectAction(*it, _fits, this, SLOT(showOldPlugin()));
- else if (p->data()._isFilter)
+ } else if (p->data()._isFilter) {
createObjectAction(*it, _filters, this, SLOT(showOldPlugin()));
- else
- createObjectAction(*it, _data, this, SLOT(showOldPlugin()));
+ } else {
+ createObjectAction(*it, _plugins, this, SLOT(showOldPlugin()));
+ }
}
}
}
--- branches/work/kst/1.5/kst/src/libkstapp/kstdatamanager_i.h #667412:667413
@ -74,6 +74,7 @
KstDoc *doc;
QToolBar *_primitive;
QToolBar *_data;
+ QToolBar *_plugins;
QToolBar *_fits;
QToolBar *_filters;
KListViewSearchLineWidget *_searchWidget;
--- branches/work/kst/1.5/kst/src/libkstmath/kstbasicplugin.h #667412:667413
@ -31,6 +31,7 @
//Operates on the inputVectors, inputScalars, and inputStrings
//to produce the outputVectors, outputScalars, and outputStrings.
virtual bool algorithm() = 0;
+ virtual Kind kind() const { return KstPlugin; }
//String lists of the names of the expected inputs.
virtual QStringList inputVectorList() const = 0;
--- branches/work/kst/1.5/kst/src/libkstmath/kstcplugin.cpp #667412:667413
@ -664,12 +664,13 @
KstDataObject::Kind KstCPlugin::kind() const {
- if (_plugin->data()._isFit)
+ if (_plugin->data()._isFit) {
return Fit;
- else if (_plugin->data()._isFilter)
+ } else if (_plugin->data()._isFilter) {
return Filter;
- else
- return Generic;
+ }
+
+ return KstPlugin;
}
--- branches/work/kst/1.5/kst/src/libkstmath/kstdataobject.h #667412:667413
@ -36,7 +36,7 @
Q_OBJECT
public:
- enum Kind { Generic, Primitive, Fit, Filter };
+ enum Kind { Generic, Primitive, KstPlugin, Fit, Filter };
KstDataObject();
KstDataObject(const QDomElement& e);
More information about the Kst
mailing list