[kwin/effects] Do not use KActionCollections for the global shortcuts
Most effects had a "collection" for one action. We don't need the action collection, all it was used for is setting the object name. With the removal of KActionCollection the effects do not need to link XmlGui any more, though the dependency is still pulled in through plasma.
This commit is contained in:
parent
e4be8c34b8
commit
145f0c096f
15 changed files with 56 additions and 68 deletions
|
@ -11,7 +11,6 @@ set(kwin_effect_KDE_LIBS
|
|||
KF5::Plasma # screenedge effect
|
||||
KF5::KIconThemes
|
||||
KF5::KService
|
||||
KF5::XmlGui
|
||||
)
|
||||
|
||||
set(kwin_effect_QT_LIBS
|
||||
|
|
|
@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "cube_inside.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <kactioncollection.h>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
#include <kwinconfig.h>
|
||||
|
@ -200,17 +199,19 @@ void CubeEffect::reconfigure(ReconfigureFlags)
|
|||
|
||||
// do not connect the shortcut if we use cylinder or sphere
|
||||
if (!shortcutsRegistered) {
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* cubeAction = actionCollection->addAction(QStringLiteral("Cube"));
|
||||
QAction* cubeAction = new QAction(this);
|
||||
cubeAction->setObjectName(QStringLiteral("Cube"));
|
||||
cubeAction->setText(i18n("Desktop Cube"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(cubeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F11);
|
||||
KGlobalAccel::self()->setShortcut(cubeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F11);
|
||||
cubeShortcut = KGlobalAccel::self()->shortcut(cubeAction);
|
||||
QAction* cylinderAction = actionCollection->addAction(QStringLiteral("Cylinder"));
|
||||
QAction* cylinderAction = new QAction(this);
|
||||
cylinderAction->setObjectName(QStringLiteral("Cylinder"));
|
||||
cylinderAction->setText(i18n("Desktop Cylinder"));
|
||||
KGlobalAccel::self()->setShortcut(cylinderAction, QList<QKeySequence>());
|
||||
cylinderShortcut = KGlobalAccel::self()->shortcut(cylinderAction);
|
||||
QAction* sphereAction = actionCollection->addAction(QStringLiteral("Sphere"));
|
||||
QAction* sphereAction = new QAction(this);
|
||||
sphereAction->setObjectName(QStringLiteral("Sphere"));
|
||||
sphereAction->setText(i18n("Desktop Sphere"));
|
||||
KGlobalAccel::self()->setShortcut(sphereAction, QList<QKeySequence>());
|
||||
sphereShortcut = KGlobalAccel::self()->shortcut(sphereAction);
|
||||
|
|
|
@ -30,7 +30,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <kactioncollection.h>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
#include <netwm_def.h>
|
||||
|
@ -67,8 +66,8 @@ DesktopGridEffect::DesktopGridEffect()
|
|||
, m_proxy(0)
|
||||
{
|
||||
// Load shortcuts
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* a = actionCollection->addAction(QStringLiteral("ShowDesktopGrid"));
|
||||
QAction* a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("ShowDesktopGrid"));
|
||||
a->setText(i18n("Show Desktop Grid"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F8);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F8);
|
||||
|
|
|
@ -28,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <QMatrix4x4>
|
||||
|
||||
#include <QAction>
|
||||
#include <KActionCollection>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
|
||||
|
@ -57,13 +56,14 @@ FlipSwitchEffect::FlipSwitchEffect()
|
|||
m_captionFont.setBold(true);
|
||||
m_captionFont.setPointSize(m_captionFont.pointSize() * 2);
|
||||
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* flipSwitchCurrentAction = actionCollection->addAction(QStringLiteral("FlipSwitchCurrent"));
|
||||
QAction* flipSwitchCurrentAction = new QAction(this);
|
||||
flipSwitchCurrentAction->setObjectName(QStringLiteral("FlipSwitchCurrent"));
|
||||
flipSwitchCurrentAction->setText(i18n("Toggle Flip Switch (Current desktop)"));
|
||||
KGlobalAccel::self()->setShortcut(flipSwitchCurrentAction, QList<QKeySequence>());
|
||||
m_shortcutCurrent = KGlobalAccel::self()->shortcut(flipSwitchCurrentAction);
|
||||
connect(flipSwitchCurrentAction, SIGNAL(triggered(bool)), this, SLOT(toggleActiveCurrent()));
|
||||
QAction* flipSwitchAllAction = actionCollection->addAction(QStringLiteral("FlipSwitchAll"));
|
||||
QAction* flipSwitchAllAction = new QAction(this);
|
||||
flipSwitchAllAction->setObjectName(QStringLiteral("FlipSwitchAll"));
|
||||
flipSwitchAllAction->setText(i18n("Toggle Flip Switch (All desktops)"));
|
||||
KGlobalAccel::self()->setShortcut(flipSwitchAllAction, QList<QKeySequence>());
|
||||
m_shortcutAll = KGlobalAccel::self()->shortcut(flipSwitchAllAction);
|
||||
|
|
|
@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <QAction>
|
||||
#include <kwinglutils.h>
|
||||
#include <kwinglplatform.h>
|
||||
#include <kactioncollection.h>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
#include <QStandardPaths>
|
||||
|
@ -43,15 +42,15 @@ InvertEffect::InvertEffect()
|
|||
m_shader(NULL),
|
||||
m_allWindows(false)
|
||||
{
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
|
||||
QAction* a = actionCollection->addAction(QStringLiteral("Invert"));
|
||||
QAction* a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("Invert"));
|
||||
a->setText(i18n("Toggle Invert Effect"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I);
|
||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleScreenInversion()));
|
||||
|
||||
QAction* b = actionCollection->addAction(QStringLiteral("InvertWindow"));
|
||||
QAction* b = new QAction(this);
|
||||
b->setObjectName(QStringLiteral("InvertWindow"));
|
||||
b->setText(i18n("Toggle Invert Effect on Window"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(b, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U);
|
||||
KGlobalAccel::self()->setShortcut(b, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U);
|
||||
|
|
|
@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <kwinglutils.h>
|
||||
#include <kwinglplatform.h>
|
||||
|
||||
#include <kactioncollection.h>
|
||||
#include <KDE/KStandardAction>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
#include <QVector2D>
|
||||
|
@ -53,20 +53,16 @@ LookingGlassEffect::LookingGlassEffect()
|
|||
, m_enabled(false)
|
||||
, m_valid(false)
|
||||
{
|
||||
actionCollection = new KActionCollection(this);
|
||||
actionCollection->setConfigGlobal(true);
|
||||
actionCollection->setConfigGroup(QStringLiteral("LookingGlass"));
|
||||
|
||||
QAction* a;
|
||||
a = actionCollection->addAction(KStandardAction::ZoomIn, this, SLOT(zoomIn()));
|
||||
a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
|
||||
|
||||
a = actionCollection->addAction(KStandardAction::ZoomOut, this, SLOT(zoomOut()));
|
||||
a = KStandardAction::zoomOut(this, SLOT(zoomOut()), this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
|
||||
|
||||
a = actionCollection->addAction(KStandardAction::ActualSize, this, SLOT(toggle()));
|
||||
a = KStandardAction::actualSize(this, SLOT(toggle()), this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
|
||||
|
||||
|
@ -94,7 +90,6 @@ void LookingGlassEffect::reconfigure(ReconfigureFlags)
|
|||
initialradius = LookingGlassConfig::radius();
|
||||
radius = initialradius;
|
||||
qCDebug(KWINEFFECTS) << QStringLiteral("Radius from config: %1").arg(radius) << endl;
|
||||
actionCollection->readSettings();
|
||||
m_valid = loadData();
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include <kwineffects.h>
|
||||
|
||||
class KActionCollection;
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
|
@ -72,7 +70,6 @@ private:
|
|||
bool polling; // Mouse polling
|
||||
int radius;
|
||||
int initialradius;
|
||||
KActionCollection* actionCollection;
|
||||
GLTexture *m_texture;
|
||||
GLRenderTarget *m_fbo;
|
||||
GLVertexBuffer *m_vbo;
|
||||
|
|
|
@ -26,8 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
#include <QAction>
|
||||
#include <kwinconfig.h>
|
||||
|
||||
#include <kactioncollection.h>
|
||||
#include <kstandardaction.h>
|
||||
|
||||
#include <kwinglutils.h>
|
||||
|
@ -55,17 +53,16 @@ MagnifierEffect::MagnifierEffect()
|
|||
, m_pixmap(XCB_PIXMAP_NONE)
|
||||
#endif
|
||||
{
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* a;
|
||||
a = actionCollection->addAction(KStandardAction::ZoomIn, this, SLOT(zoomIn()));
|
||||
a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
|
||||
|
||||
a = actionCollection->addAction(KStandardAction::ZoomOut, this, SLOT(zoomOut()));
|
||||
a = KStandardAction::zoomOut(this, SLOT(zoomOut()), this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
|
||||
|
||||
a = actionCollection->addAction(KStandardAction::ActualSize, this, SLOT(toggle()));
|
||||
a = KStandardAction::actualSize(this, SLOT(toggle()), this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <xcb/render.h>
|
||||
#endif
|
||||
|
||||
#include <KDE/KActionCollection>
|
||||
#include <KDE/KConfigGroup>
|
||||
#include <KDE/KGlobalAccel>
|
||||
|
||||
|
@ -46,8 +45,8 @@ MouseClickEffect::MouseClickEffect()
|
|||
{
|
||||
m_enabled = false;
|
||||
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* a = actionCollection->addAction(QStringLiteral("ToggleMouseClick"));
|
||||
QAction* a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("ToggleMouseClick"));
|
||||
a->setText(i18n("Toggle Effect"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Asterisk);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Asterisk);
|
||||
|
|
|
@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <QAction>
|
||||
#include <kwinconfig.h>
|
||||
#include <kwinglutils.h>
|
||||
#include <kactioncollection.h>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
|
||||
|
@ -46,13 +45,14 @@ KWIN_EFFECT(mousemark, MouseMarkEffect)
|
|||
|
||||
MouseMarkEffect::MouseMarkEffect()
|
||||
{
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* a = actionCollection->addAction(QStringLiteral("ClearMouseMarks"));
|
||||
QAction* a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("ClearMouseMarks"));
|
||||
a->setText(i18n("Clear All Mouse Marks"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F11);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F11);
|
||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(clear()));
|
||||
a = actionCollection->addAction(QStringLiteral("ClearLastMouseMark"));
|
||||
a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("ClearLastMouseMark"));
|
||||
a->setText(i18n("Clear Last Mouse Mark"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F12);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::SHIFT + Qt::META + Qt::Key_F12);
|
||||
|
|
|
@ -23,7 +23,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
//KConfigSkeleton
|
||||
#include "presentwindowsconfig.h"
|
||||
#include <QAction>
|
||||
#include <kactioncollection.h>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
#include <kdeclarative/kdeclarative.h>
|
||||
|
@ -74,20 +73,22 @@ PresentWindowsEffect::PresentWindowsEffect()
|
|||
m_atomDesktop = effects->announceSupportProperty("_KDE_PRESENT_WINDOWS_DESKTOP", this);
|
||||
m_atomWindows = effects->announceSupportProperty("_KDE_PRESENT_WINDOWS_GROUP", this);
|
||||
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* exposeAction = actionCollection->addAction(QStringLiteral("Expose"));
|
||||
QAction* exposeAction = new QAction(this);
|
||||
exposeAction->setObjectName(QStringLiteral("Expose"));
|
||||
exposeAction->setText(i18n("Toggle Present Windows (Current desktop)"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(exposeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F9);
|
||||
KGlobalAccel::self()->setShortcut(exposeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F9);
|
||||
shortcut = KGlobalAccel::self()->shortcut(exposeAction);
|
||||
connect(exposeAction, SIGNAL(triggered(bool)), this, SLOT(toggleActive()));
|
||||
QAction* exposeAllAction = actionCollection->addAction(QStringLiteral("ExposeAll"));
|
||||
QAction* exposeAllAction = new QAction(this);
|
||||
exposeAllAction->setObjectName(QStringLiteral("ExposeAll"));
|
||||
exposeAllAction->setText(i18n("Toggle Present Windows (All desktops)"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10);
|
||||
KGlobalAccel::self()->setShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10);
|
||||
shortcutAll = KGlobalAccel::self()->shortcut(exposeAllAction);
|
||||
connect(exposeAllAction, SIGNAL(triggered(bool)), this, SLOT(toggleActiveAllDesktops()));
|
||||
QAction* exposeClassAction = actionCollection->addAction(QStringLiteral("ExposeClass"));
|
||||
QAction* exposeClassAction = new QAction(this);
|
||||
exposeClassAction->setObjectName(QStringLiteral("ExposeClass"));
|
||||
exposeClassAction->setText(i18n("Toggle Present Windows (Window class)"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(exposeClassAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F7);
|
||||
KGlobalAccel::self()->setShortcut(exposeClassAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F7);
|
||||
|
|
|
@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "thumbnailasideconfig.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <kactioncollection.h>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
|
||||
|
@ -35,8 +34,8 @@ KWIN_EFFECT(thumbnailaside, ThumbnailAsideEffect)
|
|||
|
||||
ThumbnailAsideEffect::ThumbnailAsideEffect()
|
||||
{
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* a = actionCollection->addAction(QStringLiteral("ToggleCurrentThumbnail"));
|
||||
QAction* a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("ToggleCurrentThumbnail"));
|
||||
a->setText(i18n("Toggle Thumbnail for Current Window"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_T);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::CTRL + Qt::Key_T);
|
||||
|
|
|
@ -32,7 +32,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <kwinglutils.h>
|
||||
#include <kwinxrenderutils.h>
|
||||
|
||||
#include <kactioncollection.h>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
|
||||
|
@ -57,8 +56,8 @@ TrackMouseEffect::TrackMouseEffect()
|
|||
m_angleBase = 90.0;
|
||||
m_mousePolling = false;
|
||||
|
||||
KActionCollection *actionCollection = new KActionCollection(this);
|
||||
m_action = actionCollection->addAction(QStringLiteral("TrackMouse"));
|
||||
m_action = new QAction(this);
|
||||
m_action->setObjectName(QStringLiteral("TrackMouse"));
|
||||
m_action->setText(i18n("Track mouse"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(m_action, QList<QKeySequence>());
|
||||
KGlobalAccel::self()->setShortcut(m_action, QList<QKeySequence>());
|
||||
|
|
|
@ -28,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <kwinconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <kwindowsystem.h>
|
||||
#include <KActionCollection>
|
||||
#include <KDE/KGlobalAccel>
|
||||
#include <KDE/KLocalizedString>
|
||||
|
||||
|
@ -60,8 +59,8 @@ WindowGeometry::WindowGeometry()
|
|||
myMeasure[1]->setAlignment(Qt::AlignCenter);
|
||||
myMeasure[2]->setAlignment(Qt::AlignRight | Qt::AlignBottom);
|
||||
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* a = actionCollection->addAction(QStringLiteral("WindowGeometry"));
|
||||
QAction* a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("WindowGeometry"));
|
||||
a->setText(i18n("Toggle window geometry display (effect only)"));
|
||||
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::SHIFT + Qt::Key_F11);
|
||||
|
|
|
@ -28,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <QStyle>
|
||||
#include <QtGui/QVector2D>
|
||||
#include <QtDBus/QDBusConnection>
|
||||
#include <kactioncollection.h>
|
||||
#include <kstandardaction.h>
|
||||
#include <KDE/KConfigGroup>
|
||||
#include <KDE/KGlobalAccel>
|
||||
|
@ -66,52 +65,57 @@ ZoomEffect::ZoomEffect()
|
|||
, yMove(0)
|
||||
, moveFactor(20.0)
|
||||
{
|
||||
KActionCollection* actionCollection = new KActionCollection(this);
|
||||
QAction* a = 0;
|
||||
a = actionCollection->addAction(KStandardAction::ZoomIn, this, SLOT(zoomIn()));
|
||||
a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Equal);
|
||||
|
||||
a = actionCollection->addAction(KStandardAction::ZoomOut, this, SLOT(zoomOut()));
|
||||
a = KStandardAction::zoomOut(this, SLOT(zoomOut()), this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Minus);
|
||||
|
||||
a = actionCollection->addAction(KStandardAction::ActualSize, this, SLOT(actualSize()));
|
||||
a = KStandardAction::actualSize(this, SLOT(actualSize()), this);
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_0);
|
||||
|
||||
a = actionCollection->addAction(QStringLiteral("MoveZoomLeft"));
|
||||
a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("MoveZoomLeft"));
|
||||
a->setText(i18n("Move Zoomed Area to Left"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Left);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Left);
|
||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomLeft()));
|
||||
|
||||
a = actionCollection->addAction(QStringLiteral("MoveZoomRight"));
|
||||
a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("MoveZoomRight"));
|
||||
a->setText(i18n("Move Zoomed Area to Right"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Right);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Right);
|
||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomRight()));
|
||||
|
||||
a = actionCollection->addAction(QStringLiteral("MoveZoomUp"));
|
||||
a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("MoveZoomUp"));
|
||||
a->setText(i18n("Move Zoomed Area Upwards"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Up);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Up);
|
||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomUp()));
|
||||
|
||||
a = actionCollection->addAction(QStringLiteral("MoveZoomDown"));
|
||||
a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("MoveZoomDown"));
|
||||
a->setText(i18n("Move Zoomed Area Downwards"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Down);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_Down);
|
||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(moveZoomDown()));
|
||||
|
||||
// TODO: these two actions don't belong into the effect. They need to be moved into KWin core
|
||||
a = actionCollection->addAction(QStringLiteral("MoveMouseToFocus"));
|
||||
a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("MoveMouseToFocus"));
|
||||
a->setText(i18n("Move Mouse to Focus"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_F5);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_F5);
|
||||
connect(a, SIGNAL(triggered(bool)), this, SLOT(moveMouseToFocus()));
|
||||
|
||||
a = actionCollection->addAction(QStringLiteral("MoveMouseToCenter"));
|
||||
a = new QAction(this);
|
||||
a->setObjectName(QStringLiteral("MoveMouseToCenter"));
|
||||
a->setText(i18n("Move Mouse to Center"));
|
||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_F6);
|
||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::META + Qt::Key_F6);
|
||||
|
|
Loading…
Reference in a new issue