summaryrefslogtreecommitdiff
path: root/core/settings/button/remapdlg.cpp
Unidiff
Diffstat (limited to 'core/settings/button/remapdlg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/button/remapdlg.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp
index 7dabe68..121173a 100644
--- a/core/settings/button/remapdlg.cpp
+++ b/core/settings/button/remapdlg.cpp
@@ -34,97 +34,97 @@ public:
34 p-> setFont ( f ); 34 p-> setFont ( f );
35 } 35 }
36 QListViewItem::paintCell ( p, cg, column, width, align ); 36 QListViewItem::paintCell ( p, cg, column, width, align );
37 } 37 }
38 38
39private: 39private:
40 QString m_key; 40 QString m_key;
41 bool m_def; 41 bool m_def;
42}; 42};
43 43
44 44
45RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, const char *name ) 45RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, const char *name )
46 : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) 46 : RemapDlgBase ( parent, name, true, WStyle_ContextHelp )
47{ 47{
48 setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( ))); 48 setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( )));
49 49
50 m_current = 0; 50 m_current = 0;
51 51
52 static const char * const def_channels [] = { "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 }; 52 static const char * const def_channels [] = { "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 };
53 w_channel-> insertStrList ((const char **) def_channels ); 53 w_channel-> insertStrList ((const char **) def_channels );
54 54
55 m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); 55 m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( );
56 m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); 56 m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( );
57 57
58 m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); 58 m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" ));
59 m_map_preset = new NoSortItem ( w_list, 1, tr( "Default" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); 59 m_map_preset = new NoSortItem ( w_list, 1, tr( "Default" ), m_msg_preset. channel ( ), m_msg_preset. message ( ));
60 ((NoSortItem *) m_map_preset )-> setDefault ( true ); 60 ((NoSortItem *) m_map_preset )-> setDefault ( true );
61 61
62 if (m_msg. channel ( ) == "ignore") 62 if (m_msg. channel ( ) == "ignore")
63 { 63 {
64 m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); 64 m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg_preset. channel ( ), m_msg_preset. message ( ));
65 65
66 m_current = m_map_none; 66 m_current = m_map_none;
67 } 67 }
68 else 68 else
69 { 69 {
70 m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); 70 m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( ));
71 m_current = m_map_custom; 71 m_current = m_map_custom;
72 } 72 }
73 73
74 QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" )); 74 QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" ));
75 ButtonUtils::inst ( )-> insertActions ( it ); 75 ButtonUtils::inst ( )-> insertActions ( it );
76 it-> setOpen ( true ); 76 it-> setOpen ( true );
77 77
78 m_map_show = new NoSortItem ( w_list, 4, tr( "Show" )); 78 m_map_show = new NoSortItem ( w_list, 4, tr( "Show" ));
79 79
80 w_list-> setCurrentItem ( m_current ); 80 w_list-> setCurrentItem ( m_current );
81 81
82 QTimer::singleShot ( 0, this, SLOT( delayedInit ( ))); 82 QTimer::singleShot ( 0, this, SLOT( delayedInit()));
83} 83}
84 84
85RemapDlg::~RemapDlg ( ) 85RemapDlg::~RemapDlg ( )
86{ 86{
87} 87}
88 88
89void RemapDlg::delayedInit ( ) 89void RemapDlg::delayedInit ( )
90{ 90{
91 bool b = w_list-> viewport ( )-> isUpdatesEnabled ( ); 91 bool b = w_list-> viewport ( )-> isUpdatesEnabled ( );
92 w_list-> viewport ( )-> setUpdatesEnabled ( false ); 92 w_list-> viewport ( )-> setUpdatesEnabled ( false );
93 93
94 ButtonUtils::inst ( )-> insertAppLnks ( m_map_show ); 94 ButtonUtils::inst ( )-> insertAppLnks ( m_map_show );
95 95
96 w_list-> viewport ( )-> setUpdatesEnabled ( b ); 96 w_list-> viewport ( )-> setUpdatesEnabled ( b );
97 97
98 m_map_show-> repaint ( ); 98 m_map_show-> repaint ( );
99} 99}
100 100
101void RemapDlg::itemChanged ( QListViewItem *it ) 101void RemapDlg::itemChanged ( QListViewItem *it )
102{ 102{
103 bool enabled = false; 103 bool enabled = false;
104 OQCopMessage m; 104 OQCopMessage m;
105 105
106 m_current = it; 106 m_current = it;
107 107
108 if ( it == m_map_none ) 108 if ( it == m_map_none )
109 { 109 {
110 m_msg = m = OQCopMessage ( "ignore", 0 ); 110 m_msg = m = OQCopMessage ( "ignore", 0 );
111 qDebug ("***ignoring"); 111 qDebug ("***ignoring");
112 } 112 }
113 else if ( it == m_map_preset ) 113 else if ( it == m_map_preset )
114 { 114 {
115 m_msg = m = m_msg_preset; 115 m_msg = m = m_msg_preset;
116 qDebug ("***Preset"); 116 qDebug ("***Preset");
117 } 117 }
118 else if ( it && !it-> childCount ( ) ) 118 else if ( it && !it-> childCount ( ) )
119 { 119 {
120 qDebug ("***Custom: %s %s ",it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); 120 qDebug ("***Custom: %s %s ",it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( ));
121 enabled = ( it == m_map_custom ); 121 enabled = ( it == m_map_custom );
122 m_msg = m = OQCopMessage ( it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( )); 122 m_msg = m = OQCopMessage ( it-> text ( 1 ). latin1 ( ), it-> text ( 2 ). latin1 ( ));
123 } 123 }
124 124
125 w_channel-> setEnabled ( enabled ); 125 w_channel-> setEnabled ( enabled );
126 w_message-> setEnabled ( enabled ); 126 w_message-> setEnabled ( enabled );
127 127
128 w_channel-> setEditText ( m. channel ( )); 128 w_channel-> setEditText ( m. channel ( ));
129//hack for if user has typed in a message, such as 'suspend()' 129//hack for if user has typed in a message, such as 'suspend()'
130//so raise() is always present 130//so raise() is always present