Diffstat (limited to 'core/settings/button/buttonsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/button/buttonsettings.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index 942d5e4..b6a07a8 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp @@ -17,3 +17,3 @@ ..}^=.= = ; Public License for more details. -++= -. .` .: +++= -. .` .: : = ...= . :.=- You should have received a copy of the GNU @@ -52,3 +52,3 @@ struct buttoninfo { QLabel *m_hlabel; - + bool m_pdirty : 1; @@ -58,3 +58,3 @@ struct buttoninfo { -ButtonSettings::ButtonSettings ( ) +ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal, WFlags f ) : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) @@ -67,6 +67,6 @@ ButtonSettings::ButtonSettings ( ) QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); - + QLabel *l = new QLabel ( tr( "<center>Press or hold the button you want to remap.</center>" ), this ); toplay-> addWidget ( l ); - + QGridLayout *lay = new QGridLayout ( toplay ); @@ -79,3 +79,3 @@ ButtonSettings::ButtonSettings ( ) m_infos. setAutoDelete ( true ); - + int i = 1; @@ -97,8 +97,8 @@ ButtonSettings::ButtonSettings ( ) bi-> m_hdirty = false; - + l = new QLabel ( this ); l-> setPixmap (( *it ). pixmap ( )); - + lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); - + l = new QLabel ( tr( "Press:" ), this ); @@ -107,3 +107,3 @@ ButtonSettings::ButtonSettings ( ) lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop ); - + l = new QLabel ( this ); @@ -117,3 +117,3 @@ ButtonSettings::ButtonSettings ( ) bi-> m_plabel = l; - + l = new QLabel ( this ); @@ -127,7 +127,7 @@ ButtonSettings::ButtonSettings ( ) bi-> m_hlabel = l; - + i += 2; - + m_infos. append ( bi ); - } + } @@ -137,3 +137,3 @@ ButtonSettings::ButtonSettings ( ) m_lock = false; - + m_timer = new QTimer ( this ); @@ -141,4 +141,4 @@ ButtonSettings::ButtonSettings ( ) - updateLabels ( ); - + updateLabels ( ); + QPEApplication::grabKeyboard ( ); @@ -155,3 +155,3 @@ void ButtonSettings::updateLabels ( ) qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); - + (*it)-> m_picon-> setPixmap ( cip. m_icon ); @@ -170,5 +170,5 @@ buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) if ((*it)-> m_button-> keycode ( ) == key ) - return *it; - } - return 0; + return *it; + } + return 0; } @@ -178,4 +178,4 @@ void ButtonSettings::keyPressEvent ( QKeyEvent *e ) buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); - - if ( bi && !e-> isAutoRepeat ( )) { + + if ( bi && !e-> isAutoRepeat ( )) { m_timer-> stop ( ); @@ -191,6 +191,6 @@ void ButtonSettings::keyReleaseEvent ( QKeyEvent *e ) buttoninfo *bi = buttonInfoForKeycode ( e-> key ( )); - + if ( bi && !e-> isAutoRepeat ( ) && m_timer-> isActive ( )) { m_timer-> stop ( ); - edit ( bi, false ); + edit ( bi, false ); } @@ -210,3 +210,3 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) { - + if ( m_lock ) @@ -214,9 +214,9 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) m_lock = true; - + RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this ); - d-> showMaximized ( ); + d-> showMaximized ( ); if ( d-> exec ( ) == QDialog::Accepted ) { - + if ( hold ) { @@ -229,8 +229,8 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) } - + updateLabels ( ); } - + delete d; - + m_lock = false; @@ -242,3 +242,3 @@ void ButtonSettings::accept ( ) buttoninfo *bi = *it; - + if ( bi-> m_pdirty ) |