[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Tue Jan 27 23:51:10 CET 2004


CVS commit by staikos: 

display arguments in the listbox to make it easier to work with


  M +18 -1     filterintermediate.h   1.3
  M +4 -1      filterlisteditor.ui.h   1.18
  M +1 -0      variableeditor.cpp   1.3


--- kdeextragear-2/kst/kst/filterintermediate.h  #1.2:1.3
@@ -26,8 +26,25 @@
 class FilterListBoxItem : public QListBoxText {
   public:
-    FilterListBoxItem(QListBox *p, const QString& filter) : QListBoxText(p, filter) {}
+    FilterListBoxItem(QListBox *p, const QString& filter) : QListBoxText(p, filter), _filter(filter) {}
     virtual ~FilterListBoxItem() {}
 
+    void updateText() {
+      QString txt = _filter + "(";
+      for (KstScalarMap::ConstIterator it = arguments.begin(); it != arguments.end(); ++it) {
+        if (it != arguments.begin()) {
+          txt += ", ";
+        }
+        if (it.data()->isGlobal()) {
+          txt += it.data()->tagName();
+        } else {
+          txt += QString::number(it.data()->value());
+        }
+      }
+      txt += ")";
+      setText(txt);
+    }
+
     KstScalarMap arguments;
+    QString _filter;
 };
 

--- kdeextragear-2/kst/kst/filterlisteditor.ui.h  #1.17:1.18
@@ -61,4 +61,5 @@ void FilterListEditor::displayObject()
             FilterListBoxItem *fi = new FilterListBoxItem(_applied, (*it)->tagName());
             fi->arguments = (*it)->inputScalars();
+            fi->updateText();
         }
     } else {
@@ -123,4 +124,5 @@ void FilterListEditor::moveRight()
                 fli->arguments.insert((*ivi)._name, s);
                 KST::scalarList.remove(s);
+                fli->updateText();
             }
         }
@@ -252,5 +254,5 @@ void FilterListEditor::applyChanges()
     for (unsigned int i = 0; i < _applied->count(); ++i) {
         FilterListBoxItem *item = static_cast<FilterListBoxItem*>(_applied->item(i));
-        QString txt = item->text();
+        QString txt = item->_filter;
         KSharedPtr<Plugin> pp = PluginCollection::self()->plugin(txt);
         if (pp) {
@@ -314,4 +316,5 @@ void FilterListEditor::editFilter()
             }
         }
+        item->updateText();
     }
     

--- kdeextragear-2/kst/kst/variableeditor.cpp  #1.2:1.3
@@ -62,4 +62,5 @@ VariableEditor::VariableEditor(QWidget *
 
   _spacer = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding);
+  _layout->addItem(_spacer);
 
   setVScrollBarMode(QScrollView::Auto);





More information about the Kst mailing list