Registered Member
|
Hello.
In my application, KRadioRipper, I have 2 problems the KDEs XMLGUI. 1.) The action for "paste" is created by KStandardAction.paste(). That's convenient (automatically you get an icon, appropriate shortcut...). However, "paste" shown now up in the toolbar - but in kradioripperui.rc I have inserted it only in the menu, not in the toolbar. Why does it also shows up in the toolbar and how can I avoid this? 2.) In the menu "Help", the entry "KRadioRipper Handbook F1" is created automatically - without that I have requested this in kradioripperui.rc. How can I avoid that this entry shows up? (Actually, there is no handbook, and I think for the user it's always frustrating to click on a "help" button and than get nothing). I'm thankful for every hint. Tim
urwald, proud to be a member of KDE forums since 2008-Oct.
|
Administrator
|
This is because they are provided by KXmlGui itself, as determined by the main Xml files from which yours inherits. You will need to use the following method, using your own custom name instead.
Change "custompaste" and "pasteSlot()" as needed.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Hm, actually I use
When I add a 4. argument, it doesn't compile anymore. And in the apidoc for KStandardAction namespace, there is also only a function with 3 arguments. However, I can workaround by creating the paste action manually (by KAction itself, not by KStandardAction). That's not convenient, but works. More important is my 2. question: How do I avoid that an entry for a handbook shows up in the menu? This action I haven't even created in the source code. How can I influence that?
urwald, proud to be a member of KDE forums since 2008-Oct.
|
Registered Member
|
I've made some experiments with kDebug() and found out how it works:
KXmlGuiWindow::setupGUI() creates a certain number of KAction objects, including an action for the handbook. It has the name "help_contents". With the following code, it is accessible and can be disabled or even removed:
urwald, proud to be a member of KDE forums since 2008-Oct.
|
Administrator
|
I actually meant this... oops.
http://api.kde.org/4.x-api/kdelibs-apid ... 8c2835d8f6 You can also use the appropriate remove() argument of KActionCollection which will hide it correctly.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
This one is very good. Thanks.
Problem is SOLVED
urwald, proud to be a member of KDE forums since 2008-Oct.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]