summaryrefslogtreecommitdiffstats
path: root/kxkb/kcmlayout.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2023-06-01 12:53:38 +0300
committerMavridis Philippe <[email protected]>2023-06-14 14:19:31 +0300
commit4e428e11c5858b5a2485af135cbb2fabd8a3522f (patch)
treeea5edb36e57eb9cbe0621c6b030d66b602c3c1d2 /kxkb/kcmlayout.cpp
parente4e948060df1bb40207cc62b0d231f3b147c7b16 (diff)
downloadtdebase-4e428e11c5858b5a2485af135cbb2fabd8a3522f.tar.gz
tdebase-4e428e11c5858b5a2485af135cbb2fabd8a3522f.zip
kxkb: re-add custom TDE switching shortcut
This commit fixes issue #342. Signed-off-by: Mavridis Philippe <[email protected]> (cherry picked from commit 22bb398b3ba83142bf49f6abf47081e5e9e11bef)
Diffstat (limited to 'kxkb/kcmlayout.cpp')
-rw-r--r--kxkb/kcmlayout.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/kxkb/kcmlayout.cpp b/kxkb/kcmlayout.cpp
index a2b5d8e12..9499d8efc 100644
--- a/kxkb/kcmlayout.cpp
+++ b/kxkb/kcmlayout.cpp
@@ -13,6 +13,7 @@
#include <tqlistview.h>
#include <tqbuttongroup.h>
#include <tqspinbox.h>
+#include <tqvbox.h>
#include <tdefontrequester.h>
#include <kcolorbutton.h>
@@ -25,6 +26,7 @@
#include <tdeapplication.h>
#include <kiconloader.h>
#include <tdemessagebox.h>
+#include <kglobalaccel.h>
#include <dcopref.h>
#include <dcopclient.h>
@@ -168,9 +170,14 @@ LayoutConfig::LayoutConfig(TQWidget *parent, const char *name)
//Read rules - we _must_ read _before_ creating xkb-options comboboxes
loadRules();
- makeOptionsTab();
+ // Load global shortcuts
+#define NOSLOTS
+ keys = new TDEGlobalAccel(TQT_TQOBJECT(this));
+#include "kxkbbindings.cpp"
+ makeOptionsTab();
load();
+ makeShortcutsTab();
}
@@ -184,6 +191,8 @@ void LayoutConfig::load()
{
m_kxkbConfig.load(KxkbConfig::LOAD_ALL);
+ keys->readSettings();
+
initUI();
}
@@ -419,6 +428,10 @@ void LayoutConfig::save()
m_forceGrpOverwrite = false;
}
+ // Save and apply global shortcuts
+ m_keyChooser->commitChanges();
+ keys->writeSettings(0, true);
+
// Get current layout from Kxkb
if (!kapp->dcopClient()->isAttached())
kapp->dcopClient()->attach();
@@ -715,6 +728,13 @@ TQWidget* LayoutConfig::makeOptionsTab()
return listView;
}
+TQWidget* LayoutConfig::makeShortcutsTab() {
+ m_keyChooser = new KKeyChooser(keys, widget->tabShortcuts, false, false);
+ connect(m_keyChooser, SIGNAL(keyChange()), this, SLOT(changed()));
+ widget->tabShortcuts->layout()->add(m_keyChooser);
+ return m_keyChooser;
+}
+
void LayoutConfig::updateOptionsCommand()
{
TQString setxkbmap;
@@ -1064,7 +1084,7 @@ void LayoutConfig::hotkeyComboChanged() {
}
if (widget->comboHotkey->currentItem() == other) {
- widget->tabWidget->setCurrentPage(3);
+ widget->tabWidget->setCurrentPage(4);
widget->listOptions->ensureItemVisible(grpItem);
widget->listOptions->setFocus();
}