summaryrefslogtreecommitdiffstats
path: root/kxkb/kxkb.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/kxkb.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/kxkb.cpp')
-rw-r--r--kxkb/kxkb.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/kxkb/kxkb.cpp b/kxkb/kxkb.cpp
index 0764aff41..4bc5bdbd7 100644
--- a/kxkb/kxkb.cpp
+++ b/kxkb/kxkb.cpp
@@ -74,6 +74,10 @@ KXKBApp::KXKBApp(bool allowStyles, bool GUIenabled)
m_layoutOwnerMap = new LayoutMap(kxkbConfig);
+ // keep in sync with kcmlayout.cpp
+ keys = new TDEGlobalAccel(TQT_TQOBJECT(this));
+#include "kxkbbindings.cpp"
+
connect( this, TQT_SIGNAL(settingsChanged(int)), TQT_SLOT(slotSettingsChanged(int)) );
addKipcEventMask( KIPC::SettingsChanged );
}
@@ -81,11 +85,12 @@ KXKBApp::KXKBApp(bool allowStyles, bool GUIenabled)
KXKBApp::~KXKBApp()
{
- delete m_tray;
- delete m_rules;
- delete m_extension;
+ delete m_tray;
+ delete m_rules;
+ delete m_extension;
delete m_layoutOwnerMap;
delete kWinModule;
+ delete keys;
}
int KXKBApp::newInstance()
@@ -151,6 +156,8 @@ bool KXKBApp::settingsRead()
initTray();
TDEGlobal::config()->reparseConfiguration(); // kcontrol modified kdeglobals
+ keys->readSettings();
+ keys->updateConnections();
return true;
}
@@ -235,6 +242,13 @@ void KXKBApp::nextLayout()
setLayout(layout);
}
+void KXKBApp::prevLayout()
+{
+ const LayoutUnit& layout = m_layoutOwnerMap->getPrevLayout().layoutUnit;
+ setLayout(layout);
+}
+
+
void KXKBApp::menuActivated(int id)
{
if( KxkbLabelController::START_MENU_ID <= id
@@ -297,10 +311,11 @@ void KXKBApp::windowChanged(WId winId)
void KXKBApp::slotSettingsChanged(int category)
{
- if ( category != TDEApplication::SETTINGS_SHORTCUTS)
- return;
-
- TDEGlobal::config()->reparseConfiguration(); // kcontrol modified kdeglobals
+ if (category == TDEApplication::SETTINGS_SHORTCUTS) {
+ TDEGlobal::config()->reparseConfiguration(); // kcontrol modified kdeglobals
+ keys->readSettings();
+ keys->updateConnections();
+ }
}
bool KXKBApp::x11EventFilter(XEvent *e) {
@@ -309,8 +324,7 @@ bool KXKBApp::x11EventFilter(XEvent *e) {
return TDEApplication::x11EventFilter(e);
}
-const char * DESCRIPTION =
- I18N_NOOP("A utility to switch keyboard maps");
+const char *DESCRIPTION = I18N_NOOP("A utility to switch keyboard maps");
extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
{