Diffstat (limited to 'core/settings/button/buttonsettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/settings/button/buttonsettings.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index c71514c..8b0b0a8 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp @@ -57,12 +57,13 @@ struct buttoninfo { ButtonSettings::ButtonSettings ( ) : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) { const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); + (void) ButtonUtils::inst ( ); // initialise setCaption ( tr( "Button Settings" )); QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); QLabel *l = new QLabel ( tr( "<center>Press or hold the button you want to remap.</center>" ), this ); @@ -130,12 +131,13 @@ ButtonSettings::ButtonSettings ( ) m_infos. append ( bi ); } toplay-> addStretch ( 10 ); m_last_button = 0; + m_lock = false; m_timer = new QTimer ( this ); connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( keyTimeout ( ))); updateLabels ( ); @@ -205,12 +207,16 @@ void ButtonSettings::keyTimeout ( ) } void ButtonSettings::edit ( buttoninfo *bi, bool hold ) { qDebug ( "remap %s for %s", hold ? "hold" : "press", bi-> m_button-> userText ( ). latin1 ( )); + if ( m_lock ) + return; + m_lock = true; + RemapDlg *d = new RemapDlg ( bi-> m_button, hold, this ); d-> showMaximized ( ); if ( d-> exec ( ) == QDialog::Accepted ) { qDebug ( " -> %s %s", d-> message ( ). channel ( ). data ( ), d-> message ( ). message ( ). data ( )); @@ -224,12 +230,14 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) } updateLabels ( ); } delete d; + + m_lock = false; } void ButtonSettings::accept ( ) { for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { buttoninfo *bi = *it; |