summaryrefslogtreecommitdiff
path: root/core/settings/button/remapdlg.cpp
Side-by-side diff
Diffstat (limited to 'core/settings/button/remapdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/button/remapdlg.cpp72
1 files changed, 39 insertions, 33 deletions
diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp
index 4effebc..cadb955 100644
--- a/core/settings/button/remapdlg.cpp
+++ b/core/settings/button/remapdlg.cpp
@@ -1 +1,9 @@
+
+#include "remapdlg.h"
+#include "buttonutils.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+
+/* QT */
#include <qlistview.h>
@@ -4,4 +12,2 @@
-#include "remapdlg.h"
-#include "buttonutils.h"
@@ -17,3 +23,3 @@ public:
}
-
+
void setDefault ( bool b )
@@ -22,3 +28,3 @@ public:
}
-
+
virtual QString key ( int /*column*/, bool /*ascending*/ ) const
@@ -27,13 +33,13 @@ public:
}
-
- virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )
+
+ virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )
{
if ( m_def ) {
- QFont f ( listView ( )-> font ( ));
- f. setBold ( true );
+ QFont f ( listView ( )-> font ( ));
+ f. setBold ( true );
p-> setFont ( f );
}
- QListViewItem::paintCell ( p, cg, column, width, align );
+ QListViewItem::paintCell ( p, cg, column, width, align );
}
-
+
private:
@@ -50,9 +56,9 @@ RemapDlg::RemapDlg ( const Opie::Core::ODeviceButton *b, bool hold, QWidget *par
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" ));
@@ -60,3 +66,3 @@ RemapDlg::RemapDlg ( const Opie::Core::ODeviceButton *b, bool hold, QWidget *par
((NoSortItem *) m_map_preset )-> setDefault ( true );
-
+
if (m_msg. channel ( ) == "ignore")
@@ -64,3 +70,3 @@ RemapDlg::RemapDlg ( const Opie::Core::ODeviceButton *b, bool hold, QWidget *par
m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg_preset. channel ( ), m_msg_preset. message ( ));
-
+
m_current = m_map_none;
@@ -72,11 +78,11 @@ RemapDlg::RemapDlg ( const Opie::Core::ODeviceButton *b, bool hold, QWidget *par
}
-
- QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" ));
+
+ 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_map_show = new NoSortItem ( w_list, 4, tr( "Show" ));
+
w_list-> setCurrentItem ( m_current );
-
+
QTimer::singleShot ( 0, this, SLOT( delayedInit()));
@@ -92,7 +98,7 @@ void RemapDlg::delayedInit ( )
w_list-> viewport ( )-> setUpdatesEnabled ( false );
-
+
ButtonUtils::inst ( )-> insertAppLnks ( m_map_show );
-
+
w_list-> viewport ( )-> setUpdatesEnabled ( b );
-
+
m_map_show-> repaint ( );
@@ -104,3 +110,3 @@ void RemapDlg::itemChanged ( QListViewItem *it )
OQCopMessage m;
-
+
m_current = it;
@@ -110,3 +116,3 @@ void RemapDlg::itemChanged ( QListViewItem *it )
m_msg = m = OQCopMessage ( "ignore", 0 );
- qDebug ("***ignoring");
+ odebug << "***ignoring" << oendl;
}
@@ -115,7 +121,7 @@ void RemapDlg::itemChanged ( QListViewItem *it )
m_msg = m = m_msg_preset;
- qDebug ("***Preset");
+ odebug << "***Preset" << oendl;
}
- else if ( it && !it-> childCount ( ) )
+ else if ( it && !it-> childCount ( ) )
{
- qDebug ("***Custom: %s %s ",it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( ));
+ odebug << "***Custom: " << it-> text ( 1 ). latin1 ( ) << " " << it-> text ( 2 ). latin1 ( ) << oendl;
enabled = ( it == m_map_custom );
@@ -123,9 +129,9 @@ void RemapDlg::itemChanged ( QListViewItem *it )
}
-
+
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
+//so raise() is always present
if(m. message ( ) != "raise()")
@@ -151,3 +157,3 @@ OQCopMessage RemapDlg::message ( )
//make sure to update message if typed in
- itemChanged(w_list->currentItem());
+ itemChanged(w_list->currentItem());
return m_msg;