summaryrefslogtreecommitdiff
path: root/core/settings/button/remapdlg.cpp
Side-by-side diff
Diffstat (limited to 'core/settings/button/remapdlg.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/settings/button/remapdlg.cpp24
1 files changed, 21 insertions, 3 deletions
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
@@ -50,33 +50,43 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c
m_current = 0;
static const char * const def_channels [] = { "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 };
w_channel-> insertStrList ((const char **) def_channels );
m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( );
m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( );
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 );
+
+ 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 );
it-> setOpen ( true );
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 ( )));
}
RemapDlg::~RemapDlg ( )
{
}
void RemapDlg::delayedInit ( )
{
bool b = w_list-> viewport ( )-> isUpdatesEnabled ( );
@@ -88,28 +98,36 @@ void RemapDlg::delayedInit ( )
m_map_show-> repaint ( );
}
void RemapDlg::itemChanged ( QListViewItem *it )
{
bool enabled = false;
OQCopMessage m;
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 ( ));
}
w_channel-> setEnabled ( enabled );
w_message-> setEnabled ( enabled );
w_channel-> setEditText ( m. channel ( ));
w_message-> setEditText ( m. message ( ));
}
void RemapDlg::textChanged ( const QString &str )