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/kcontrol/gestures_settings_tab.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/kcontrol/gestures_settings_tab.cpp')
-rw-r--r-- | khotkeys/kcontrol/gestures_settings_tab.cpp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/khotkeys/kcontrol/gestures_settings_tab.cpp b/khotkeys/kcontrol/gestures_settings_tab.cpp new file mode 100644 index 000000000..e3c71c66a --- /dev/null +++ b/khotkeys/kcontrol/gestures_settings_tab.cpp @@ -0,0 +1,76 @@ +/**************************************************************************** + + KHotKeys + + Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org> + + Distributed under the terms of the GNU General Public License version 2. + +****************************************************************************/ + +#define _GESTURES_SETTINGS_TAB_CPP_ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "gestures_settings_tab.h" + +#include <klocale.h> +#include <qcombobox.h> +#include <knuminput.h> +#include <qcheckbox.h> + +#include "kcmkhotkeys.h" +#include "windowdef_list_widget.h" + +namespace KHotKeys +{ + +Gestures_settings_tab::Gestures_settings_tab( QWidget* parent_P, const char* name_P ) + : Gestures_settings_tab_ui( parent_P, name_P ) + { + mouse_button_combo->insertItem( i18n( "Button 2 (middle)" ), 0 ); + mouse_button_combo->insertItem( i18n( "Button 3 (secondary)" ), 1 ); + mouse_button_combo->insertItem( i18n( "Button 4 (often wheel up)" ), 2 ); + mouse_button_combo->insertItem( i18n( "Button 5 (often wheel down)" ), 3 ); + mouse_button_combo->insertItem( i18n( "Button 6 (if available)" ), 4 ); + mouse_button_combo->insertItem( i18n( "Button 7 (if available)" ), 5 ); + mouse_button_combo->insertItem( i18n( "Button 8 (if available)" ), 6 ); + mouse_button_combo->insertItem( i18n( "Button 9 (if available)" ), 7 ); + // KHotKeys::Module::changed() + connect( mouse_gestures_globally, SIGNAL( clicked()), + module, SLOT( changed())); + connect( mouse_button_combo, SIGNAL( activated( int )), + module, SLOT( changed())); + connect( timeout_input, SIGNAL( valueChanged( int )), + module, SLOT( changed())); + } + +void Gestures_settings_tab::read_data() + { + mouse_gestures_globally->setChecked( module->gestures_disabled()); + mouse_button_combo->setCurrentItem( module->gesture_button() - 2 ); + timeout_input->setValue( module->gesture_timeout()); + if( module->gestures_exclude() != NULL ) + windowdef_list_widget->set_data( module->gestures_exclude()); + else + windowdef_list_widget->clear_data(); + } + +void Gestures_settings_tab::write_data() const + { + module->set_gestures_disabled( mouse_gestures_globally->isChecked()); + module->set_gesture_button( mouse_button_combo->currentItem() + 2 ); + module->set_gesture_timeout( timeout_input->value()); + module->set_gestures_exclude( windowdef_list_widget->get_data()); + } + +void Gestures_settings_tab::clear_data() + { + // "global" tab, not action specific, do nothing + } + +} // namespace KHotKeys + +#include "gestures_settings_tab.moc" |