summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-04-15 00:36:18 (UTC)
committer llornkcor <llornkcor>2003-04-15 00:36:18 (UTC)
commit02f76303f1b134c26b13c30f97295e78ffca051b (patch) (side-by-side diff)
tree8f64d4caa99229fa7d93258656c318667e8d6d6f
parent0b785144fe1700423b8a57e51638d444f1725283 (diff)
downloadopie-02f76303f1b134c26b13c30f97295e78ffca051b.zip
opie-02f76303f1b134c26b13c30f97295e78ffca051b.tar.gz
opie-02f76303f1b134c26b13c30f97295e78ffca051b.tar.bz2
hack for bug 840. remembers typed in messages.
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/settings/button/remapdlg.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp
index b6ee60b..939a6bf 100644
--- a/core/settings/button/remapdlg.cpp
+++ b/core/settings/button/remapdlg.cpp
@@ -82,69 +82,75 @@ RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, c
QTimer::singleShot ( 0, this, SLOT( delayedInit ( )));
}
RemapDlg::~RemapDlg ( )
{
}
void RemapDlg::delayedInit ( )
{
bool b = w_list-> viewport ( )-> isUpdatesEnabled ( );
w_list-> viewport ( )-> setUpdatesEnabled ( false );
ButtonUtils::inst ( )-> insertAppLnks ( m_map_show );
w_list-> viewport ( )-> setUpdatesEnabled ( b );
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 ( "ignore", 0 );
qDebug ("***ignoring");
}
else if ( it == m_map_preset )
{
m_msg = m = m_msg_preset;
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 ( ));
+//hack for if user has typed in a message, such as 'suspend()'
+//so raise() is always present
+ if(m. message ( ) != "raise()")
+ w_message->insertItem("raise()");
w_message-> setEditText ( m. message ( ));
}
void RemapDlg::textChanged ( const QString &str )
{
if ( !m_current )
return;
QComboBox *which = (QComboBox *) sender ( );
if ( which == w_channel )
m_current-> setText ( 1, str );
else if ( which == w_message )
m_current-> setText ( 2, str );
}
OQCopMessage RemapDlg::message ( )
{
+//make sure to update message if typed in
+ itemChanged(w_list->currentItem());
return m_msg;
}