-rw-r--r-- | libopie/odevice.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 01932c9..f0429d4 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -238,131 +238,133 @@ struct z_button z_buttons_c700 [] = { | |||
238 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 238 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
239 | "devicebuttons/z_calendar", | 239 | "devicebuttons/z_calendar", |
240 | "datebook", "nextView()", | 240 | "datebook", "nextView()", |
241 | "today", "raise()" }, | 241 | "today", "raise()" }, |
242 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 242 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
243 | "devicebuttons/z_contact", | 243 | "devicebuttons/z_contact", |
244 | "addressbook", "raise()", | 244 | "addressbook", "raise()", |
245 | "addressbook", "beamBusinessCard()" }, | 245 | "addressbook", "beamBusinessCard()" }, |
246 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 246 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
247 | "devicebuttons/z_home", | 247 | "devicebuttons/z_home", |
248 | "QPE/Launcher", "home()", | 248 | "QPE/Launcher", "home()", |
249 | "buttonsettings", "raise()" }, | 249 | "buttonsettings", "raise()" }, |
250 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 250 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
251 | "devicebuttons/z_menu", | 251 | "devicebuttons/z_menu", |
252 | "QPE/TaskBar", "toggleMenu()", | 252 | "QPE/TaskBar", "toggleMenu()", |
253 | "QPE/TaskBar", "toggleStartMenu()" }, | 253 | "QPE/TaskBar", "toggleStartMenu()" }, |
254 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Display Rotate"), | 254 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Display Rotate"), |
255 | "", | 255 | "", |
256 | "QPE/Rotation", "flip()", | 256 | "QPE/Rotation", "flip()", |
257 | "QPE/Rotation", "flip()" }, | 257 | "QPE/Rotation", "flip()" }, |
258 | }; | 258 | }; |
259 | 259 | ||
260 | struct s_button { | 260 | struct s_button { |
261 | uint model; | 261 | uint model; |
262 | Qt::Key code; | 262 | Qt::Key code; |
263 | char *utext; | 263 | char *utext; |
264 | char *pix; | 264 | char *pix; |
265 | char *fpressedservice; | 265 | char *fpressedservice; |
266 | char *fpressedaction; | 266 | char *fpressedaction; |
267 | char *fheldservice; | 267 | char *fheldservice; |
268 | char *fheldaction; | 268 | char *fheldaction; |
269 | } simpad_buttons [] = { | 269 | } simpad_buttons [] = { |
270 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 270 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
271 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), | 271 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), |
272 | "devicebuttons/simpad_lower_up", | 272 | "devicebuttons/simpad_lower_up", |
273 | "datebook", "nextView()", | 273 | "datebook", "nextView()", |
274 | "today", "raise()" }, | 274 | "today", "raise()" }, |
275 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 275 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
276 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), | 276 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), |
277 | "devicebuttons/simpad_lower_down", | 277 | "devicebuttons/simpad_lower_down", |
278 | "addressbook", "raise()", | 278 | "addressbook", "raise()", |
279 | "addressbook", "beamBusinessCard()" }, | 279 | "addressbook", "beamBusinessCard()" }, |
280 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 280 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
281 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), | 281 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), |
282 | "devicebuttons/simpad_lower_right", | 282 | "devicebuttons/simpad_lower_right", |
283 | "QPE/TaskBar", "toggleMenu()", | 283 | "QPE/TaskBar", "toggleMenu()", |
284 | "QPE/TaskBar", "toggleStartMenu()" }, | 284 | "QPE/TaskBar", "toggleStartMenu()" }, |
285 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 285 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
286 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | ||
287 | "devicebuttons/simpad_lower_upper", | ||
288 | "QPE/Launcher", "home()", | ||
289 | "buttonsettings", "raise()" }, | ||
290 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | ||
291 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), | 286 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), |
292 | "devicebuttons/simpad_lower_left", | 287 | "devicebuttons/simpad_lower_left", |
293 | "mail", "raise()", | 288 | "mail", "raise()", |
294 | "mail", "newMail()" }, | 289 | "mail", "newMail()" }, |
295 | 290 | ||
296 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 291 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
297 | Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), | 292 | Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), |
298 | "devicebuttons/simpad_upper_up", | 293 | "devicebuttons/simpad_upper_up", |
299 | "datebook", "nextView()", | 294 | "QPE/Launcher", "home()", |
300 | "today", "raise()" }, | 295 | "buttonsettings", "raise()" }, |
301 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 296 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
302 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), | 297 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), |
303 | "devicebuttons/simpad_upper_down", | 298 | "devicebuttons/simpad_upper_down", |
304 | "addressbook", "raise()", | 299 | "addressbook", "raise()", |
305 | "addressbook", "beamBusinessCard()" }, | 300 | "addressbook", "beamBusinessCard()" }, |
306 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 301 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
307 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), | 302 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), |
308 | "devicebuttons/simpad_upper_right", | 303 | "devicebuttons/simpad_upper_right", |
309 | "QPE/TaskBar", "toggleMenu()", | 304 | "QPE/TaskBar", "toggleMenu()", |
310 | "QPE/TaskBar", "toggleStartMenu()" }, | 305 | "QPE/TaskBar", "toggleStartMenu()" }, |
311 | /*{ Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 306 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
307 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), | ||
308 | "devicebuttons/simpad_upper_left", | ||
309 | "QPE/Rotation", "flip()", | ||
310 | "QPE/Rotation", "flip()" }, | ||
311 | /* | ||
312 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | ||
312 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 313 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
313 | "devicebuttons/simpad_lower_upper", | 314 | "devicebuttons/simpad_lower_upper", |
314 | "QPE/Launcher", "home()", | 315 | "QPE/Launcher", "home()", |
315 | "buttonsettings", "raise()" },*/ | 316 | "buttonsettings", "raise()" }, |
316 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 317 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
317 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), | 318 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
318 | "devicebuttons/simpad_upper_left", | 319 | "devicebuttons/simpad_upper_lower", |
319 | "mail", "raise()", | 320 | "QPE/Launcher", "home()", |
320 | "mail", "newMail()" }, | 321 | "buttonsettings", "raise()" }, |
322 | */ | ||
321 | }; | 323 | }; |
322 | 324 | ||
323 | static QCString makeChannel ( const char *str ) | 325 | static QCString makeChannel ( const char *str ) |
324 | { | 326 | { |
325 | if ( str && !::strchr ( str, '/' )) | 327 | if ( str && !::strchr ( str, '/' )) |
326 | return QCString ( "QPE/Application/" ) + str; | 328 | return QCString ( "QPE/Application/" ) + str; |
327 | else | 329 | else |
328 | return str; | 330 | return str; |
329 | } | 331 | } |
330 | 332 | ||
331 | static inline bool isQWS() | 333 | static inline bool isQWS() |
332 | { | 334 | { |
333 | return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; | 335 | return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; |
334 | } | 336 | } |
335 | 337 | ||
336 | ODevice *ODevice::inst ( ) | 338 | ODevice *ODevice::inst ( ) |
337 | { | 339 | { |
338 | static ODevice *dev = 0; | 340 | static ODevice *dev = 0; |
339 | 341 | ||
340 | if ( !dev ) { | 342 | if ( !dev ) { |
341 | if ( QFile::exists ( "/proc/hal/model" )) | 343 | if ( QFile::exists ( "/proc/hal/model" )) |
342 | dev = new iPAQ ( ); | 344 | dev = new iPAQ ( ); |
343 | else if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | 345 | else if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) |
344 | dev = new Zaurus ( ); | 346 | dev = new Zaurus ( ); |
345 | else if ( QFile::exists ( "/proc/ucb1x00" ) && QFile::exists ( "/proc/cs3" )) | 347 | else if ( QFile::exists ( "/proc/ucb1x00" ) && QFile::exists ( "/proc/cs3" )) |
346 | dev = new SIMpad ( ); | 348 | dev = new SIMpad ( ); |
347 | else | 349 | else |
348 | dev = new ODevice ( ); | 350 | dev = new ODevice ( ); |
349 | 351 | ||
350 | dev-> init ( ); | 352 | dev-> init ( ); |
351 | } | 353 | } |
352 | return dev; | 354 | return dev; |
353 | } | 355 | } |
354 | 356 | ||
355 | 357 | ||
356 | /************************************************** | 358 | /************************************************** |
357 | * | 359 | * |
358 | * common | 360 | * common |
359 | * | 361 | * |
360 | **************************************************/ | 362 | **************************************************/ |
361 | 363 | ||
362 | 364 | ||
363 | ODevice::ODevice ( ) | 365 | ODevice::ODevice ( ) |
364 | { | 366 | { |
365 | d = new ODeviceData; | 367 | d = new ODeviceData; |
366 | 368 | ||
367 | d-> m_modelstr = "Unknown"; | 369 | d-> m_modelstr = "Unknown"; |
368 | d-> m_model = Model_Unknown; | 370 | d-> m_model = Model_Unknown; |