[Kde-kiosk] action/help=false doesn't seem to work

Waldo Bastian kde-kiosk@mail.kde.org
Tue, 18 Feb 2003 13:14:30 +0100


--Boundary-00=_mOiU+qRQ+z8C0fP
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Sunday 16 February 2003 00:14, Chris Howells wrote:
> Hi,
>
> setting action/help=false in my kdeglobals file doesn't appear to do what I
> expected and totally disable the help menu. Is this a bug?

Yes, that's a bug. Or actually, disabling a whole menu at once is basically 
just not supported atm. It is rather easy to get rid of the menu with the 
attached patch, but the behaviour is probably not quite what one would 
expect: The menu is hidden but all the actions are still there, and as a 
result all the keyboard shortcuts continue to work.

I'm not sure how easy it is going to be to implement "disable all actions that 
are part of a disabled menu", since the whole idea of the KActions as used by 
KDE is to have the action exist independant of any particular menu or 
toolbar. The manifestation of an action in a menu is just one of the many 
possible manifestations for an action.

Cheers,
Waldo
-- 
bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com

--Boundary-00=_mOiU+qRQ+z8C0fP
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="guibuilder.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="guibuilder.diff"

--- kxmlguibuilder.cpp~	Tue Feb 18 12:58:35 2003
+++ kxmlguibuilder.cpp	Tue Feb 18 12:58:35 2003
@@ -18,6 +18,7 @@
    Boston, MA 02111-1307, USA.
 */
 
+#include "kapplication.h"
 #include "kxmlguibuilder.h"
 #include "kmenubar.h"
 #include "kpopupmenu.h"
@@ -160,7 +161,12 @@
     while ( p && !p->inherits("KMainWindow") )
         p = p->parentWidget();
 
-    KPopupMenu *popup = new KPopupMenu( p, element.attribute( d->attrName ).utf8());
+    QCString name = element.attribute( d->attrName ).utf8();
+    
+    if (!kapp->authorizeKAction(name))
+       return 0;
+
+    KPopupMenu *popup = new KPopupMenu( p, name);
 
     QString i18nText;
     QCString text = element.namedItem( d->attrText1 ).toElement().text().utf8();

--Boundary-00=_mOiU+qRQ+z8C0fP--