[Kst] [Bug 111239] Ability to easily setup supressed axis plots

Andrew Walker arwalker at sumusltd.com
Thu Jun 22 02:05:06 CEST 2006


------- 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=111239         




------- Additional Comments From arwalker sumusltd com  2006-06-22 02:05 -------
SVN commit 553763 by arwalker:

CCBUG:111239 Disable menu item rather than hide it when not applicable. Ensure update under all conditions.

 M  +11 -5     ksttoplevelview.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/ksttoplevelview.cpp #553762:553763
 @ -1192,6 +1192,7  @
 
       KPopupMenu *subMenu;
       int         numPlots = 0;
+      int         id;
       
       for (KstViewObjectList::ConstIterator i = _selectionList.begin(); i != _selectionList.end(); ++i) {
         if (kst_cast<Kst2DPlot>(*i)) {
 @ -1201,11 +1202,12  @
           }
         }
       }
-      if (numPlots > 1) {
-        subMenu = new KPopupMenu(menu);
-        subMenu->insertItem(i18n("X-axis"), this, SLOT(condenseXAxis()));
-        subMenu->insertItem(i18n("Y-axis"), this, SLOT(condenseYAxis()));
-        menu->insertItem(i18n("Condense"), subMenu);
+      subMenu = new KPopupMenu(menu);
+      subMenu->insertItem(i18n("X-axis"), this, SLOT(condenseXAxis()));
+      subMenu->insertItem(i18n("Y-axis"), this, SLOT(condenseYAxis()));
+      id = menu->insertItem(i18n("Condense selected"), subMenu);
+      if (numPlots < 2) {
+        menu->setItemEnabled(id, false);
       }
       
       subMenu = new KPopupMenu(menu);
 @ -1293,13 +1295,17  @
       // modify the plot properties appropriately
       if (plotsProcess.count() > 1) {
         plotsProcess.first()->setSuppressTop(true);
+        plotsProcess.first()->setDirty();
         plotsProcess.pop_front();
+        
         plotsProcess.last()->setSuppressBottom(true);
+        plotsProcess.last()->setDirty();
         plotsProcess.pop_back();
         
         for (Kst2DPlotList::Iterator i = plotsProcess.begin(); i != plotsProcess.end(); ++i) {
           (*i)->setSuppressTop(true);
           (*i)->setSuppressBottom(true);
+          (*i)->setDirty();  
         }
         
         processed = true;


More information about the Kst mailing list