Bug 140627 - Data manager Data Objects list unclear
Summary: Data manager Data Objects list unclear
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-25 23:06 UTC by Andrew Walker
Modified: 2007-05-22 20:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2007-01-25 23:06:58 UTC
Version:           HEAD (using KDE KDE 3.5.1)
OS:                Linux

PROBLEM:

The list of Data Objects in the data manager toolbox is unclear as the list is sorted alphabetically first by primitive objects and then by plugins. In other places in the UI these two types of object are explicitly distinguished between.

It would be better to have an additional entry in the toolbox giving only the primitive objects, or to at least add a seperator between the two groups.
Comment 1 Nicolas Brisset 2007-01-29 10:35:05 UTC
There has already been some discussion on the list:
http://mail.kde.org/pipermail/kst/2007-January/012667.html

The idea of dynamic categories was rather well received, Adam said he'd be looking into it. I am not aware of the status of his reflexion/implementation, though... In any case, let's not forget that users are not coders and have no idea what a primitive object is :-) The least we can do is provide user-friendly names.
Comment 2 Andrew Walker 2007-01-31 20:15:35 UTC
Agreed, the user should not care whether objects are primitive or not. But in this case primitive objects happen to correspond to objects that are going to be commonly used. Putting Curve in with Convolution does not really help the typical user.
Comment 3 Andrew Walker 2007-05-22 20:54:21 UTC
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);