summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog3
-rw-r--r--core/apps/calibrate/calibrate.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 38b65c0..1c713ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,97 +20,98 @@
20 * Opieplayer: rudimentary podcast support (ljp) 20 * Opieplayer: rudimentary podcast support (ljp)
21 21
22 Fixed Bugs 22 Fixed Bugs
23 ---------- 23 ----------
24 * #1377 - Suspend Powermanagement when switched to another VT (mickeyl) 24 * #1377 - Suspend Powermanagement when switched to another VT (mickeyl)
25 - We actually suspend the complete Opie now in that case. 25 - We actually suspend the complete Opie now in that case.
26 * #1384 - Battery status updated improperly when charging (skyhusker) 26 * #1384 - Battery status updated improperly when charging (skyhusker)
27 * #1476 - Wrong order of application entries in the O-menu (skyhusker) 27 * #1476 - Wrong order of application entries in the O-menu (skyhusker)
28 * #1514 - Remove usage of cardmon/pcmcia picture in applications. pcmcia is now an inline picture (mickeyl) 28 * #1514 - Remove usage of cardmon/pcmcia picture in applications. pcmcia is now an inline picture (mickeyl)
29 * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller) 29 * #1535- Missing line break and unnecessary location shown with Today-Calendar plugin (deller)
30 * #1543 - Time Settings: "predict" tab is displayed twice after reopen (hrw) 30 * #1543 - Time Settings: "predict" tab is displayed twice after reopen (hrw)
31 * #1546 - Battery applet popup is not always large enough to show jacket remaining info (skyhusker) 31 * #1546 - Battery applet popup is not always large enough to show jacket remaining info (skyhusker)
32 * #1557 - Light&Power-Settings don't store warning intervall and warning levels (skyhusker) 32 * #1557 - Light&Power-Settings don't store warning intervall and warning levels (skyhusker)
33 * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller) 33 * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller)
34 * #1614 - Make Opie-console start in $HOME instead of / (skyhusker) 34 * #1614 - Make Opie-console start in $HOME instead of / (skyhusker)
35 * #1635 - opie-today, datebook-plugin does not show notes (skyhusker) 35 * #1635 - opie-today, datebook-plugin does not show notes (skyhusker)
36 * #1665 - Opie-IRC displays the host prepended to the message when peer is using and ipv6 address (skyhusker) 36 * #1665 - Opie-IRC displays the host prepended to the message when peer is using and ipv6 address (skyhusker)
37 * #1666 - Opie-IRC does not allow to add !channels in config asautojoin ones (skyhusker) 37 * #1666 - Opie-IRC does not allow to add !channels in config asautojoin ones (skyhusker)
38 * #1667 - Opie-IRC does not show messages from !channel (skyhusker) 38 * #1667 - Opie-IRC does not show messages from !channel (skyhusker)
39 * #1679 - Security PIN plugin is QVGA sized (hrw) 39 * #1679 - Security PIN plugin is QVGA sized (hrw)
40 * #1682 - Properly resize tab control in OTabWidget (drw) 40 * #1682 - Properly resize tab control in OTabWidget (drw)
41 * n.a. - always show volume and wireless applet popups inside visible screen (deller) 41 * n.a. - always show volume and wireless applet popups inside visible screen (deller)
42 * n.a. - scale O-Menu-Applets appropriately (mickeyl) 42 * n.a. - scale O-Menu-Applets appropriately (mickeyl)
43 * n.a. - libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) 43 * n.a. - libopienet: fix bugs in wireless scanning and setting SSID (skyhusker)
44 * n.a. - Wellenreiter: relax WE version matching test a bit (mickeyl) 44 * n.a. - Wellenreiter: relax WE version matching test a bit (mickeyl)
45 * n.a. - scale BluezApplet appropriately and use larger icons (mickeyl) 45 * n.a. - scale BluezApplet appropriately and use larger icons (mickeyl)
46 * n.a. - memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham) 46 * n.a. - memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham)
47 * n.a. - networksettings: ignore hostap control interfaces wifi* (mickeyl) 47 * n.a. - networksettings: ignore hostap control interfaces wifi* (mickeyl)
48 * n.a. - Today Addressbook plugin fix configuration to show/not show birthdays, use checkboxes for selection (hrw) 48 * n.a. - Today Addressbook plugin fix configuration to show/not show birthdays, use checkboxes for selection (hrw)
49 * n.a. - remove hardcoded font size from netsystemtime (hrw) 49 * n.a. - remove hardcoded font size from netsystemtime (hrw)
50 * n.a. - remove hardcoded font size from checkbook graphs (hrw) 50 * n.a. - remove hardcoded font size from checkbook graphs (hrw)
51 * n.a. - Dagger - fixes for Sword 1.5.8, morph tag x-refs, closing last tab crash (drw) 51 * n.a. - Dagger - fixes for Sword 1.5.8, morph tag x-refs, closing last tab crash (drw)
52 52
53 53
54 Internal 54 Internal
55 -------- 55 --------
56 * Make BluezApplet use OTaskbarApplet (mickeyl) 56 * Make BluezApplet use OTaskbarApplet (mickeyl)
57 * libopiecore: rewrite OFileNotification to use the Linux 2.6 inotify interface (mickeyl) 57 * libopiecore: rewrite OFileNotification to use the Linux 2.6 inotify interface (mickeyl)
58 * libopiecore: add ODirNotification - recursive directory notifications (mickeyl) 58 * libopiecore: add ODirNotification - recursive directory notifications (mickeyl)
59 * libopienet: Skip hostap control interfaces 'wifi' and improve robustness in ONetworkInterface (mickeyl) 59 * libopienet: Skip hostap control interfaces 'wifi' and improve robustness in ONetworkInterface (mickeyl)
60 * libopieui: Remove OVersatileView and OVersatileViewItem (mickeyl) 60 * libopieui: Remove OVersatileView and OVersatileViewItem (mickeyl)
61 * libopienet: Miscellaneous API cleanups (mickeyl) 61 * libopienet: Miscellaneous API cleanups (mickeyl)
62 * libopiecore: Add linux pcmcia system abstraction classes (mickeyl) 62 * libopiecore: Add linux pcmcia system abstraction classes (mickeyl)
63 * libopiecore: ODevice now knows the default gfx driver to use (mteira,mickeyl) 63 * libopiecore: ODevice now knows the default gfx driver to use (mteira,mickeyl)
64 * libopiecore: Add support for the Sharp SL-C3100 "Borzoi" (mickeyl) 64 * libopiecore: Add support for the Sharp SL-C3100 "Borzoi" (mickeyl)
65 * libopiecore: Add support for the new Linux Inputsystem Switches type [necessary for auto rotation in 2.6.13] (mickeyl) 65 * libopiecore: Add support for the new Linux Inputsystem Switches type [necessary for auto rotation in 2.6.13] (mickeyl)
66 * Remove assumptions about default gfx driver ("Transformed") all over the place (mteira,mickeyl) 66 * Remove assumptions about default gfx driver ("Transformed") all over the place (mteira,mickeyl)
67 * Fix / Optimize number of scanned directories (ljp) 67 * Fix / Optimize number of scanned directories (ljp)
68 68 * Use five point mouse calibration to make calibrated mouse drivers work on newer Zaurii (rp,mickeyl)
69
69 2005-03-25Opie 1.2.0 70 2005-03-25Opie 1.2.0
70 71
71 Fixed Bugs 72 Fixed Bugs
72 ---------- 73 ----------
73 * #1613 - AdvancedFM - scale toolbar icons appropriately (drw) 74 * #1613 - AdvancedFM - scale toolbar icons appropriately (drw)
74 * #1620 - OFileSelector - show the button on press and not on press on hold (alwin) 75 * #1620 - OFileSelector - show the button on press and not on press on hold (alwin)
75 * #1473 - Opie-Eye - Same as #1620 but we lack a common FileSystem Button class (zecke) 76 * #1473 - Opie-Eye - Same as #1620 but we lack a common FileSystem Button class (zecke)
76 * n.a. - PackageManager - fix bug where messages show up multiple times in install dialog (drw) 77 * n.a. - PackageManager - fix bug where messages show up multiple times in install dialog (drw)
77 * n.a.- make qpeglobal.h include qglobal.h (zecke) 78 * n.a.- make qpeglobal.h include qglobal.h (zecke)
78 79
79 2005-03-20Opie 1.2.0-rc1 80 2005-03-20Opie 1.2.0-rc1
80 81
81 82
82 New Features 83 New Features
83 ------------ 84 ------------
84 * Launcher: Support a static background pixmap (mickeyl) 85 * Launcher: Support a static background pixmap (mickeyl)
85 * LauncherSettings: Choose whether to have a static background pixmap (mickeyl) 86 * LauncherSettings: Choose whether to have a static background pixmap (mickeyl)
86 * PackageManager supports the 'lists_dir' ipkg configuration option (drw) 87 * PackageManager supports the 'lists_dir' ipkg configuration option (drw)
87 * Added hi-res inline images for large resolution devices (drw) 88 * Added hi-res inline images for large resolution devices (drw)
88 * Improved launcher icons for consistency (ar) 89 * Improved launcher icons for consistency (ar)
89 * Datebook: Added plugin system to datebook so holidays and birthdays from contacts may displayed in datebook (alwin) 90 * Datebook: Added plugin system to datebook so holidays and birthdays from contacts may displayed in datebook (alwin)
90 91
91 Fixed Bugs 92 Fixed Bugs
92 ---------- 93 ----------
93 * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers) 94 * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers)
94 * #1412 - Launcher Settings - fixed default settings for background in Edit tab dialog (drw) 95 * #1412 - Launcher Settings - fixed default settings for background in Edit tab dialog (drw)
95 * #1472 - Opie textedit now check for unsaved changes on ESC key (ljp) 96 * #1472 - Opie textedit now check for unsaved changes on ESC key (ljp)
96 * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke) 97 * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke)
97 * #1482 - Fix double '/' in paths (zecke) 98 * #1482 - Fix double '/' in paths (zecke)
98 * #1536 - Autosave of custom locations in opie backup (ar) 99 * #1536 - Autosave of custom locations in opie backup (ar)
99 * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke) 100 * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke)
100 * #1540 - Implemented deletion of DocLnks in opie-eye (zecke) 101 * #1540 - Implemented deletion of DocLnks in opie-eye (zecke)
101 * #1542 - Fixed Todo crash when priority < 1 or > 5 (drw) 102 * #1542 - Fixed Todo crash when priority < 1 or > 5 (drw)
102 * #1550 - Browse for alarm sound start in QPEDIR/sounds/ (zecke) 103 * #1550 - Browse for alarm sound start in QPEDIR/sounds/ (zecke)
103 * #1554 - Fixed Opie-Console name in .desktop file (mickeyl) 104 * #1554 - Fixed Opie-Console name in .desktop file (mickeyl)
104 * #1556 - Start to look for sound files in /opt/QtPalmtop/sounds (zecke) 105 * #1556 - Start to look for sound files in /opt/QtPalmtop/sounds (zecke)
105 * #1558 - Fixed opie-login breaking opie startup (mickeyl) 106 * #1558 - Fixed opie-login breaking opie startup (mickeyl)
106 * #1560 - Fixed Opie-Console picking up the wrong shell (bluelightning) 107 * #1560 - Fixed Opie-Console picking up the wrong shell (bluelightning)
107 * #1570 - Confirmation needed befor Restore a backup and overwrite local data (ar) 108 * #1570 - Confirmation needed befor Restore a backup and overwrite local data (ar)
108 * #1591 - Addressbook sortorder changed by clicking on column 0 (eilers) 109 * #1591 - Addressbook sortorder changed by clicking on column 0 (eilers)
109 * #1599 - Security - change recommendation for opie-multiauth to opie-securityplugin (gints) 110 * #1599 - Security - change recommendation for opie-multiauth to opie-securityplugin (gints)
110 * #1604 - Checkbook crashed on startup (drw) 111 * #1604 - Checkbook crashed on startup (drw)
111 * #1608 - Addressbook crashed after search, which may caused by not initialzed member variable (eilers) 112 * #1608 - Addressbook crashed after search, which may caused by not initialzed member variable (eilers)
112 * #1608 - QueryByExampe-Datediff on SQL database did not worked properly (eilers) 113 * #1608 - QueryByExampe-Datediff on SQL database did not worked properly (eilers)
113 * n.a. - Netsystemtime - fixed UI to prevent error dialog from displaying when it shouldn't, get rid of some compiler warnings (drw) 114 * n.a. - Netsystemtime - fixed UI to prevent error dialog from displaying when it shouldn't, get rid of some compiler warnings (drw)
114 * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw) 115 * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw)
115 * n.a. - PackageManager - fixed bug where lists_dir was not being honored at startup (drw) 116 * n.a. - PackageManager - fixed bug where lists_dir was not being honored at startup (drw)
116 * n.a. - PackageManager - provided default value for lists_dir when none is entered in configuration dialog (drw) 117 * n.a. - PackageManager - provided default value for lists_dir when none is entered in configuration dialog (drw)
diff --git a/core/apps/calibrate/calibrate.cpp b/core/apps/calibrate/calibrate.cpp
index 5f52bdc..53388f1 100644
--- a/core/apps/calibrate/calibrate.cpp
+++ b/core/apps/calibrate/calibrate.cpp
@@ -79,196 +79,196 @@ void Calibrate::store()
79{ 79{
80#ifdef QWS 80#ifdef QWS
81 QWSServer::mouseHandler() ->calibrate( &goodcd ); 81 QWSServer::mouseHandler() ->calibrate( &goodcd );
82#endif 82#endif
83} 83}
84 84
85void Calibrate::hide() 85void Calibrate::hide()
86{ 86{
87 if ( isVisible()) { 87 if ( isVisible()) {
88 store(); 88 store();
89 89
90 // hack - calibrate is a launcher dialog, but treated like a standalone app 90 // hack - calibrate is a launcher dialog, but treated like a standalone app
91 { 91 {
92 QCopEnvelope e( "QPE/System", "closing(QString)" ); 92 QCopEnvelope e( "QPE/System", "closing(QString)" );
93 e << QString ( "calibrate" ); 93 e << QString ( "calibrate" );
94 } 94 }
95 } 95 }
96 QDialog::hide(); 96 QDialog::hide();
97} 97}
98 98
99void Calibrate::reset() 99void Calibrate::reset()
100{ 100{
101#ifdef QWS 101#ifdef QWS
102 penPos = QPoint(); 102 penPos = QPoint();
103 location = QWSPointerCalibrationData::TopLeft; 103 location = QWSPointerCalibrationData::TopLeft;
104 crossPos = fromDevice( cd.screenPoints[ location ] ); 104 crossPos = fromDevice( cd.screenPoints[ location ] );
105#endif 105#endif
106} 106}
107 107
108QPoint Calibrate::fromDevice( const QPoint &p ) 108QPoint Calibrate::fromDevice( const QPoint &p )
109{ 109{
110#ifdef QWS 110#ifdef QWS
111 return qt_screen->mapFromDevice ( p, QSize( qt_screen->deviceWidth ( ), qt_screen->deviceHeight() ) ); 111 return qt_screen->mapFromDevice ( p, QSize( qt_screen->deviceWidth ( ), qt_screen->deviceHeight() ) );
112#else 112#else
113 return QPoint(); 113 return QPoint();
114#endif 114#endif
115 115
116} 116}
117 117
118bool Calibrate::sanityCheck() 118bool Calibrate::sanityCheck()
119{ 119{
120#ifdef QWS 120#ifdef QWS
121 QPoint tl = cd.devPoints[QWSPointerCalibrationData::TopLeft]; 121 QPoint tl = cd.devPoints[QWSPointerCalibrationData::TopLeft];
122 QPoint tr = cd.devPoints[QWSPointerCalibrationData::TopRight]; 122 QPoint tr = cd.devPoints[QWSPointerCalibrationData::TopRight];
123 QPoint bl = cd.devPoints[QWSPointerCalibrationData::BottomLeft]; 123 QPoint bl = cd.devPoints[QWSPointerCalibrationData::BottomLeft];
124 QPoint br = cd.devPoints[QWSPointerCalibrationData::BottomRight]; 124 QPoint br = cd.devPoints[QWSPointerCalibrationData::BottomRight];
125 125
126 // not needed anywhere .. just calculate it, so it's there 126 // not needed anywhere .. just calculate it, so it's there
127 cd.devPoints[QWSPointerCalibrationData::Center] = QRect( tl, br ).normalize().center(); 127 //cd.devPoints[QWSPointerCalibrationData::Center] = QRect( tl, br ).normalize().center();
128 128
129 int dlx = QABS( bl. x ( ) - tl. x ( )); 129 int dlx = QABS( bl. x ( ) - tl. x ( ));
130 int dly = QABS( bl. y ( ) - tl. y ( )); 130 int dly = QABS( bl. y ( ) - tl. y ( ));
131 int drx = QABS( br. x ( ) - tr. x ( )); 131 int drx = QABS( br. x ( ) - tr. x ( ));
132 int dry = QABS( br. y ( ) - tr. y ( )); 132 int dry = QABS( br. y ( ) - tr. y ( ));
133 int dtx = QABS( tr. x ( ) - tl. x ( )); 133 int dtx = QABS( tr. x ( ) - tl. x ( ));
134 int dty = QABS( tr. y ( ) - tl. y ( )); 134 int dty = QABS( tr. y ( ) - tl. y ( ));
135 int dbx = QABS( br. x ( ) - bl. x ( )); 135 int dbx = QABS( br. x ( ) - bl. x ( ));
136 int dby = QABS( br. y ( ) - bl. y ( )); 136 int dby = QABS( br. y ( ) - bl. y ( ));
137 137
138 int dl = (int) ::sqrt (( dlx * dlx ) + ( dly * dly )); // calculate vector lengths for all sides 138 int dl = (int) ::sqrt (( dlx * dlx ) + ( dly * dly )); // calculate vector lengths for all sides
139 int dr = (int) ::sqrt (( drx * drx ) + ( dry * dry )); 139 int dr = (int) ::sqrt (( drx * drx ) + ( dry * dry ));
140 int dt = (int) ::sqrt (( dtx * dtx ) + ( dty * dty )); 140 int dt = (int) ::sqrt (( dtx * dtx ) + ( dty * dty ));
141 int db = (int) ::sqrt (( dbx * dbx ) + ( dby * dby )); 141 int db = (int) ::sqrt (( dbx * dbx ) + ( dby * dby ));
142 142
143 // Calculate leeway for x/y (we do not care if diff1/diff2 is for x or y here !) 143 // Calculate leeway for x/y (we do not care if diff1/diff2 is for x or y here !)
144 int diff1 = QABS( dl - dr ); 144 int diff1 = QABS( dl - dr );
145 int avg1 = ( dl + dr ) / 2; 145 int avg1 = ( dl + dr ) / 2;
146 int diff2 = QABS( dt - db ); 146 int diff2 = QABS( dt - db );
147 int avg2 = ( dt + db ) / 2; 147 int avg2 = ( dt + db ) / 2;
148 148
149 // Calculate leeway for "real" vector length against "manhattan" vector length 149 // Calculate leeway for "real" vector length against "manhattan" vector length
150 // This is a check, if the rect is rotated (other then 0/90/180/270) 150 // This is a check, if the rect is rotated (other then 0/90/180/270)
151 // It needs to be performed only for the triange (bl, tl, tr) 151 // It needs to be performed only for the triange (bl, tl, tr)
152 int diff3 = QABS(( dlx + dly + dtx + dty ) - ( dl + dt )); 152 int diff3 = QABS(( dlx + dly + dtx + dty ) - ( dl + dt ));
153 int avg3 = (( dlx + dly + dtx + dty ) + ( dl + dt )) / 2; 153 int avg3 = (( dlx + dly + dtx + dty ) + ( dl + dt )) / 2;
154 154
155 if (( diff1 > ( avg1 / 20 )) || // 5% leeway 155 if (( diff1 > ( avg1 / 20 )) || // 5% leeway
156 ( diff2 > ( avg2 / 20 )) || 156 ( diff2 > ( avg2 / 20 )) ||
157 ( diff3 > ( avg3 / 20 ))) 157 ( diff3 > ( avg3 / 20 )))
158 return false; 158 return false;
159 else 159 else
160 return true; 160 return true;
161#else 161#else
162return true; 162return true;
163#endif 163#endif
164} 164}
165 165
166void Calibrate::moveCrosshair( QPoint pt ) 166void Calibrate::moveCrosshair( QPoint pt )
167{ 167{
168 showCross = FALSE; 168 showCross = FALSE;
169 repaint( crossPos.x() - 14, crossPos.y() - 14, 28, 28 ); 169 repaint( crossPos.x() - 14, crossPos.y() - 14, 28, 28 );
170 showCross = TRUE; 170 showCross = TRUE;
171 crossPos = pt; 171 crossPos = pt;
172 repaint( crossPos.x() - 14, crossPos.y() - 14, 28, 28 ); 172 repaint( crossPos.x() - 14, crossPos.y() - 14, 28, 28 );
173} 173}
174 174
175void Calibrate::paintEvent( QPaintEvent * ) 175void Calibrate::paintEvent( QPaintEvent * )
176{ 176{
177 QPainter p( this ); 177 QPainter p( this );
178 int y = height() / 3; 178 int y = height() / 2;
179 179
180 p.drawText( 0, y + height() / 8, width(), height() - y, AlignHCenter, 180 p.drawText( 0, y + height() / 8, width(), height() - y, AlignHCenter,
181 tr( "Touch the crosshairs firmly and\n" 181 tr( "Touch the crosshairs firmly and\n"
182 "accurately to calibrate your screen." ) ); 182 "accurately to calibrate your screen." ) );
183 183
184 if ( !showCross ) return; 184 if ( !showCross ) return;
185 185
186#if 0 186#if 0
187 if ( crosshair.isNull() ) { 187 if ( crosshair.isNull() ) {
188#endif 188#endif
189 p.setPen( QColor( 0, 0, 155 ) ); 189 p.setPen( QColor( 0, 0, 155 ) );
190 p.drawEllipse( crossPos.x()-8, crossPos.y()-8, 16, 16 ); 190 p.drawEllipse( crossPos.x()-8, crossPos.y()-8, 16, 16 );
191 p.setPen( QColor( 250, 220, 220 ) ); 191 p.setPen( QColor( 250, 220, 220 ) );
192 p.drawRoundRect( crossPos.x()-12, crossPos.y()-12, 24, 24, 75, 75 ); 192 p.drawRoundRect( crossPos.x()-12, crossPos.y()-12, 24, 24, 75, 75 );
193 p.setPen( QColor( 0, 0, 120 ) ); 193 p.setPen( QColor( 0, 0, 120 ) );
194 p.drawRect( crossPos.x() - 1, crossPos.y() - 14, 2, 13 ); 194 p.drawRect( crossPos.x() - 1, crossPos.y() - 14, 2, 13 );
195 p.drawRect( crossPos.x() - 1, crossPos.y() + 1, 2, 13 ); 195 p.drawRect( crossPos.x() - 1, crossPos.y() + 1, 2, 13 );
196 p.drawRect( crossPos.x() - 14, crossPos.y() - 1, 13, 2 ); 196 p.drawRect( crossPos.x() - 14, crossPos.y() - 1, 13, 2 );
197 p.drawRect( crossPos.x() + 1, crossPos.y() - 1, 13, 2 ); 197 p.drawRect( crossPos.x() + 1, crossPos.y() - 1, 13, 2 );
198#if 0 198#if 0
199 } 199 }
200 else p.drawPixmap( crossPos.x(), crossPos.y(), crosshair ); 200 else p.drawPixmap( crossPos.x(), crossPos.y(), crosshair );
201#endif 201#endif
202} 202}
203 203
204void Calibrate::mousePressEvent( QMouseEvent *e ) 204void Calibrate::mousePressEvent( QMouseEvent *e )
205{ 205{
206#ifdef QWS 206#ifdef QWS
207 // map to device coordinates 207 // map to device coordinates
208 QPoint devPos = qt_screen->mapToDevice( e->pos(), QSize( qt_screen->width(), qt_screen->height() ) ); 208 QPoint devPos = qt_screen->mapToDevice( e->pos(), QSize( qt_screen->width(), qt_screen->height() ) );
209 if ( penPos.isNull() ) 209 if ( penPos.isNull() )
210 penPos = devPos; 210 penPos = devPos;
211 else 211 else
212 penPos = QPoint( ( penPos.x() + devPos.x() ) / 2, 212 penPos = QPoint( ( penPos.x() + devPos.x() ) / 2,
213 ( penPos.y() + devPos.y() ) / 2 ); 213 ( penPos.y() + devPos.y() ) / 2 );
214#endif 214#endif
215} 215}
216 216
217void Calibrate::mouseReleaseEvent( QMouseEvent * ) 217void Calibrate::mouseReleaseEvent( QMouseEvent * )
218{ 218{
219#ifdef QWS 219#ifdef QWS
220 if ( timer->isActive() ) 220 if ( timer->isActive() )
221 return ; 221 return ;
222 222
223 bool doMove = TRUE; 223 bool doMove = TRUE;
224 224
225 cd.devPoints[ location ] = penPos; 225 cd.devPoints[ location ] = penPos;
226 if ( location < QWSPointerCalibrationData::TopRight ) { 226 if ( location < QWSPointerCalibrationData::Center ) {
227 location = (QWSPointerCalibrationData::Location) ( int( location ) + 1 ); 227 location = (QWSPointerCalibrationData::Location) ( int( location ) + 1 );
228 } 228 }
229 else { 229 else {
230 if ( sanityCheck() ) { 230 if ( sanityCheck() ) {
231 reset(); 231 reset();
232 goodcd = cd; 232 goodcd = cd;
233 hide(); 233 hide();
234 emit accept(); 234 emit accept();
235 doMove = FALSE; 235 doMove = FALSE;
236 } 236 }
237 else { 237 else {
238 location = QWSPointerCalibrationData::TopLeft; 238 location = QWSPointerCalibrationData::TopLeft;
239 } 239 }
240 } 240 }
241 241
242 if ( doMove ) { 242 if ( doMove ) {
243 QPoint target = fromDevice( cd.screenPoints[ location ] ); 243 QPoint target = fromDevice( cd.screenPoints[ location ] );
244 dx = ( target.x() - crossPos.x() ) / 10; 244 dx = ( target.x() - crossPos.x() ) / 10;
245 dy = ( target.y() - crossPos.y() ) / 10; 245 dy = ( target.y() - crossPos.y() ) / 10;
246 timer->start( 30 ); 246 timer->start( 30 );
247 } 247 }
248#endif 248#endif
249} 249}
250 250
251void Calibrate::timeout() 251void Calibrate::timeout()
252{ 252{
253#ifdef QWS 253#ifdef QWS
254 QPoint target = fromDevice( cd.screenPoints[ location ] ); 254 QPoint target = fromDevice( cd.screenPoints[ location ] );
255 255
256 bool doneX = FALSE; 256 bool doneX = FALSE;
257 bool doneY = FALSE; 257 bool doneY = FALSE;
258 QPoint newPos( crossPos.x() + dx, crossPos.y() + dy ); 258 QPoint newPos( crossPos.x() + dx, crossPos.y() + dy );
259 259
260 if ( QABS( crossPos.x() - target.x() ) <= QABS( dx ) ) { 260 if ( QABS( crossPos.x() - target.x() ) <= QABS( dx ) ) {
261 newPos.setX( target.x() ); 261 newPos.setX( target.x() );
262 doneX = TRUE; 262 doneX = TRUE;
263 } 263 }
264 264
265 if ( QABS( crossPos.y() - target.y() ) <= QABS( dy ) ) { 265 if ( QABS( crossPos.y() - target.y() ) <= QABS( dy ) ) {
266 newPos.setY( target.y() ); 266 newPos.setY( target.y() );
267 doneY = TRUE; 267 doneY = TRUE;
268 } 268 }
269 269
270 if ( doneX && doneY ) { 270 if ( doneX && doneY ) {
271 penPos = QPoint(); 271 penPos = QPoint();
272 timer->stop(); 272 timer->stop();
273 } 273 }
274 274