summaryrefslogtreecommitdiffstats
path: root/kxkb/kcmlayout.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2023-06-01 12:53:38 +0300
committerMavridis Philippe <mavridisf@gmail.com>2023-06-14 14:18:24 +0300
commit22bb398b3ba83142bf49f6abf47081e5e9e11bef (patch)
tree4783649fb76eb12aac34fb9342e8e8205de616d9 /kxkb/kcmlayout.cpp
parentbcd2bfcdc49dcf97b730889d5554b15623072a40 (diff)
downloadtdebase-22bb398b3ba83142bf49f6abf47081e5e9e11bef.tar.gz
tdebase-22bb398b3ba83142bf49f6abf47081e5e9e11bef.zip
kxkb: re-add custom TDE switching shortcut
This commit fixes issue #342. Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
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();
}