-rw-r--r-- | core/settings/button/buttonsettings.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index 8b0b0a8..eabb779 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp | |||
@@ -39,97 +39,97 @@ | |||
39 | 39 | ||
40 | using namespace Opie; | 40 | using namespace Opie; |
41 | 41 | ||
42 | struct buttoninfo { | 42 | struct buttoninfo { |
43 | const ODeviceButton *m_button; | 43 | const ODeviceButton *m_button; |
44 | int m_index; | 44 | int m_index; |
45 | 45 | ||
46 | OQCopMessage m_pmsg; | 46 | OQCopMessage m_pmsg; |
47 | QLabel *m_picon; | 47 | QLabel *m_picon; |
48 | QLabel *m_plabel; | 48 | QLabel *m_plabel; |
49 | 49 | ||
50 | OQCopMessage m_hmsg; | 50 | OQCopMessage m_hmsg; |
51 | QLabel *m_hicon; | 51 | QLabel *m_hicon; |
52 | QLabel *m_hlabel; | 52 | QLabel *m_hlabel; |
53 | 53 | ||
54 | bool m_pdirty : 1; | 54 | bool m_pdirty : 1; |
55 | bool m_hdirty : 1; | 55 | bool m_hdirty : 1; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | 58 | ||
59 | ButtonSettings::ButtonSettings ( ) | 59 | ButtonSettings::ButtonSettings ( ) |
60 | : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) | 60 | : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) |
61 | { | 61 | { |
62 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); | 62 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); |
63 | (void) ButtonUtils::inst ( ); // initialise | 63 | (void) ButtonUtils::inst ( ); // initialise |
64 | 64 | ||
65 | setCaption ( tr( "Button Settings" )); | 65 | setCaption ( tr( "Button Settings" )); |
66 | 66 | ||
67 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); | 67 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); |
68 | 68 | ||
69 | QLabel *l = new QLabel ( tr( "<center>Press or hold the button you want to remap.</center>" ), this ); | 69 | QLabel *l = new QLabel ( tr( "<center>Press or hold the button you want to remap.</center>" ), this ); |
70 | toplay-> addWidget ( l ); | 70 | toplay-> addWidget ( l ); |
71 | 71 | ||
72 | QGridLayout *lay = new QGridLayout ( toplay ); | 72 | QGridLayout *lay = new QGridLayout ( toplay ); |
73 | lay-> setMargin ( 0 ); | 73 | lay-> setMargin ( 0 ); |
74 | lay-> setColStretch ( 0, 0 ); | 74 | lay-> setColStretch ( 0, 0 ); |
75 | lay-> setColStretch ( 1, 0 ); | 75 | lay-> setColStretch ( 1, 0 ); |
76 | lay-> setColStretch ( 2, 0 ); | 76 | lay-> setColStretch ( 2, 0 ); |
77 | lay-> setColStretch ( 3, 10 ); | 77 | lay-> setColStretch ( 3, 10 ); |
78 | 78 | ||
79 | m_infos. setAutoDelete ( true ); | 79 | m_infos. setAutoDelete ( true ); |
80 | 80 | ||
81 | int i = 1; | 81 | int i = 1; |
82 | int index = 0; | 82 | int index = 0; |
83 | for ( QValueList<ODeviceButton>::ConstIterator it = buttons. begin ( ); it != buttons. end ( ); it++ ) { | 83 | for ( QValueList<ODeviceButton>::ConstIterator it = buttons. begin ( ); it != buttons. end ( ); it++ ) { |
84 | if ( it != buttons. begin ( )) { | 84 | if ( it != buttons. begin ( )) { |
85 | QFrame *f = new QFrame ( this ); | 85 | QFrame *f = new QFrame ( this ); |
86 | f-> setFrameStyle ( QFrame::Sunken | QFrame::VLine ); | 86 | f-> setFrameStyle ( QFrame::Sunken | QFrame::VLine ); |
87 | lay-> addMultiCellWidget ( f, i, i, 0, 2 ); | 87 | lay-> addMultiCellWidget ( f, i, i, 0, 3 ); |
88 | i++; | 88 | i++; |
89 | } | 89 | } |
90 | 90 | ||
91 | buttoninfo *bi = new buttoninfo ( ); | 91 | buttoninfo *bi = new buttoninfo ( ); |
92 | bi-> m_button = &(*it); | 92 | bi-> m_button = &(*it); |
93 | bi-> m_index = index++; | 93 | bi-> m_index = index++; |
94 | bi-> m_pmsg = (*it). pressedAction ( ); | 94 | bi-> m_pmsg = (*it). pressedAction ( ); |
95 | bi-> m_hmsg = (*it). heldAction ( ); | 95 | bi-> m_hmsg = (*it). heldAction ( ); |
96 | bi-> m_pdirty = false; | 96 | bi-> m_pdirty = false; |
97 | bi-> m_hdirty = false; | 97 | bi-> m_hdirty = false; |
98 | 98 | ||
99 | l = new QLabel ( this ); | 99 | l = new QLabel ( this ); |
100 | l-> setPixmap (( *it ). pixmap ( )); | 100 | l-> setPixmap (( *it ). pixmap ( )); |
101 | 101 | ||
102 | lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); | 102 | lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); |
103 | 103 | ||
104 | l = new QLabel ( tr( "Press:" ), this ); | 104 | l = new QLabel ( tr( "Press:" ), this ); |
105 | lay-> addWidget ( l, i, 1, AlignLeft | AlignBottom ); | 105 | lay-> addWidget ( l, i, 1, AlignLeft | AlignBottom ); |
106 | l = new QLabel ( tr( "Hold:" ), this ); | 106 | l = new QLabel ( tr( "Hold:" ), this ); |
107 | lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop ); | 107 | lay-> addWidget ( l, i + 1, 1, AlignLeft | AlignTop ); |
108 | 108 | ||
109 | l = new QLabel ( this ); | 109 | l = new QLabel ( this ); |
110 | l-> setFixedSize ( 16, 16 ); | 110 | l-> setFixedSize ( 16, 16 ); |
111 | lay-> addWidget ( l, i, 2, AlignLeft | AlignBottom ); | 111 | lay-> addWidget ( l, i, 2, AlignLeft | AlignBottom ); |
112 | bi-> m_picon = l; | 112 | bi-> m_picon = l; |
113 | 113 | ||
114 | l = new QLabel ( this ); | 114 | l = new QLabel ( this ); |
115 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); | 115 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); |
116 | lay-> addWidget ( l, i, 3, AlignLeft | AlignBottom ); | 116 | lay-> addWidget ( l, i, 3, AlignLeft | AlignBottom ); |
117 | bi-> m_plabel = l; | 117 | bi-> m_plabel = l; |
118 | 118 | ||
119 | l = new QLabel ( this ); | 119 | l = new QLabel ( this ); |
120 | l-> setFixedSize ( 16, 16 ); | 120 | l-> setFixedSize ( 16, 16 ); |
121 | lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop ); | 121 | lay-> addWidget ( l, i + 1, 2, AlignLeft | AlignTop ); |
122 | bi-> m_hicon = l; | 122 | bi-> m_hicon = l; |
123 | 123 | ||
124 | l = new QLabel ( this ); | 124 | l = new QLabel ( this ); |
125 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); | 125 | l-> setAlignment ( AlignLeft | AlignVCenter | SingleLine ); |
126 | lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop ); | 126 | lay-> addWidget ( l, i + 1, 3, AlignLeft | AlignTop ); |
127 | bi-> m_hlabel = l; | 127 | bi-> m_hlabel = l; |
128 | 128 | ||
129 | i += 2; | 129 | i += 2; |
130 | 130 | ||
131 | m_infos. append ( bi ); | 131 | m_infos. append ( bi ); |
132 | } | 132 | } |
133 | 133 | ||
134 | toplay-> addStretch ( 10 ); | 134 | toplay-> addStretch ( 10 ); |
135 | 135 | ||