-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 62 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 22 |
2 files changed, 22 insertions, 62 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index 3d69614..2c5190c 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp @@ -272,31 +272,5 @@ ODevice::~ODevice() bool ODevice::suspend() { - if ( !isQWS( ) ) // only qwsserver is allowed to suspend - return false; - - if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices - return false; - - bool res = false; - ODevice::sendSuspendmsg(); - - struct timeval tvs, tvn; - ::gettimeofday ( &tvs, 0 ); - - ::sync(); // flush fs caches - res = ( ::system ( "apm --suspend" ) == 0 ); - - // This is needed because the iPAQ apm implementation is asynchronous and we - // can not be sure when exactly the device is really suspended - // This can be deleted as soon as a stable familiar with a synchronous apm implementation exists. - - if ( res ) { - do { // wait at most 1.5 sec: either suspend didn't work or the device resumed - ::usleep ( 200 * 1000 ); - ::gettimeofday ( &tvn, 0 ); - } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 1500 ); - } - - return res; + return false; // default implementation == unknown device or qvfb } @@ -316,21 +290,6 @@ bool ODevice::suspend() bool ODevice::setDisplayStatus ( bool on ) { - qDebug("ODevice::setDisplayStatus(%d)", on); - - if ( d->m_model == Model_Unknown ) - return false; - - bool res = false; - int fd; - -#ifdef QT_QWS_DEVFS - if (( fd = ::open ( "/dev/fb/0", O_RDWR )) >= 0 ) { -#else - if (( fd = ::open ( "/dev/fb0", O_RDWR )) >= 0 ) { -#endif - res = ( ::ioctl ( fd, FBIOBLANK, on ? VESA_NO_BLANKING : VESA_POWERDOWN ) == 0 ); - ::close ( fd ); - } - return res; + qDebug( "ODevice::setDisplayStatus( %d ) - please override me.", on ); + return false; // don't do anything for unknown models } @@ -343,5 +302,5 @@ bool ODevice::setDisplayStatus ( bool on ) bool ODevice::setDisplayBrightness ( int b) { - Q_UNUSED( b ) + qDebug( "ODevice::setDisplayBrightness( %d ) - please override me.", b ); return false; } @@ -349,6 +308,6 @@ bool ODevice::setDisplayBrightness ( int b) /** * - * @return Returns the number of steppings on the brightness slider - * in the Light-'n-Power settings. Values smaller zero and bigger + * @returns the number of steppings on the brightness slider + * in the Light-'n-Power settings. Values smaller than zero and bigger * than 255 do not make sense. * @@ -358,4 +317,5 @@ bool ODevice::setDisplayBrightness ( int b) int ODevice::displayBrightnessResolution() const { + qDebug( "ODevice::displayBrightnessResolution() - please override me." ); return 16; } @@ -364,18 +324,19 @@ int ODevice::displayBrightnessResolution() const * This sets the display contrast * @param p The contrast to be set on a scale from 0 to 255 -* @return success or failure +* @returns success or failure */ bool ODevice::setDisplayContrast ( int p) { - Q_UNUSED( p ) + qDebug( "ODevice::setDisplayContrast( %d ) - please override me.", p ); return false; } /** -* @return return the max value for the brightness settings slider +* @returns the maximum value for the contrast settings slider * or 0 if the device doesn't support setting of a contrast */ int ODevice::displayContrastResolution() const { + qDebug( "ODevice::displayBrightnessResolution() - please override me." ); return 0; } @@ -680,5 +641,4 @@ void ODevice::reloadButtonMapping() b. setPressedAction ( OQCopMessage ( pch, pm, pdata )); - b. setHeldAction ( OQCopMessage ( hch, hm, hdata )); } diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 7377965..82e127e 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp @@ -103,16 +103,16 @@ struct z_button z_buttons_c700 [] = { "opiemail", "newMail()" }, - { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Display Rotate"), - "devicebuttons/z_hinge", + { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Hinge1"), + "devicebuttons/z_hinge1", "QPE/Rotation", "rotateDefault()", - "QPE/Dummy", "doNothing()" }, - { Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Display Rotate"), - "devicebuttons/z_hinge", + "QPE/Rotation", "rotateDefault()" }, + { Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Hinge2"), + "devicebuttons/z_hinge2", "QPE/Rotation", "rotateDefault()", - "QPE/Dummy", "doNothing()" }, - { Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Display Rotate"), - "devicebuttons/z_hinge", + "QPE/Rotation", "rotateDefault()" }, + { Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Hinge3"), + "devicebuttons/z_hinge3", "QPE/Rotation", "rotateDefault()", - "QPE/Dummy", "doNothing()" }, + "QPE/Rotation", "rotateDefault()" }, }; @@ -489,5 +489,5 @@ bool Zaurus::suspend() return false; - if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices + if ( d->m_model == Model_Unknown ) // better don't suspend on unknown devices return false; @@ -535,5 +535,5 @@ Transformation Zaurus::rotation() const else { - if ( hs == CASE_PORTRAIT ) rot = Rot270; + if ( hs == CASE_PORTRAIT ) rot = Rot90; else if ( hs == CASE_UNKNOWN ) rot = Rot0; else rot = Rot0; |