diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 4aed2c8219774f5d797760606b8489a92ddc5163 (patch) | |
tree | 3f8c130f7d269626bf6a9447407ef6c35954426a /khotkeys/app/kded.cpp | |
download | tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khotkeys/app/kded.cpp')
-rw-r--r-- | khotkeys/app/kded.cpp | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/khotkeys/app/kded.cpp b/khotkeys/app/kded.cpp new file mode 100644 index 000000000..08c9bb487 --- /dev/null +++ b/khotkeys/app/kded.cpp @@ -0,0 +1,103 @@ +/**************************************************************************** + + KHotKeys + + Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org> + + Distributed under the terms of the GNU General Public License version 2. + +****************************************************************************/ + +#define _KHOTKEYS_KDED_CPP_ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "kded.h" + +#include <kcmdlineargs.h> +#include <kconfig.h> +#include <klocale.h> +#include <kapplication.h> + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +#include <X11/Xlib.h> + +#include <settings.h> +#include <input.h> +#include <action_data.h> +#include <gestures.h> +#include <voices.h> + +extern "C" +KDE_EXPORT KDEDModule *create_khotkeys( const QCString& obj ) + { + return new KHotKeys::KHotKeysModule( obj ); + } + +namespace KHotKeys +{ + +// KhotKeysModule + +KHotKeysModule::KHotKeysModule( const QCString& obj ) + : KDEDModule( obj ) + { + for( int i = 0; + i < 5; + ++i ) + { + if( kapp->dcopClient()->isApplicationRegistered( "khotkeys" )) + { + QByteArray data, replyData; + QCString reply; + // wait for it to finish + kapp->dcopClient()->call( "khotkeys*", "khotkeys", "quit()", data, reply, replyData ); + sleep( 1 ); + } + } + client.registerAs( "khotkeys", false ); // extra dcop connection (like if it was an app) + init_global_data( true, this ); // grab keys + // CHECKME triggery a dalsi vytvaret az tady za inicializaci + actions_root = NULL; + reread_configuration(); + } + +KHotKeysModule::~KHotKeysModule() + { + // CHECKME triggery a dalsi rusit uz tady pred cleanupem + delete actions_root; + } + +void KHotKeysModule::reread_configuration() + { // TODO + kdDebug( 1217 ) << "reading configuration" << endl; + delete actions_root; + khotkeys_set_active( false ); + Settings settings; + settings.read_settings( false ); + gesture_handler->set_mouse_button( settings.gesture_mouse_button ); + gesture_handler->set_timeout( settings.gesture_timeout ); + gesture_handler->enable( !settings.gestures_disabled_globally ); + gesture_handler->set_exclude( settings.gestures_exclude ); + voice_handler->set_shortcut( settings.voice_shortcut ); +#if 0 // TEST CHECKME + settings.write_settings(); +#endif + actions_root = settings.actions; + khotkeys_set_active( true ); + actions_root->update_triggers(); + } + +void KHotKeysModule::quit() + { + delete this; + } + +} // namespace KHotKeys + +#include "kded.moc" |