[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Mon Dec 13 04:37:20 CET 2004


CVS commit by staikos: 

fix enable-disabled state (wrong menu was called), and always show the menu
entries instead of dynamically removing them.  it's confusing to remove them
randomly.


  M +94 -110   kst2dplot.cpp   1.315


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.314:1.315
@@ -2757,5 +2757,4 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
   int n_curves = Curves.count();
   int n_images = _images.count();
-  if (n_curves + n_images > 0) {
     menu->insertSeparator();
 
@@ -2767,7 +2766,5 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
     _imageRemoveMap.clear();
 
-    //
     // Edit menu
-    //
     submenu = new KPopupMenu(menu);
     hasEntry = false;
@@ -2799,7 +2796,5 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
     }
 
-    //
-    // Repeat for images...
-    //
+  // Repeat edit menu for images...
     for (i = n_curves; i < n_images + n_curves; i++) {
       const QString& tag = _images[i-n_curves]->tagName();
@@ -2812,8 +2807,5 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
     menu->setItemEnabled(id, hasEntry);
 
-    if (n_curves > 0) {
-      //
       // Fit menu...
-      //
       submenu = new KPopupMenu(menu);
       hasEntry = false;
@@ -2826,9 +2818,7 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
       }
       id = menu->insertItem(i18n("Fit"), submenu);
-      submenu->setItemEnabled(id, hasEntry);
+  menu->setItemEnabled(id, hasEntry);
 
-      //
       // Filter menu...
-      //
       submenu = new KPopupMenu(menu);
       hasEntry = false;
@@ -2841,10 +2831,7 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
       }
       id = menu->insertItem(i18n("Filter"), submenu);
-      submenu->setItemEnabled(id, hasEntry);
-    }
+  menu->setItemEnabled(id, hasEntry);
 
-    //
     // Remove menu...
-    //
     submenu = new KPopupMenu(menu);
     hasEntry = false;
@@ -2857,7 +2844,5 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
     }
 
-    //
-    // Repeat for images...
-    //
+  // Repeat remove menu for images...
     for (i = n_curves; i < n_images + n_curves; i++) {
       const QString& tag = _images[i-n_curves]->tagName();
@@ -2869,5 +2854,4 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
     id = menu->insertItem(i18n("Remove"), submenu);
     menu->setItemEnabled(id, hasEntry);
-  }
 
   return true;





More information about the Kst mailing list