From 28be0fcc9bda71175c3ee17e79fce2ac24340ff2 Mon Sep 17 00:00:00 2001 From: groucho Date: Wed, 19 Mar 2003 11:36:34 +0000 Subject: Fixed bug #744 where non mapped buttons in buttonsettings were not saved by introducing the " ignore" statement. Also removed unsed debug code --- (limited to 'core/settings') diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index eabb779..942d5e4 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp @@ -208,7 +208,6 @@ 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; @@ -218,7 +217,7 @@ void ButtonSettings::edit ( buttoninfo *bi, bool hold ) d-> showMaximized ( ); if ( d-> exec ( ) == QDialog::Accepted ) { - qDebug ( " -> %s %s", d-> message ( ). channel ( ). data ( ), d-> message ( ). message ( ). data ( )); + if ( hold ) { bi-> m_hmsg = d-> message ( ); diff --git a/core/settings/button/buttonutils.cpp b/core/settings/button/buttonutils.cpp index 91d2af3..27a2f38 100644 --- a/core/settings/button/buttonutils.cpp +++ b/core/settings/button/buttonutils.cpp @@ -65,7 +65,8 @@ qCopInfo ButtonUtils::messageToInfo ( const OQCopMessage &c ) QCString ch = c. channel ( ); QCString f = c. message ( ); - if ( ch. isNull ( )) + + if ( ch == "ignore" ) return qCopInfo ( qApp-> translate ( "ButtonSettings", "Ignored" )); for ( const predef_qcop *p = predef; p-> m_text; p++ ) { diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp index a251bd4..b6ee60b 100644 --- a/core/settings/button/remapdlg.cpp +++ b/core/settings/button/remapdlg.cpp @@ -59,7 +59,18 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); m_map_preset = new NoSortItem ( w_list, 1, tr( "Default" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); ((NoSortItem *) m_map_preset )-> setDefault ( true ); - m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); + + if (m_msg. channel ( ) == "ignore") + { + m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); + + m_current = m_map_none; + } + else + { + m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); + m_current = m_map_custom; + } QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" )); ButtonUtils::inst ( )-> insertActions ( it ); @@ -67,7 +78,6 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c m_map_show = new NoSortItem ( w_list, 4, tr( "Show" )); - m_current = m_map_custom; w_list-> setCurrentItem ( m_current ); QTimer::singleShot ( 0, this, SLOT( delayedInit ( ))); @@ -97,10 +107,18 @@ void RemapDlg::itemChanged ( QListViewItem *it ) m_current = it; if ( it == m_map_none ) - m_msg = m = OQCopMessage ( 0, 0 ); + { + m_msg = m = OQCopMessage ( "ignore", 0 ); + qDebug ("***ignoring"); + } else if ( it == m_map_preset ) + { m_msg = m = m_msg_preset; - else if ( it && !it-> childCount ( )) { + qDebug ("***Preset"); + } + else if ( it && !it-> childCount ( )) + { + qDebug ("***Custom: %s %s ",it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); enabled = ( it == m_map_custom ); m_msg = m = OQCopMessage ( it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); } -- cgit v0.9.0.2