Changeset View
Changeset View
Standalone View
Standalone View
effects/invert/invert.cpp
Show All 40 Lines | 38 | : m_inited(false), | |||
---|---|---|---|---|---|
41 | m_allWindows(false) | 41 | m_allWindows(false) | ||
42 | { | 42 | { | ||
43 | QAction* a = new QAction(this); | 43 | QAction* a = new QAction(this); | ||
44 | a->setObjectName(QStringLiteral("Invert")); | 44 | a->setObjectName(QStringLiteral("Invert")); | ||
45 | a->setText(i18n("Toggle Invert Effect")); | 45 | a->setText(i18n("Toggle Invert Effect")); | ||
46 | KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I); | 46 | KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I); | ||
47 | KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I); | 47 | KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_I); | ||
48 | effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_I, a); | 48 | effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_I, a); | ||
49 | connect(a, SIGNAL(triggered(bool)), this, SLOT(toggleScreenInversion())); | 49 | connect(a, &QAction::triggered, this, &InvertEffect::toggleScreenInversion); | ||
50 | 50 | | |||
51 | QAction* b = new QAction(this); | 51 | QAction* b = new QAction(this); | ||
52 | b->setObjectName(QStringLiteral("InvertWindow")); | 52 | b->setObjectName(QStringLiteral("InvertWindow")); | ||
53 | b->setText(i18n("Toggle Invert Effect on Window")); | 53 | b->setText(i18n("Toggle Invert Effect on Window")); | ||
54 | KGlobalAccel::self()->setDefaultShortcut(b, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U); | 54 | KGlobalAccel::self()->setDefaultShortcut(b, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U); | ||
55 | KGlobalAccel::self()->setShortcut(b, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U); | 55 | KGlobalAccel::self()->setShortcut(b, QList<QKeySequence>() << Qt::CTRL + Qt::META + Qt::Key_U); | ||
56 | effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_U, b); | 56 | effects->registerGlobalShortcut(Qt::CTRL + Qt::META + Qt::Key_U, b); | ||
57 | connect(b, SIGNAL(triggered(bool)), this, SLOT(toggleWindow())); | 57 | connect(b, &QAction::triggered, this, &InvertEffect::toggleWindow); | ||
58 | 58 | | |||
59 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | 59 | connect(effects, &EffectsHandler::windowClosed, this, &InvertEffect::slotWindowClosed); | ||
60 | } | 60 | } | ||
61 | 61 | | |||
62 | InvertEffect::~InvertEffect() | 62 | InvertEffect::~InvertEffect() | ||
63 | { | 63 | { | ||
64 | delete m_shader; | 64 | delete m_shader; | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | bool InvertEffect::supported() | 67 | bool InvertEffect::supported() | ||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |