summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <[email protected]>2018-02-14 16:20:56 -0500
committerKurt Hindenburg <[email protected]>2018-02-14 16:20:56 -0500
commitf4fbec0c020fae03c9464698102247d6c2fad2fe (patch)
treeab484c5d05ba7e4e83945860167e20c1b269becd
parentfae70127ae655bffebd1188773f78499f6b52a1b (diff)
Fix --background-mode so the shortcut works
I disabled this in 2014 since it did not work; it works now and changing the shortcut works as well. BUG: 353382
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/Application.cpp13
-rw-r--r--src/CMakeLists.txt1
3 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f3e1a8..fc387e1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,7 +45,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED
CoreAddons Crash GuiAddons DBusAddons
I18n IconThemes Init KIO Notifications NotifyConfig
Parts Pty Service TextWidgets WidgetsAddons
- WindowSystem XmlGui DBusAddons
+ WindowSystem XmlGui DBusAddons GlobalAccel
)
find_package(KF5DocTools ${KF5_MIN_VERSION})
diff --git a/src/Application.cpp b/src/Application.cpp
index ec42e6e..4901238 100644
--- a/src/Application.cpp
+++ b/src/Application.cpp
@@ -29,6 +29,7 @@
// KDE
#include <KActionCollection>
+#include <KGlobalAccel>
#include <KLocalizedString>
// Konsole
@@ -556,15 +557,13 @@ void Application::startBackgroundMode(MainWindow *window)
return;
}
-/* FIXME: This doesn't work ATM - leave in here so I dont' forget about it
KActionCollection* collection = window->actionCollection();
- QAction * action = collection->addAction("toggle-background-window");
- action->setObjectName(QLatin1String("Konsole Background Mode"));
- action->setText(i18n("Toggle Background Window"));
- action->setGlobalShortcut(QKeySequence(Konsole::ACCEL + Qt::SHIFT + Qt::Key_F12)));
-
+ QAction* action = collection->addAction(QStringLiteral("toggle-background-window"));
+ action->setObjectName(QStringLiteral("Konsole Background Mode"));
+ action->setText(i18nc("@item", "Toggle Background Window"));
+ KGlobalAccel::self()->setGlobalShortcut(action, QKeySequence(Konsole::ACCEL + Qt::SHIFT + Qt::Key_F12));
connect(action, &QAction::triggered, this, &Application::toggleBackgroundInstance);
-*/
+
_backgroundInstance = window;
}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 51a26ec..ac1e64d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -123,6 +123,7 @@ set(konsole_LIBS
KF5::Pty
KF5::KIOWidgets
KF5::DBusAddons
+ KF5::GlobalAccel
)
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")