-rw-r--r-- | library/qpeapplication.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 59ca61b..acad81d 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -98,6 +98,10 @@ | |||
98 | #include "qt_override_p.h" | 98 | #include "qt_override_p.h" |
99 | 99 | ||
100 | #include <qpe/rohfeedback.h> | ||
101 | |||
102 | |||
100 | static bool useBigPixmaps = 0; | 103 | static bool useBigPixmaps = 0; |
101 | 104 | ||
105 | |||
102 | class HackWidget : public QWidget | 106 | class HackWidget : public QWidget |
103 | { | 107 | { |
@@ -127,4 +131,5 @@ public: | |||
127 | smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 ); | 131 | smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 ); |
128 | bigIconSize = cfg.readNumEntry( "BigIconSize", 32 ); | 132 | bigIconSize = cfg.readNumEntry( "BigIconSize", 32 ); |
133 | RoH = 0; | ||
129 | } | 134 | } |
130 | 135 | ||
@@ -493,4 +498,6 @@ static void qpe_show_dialog( QDialog* d, bool nomax ) | |||
493 | } | 498 | } |
494 | } | 499 | } |
500 | |||
501 | Opie::Internal::RoHFeedback * RoH; | ||
495 | }; | 502 | }; |
496 | 503 | ||
@@ -1206,5 +1213,5 @@ QPEApplication::~QPEApplication() | |||
1206 | delete pidChannel; | 1213 | delete pidChannel; |
1207 | #endif | 1214 | #endif |
1208 | 1215 | delete d->RoH; | |
1209 | delete d; | 1216 | delete d; |
1210 | } | 1217 | } |
@@ -2024,9 +2031,19 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e ) | |||
2024 | case QEvent::MouseButtonPress: | 2031 | case QEvent::MouseButtonPress: |
2025 | if ( me->button() == LeftButton ) { | 2032 | if ( me->button() == LeftButton ) { |
2026 | if (!d->presstimer ) | ||
2027 | d->presstimer = startTimer(500); // #### pref. | ||
2028 | d->presswidget = (QWidget*)o; | 2033 | d->presswidget = (QWidget*)o; |
2029 | d->presspos = me->pos(); | 2034 | d->presspos = me->pos(); |
2030 | d->rightpressed = FALSE; | 2035 | d->rightpressed = FALSE; |
2036 | // just for the time being | ||
2037 | static int pref = 500; | ||
2038 | #ifdef WITHROHFEEDBACK | ||
2039 | if( ! d->RoH ) | ||
2040 | d->RoH = new Opie::Internal::RoHFeedback; | ||
2041 | |||
2042 | d->RoH->init( me->globalPos(), d->presswidget ); | ||
2043 | pref = d->RoH->delay(); | ||
2044 | #endif | ||
2045 | if (!d->presstimer ) | ||
2046 | d->presstimer = startTimer( pref ); // #### pref. | ||
2047 | |||
2031 | } | 2048 | } |
2032 | break; | 2049 | break; |
@@ -2034,4 +2051,8 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e ) | |||
2034 | if (d->presstimer && (me->pos() - d->presspos).manhattanLength() > 8) { | 2051 | if (d->presstimer && (me->pos() - d->presspos).manhattanLength() > 8) { |
2035 | killTimer(d->presstimer); | 2052 | killTimer(d->presstimer); |
2053 | #ifdef WITHROHFEEDBACK | ||
2054 | if( d->RoH ) | ||
2055 | d->RoH->stop( ); | ||
2056 | #endif | ||
2036 | d->presstimer = 0; | 2057 | d->presstimer = 0; |
2037 | } | 2058 | } |
@@ -2041,4 +2062,8 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e ) | |||
2041 | if ( d->presstimer ) { | 2062 | if ( d->presstimer ) { |
2042 | killTimer(d->presstimer); | 2063 | killTimer(d->presstimer); |
2064 | #ifdef WITHROHFEEDBACK | ||
2065 | if( d->RoH ) | ||
2066 | d->RoH->stop( ); | ||
2067 | #endif | ||
2043 | d->presstimer = 0; | 2068 | d->presstimer = 0; |
2044 | } | 2069 | } |
@@ -2094,4 +2119,5 @@ void QPEApplication::timerEvent( QTimerEvent *e ) | |||
2094 | d->presstimer = 0; | 2119 | d->presstimer = 0; |
2095 | d->rightpressed = TRUE; | 2120 | d->rightpressed = TRUE; |
2121 | d->RoH->stop(); | ||
2096 | } | 2122 | } |
2097 | } | 2123 | } |