Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index efe35e7..16c0538 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -93,139 +93,114 @@ struct i_button ipaq_buttons [] = { | |||
93 | "addressbook", "raise()", | 93 | "addressbook", "raise()", |
94 | "addressbook", "beamBusinessCard()" }, | 94 | "addressbook", "beamBusinessCard()" }, |
95 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, | 95 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, |
96 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 96 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
97 | "devicebuttons/ipaq_menu", | 97 | "devicebuttons/ipaq_menu", |
98 | "QPE/TaskBar", "toggleMenu()", | 98 | "QPE/TaskBar", "toggleMenu()", |
99 | "QPE/TaskBar", "toggleStartMenu()" }, | 99 | "QPE/TaskBar", "toggleStartMenu()" }, |
100 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 100 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
101 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 101 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
102 | "devicebuttons/ipaq_mail", | 102 | "devicebuttons/ipaq_mail", |
103 | "opiemail", "raise()", | 103 | "opiemail", "raise()", |
104 | "opiemail", "newMail()" }, | 104 | "opiemail", "newMail()" }, |
105 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 105 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
106 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 106 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
107 | "devicebuttons/ipaq_home", | 107 | "devicebuttons/ipaq_home", |
108 | "QPE/Launcher", "home()", | 108 | "QPE/Launcher", "home()", |
109 | "buttonsettings", "raise()" }, | 109 | "buttonsettings", "raise()" }, |
110 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 110 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
111 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), | 111 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), |
112 | "devicebuttons/ipaq_record", | 112 | "devicebuttons/ipaq_record", |
113 | "QPE/VMemo", "toggleRecord()", | 113 | "QPE/VMemo", "toggleRecord()", |
114 | "sound", "raise()" }, | 114 | "sound", "raise()" }, |
115 | }; | 115 | }; |
116 | 116 | ||
117 | void iPAQ::init(const QString& model) | 117 | void iPAQ::init(const QString& model) |
118 | { | 118 | { |
119 | d->m_vendorstr = "HP"; | 119 | d->m_vendorstr = "HP"; |
120 | d->m_vendor = Vendor_HP; | 120 | d->m_vendor = Vendor_HP; |
121 | 121 | ||
122 | d->m_modelstr = model.mid(model.findRev('H')); | 122 | d->m_modelstr = model.mid(model.findRev('H')); |
123 | 123 | ||
124 | if ( d->m_modelstr == "H3100" ) | 124 | if ( d->m_modelstr == "H3100" ) |
125 | d->m_model = Model_iPAQ_H31xx; | 125 | d->m_model = Model_iPAQ_H31xx; |
126 | else if ( d->m_modelstr == "H3600" ) | 126 | else if ( d->m_modelstr == "H3600" ) |
127 | d->m_model = Model_iPAQ_H36xx; | 127 | d->m_model = Model_iPAQ_H36xx; |
128 | else if ( d->m_modelstr == "H3700" ) | 128 | else if ( d->m_modelstr == "H3700" ) |
129 | d->m_model = Model_iPAQ_H37xx; | 129 | d->m_model = Model_iPAQ_H37xx; |
130 | else if ( d->m_modelstr == "H3800" ) | 130 | else if ( d->m_modelstr == "H3800" ) |
131 | d->m_model = Model_iPAQ_H38xx; | 131 | d->m_model = Model_iPAQ_H38xx; |
132 | else if ( d->m_modelstr == "H3900" ) | 132 | else if ( d->m_modelstr == "H3900" ) |
133 | d->m_model = Model_iPAQ_H39xx; | 133 | d->m_model = Model_iPAQ_H39xx; |
134 | else if ( d->m_modelstr == "H5400" ) | 134 | else if ( d->m_modelstr == "H5400" ) |
135 | d->m_model = Model_iPAQ_H5xxx; | 135 | d->m_model = Model_iPAQ_H5xxx; |
136 | else if ( d->m_modelstr == "H2200" ) | 136 | else if ( d->m_modelstr == "H2200" ) |
137 | d->m_model = Model_iPAQ_H22xx; | 137 | d->m_model = Model_iPAQ_H22xx; |
138 | else | 138 | else |
139 | d->m_model = Model_Unknown; | 139 | d->m_model = Model_Unknown; |
140 | 140 | ||
141 | |||
142 | |||
143 | switch ( d->m_model ) { | 141 | switch ( d->m_model ) { |
144 | case Model_iPAQ_H31xx: | 142 | case Model_iPAQ_H31xx: |
145 | case Model_iPAQ_H38xx: | 143 | case Model_iPAQ_H38xx: |
146 | d->m_rotation = Rot90; | 144 | d->m_rotation = Rot90; |
147 | break; | 145 | break; |
148 | case Model_iPAQ_H5xxx: | 146 | case Model_iPAQ_H5xxx: |
149 | case Model_iPAQ_H22xx: | 147 | case Model_iPAQ_H22xx: |
150 | d->m_rotation = Rot0; | 148 | d->m_rotation = Rot0; |
151 | break; | 149 | break; |
152 | case Model_iPAQ_H36xx: | 150 | case Model_iPAQ_H36xx: |
153 | case Model_iPAQ_H37xx: | 151 | case Model_iPAQ_H37xx: |
154 | case Model_iPAQ_H39xx: | 152 | case Model_iPAQ_H39xx: |
155 | default: | 153 | default: |
156 | d->m_rotation = Rot270; | 154 | d->m_rotation = Rot270; |
157 | break; | 155 | break; |
158 | 156 | ||
159 | } | 157 | } |
160 | 158 | ||
161 | QFile f( "/etc/familiar-version" ); | ||
162 | if ( f. open ( IO_ReadOnly )) { | ||
163 | d->m_systemstr = "Familiar"; | ||
164 | d->m_system = System_Familiar; | ||
165 | |||
166 | QTextStream ts ( &f ); | ||
167 | d->m_sysverstr = ts. readLine(). mid ( 10 ); | ||
168 | |||
169 | f. close(); | ||
170 | } else { | ||
171 | f. setName ( "/etc/oz_version" ); | ||
172 | |||
173 | if ( f. open ( IO_ReadOnly )) { | ||
174 | d->m_systemstr = "OpenEmbedded/iPaq"; | ||
175 | d->m_system = System_Familiar; | ||
176 | |||
177 | QTextStream ts ( &f ); | ||
178 | ts.setDevice ( &f ); | ||
179 | d->m_sysverstr = ts. readLine(); | ||
180 | f. close(); | ||
181 | } | ||
182 | } | ||
183 | |||
184 | m_leds [0] = m_leds [1] = Led_Off; | 159 | m_leds [0] = m_leds [1] = Led_Off; |
185 | 160 | ||
186 | m_power_timer = 0; | 161 | m_power_timer = 0; |
187 | 162 | ||
188 | } | 163 | } |
189 | 164 | ||
190 | void iPAQ::initButtons() | 165 | void iPAQ::initButtons() |
191 | { | 166 | { |
192 | if ( d->m_buttons ) | 167 | if ( d->m_buttons ) |
193 | return; | 168 | return; |
194 | 169 | ||
195 | if ( isQWS( ) ) | 170 | if ( isQWS( ) ) |
196 | QWSServer::setKeyboardFilter ( this ); | 171 | QWSServer::setKeyboardFilter ( this ); |
197 | 172 | ||
198 | d->m_buttons = new QValueList <ODeviceButton>; | 173 | d->m_buttons = new QValueList <ODeviceButton>; |
199 | 174 | ||
200 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { | 175 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { |
201 | i_button *ib = ipaq_buttons + i; | 176 | i_button *ib = ipaq_buttons + i; |
202 | ODeviceButton b; | 177 | ODeviceButton b; |
203 | 178 | ||
204 | if (( ib->model & d->m_model ) == d->m_model ) { | 179 | if (( ib->model & d->m_model ) == d->m_model ) { |
205 | b. setKeycode ( ib->code ); | 180 | b. setKeycode ( ib->code ); |
206 | b. setUserText ( QObject::tr ( "Button", ib->utext )); | 181 | b. setUserText ( QObject::tr ( "Button", ib->utext )); |
207 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); | 182 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); |
208 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); | 183 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); |
209 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); | 184 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); |
210 | 185 | ||
211 | d->m_buttons->append ( b ); | 186 | d->m_buttons->append ( b ); |
212 | } | 187 | } |
213 | } | 188 | } |
214 | reloadButtonMapping(); | 189 | reloadButtonMapping(); |
215 | 190 | ||
216 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 191 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
217 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); | 192 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
218 | } | 193 | } |
219 | 194 | ||
220 | QValueList <OLed> iPAQ::ledList() const | 195 | QValueList <OLed> iPAQ::ledList() const |
221 | { | 196 | { |
222 | QValueList <OLed> vl; | 197 | QValueList <OLed> vl; |
223 | vl << Led_Power; | 198 | vl << Led_Power; |
224 | 199 | ||
225 | if ( d->m_model == Model_iPAQ_H38xx ) | 200 | if ( d->m_model == Model_iPAQ_H38xx ) |
226 | vl << Led_BlueTooth; | 201 | vl << Led_BlueTooth; |
227 | return vl; | 202 | return vl; |
228 | } | 203 | } |
229 | 204 | ||
230 | QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const | 205 | QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const |
231 | { | 206 | { |