[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    PATCH: KGlobalAccel + Tux keys
From:       Lubos Lunak <l.lunak () suse ! cz>
Date:       2002-10-30 10:41:47
[Download RAW message or body]

Hello,

 please review. When configuring global shortcuts for e.g. KMixApplet or 
KNotes, it's not possible to create shortcuts with the Tux modifier key 
(called by the strange name 'Win' in KKeyDialog for some unknown reason). 
This is because such shortcuts are allowed only for KGlobalAccel, and 
KKeyDialog::configure( KGlobalAccel*, ... ) creates the KKeyChooser as when 
configuring app shortcuts.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak@suse.cz , l.lunak@kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/

["kkeydialog.cpp.patch" (text/x-diff)]

--- kkeydialog.cpp.sav	Mon Oct 14 15:05:47 2002
+++ kkeydialog.cpp	Wed Oct 30 11:04:47 2002
@@ -184,14 +184,10 @@ KKeyChooser::KKeyChooser( KAccel* action
 KKeyChooser::KKeyChooser( KGlobalAccel* actions, QWidget* parent,
 			bool bCheckAgainstStdKeys,
 			bool bAllowLetterShortcuts,
-			bool bAllowWinKey )
+			bool /*bAllowWinKey*/ )
 : QWidget( parent )
 {
-	ActionType type;
-	if( bAllowWinKey )
-		type = (bCheckAgainstStdKeys) ? ApplicationGlobal : Global;
-	else
-		type = Application;
+	ActionType type = (bCheckAgainstStdKeys) ? ApplicationGlobal : Global;
 
 	initGUI( type, bAllowLetterShortcuts );
 	insert( actions );
@@ -851,6 +847,19 @@ int KKeyChooserItem::compare( QListViewI
 /* (by using KDialogBase there is almost no code left ;)                */
 /*                                                                      */
 /************************************************************************/
+KKeyDialog::KKeyDialog( KKeyChooser::ActionType type, bool bAllowLetterShortcuts, \
QWidget *parent, const char* name ) +: KDialogBase( parent, name, true, \
i18n("Configure Shortcuts"), Help|Default|Ok|Cancel, Ok ) +{
+	m_pKeyChooser = new KKeyChooser( this, type, bAllowLetterShortcuts );
+	setMainWidget( m_pKeyChooser );
+	connect( this, SIGNAL(defaultClicked()), m_pKeyChooser, SLOT(allDefault()) );
+	enableButton( Help, false );
+
+	KConfigGroup group( KGlobal::config(), "KKeyDialog Settings" );
+	QSize sz = size();
+	resize( group.readSizeEntry( "Dialog Size", &sz ) );
+}
+
 KKeyDialog::KKeyDialog( bool bAllowLetterShortcuts, QWidget *parent, const char* \
name )  : KDialogBase( parent, name, true, i18n("Configure Shortcuts"), \
Help|Default|Ok|Cancel, Ok )  {
@@ -924,7 +933,7 @@ int KKeyDialog::configure( KAccel* keys,
 
 int KKeyDialog::configure( KGlobalAccel* keys, bool bAllowLetterShortcuts, QWidget \
*parent, bool bSaveSettings )  {
-	KKeyDialog dlg( bAllowLetterShortcuts, parent );
+	KKeyDialog dlg( KKeyChooser::ApplicationGlobal, bAllowLetterShortcuts, parent );
 	dlg.m_pKeyChooser->insert( keys );
 	bool b = dlg.configure( bSaveSettings );
 	if( b && bSaveSettings )


["kkeydialog.h.patch" (text/x-diff)]

--- kkeydialog.h.sav	Mon Oct 14 15:00:14 2002
+++ kkeydialog.h	Wed Oct 30 10:55:49 2002
@@ -223,6 +223,7 @@ public:
 	 * keys ('A', '1', etc.) are not permissible shortcuts.
 	 */
 	KKeyDialog( bool bAllowLetterShortcuts = true, QWidget* parent = 0, const char* \
name = 0 ); +	KKeyDialog( KKeyChooser::ActionType, bool bAllowLetterShortcuts = true, \
QWidget* parent = 0, const char* name = 0 );  
 	/**
 	 * Destructor. Deletes all resources used by a KKeyDialog object.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic