Bug 113647 - Add to Main Panel option in KMenu is non-sens if the panels are locked
Summary: Add to Main Panel option in KMenu is non-sens if the panels are locked
Status: RESOLVED FIXED
Alias: None
Product: kicker
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Aaron J. Seigo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-30 22:22 UTC by baum-im-wald
Modified: 2005-10-03 16:20 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 baum-im-wald 2005-09-30 22:22:40 UTC
Version:            (using KDE Devel)
OS:                Linux

By right-clicking an item of the KMenu you get a context menu wich - among others - has the option to add the selected item to the main panel. However, this does not work if the panels are locked which might be confusing for new users.

There are (at least) two possibilities to change this:
a) remove/disable the "Add to Main Panel" entry if the panels are locked
b) just ignore the lock and always put the icon in the panel

I'd prefer b) because otherwise you sometimes have an option in the context menu and sometimes not. Users might need some time to figure out when it is disabled/hidden and when not.

Anyways, I hope I reported this one in the right section (there was none for the kmenu)
Comment 1 Aaron J. Seigo 2005-10-03 16:20:51 UTC
SVN commit 466830 by aseigo:

don't show the context menu if we are locked or if there is nothing to
show due to kiosk restrictions
BUG:113647


 M  +14 -4     service_mnu.cpp  


--- branches/KDE/3.5/kdebase/kicker/kicker/ui/service_mnu.cpp #466829:466830
@@ -504,7 +504,7 @@
 
 void PanelServiceMenu::mouseReleaseEvent(QMouseEvent * ev)
 {
-    if (ev->button()==RightButton)
+    if (ev->button() == RightButton && !Kicker::the()->isImmutable())
     {
         int id = idAt( ev->pos() );
 
@@ -524,27 +524,32 @@
         delete popupMenu_;
         popupMenu_ = new KPopupMenu(this);
         connect(popupMenu_, SIGNAL(activated(int)), SLOT(slotContextMenu(int)));
+        bool hasEntries = false;
 
         switch (contextKSycocaEntry_->sycocaType())
         {
         case KST_KService:
             if (kapp->authorize("editable_desktop_icons"))
             {
+                hasEntries = true;
                 popupMenu_->insertItem(SmallIconSet("desktop"),
                     i18n("Add Item to Desktop"), AddItemToDesktop);
             }
             if (kapp->authorizeKAction("kicker_rmb"))
             {
+                hasEntries = true;
                 popupMenu_->insertItem(SmallIconSet("kicker"),
                     i18n("Add Item to Main Panel"), AddItemToPanel);
             }
             if (kapp->authorizeKAction("menuedit"))
             {
+                hasEntries = true;
                 popupMenu_->insertItem(SmallIconSet("kmenuedit"),
                     i18n("Edit Item"), EditItem);
             }
             if (kapp->authorize("run_command"))
             {
+                hasEntries = true;
                 popupMenu_->insertItem(SmallIconSet("run"),
                     i18n("Put Into Run Dialog"), PutIntoRunDialog);
             }
@@ -553,28 +558,33 @@
         case KST_KServiceGroup:
             if (kapp->authorize("editable_desktop_icons"))
             {
+                hasEntries = true;
                 popupMenu_->insertItem(SmallIconSet("desktop"),
                     i18n("Add Menu to Desktop"), AddMenuToDesktop);
             }
             if (kapp->authorizeKAction("kicker_rmb"))
             {
+                hasEntries = true;
                 popupMenu_->insertItem(SmallIconSet("kicker"),
                     i18n("Add Menu to Main Panel"), AddMenuToPanel);
             }
             if (kapp->authorizeKAction("menuedit"))
             {
+                hasEntries = true;
                 popupMenu_->insertItem(SmallIconSet("kmenuedit"),
                     i18n("Edit Menu"), EditMenu);
             }
             break;
 
         default:
-            return;
             break;
         }
 
-        popupMenu_->popup(this->mapToGlobal(ev->pos()));
-        return;
+        if (hasEntries)
+        {
+            popupMenu_->popup(this->mapToGlobal(ev->pos()));
+            return;
+        }
     }
 
     delete popupMenu_;