Containment::ToolType -> Plasma::ActionType
actions categories are no more Toolbox-specific, but generic properties for actions
This commit is contained in:
parent
f5b51c7c54
commit
3ce3048ad1
@ -67,17 +67,6 @@ class PLASMA_EXPORT Containment : public Applet
|
|||||||
Q_PROPERTY(QString wallpaper READ wallpaper WRITE setWallpaper NOTIFY wallpaperChanged)
|
Q_PROPERTY(QString wallpaper READ wallpaper WRITE setWallpaper NOTIFY wallpaperChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum ToolType {
|
|
||||||
AddTool = 0,
|
|
||||||
ConfigureTool = 100,
|
|
||||||
ControlTool = 200,
|
|
||||||
MiscTool = 300,
|
|
||||||
DestructiveTool = 400,
|
|
||||||
UserToolType = DestructiveTool + 1000
|
|
||||||
};
|
|
||||||
Q_ENUMS(ToolType)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parent the QObject this applet is parented to
|
* @param parent the QObject this applet is parented to
|
||||||
* @param serviceId the name of the .desktop file containing the
|
* @param serviceId the name of the .desktop file containing the
|
||||||
|
@ -471,7 +471,7 @@ void CoronaPrivate::init()
|
|||||||
lockAction->setText(i18n("Lock Widgets"));
|
lockAction->setText(i18n("Lock Widgets"));
|
||||||
lockAction->setAutoRepeat(true);
|
lockAction->setAutoRepeat(true);
|
||||||
lockAction->setIcon(KDE::icon("object-locked"));
|
lockAction->setIcon(KDE::icon("object-locked"));
|
||||||
lockAction->setData(Containment::ControlTool);
|
lockAction->setData(Plasma::ControlAction);
|
||||||
lockAction->setShortcut(KShortcut("alt+d, l"));
|
lockAction->setShortcut(KShortcut("alt+d, l"));
|
||||||
lockAction->setShortcutContext(Qt::ApplicationShortcut);
|
lockAction->setShortcutContext(Qt::ApplicationShortcut);
|
||||||
|
|
||||||
@ -483,7 +483,7 @@ void CoronaPrivate::init()
|
|||||||
action->setText(i18n("Shortcut Settings"));
|
action->setText(i18n("Shortcut Settings"));
|
||||||
action->setIcon(KDE::icon("configure-shortcuts"));
|
action->setIcon(KDE::icon("configure-shortcuts"));
|
||||||
action->setAutoRepeat(false);
|
action->setAutoRepeat(false);
|
||||||
action->setData(Containment::ConfigureTool);
|
action->setData(Plasma::ConfigureAction);
|
||||||
//action->setShortcut(KShortcut("ctrl+h"));
|
//action->setShortcut(KShortcut("ctrl+h"));
|
||||||
action->setShortcutContext(Qt::ApplicationShortcut);
|
action->setShortcutContext(Qt::ApplicationShortcut);
|
||||||
|
|
||||||
|
@ -91,6 +91,19 @@ enum ContainmentType {
|
|||||||
};
|
};
|
||||||
Q_ENUMS(ContainmentType)
|
Q_ENUMS(ContainmentType)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A descriptrive type for QActions, to help categorizing them when presented to the user
|
||||||
|
*/
|
||||||
|
enum ActionType {
|
||||||
|
AddAction = 0, /**The action will cause something new being created*/
|
||||||
|
ConfigureAction = 100, /** The Action will make some kind of configuration ui to appear */
|
||||||
|
ControlAction = 200, /** Generic control, similar to ConfigureAction TODO: better doc */
|
||||||
|
MiscAction = 300, /** A type of action that doesn't fit in the oher categories */
|
||||||
|
DestructiveAction = 400, /** A dangerous action, such as deletion of objects, plasmoids and files. They are intended to be shown separed from other actions */
|
||||||
|
UserAction = DestructiveAction + 1000 /** If new types are needed in a C++ implementation, define them as ids more than UserAction*/
|
||||||
|
};
|
||||||
|
Q_ENUMS(ActionType)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Direction enumeration describes in which direction, relative to the
|
* The Direction enumeration describes in which direction, relative to the
|
||||||
* Applet (and its managing container), popup menus, expanders, balloons,
|
* Applet (and its managing container), popup menus, expanders, balloons,
|
||||||
|
@ -209,14 +209,14 @@ KActionCollection* AppletPrivate::defaultActions(QObject *parent)
|
|||||||
configAction->setText(i18n("Widget Settings"));
|
configAction->setText(i18n("Widget Settings"));
|
||||||
configAction->setIcon(KDE::icon("configure"));
|
configAction->setIcon(KDE::icon("configure"));
|
||||||
configAction->setShortcut(KShortcut("alt+d, s"));
|
configAction->setShortcut(KShortcut("alt+d, s"));
|
||||||
configAction->setData(Containment::ConfigureTool);
|
configAction->setData(Plasma::ConfigureAction);
|
||||||
|
|
||||||
KAction *closeApplet = actions->addAction("remove");
|
KAction *closeApplet = actions->addAction("remove");
|
||||||
closeApplet->setAutoRepeat(false);
|
closeApplet->setAutoRepeat(false);
|
||||||
closeApplet->setText(i18n("Remove this Widget"));
|
closeApplet->setText(i18n("Remove this Widget"));
|
||||||
closeApplet->setIcon(KDE::icon("edit-delete"));
|
closeApplet->setIcon(KDE::icon("edit-delete"));
|
||||||
closeApplet->setShortcut(KShortcut("alt+d, r"));
|
closeApplet->setShortcut(KShortcut("alt+d, r"));
|
||||||
closeApplet->setData(Containment::DestructiveTool);
|
closeApplet->setData(Plasma::DestructiveAction);
|
||||||
|
|
||||||
KAction *runAssociatedApplication = actions->addAction("run associated application");
|
KAction *runAssociatedApplication = actions->addAction("run associated application");
|
||||||
runAssociatedApplication->setAutoRepeat(false);
|
runAssociatedApplication->setAutoRepeat(false);
|
||||||
@ -225,7 +225,7 @@ KActionCollection* AppletPrivate::defaultActions(QObject *parent)
|
|||||||
runAssociatedApplication->setShortcut(KShortcut("alt+d, t"));
|
runAssociatedApplication->setShortcut(KShortcut("alt+d, t"));
|
||||||
runAssociatedApplication->setVisible(false);
|
runAssociatedApplication->setVisible(false);
|
||||||
runAssociatedApplication->setEnabled(false);
|
runAssociatedApplication->setEnabled(false);
|
||||||
runAssociatedApplication->setData(Containment::ControlTool);
|
runAssociatedApplication->setData(Plasma::ControlAction);
|
||||||
|
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
@ -71,19 +71,19 @@ void ContainmentPrivate::addDefaultActions(KActionCollection *actions, Containme
|
|||||||
appletBrowserAction->setText(i18n("Add Widgets..."));
|
appletBrowserAction->setText(i18n("Add Widgets..."));
|
||||||
appletBrowserAction->setIcon(KDE::icon("list-add"));
|
appletBrowserAction->setIcon(KDE::icon("list-add"));
|
||||||
appletBrowserAction->setShortcut(KShortcut("alt+d, a"));
|
appletBrowserAction->setShortcut(KShortcut("alt+d, a"));
|
||||||
appletBrowserAction->setData(Containment::AddTool);
|
appletBrowserAction->setData(Plasma::AddAction);
|
||||||
|
|
||||||
KAction *action = actions->addAction("next applet");
|
KAction *action = actions->addAction("next applet");
|
||||||
action->setText(i18n("Next Widget"));
|
action->setText(i18n("Next Widget"));
|
||||||
//no icon
|
//no icon
|
||||||
action->setShortcut(KShortcut("alt+d, n"));
|
action->setShortcut(KShortcut("alt+d, n"));
|
||||||
action->setData(Containment::ControlTool);
|
action->setData(Plasma::ControlAction);
|
||||||
|
|
||||||
action = actions->addAction("previous applet");
|
action = actions->addAction("previous applet");
|
||||||
action->setText(i18n("Previous Widget"));
|
action->setText(i18n("Previous Widget"));
|
||||||
//no icon
|
//no icon
|
||||||
action->setShortcut(KShortcut("alt+d, p"));
|
action->setShortcut(KShortcut("alt+d, p"));
|
||||||
action->setData(Containment::ControlTool);
|
action->setData(Plasma::ControlAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContainmentPrivate::setScreen(int newScreen)
|
void ContainmentPrivate::setScreen(int newScreen)
|
||||||
|
Loading…
Reference in New Issue
Block a user