libkonq
#include <konq_menuactions.h>
Public Member Functions | |
KonqMenuActions () | |
~KonqMenuActions () | |
int | addActionsTo (QMenu *menu) |
void | addOpenWithActionsTo (QMenu *menu, const QString &traderConstraint) |
KAction * | preferredOpenWithAction (const QString &traderConstraint) |
void | setItemListProperties (const KFileItemListProperties &itemList) |
void | setParentWidget (QWidget *widget) |
KDE_DEPRECATED void | setPopupMenuInfo (const KonqPopupMenuInformation &info) |
Detailed Description
This class handles the user-defined actions for a url in a popupmenu.
User-defined actions include:
- builtin services like mount/unmount for old-style device desktop files
- user-defined actions for a .desktop file, defined in the file itself (see the desktop entry standard)
- servicemenus actions, defined in .desktop files and selected based on the mimetype of the url
In addition it can also add "open with" actions.
Definition at line 42 of file konq_menuactions.h.
Constructor & Destructor Documentation
KonqMenuActions::KonqMenuActions | ( | ) |
Creates a KonqMenuActions instance.
Note that this instance must stay alive for at least as long as the popupmenu; it has the slots for the actions created by addActionsTo.
Definition at line 26 of file konq_menuactions.cpp.
KonqMenuActions::~KonqMenuActions | ( | ) |
Destructor.
Definition at line 32 of file konq_menuactions.cpp.
Member Function Documentation
int KonqMenuActions::addActionsTo | ( | QMenu * | menu | ) |
Generate the user-defined actions and submenus, and adds them to the menu
.
User-defined actions include:
- builtin services like mount/unmount for old-style device desktop files
- user-defined actions for a .desktop file, defined in the file itself (see the desktop entry standard)
- servicemenus actions, defined in .desktop files and selected based on the mimetype of the url
When KFileItemListProperties::supportsWriting() is false, actions that modify the files are not shown. This is controlled by Require=Write in the servicemenu desktop files.
All actions are created as children of the menu.
- Returns
- the number of actions added
Definition at line 47 of file konq_menuactions.cpp.
void KonqMenuActions::addOpenWithActionsTo | ( | QMenu * | menu, |
const QString & | traderConstraint | ||
) |
Generate the "Open With <Application>" actions, and adds them to the menu
.
All actions are created as children of the menu.
- Parameters
-
menu the QMenu where to add actions traderConstraint this constraint allows to exclude the current application from the "open with" list. Example: "DesktopEntryName != 'kfmclient'".
Definition at line 52 of file konq_menuactions.cpp.
KAction * KonqMenuActions::preferredOpenWithAction | ( | const QString & | traderConstraint | ) |
Returns an action for the preferred app only.
- Parameters
-
traderConstraint this constraint allows to exclude the current application from the "open with" list. Example: "DesktopEntryName != 'kfmclient'".
- Returns
- the action - or 0 if no application was found.
- Since
- 4.3 – TODO REMOVE AND PORT FOLDERVIEW
Definition at line 57 of file konq_menuactions.cpp.
void KonqMenuActions::setItemListProperties | ( | const KFileItemListProperties & | itemList | ) |
Sets all the data for the next instance of the popupmenu.
- See also
- KFileItemListProperties
- Since
- 4.3
Definition at line 42 of file konq_menuactions.cpp.
void KonqMenuActions::setParentWidget | ( | QWidget * | widget | ) |
Set the parent widget for any dialogs being shown.
This should normally be your mainwindow, not a popup menu, so that it still exists even after the popup is closed (e.g. error message from KRun) and so that QAction::setStatusTip can find a statusbar, too.
- Since
- 4.3
Definition at line 62 of file konq_menuactions.cpp.
void KonqMenuActions::setPopupMenuInfo | ( | const KonqPopupMenuInformation & | info | ) |
Sets all the data for the next instance of the popupmenu.
- See also
- KonqPopupMenuInformation
- Deprecated:
- use setItemList+setParentWidget
Definition at line 37 of file konq_menuactions.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.