summaryrefslogtreecommitdiffstats
path: root/khotkeys/kcontrol/voice_settings_tab.cpp
blob: 1d97d69abb4ffab91c24513975fc997114991ca6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/****************************************************************************

 KHotKeys
 
 Copyright (C) 2005        Olivier Goffart <ogoffart @ kde.org>

 Distributed under the terms of the GNU General Public License version 2.
 
****************************************************************************/

#include "voice_settings_tab.h"

#include <tdelocale.h>
#include <tqcombobox.h>
#include <knuminput.h>
#include <tqcheckbox.h>
#include <kkeybutton.h>
#include <kkeydialog.h>

#include "kcmkhotkeys.h"
#include "windowdef_list_widget.h"

namespace KHotKeys
{

Voice_settings_tab::Voice_settings_tab( TQWidget* parent_P, const char* name_P )
    : Voice_settings_tab_ui( parent_P, name_P )
    {
		connect( keyButton , TQT_SIGNAL(capturedShortcut (const TDEShortcut &)) , this, TQT_SLOT(slotCapturedKey( const TDEShortcut& )));
    }

void Voice_settings_tab::read_data()
    {
		keyButton->setShortcut( module->voice_shortcut() );
    }

void Voice_settings_tab::write_data() const
    {
		module->set_voice_shortcut( keyButton->shortcut() );
    }

void Voice_settings_tab::clear_data()
    {
    // "global" tab, not action specific, do nothing
    }
	
void Voice_settings_tab::slotCapturedKey( const TDEShortcut& cut)
   {
	   /*for(uint seq=0; seq<TDEShortcut::MAX_SEQUENCES; seq++)
	   {
		   KKeySequance key=cut.seq(seq);
		   if(key.isNull())
			   continue;
		   if(key.count() > 1)
			   return;
	   }*/
	   
	   if(KKeyChooser::checkGlobalShortcutsConflict(cut,true,this))
		   return;
	   if(KKeyChooser::checkStandardShortcutsConflict(cut,true,this))
		   return;
	   
	   keyButton->setShortcut(cut);
	   module->changed();
   }
} // namespace KHotKeys

#include "voice_settings_tab.moc"