summaryrefslogtreecommitdiffstats
path: root/kxkb/kcmlayout.cpp
diff options
context:
space:
mode:
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();
}