Changeset View
Changeset View
Standalone View
Standalone View
effects/presentwindows/presentwindows.cpp
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 67 | { | |||
---|---|---|---|---|---|
75 | 75 | | |||
76 | QAction* exposeAction = m_exposeAction; | 76 | QAction* exposeAction = m_exposeAction; | ||
77 | exposeAction->setObjectName(QStringLiteral("Expose")); | 77 | exposeAction->setObjectName(QStringLiteral("Expose")); | ||
78 | exposeAction->setText(i18n("Toggle Present Windows (Current desktop)")); | 78 | exposeAction->setText(i18n("Toggle Present Windows (Current desktop)")); | ||
79 | KGlobalAccel::self()->setDefaultShortcut(exposeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F9); | 79 | KGlobalAccel::self()->setDefaultShortcut(exposeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F9); | ||
80 | KGlobalAccel::self()->setShortcut(exposeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F9); | 80 | KGlobalAccel::self()->setShortcut(exposeAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F9); | ||
81 | shortcut = KGlobalAccel::self()->shortcut(exposeAction); | 81 | shortcut = KGlobalAccel::self()->shortcut(exposeAction); | ||
82 | effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F9, exposeAction); | 82 | effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F9, exposeAction); | ||
83 | connect(exposeAction, SIGNAL(triggered(bool)), this, SLOT(toggleActive())); | 83 | connect(exposeAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActive); | ||
84 | QAction* exposeAllAction = m_exposeAllAction; | 84 | QAction* exposeAllAction = m_exposeAllAction; | ||
85 | exposeAllAction->setObjectName(QStringLiteral("ExposeAll")); | 85 | exposeAllAction->setObjectName(QStringLiteral("ExposeAll")); | ||
86 | exposeAllAction->setText(i18n("Toggle Present Windows (All desktops)")); | 86 | exposeAllAction->setText(i18n("Toggle Present Windows (All desktops)")); | ||
87 | KGlobalAccel::self()->setDefaultShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC); | 87 | KGlobalAccel::self()->setDefaultShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC); | ||
88 | KGlobalAccel::self()->setShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC); | 88 | KGlobalAccel::self()->setShortcut(exposeAllAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F10 << Qt::Key_LaunchC); | ||
89 | shortcutAll = KGlobalAccel::self()->shortcut(exposeAllAction); | 89 | shortcutAll = KGlobalAccel::self()->shortcut(exposeAllAction); | ||
90 | effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F10, exposeAllAction); | 90 | effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F10, exposeAllAction); | ||
91 | effects->registerTouchpadSwipeShortcut(SwipeDirection::Down, exposeAllAction); | 91 | effects->registerTouchpadSwipeShortcut(SwipeDirection::Down, exposeAllAction); | ||
92 | connect(exposeAllAction, SIGNAL(triggered(bool)), this, SLOT(toggleActiveAllDesktops())); | 92 | connect(exposeAllAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActiveAllDesktops); | ||
93 | QAction* exposeClassAction = m_exposeClassAction; | 93 | QAction* exposeClassAction = m_exposeClassAction; | ||
94 | exposeClassAction->setObjectName(QStringLiteral("ExposeClass")); | 94 | exposeClassAction->setObjectName(QStringLiteral("ExposeClass")); | ||
95 | exposeClassAction->setText(i18n("Toggle Present Windows (Window class)")); | 95 | exposeClassAction->setText(i18n("Toggle Present Windows (Window class)")); | ||
96 | KGlobalAccel::self()->setDefaultShortcut(exposeClassAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F7); | 96 | KGlobalAccel::self()->setDefaultShortcut(exposeClassAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F7); | ||
97 | KGlobalAccel::self()->setShortcut(exposeClassAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F7); | 97 | KGlobalAccel::self()->setShortcut(exposeClassAction, QList<QKeySequence>() << Qt::CTRL + Qt::Key_F7); | ||
98 | effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F7, exposeClassAction); | 98 | effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F7, exposeClassAction); | ||
99 | connect(exposeClassAction, SIGNAL(triggered(bool)), this, SLOT(toggleActiveClass())); | 99 | connect(exposeClassAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActiveClass); | ||
100 | shortcutClass = KGlobalAccel::self()->shortcut(exposeClassAction); | 100 | shortcutClass = KGlobalAccel::self()->shortcut(exposeClassAction); | ||
101 | connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, &PresentWindowsEffect::globalShortcutChanged); | 101 | connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, &PresentWindowsEffect::globalShortcutChanged); | ||
102 | reconfigure(ReconfigureAll); | 102 | reconfigure(ReconfigureAll); | ||
103 | connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); | 103 | connect(effects, &EffectsHandler::windowAdded, this, &PresentWindowsEffect::slotWindowAdded); | ||
104 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | 104 | connect(effects, &EffectsHandler::windowClosed, this, &PresentWindowsEffect::slotWindowClosed); | ||
105 | connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); | 105 | connect(effects, &EffectsHandler::windowDeleted, this, &PresentWindowsEffect::slotWindowDeleted); | ||
106 | connect(effects, SIGNAL(windowGeometryShapeChanged(KWin::EffectWindow*,QRect)), this, SLOT(slotWindowGeometryShapeChanged(KWin::EffectWindow*,QRect))); | 106 | connect(effects, &EffectsHandler::windowGeometryShapeChanged, this, &PresentWindowsEffect::slotWindowGeometryShapeChanged); | ||
107 | connect(effects, SIGNAL(propertyNotify(KWin::EffectWindow*,long)), this, SLOT(slotPropertyNotify(KWin::EffectWindow*,long))); | 107 | connect(effects, &EffectsHandler::propertyNotify, this, &PresentWindowsEffect::slotPropertyNotify); | ||
108 | connect(effects, &EffectsHandler::numberScreensChanged, this, | 108 | connect(effects, &EffectsHandler::numberScreensChanged, this, | ||
109 | [this] { | 109 | [this] { | ||
110 | if (isActive()) | 110 | if (isActive()) | ||
111 | reCreateGrids(); | 111 | reCreateGrids(); | ||
112 | } | 112 | } | ||
113 | ); | 113 | ); | ||
114 | } | 114 | } | ||
115 | 115 | | |||
▲ Show 20 Lines • Show All 1952 Lines • Show Last 20 Lines |