~ubuntu-branches/ubuntu/warty/kdebase/warty

« back to all changes in this revision

Viewing changes to khotkeys/kcontrol/gestures_settings_tab.cpp

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-09-16 04:51:45 UTC
  • Revision ID: james.westby@ubuntu.com-20040916045145-9vr63kith3k1cpza
Tags: upstream-3.2.2
ImportĀ upstreamĀ versionĀ 3.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
 
 
3
 KHotKeys
 
4
 
 
5
 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
 
6
 
 
7
 Distributed under the terms of the GNU General Public License version 2.
 
8
 
 
9
****************************************************************************/
 
10
 
 
11
#define _GESTURES_SETTINGS_TAB_CPP_
 
12
 
 
13
#ifdef HAVE_CONFIG_H
 
14
#include <config.h>
 
15
#endif
 
16
 
 
17
#include "gestures_settings_tab.h"
 
18
 
 
19
#include <klocale.h>
 
20
#include <qcombobox.h>
 
21
#include <knuminput.h>
 
22
#include <qcheckbox.h>
 
23
 
 
24
#include "kcmkhotkeys.h"
 
25
 
 
26
namespace KHotKeys
 
27
{
 
28
 
 
29
Gestures_settings_tab::Gestures_settings_tab( QWidget* parent_P, const char* name_P )
 
30
    : Gestures_settings_tab_ui( parent_P, name_P )
 
31
    {
 
32
    mouse_button_combo->insertItem( i18n( "Button 2 (middle)" ), 0 );
 
33
    mouse_button_combo->insertItem( i18n( "Button 3 (right)" ), 1 );
 
34
    mouse_button_combo->insertItem( i18n( "Button 4 (often wheel up)" ), 2 );
 
35
    mouse_button_combo->insertItem( i18n( "Button 5 (often wheel down)" ), 3 );
 
36
    mouse_button_combo->insertItem( i18n( "Button 6 (if available)" ), 4 );
 
37
    mouse_button_combo->insertItem( i18n( "Button 7 (if available)" ), 5 );
 
38
    mouse_button_combo->insertItem( i18n( "Button 8 (if available)" ), 6 );
 
39
    mouse_button_combo->insertItem( i18n( "Button 9 (if available)" ), 7 );
 
40
    // KHotKeys::Module::changed()
 
41
    connect( mouse_gestures_globally, SIGNAL( clicked()),
 
42
        module, SLOT( changed()));
 
43
    connect( mouse_button_combo, SIGNAL( activated( int )),
 
44
        module, SLOT( changed()));
 
45
    connect( timeout_input, SIGNAL( valueChanged( int )),
 
46
        module, SLOT( changed()));
 
47
    }
 
48
 
 
49
void Gestures_settings_tab::read_data()
 
50
    {
 
51
    mouse_gestures_globally->setChecked( module->gestures_disabled());
 
52
    mouse_button_combo->setCurrentItem( module->gesture_button() - 2 );
 
53
    timeout_input->setValue( module->gesture_timeout());
 
54
    }
 
55
 
 
56
void Gestures_settings_tab::write_data() const
 
57
    {
 
58
    module->set_gestures_disabled( mouse_gestures_globally->isChecked());
 
59
    module->set_gesture_button( mouse_button_combo->currentItem() + 2 );
 
60
    module->set_gesture_timeout( timeout_input->value());
 
61
    }
 
62
 
 
63
void Gestures_settings_tab::clear_data()
 
64
    {
 
65
    // "global" tab, not action specific, do nothing
 
66
    }
 
67
    
 
68
} // namespace KHotKeys
 
69
 
 
70
#include "gestures_settings_tab.moc"