[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Wed Dec 24 02:48:10 CET 2003


CVS commit by staikos: 

add filter to the menu, enhance the dcop interface (add some filter support)


  M +5 -0      kst.cpp   1.63
  M +2 -0      kst.h   1.28
  M +5 -0      kstiface.h   1.10
  M +59 -0     kstiface_impl.cpp   1.13
  M +4 -0      kstiface_impl.h   1.10
  M +1 -0      kstui.rc   1.12


--- kdeextragear-2/kst/kst/kst.cpp  #1.62:1.63
@@ -257,4 +257,9 @@ void KstApp::initActions() {
 
   /************/
+  FilterDialogAction = new KAction(i18n("Edit &Filters"), 0, 0,
+                                 this, SLOT(showFilterListEditor()),
+                                 actionCollection(), "filterdialog_action");
+
+  /************/
   PlotDialogAction = new KAction(i18n("Edit &Plots"), "kst_editplots", 0,
                                  this, SLOT(showPlotDialog()),

--- kdeextragear-2/kst/kst/kst.h  #1.27:1.28
@@ -328,4 +328,6 @@ private:
   KRadioAction *TextAction;
 
+  /* Filter Edit Action */
+  KAction *FilterDialogAction;
   /* Plot Edit Action */
   KAction *PlotDialogAction;

--- kdeextragear-2/kst/kst/kstiface.h  #1.9:1.10
@@ -36,4 +36,9 @@ k_dcop:
   virtual QStringList curveList() = 0;
   virtual QStringList plotList() = 0;
+  virtual QStringList pluginList() = 0;
+  virtual QStringList filterList() = 0;
+  virtual QStringList filterSetList() = 0;
+  virtual QStringList filterSetContents(const QString& filter) = 0;
+
 
   virtual QStringList inputVectors(const QString& objectName) = 0;

--- kdeextragear-2/kst/kst/kstiface_impl.cpp  #1.12:1.13
@@ -27,4 +27,6 @@
 #include "kstvcurve.h"
 #include "kstview.h"
+#include "plugincollection.h"
+
 #include <kprinter.h>
 #include <assert.h>
@@ -82,4 +84,61 @@ return KST::plotList.tagNames();
 
 
+QStringList KstIfaceImpl::pluginList() {
+  QStringList rc;
+  PluginCollection *pc = PluginCollection::self();
+  const QMap<QString,Plugin::Data>& pluginList = pc->pluginList();
+  QMap<QString,Plugin::Data>::ConstIterator it;
+
+  for (it = pluginList.begin(); it != pluginList.end(); ++it) {
+    if (it.data()._filter == false) {
+      rc += it.data()._name;
+    }
+  }
+
+  return rc;
+}
+
+
+QStringList KstIfaceImpl::filterList() {
+  QStringList rc;
+  PluginCollection *pc = PluginCollection::self();
+  const QMap<QString,Plugin::Data>& pluginList = pc->pluginList();
+  QMap<QString,Plugin::Data>::ConstIterator it;
+
+  for (it = pluginList.begin(); it != pluginList.end(); ++it) {
+    if (it.data()._filter) {
+      rc += it.data()._name;
+    }
+  }
+
+  return rc;
+}
+
+
+QStringList KstIfaceImpl::filterSetList() {
+  QStringList rc;
+
+  for (KstFilterSetList::Iterator it = KST::filterSetList.begin(); it != KST::filterSetList.end(); ++it) {
+    rc += (*it)->name();
+  }
+
+  return rc;
+}
+
+
+QStringList KstIfaceImpl::filterSetContents(const QString& filter) {
+  QStringList rc;
+
+  KstFilterSetPtr fs = KST::filterSetList.find(filter);
+  if (fs) {
+    for (KstFilterSet::Iterator it = fs->begin(); it != fs->end(); ++it) {
+      rc += (*it)->tagName();
+    }
+  }
+
+  return rc;
+}
+
+
 bool KstIfaceImpl::plotEquation(double start, double end, int numSamples, const QString& equation, const QString& plotName, const QColor& color) {
   KstPlot *plot = 0;

--- kdeextragear-2/kst/kst/kstiface_impl.h  #1.9:1.10
@@ -37,4 +37,8 @@ public:
         virtual QStringList curveList();
         virtual QStringList plotList();
+  virtual QStringList pluginList();
+  virtual QStringList filterList();
+  virtual QStringList filterSetList();
+  virtual QStringList filterSetContents(const QString& filter);
 
         virtual bool plotEquation(const QString& xvector, const QString& equation, const QString& plotName, const QColor& color);

--- kdeextragear-2/kst/kst/kstui.rc  #1.11:1.12
@@ -21,4 +21,5 @@
     <Action name="psddialog_action"/>
     <Action name="plugindialog_action"/>
+    <Action name="filterdialog_action"/>
     <Separator/>
     <Action name="quickcurvesdialog_action"/>





More information about the Kst mailing list