-rw-r--r-- | core/apps/embeddedkonsole/TEWidget.cpp | 2 | ||||
-rw-r--r-- | core/apps/textedit/textedit.cpp | 2 | ||||
-rw-r--r-- | core/opie-login/loginwindowimpl.cpp | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp index 5171bf1..bee58e7 100644 --- a/core/apps/embeddedkonsole/TEWidget.cpp +++ b/core/apps/embeddedkonsole/TEWidget.cpp | |||
@@ -208,97 +208,97 @@ static QChar vt100extended(QChar c) | |||
208 | case 0x2424 : return 9; | 208 | case 0x2424 : return 9; |
209 | case 0x240b : return 10; | 209 | case 0x240b : return 10; |
210 | case 0x2518 : return 11; | 210 | case 0x2518 : return 11; |
211 | case 0x2510 : return 12; | 211 | case 0x2510 : return 12; |
212 | case 0x250c : return 13; | 212 | case 0x250c : return 13; |
213 | case 0x2514 : return 14; | 213 | case 0x2514 : return 14; |
214 | case 0x253c : return 15; | 214 | case 0x253c : return 15; |
215 | case 0xf800 : return 16; | 215 | case 0xf800 : return 16; |
216 | case 0xf801 : return 17; | 216 | case 0xf801 : return 17; |
217 | case 0x2500 : return 18; | 217 | case 0x2500 : return 18; |
218 | case 0xf803 : return 19; | 218 | case 0xf803 : return 19; |
219 | case 0xf804 : return 20; | 219 | case 0xf804 : return 20; |
220 | case 0x251c : return 21; | 220 | case 0x251c : return 21; |
221 | case 0x2524 : return 22; | 221 | case 0x2524 : return 22; |
222 | case 0x2534 : return 23; | 222 | case 0x2534 : return 23; |
223 | case 0x252c : return 24; | 223 | case 0x252c : return 24; |
224 | case 0x2502 : return 25; | 224 | case 0x2502 : return 25; |
225 | case 0x2264 : return 26; | 225 | case 0x2264 : return 26; |
226 | case 0x2265 : return 27; | 226 | case 0x2265 : return 27; |
227 | case 0x03c0 : return 28; | 227 | case 0x03c0 : return 28; |
228 | case 0x2260 : return 29; | 228 | case 0x2260 : return 29; |
229 | case 0x00a3 : return 30; | 229 | case 0x00a3 : return 30; |
230 | case 0x00b7 : return 31; | 230 | case 0x00b7 : return 31; |
231 | } | 231 | } |
232 | return c; | 232 | return c; |
233 | } | 233 | } |
234 | 234 | ||
235 | static QChar identicalMap(QChar c) | 235 | static QChar identicalMap(QChar c) |
236 | { | 236 | { |
237 | return c; | 237 | return c; |
238 | } | 238 | } |
239 | 239 | ||
240 | void TEWidget::fontChange(const QFont &) | 240 | void TEWidget::fontChange(const QFont &) |
241 | { | 241 | { |
242 | QFontMetrics fm(font()); | 242 | QFontMetrics fm(font()); |
243 | font_h = fm.height(); | 243 | font_h = fm.height(); |
244 | // font_w = fm.maxWidth(); | 244 | // font_w = fm.maxWidth(); |
245 | font_w = fm.width("m"); | 245 | font_w = fm.width("m"); |
246 | font_a = fm.ascent(); | 246 | font_a = fm.ascent(); |
247 | printf("font h=%d max_width=%d width_m=%d assent=%d\n", font_h, | 247 | printf("font h=%d max_width=%d width_m=%d assent=%d\n", font_h, |
248 | fm.maxWidth(), font_w, font_a); | 248 | fm.maxWidth(), font_w, font_a); |
249 | 249 | ||
250 | //printf("font_h: %d\n",font_h); | 250 | //printf("font_h: %d\n",font_h); |
251 | //printf("font_w: %d\n",font_w); | 251 | //printf("font_w: %d\n",font_w); |
252 | //printf("font_a: %d\n",font_a); | 252 | //printf("font_a: %d\n",font_a); |
253 | //printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii()); | 253 | //printf("charset: %s\n",QFont::encodingName(font().charSet()).ascii()); |
254 | //printf("rawname: %s\n",font().rawName().ascii()); | 254 | //printf("rawname: %s\n",font().rawName().ascii()); |
255 | fontMap = | 255 | fontMap = |
256 | #if QT_VERSION < 300 | 256 | #if QT_VERSION < 0x030000 |
257 | strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") | 257 | strcmp(QFont::encodingName(font().charSet()).ascii(),"iso10646") |
258 | ? vt100extended | 258 | ? vt100extended |
259 | : | 259 | : |
260 | #endif | 260 | #endif |
261 | identicalMap; | 261 | identicalMap; |
262 | propagateSize(); | 262 | propagateSize(); |
263 | update(); | 263 | update(); |
264 | } | 264 | } |
265 | 265 | ||
266 | void TEWidget::setVTFont(const QFont& f) | 266 | void TEWidget::setVTFont(const QFont& f) |
267 | { | 267 | { |
268 | QFrame::setFont(f); | 268 | QFrame::setFont(f); |
269 | } | 269 | } |
270 | 270 | ||
271 | QFont TEWidget::getVTFont() { | 271 | QFont TEWidget::getVTFont() { |
272 | return font(); | 272 | return font(); |
273 | } | 273 | } |
274 | 274 | ||
275 | void TEWidget::setFont(const QFont &) | 275 | void TEWidget::setFont(const QFont &) |
276 | { | 276 | { |
277 | // ignore font change request if not coming from konsole itself | 277 | // ignore font change request if not coming from konsole itself |
278 | } | 278 | } |
279 | 279 | ||
280 | /* ------------------------------------------------------------------------- */ | 280 | /* ------------------------------------------------------------------------- */ |
281 | /* */ | 281 | /* */ |
282 | /* Constructor / Destructor */ | 282 | /* Constructor / Destructor */ |
283 | /* */ | 283 | /* */ |
284 | /* ------------------------------------------------------------------------- */ | 284 | /* ------------------------------------------------------------------------- */ |
285 | 285 | ||
286 | TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) | 286 | TEWidget::TEWidget(QWidget *parent, const char *name) : QFrame(parent,name) |
287 | { | 287 | { |
288 | #ifndef QT_NO_CLIPBOARD | 288 | #ifndef QT_NO_CLIPBOARD |
289 | cb = QApplication::clipboard(); | 289 | cb = QApplication::clipboard(); |
290 | QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), | 290 | QObject::connect( (QObject*)cb, SIGNAL(dataChanged()), |
291 | this, SLOT(onClearSelection()) ); | 291 | this, SLOT(onClearSelection()) ); |
292 | #endif | 292 | #endif |
293 | 293 | ||
294 | scrollbar = new QScrollBar(this); | 294 | scrollbar = new QScrollBar(this); |
295 | scrollbar->setCursor( arrowCursor ); | 295 | scrollbar->setCursor( arrowCursor ); |
296 | connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); | 296 | connect(scrollbar, SIGNAL(valueChanged(int)), this, SLOT(scrollChanged(int))); |
297 | 297 | ||
298 | hScrollbar = new QScrollBar(this); | 298 | hScrollbar = new QScrollBar(this); |
299 | hScrollbar->setCursor( arrowCursor ); | 299 | hScrollbar->setCursor( arrowCursor ); |
300 | hScrollbar->setOrientation(QScrollBar::Horizontal); | 300 | hScrollbar->setOrientation(QScrollBar::Horizontal); |
301 | // hScrollbar->setMaximumHeight(16); | 301 | // hScrollbar->setMaximumHeight(16); |
302 | 302 | ||
303 | connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int))); | 303 | connect( hScrollbar, SIGNAL(valueChanged(int)), this, SLOT( hScrollChanged(int))); |
304 | 304 | ||
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index cabeb20..c7273c5 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -1,96 +1,96 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | // textedit.cpp | 2 | // textedit.cpp |
3 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 3 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
4 | ** | 4 | ** |
5 | ** This file is part of Opie Environment. | 5 | ** This file is part of Opie Environment. |
6 | ** | 6 | ** |
7 | ** This file may be distributed and/or modified under the terms of the | 7 | ** This file may be distributed and/or modified under the terms of the |
8 | ** GNU General Public License version 2 as published by the Free Software | 8 | ** GNU General Public License version 2 as published by the Free Software |
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | 9 | ** Foundation and appearing in the file LICENSE.GPL included in the |
10 | ** packaging of this file. | 10 | ** packaging of this file. |
11 | ** | 11 | ** |
12 | **********************************************************************/ | 12 | **********************************************************************/ |
13 | // changes added by L. J. Potter Sun 02-17-2002 21:31:31 | 13 | // changes added by L. J. Potter Sun 02-17-2002 21:31:31 |
14 | 14 | ||
15 | #include "textedit.h" | 15 | #include "textedit.h" |
16 | #include "filePermissions.h" | 16 | #include "filePermissions.h" |
17 | 17 | ||
18 | /* OPIE */ | 18 | /* OPIE */ |
19 | #include <opie2/odebug.h> | 19 | #include <opie2/odebug.h> |
20 | #include <opie2/ofileselector.h> | 20 | #include <opie2/ofileselector.h> |
21 | #include <opie2/ofiledialog.h> | 21 | #include <opie2/ofiledialog.h> |
22 | #include <opie2/ofontselector.h> | 22 | #include <opie2/ofontselector.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
25 | #include <qpe/qpeapplication.h> | 25 | #include <qpe/qpeapplication.h> |
26 | 26 | ||
27 | 27 | ||
28 | /* QT */ | 28 | /* QT */ |
29 | #include <qmenubar.h> | 29 | #include <qmenubar.h> |
30 | #include <qtoolbar.h> | 30 | #include <qtoolbar.h> |
31 | #include <qtextstream.h> | 31 | #include <qtextstream.h> |
32 | #include <qclipboard.h> | 32 | #include <qclipboard.h> |
33 | #include <qaction.h> | 33 | #include <qaction.h> |
34 | #include <qlineedit.h> | 34 | #include <qlineedit.h> |
35 | #include <qmessagebox.h> | 35 | #include <qmessagebox.h> |
36 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qtimer.h> | 37 | #include <qtimer.h> |
38 | #include <qdir.h> | 38 | #include <qdir.h> |
39 | 39 | ||
40 | /* STD */ | 40 | /* STD */ |
41 | #include <unistd.h> | 41 | #include <unistd.h> |
42 | #include <sys/stat.h> | 42 | #include <sys/stat.h> |
43 | #include <stdlib.h> //getenv | 43 | #include <stdlib.h> //getenv |
44 | 44 | ||
45 | using namespace Opie::Core; | 45 | using namespace Opie::Core; |
46 | using namespace Opie::Ui; | 46 | using namespace Opie::Ui; |
47 | 47 | ||
48 | #if QT_VERSION < 300 | 48 | #if QT_VERSION < 0x030000 |
49 | class QpeEditor : public QMultiLineEdit | 49 | class QpeEditor : public QMultiLineEdit |
50 | { | 50 | { |
51 | 51 | ||
52 | public: | 52 | public: |
53 | QpeEditor( QWidget *parent, const char * name = 0 ) | 53 | QpeEditor( QWidget *parent, const char * name = 0 ) |
54 | : QMultiLineEdit( parent, name ) { | 54 | : QMultiLineEdit( parent, name ) { |
55 | clearTableFlags(); | 55 | clearTableFlags(); |
56 | setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); | 56 | setTableFlags( Tbl_vScrollBar | Tbl_autoHScrollBar ); |
57 | } | 57 | } |
58 | 58 | ||
59 | void find( const QString &txt, bool caseSensitive, | 59 | void find( const QString &txt, bool caseSensitive, |
60 | bool backwards ); | 60 | bool backwards ); |
61 | protected: | 61 | protected: |
62 | bool markIt; | 62 | bool markIt; |
63 | int line1, line2, col1, col2; | 63 | int line1, line2, col1, col2; |
64 | void mousePressEvent( QMouseEvent * ); | 64 | void mousePressEvent( QMouseEvent * ); |
65 | void mouseReleaseEvent( QMouseEvent * ); | 65 | void mouseReleaseEvent( QMouseEvent * ); |
66 | 66 | ||
67 | //public slots: | 67 | //public slots: |
68 | /* | 68 | /* |
69 | signals: | 69 | signals: |
70 | void notFound(); | 70 | void notFound(); |
71 | void searchWrapped(); | 71 | void searchWrapped(); |
72 | */ | 72 | */ |
73 | 73 | ||
74 | private: | 74 | private: |
75 | 75 | ||
76 | }; | 76 | }; |
77 | 77 | ||
78 | void QpeEditor::mousePressEvent( QMouseEvent *e ) { | 78 | void QpeEditor::mousePressEvent( QMouseEvent *e ) { |
79 | switch(e->button()) { | 79 | switch(e->button()) { |
80 | case RightButton: | 80 | case RightButton: |
81 | { //rediculous workaround for qt popup menu | 81 | { //rediculous workaround for qt popup menu |
82 | //and the hold right click mechanism | 82 | //and the hold right click mechanism |
83 | this->setSelection( line1, col1, line2, col2); | 83 | this->setSelection( line1, col1, line2, col2); |
84 | QMultiLineEdit::mousePressEvent( e ); | 84 | QMultiLineEdit::mousePressEvent( e ); |
85 | markIt = false; | 85 | markIt = false; |
86 | } | 86 | } |
87 | break; | 87 | break; |
88 | default: | 88 | default: |
89 | { | 89 | { |
90 | if(!markIt) { | 90 | if(!markIt) { |
91 | int line, col; | 91 | int line, col; |
92 | this->getCursorPosition(&line, &col); | 92 | this->getCursorPosition(&line, &col); |
93 | line1=line2=line; | 93 | line1=line2=line; |
94 | col1=col2=col; | 94 | col1=col2=col; |
95 | } | 95 | } |
96 | QMultiLineEdit::mousePressEvent( e ); | 96 | QMultiLineEdit::mousePressEvent( e ); |
diff --git a/core/opie-login/loginwindowimpl.cpp b/core/opie-login/loginwindowimpl.cpp index 73c2cbe..ac24894 100644 --- a/core/opie-login/loginwindowimpl.cpp +++ b/core/opie-login/loginwindowimpl.cpp | |||
@@ -1,84 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Public License for more details. | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: | 18 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | #include <qpe/version.h> | 27 | #include <qpe/version.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
31 | #include <qtimer.h> | 31 | #include <qtimer.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qlabel.h> | 33 | #include <qlabel.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | #include <qmessagebox.h> | 35 | #include <qmessagebox.h> |
36 | #if QT_VERSION < 300 | 36 | #if QT_VERSION < 0x030000 |
37 | #include <qgfx_qws.h> | 37 | #include <qgfx_qws.h> |
38 | #endif | 38 | #endif |
39 | #include <qwindowsystem_qws.h> | 39 | #include <qwindowsystem_qws.h> |
40 | 40 | ||
41 | #include <qpe/resource.h> | 41 | #include <qpe/resource.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | #include <qpe/config.h> | 43 | #include <qpe/config.h> |
44 | 44 | ||
45 | #include <opie2/odevice.h> | 45 | #include <opie2/odevice.h> |
46 | 46 | ||
47 | #include <stdio.h> | 47 | #include <stdio.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | 49 | ||
50 | #include "passworddialogimpl.h" | 50 | #include "passworddialogimpl.h" |
51 | #include "loginwindowimpl.h" | 51 | #include "loginwindowimpl.h" |
52 | #include "loginapplication.h" | 52 | #include "loginapplication.h" |
53 | #include "inputmethods.h" | 53 | #include "inputmethods.h" |
54 | 54 | ||
55 | using namespace Opie::Core; | 55 | using namespace Opie::Core; |
56 | 56 | ||
57 | 57 | ||
58 | LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose ) | 58 | LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose ) |
59 | { | 59 | { |
60 | QPopupMenu *pop = new QPopupMenu ( this ); | 60 | QPopupMenu *pop = new QPopupMenu ( this ); |
61 | pop-> insertItem ( tr( "Restart" ), this, SLOT( restart())); | 61 | pop-> insertItem ( tr( "Restart" ), this, SLOT( restart())); |
62 | pop-> insertItem ( tr( "Quit" ), this, SLOT( quit())); | 62 | pop-> insertItem ( tr( "Quit" ), this, SLOT( quit())); |
63 | m_menu-> setPopup ( pop ); | 63 | m_menu-> setPopup ( pop ); |
64 | 64 | ||
65 | QCopChannel *channel = new QCopChannel ( "QPE/TaskBar", this ); | 65 | QCopChannel *channel = new QCopChannel ( "QPE/TaskBar", this ); |
66 | connect ( channel, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( receive(const QCString&,const QByteArray&))); | 66 | connect ( channel, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( receive(const QCString&,const QByteArray&))); |
67 | 67 | ||
68 | QHBoxLayout *lay = new QHBoxLayout ( m_taskbar, 4, 4 ); | 68 | QHBoxLayout *lay = new QHBoxLayout ( m_taskbar, 4, 4 ); |
69 | m_input = new InputMethods ( m_taskbar ); | 69 | m_input = new InputMethods ( m_taskbar ); |
70 | connect ( m_input, SIGNAL( inputToggled(bool)), this, SLOT( calcMaxWindowRect())); | 70 | connect ( m_input, SIGNAL( inputToggled(bool)), this, SLOT( calcMaxWindowRect())); |
71 | lay-> addWidget ( m_input ); | 71 | lay-> addWidget ( m_input ); |
72 | lay-> addStretch ( 10 ); | 72 | lay-> addStretch ( 10 ); |
73 | 73 | ||
74 | setActiveWindow ( ); | 74 | setActiveWindow ( ); |
75 | m_password-> setFocus ( ); | 75 | m_password-> setFocus ( ); |
76 | 76 | ||
77 | m_user-> insertStringList ( lApp-> allUsers ( )); | 77 | m_user-> insertStringList ( lApp-> allUsers ( )); |
78 | 78 | ||
79 | //there is no point in displaying the IM for a zaurus | 79 | //there is no point in displaying the IM for a zaurus |
80 | if (ODevice::inst ( )-> series ( ) != Model_Zaurus){ | 80 | if (ODevice::inst ( )-> series ( ) != Model_Zaurus){ |
81 | QTimer::singleShot ( 0, this, SLOT( showIM())); | 81 | QTimer::singleShot ( 0, this, SLOT( showIM())); |
82 | } | 82 | } |
83 | 83 | ||
84 | QString opiedir = ::getenv ( "OPIEDIR" ); | 84 | QString opiedir = ::getenv ( "OPIEDIR" ); |
@@ -91,97 +91,97 @@ LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_C | |||
91 | TextLabel2-> setBackgroundPixmap ( bgpix); | 91 | TextLabel2-> setBackgroundPixmap ( bgpix); |
92 | } | 92 | } |
93 | 93 | ||
94 | //m_caption-> setText ( tr("<center>Welcome to OPIE %1</center><center>& %2 %3</center>"). arg(QPE_VERSION). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( ))); | 94 | //m_caption-> setText ( tr("<center>Welcome to OPIE %1</center><center>& %2 %3</center>"). arg(QPE_VERSION). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( ))); |
95 | 95 | ||
96 | Config cfg ( "opie-login" ); | 96 | Config cfg ( "opie-login" ); |
97 | cfg. setGroup ( "General" ); | 97 | cfg. setGroup ( "General" ); |
98 | QString last = cfg. readEntry ( "LastLogin" ); | 98 | QString last = cfg. readEntry ( "LastLogin" ); |
99 | 99 | ||
100 | if ( !last. isEmpty ( )) | 100 | if ( !last. isEmpty ( )) |
101 | m_user-> setEditText ( last ); | 101 | m_user-> setEditText ( last ); |
102 | 102 | ||
103 | calcMaxWindowRect ( ); | 103 | calcMaxWindowRect ( ); |
104 | 104 | ||
105 | if ( PasswordDialogImpl::needDialog() ) | 105 | if ( PasswordDialogImpl::needDialog() ) |
106 | QTimer::singleShot(10, this, SLOT(showPasswordDialog()) ); | 106 | QTimer::singleShot(10, this, SLOT(showPasswordDialog()) ); |
107 | 107 | ||
108 | 108 | ||
109 | } | 109 | } |
110 | 110 | ||
111 | LoginWindowImpl::~LoginWindowImpl ( ) | 111 | LoginWindowImpl::~LoginWindowImpl ( ) |
112 | { | 112 | { |
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
116 | void LoginWindowImpl::receive ( const QCString &msg, const QByteArray &data ) | 116 | void LoginWindowImpl::receive ( const QCString &msg, const QByteArray &data ) |
117 | { | 117 | { |
118 | QDataStream stream ( data, IO_ReadOnly ); | 118 | QDataStream stream ( data, IO_ReadOnly ); |
119 | 119 | ||
120 | if ( msg == "hideInputMethod()" ) | 120 | if ( msg == "hideInputMethod()" ) |
121 | m_input-> hideInputMethod ( ); | 121 | m_input-> hideInputMethod ( ); |
122 | else if ( msg == "showInputMethod()" ) | 122 | else if ( msg == "showInputMethod()" ) |
123 | m_input-> showInputMethod ( ); | 123 | m_input-> showInputMethod ( ); |
124 | else if ( msg == "reloadInputMethods()" ) | 124 | else if ( msg == "reloadInputMethods()" ) |
125 | m_input-> loadInputMethods ( ); | 125 | m_input-> loadInputMethods ( ); |
126 | } | 126 | } |
127 | 127 | ||
128 | void LoginWindowImpl::calcMaxWindowRect ( ) | 128 | void LoginWindowImpl::calcMaxWindowRect ( ) |
129 | { | 129 | { |
130 | #ifdef Q_WS_QWS | 130 | #ifdef Q_WS_QWS |
131 | QRect wr; | 131 | QRect wr; |
132 | int displayWidth = qApp-> desktop ( )-> width ( ); | 132 | int displayWidth = qApp-> desktop ( )-> width ( ); |
133 | QRect ir = m_input-> inputRect ( ); | 133 | QRect ir = m_input-> inputRect ( ); |
134 | if ( ir.isValid() ) | 134 | if ( ir.isValid() ) |
135 | wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); | 135 | wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); |
136 | else | 136 | else |
137 | wr.setCoords( 0, 0, displayWidth-1, m_taskbar->y()-1 ); | 137 | wr.setCoords( 0, 0, displayWidth-1, m_taskbar->y()-1 ); |
138 | 138 | ||
139 | #if QT_VERSION < 300 | 139 | #if QT_VERSION < 0x030000 |
140 | wr = qt_screen-> mapToDevice ( wr, QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); | 140 | wr = qt_screen-> mapToDevice ( wr, QSize ( qt_screen-> width ( ), qt_screen-> height ( ))); |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | QWSServer::setMaxWindowRect( wr ); | 143 | QWSServer::setMaxWindowRect( wr ); |
144 | #endif | 144 | #endif |
145 | } | 145 | } |
146 | 146 | ||
147 | 147 | ||
148 | void LoginWindowImpl::keyPressEvent ( QKeyEvent *e ) | 148 | void LoginWindowImpl::keyPressEvent ( QKeyEvent *e ) |
149 | { | 149 | { |
150 | switch ( e-> key ( )) { | 150 | switch ( e-> key ( )) { |
151 | case HardKey_Suspend: suspend ( ); | 151 | case HardKey_Suspend: suspend ( ); |
152 | break; | 152 | break; |
153 | case HardKey_Backlight: backlight ( ); | 153 | case HardKey_Backlight: backlight ( ); |
154 | break; | 154 | break; |
155 | default: e-> ignore ( ); | 155 | default: e-> ignore ( ); |
156 | break; | 156 | break; |
157 | } | 157 | } |
158 | LoginWindow::keyPressEvent ( e ); | 158 | LoginWindow::keyPressEvent ( e ); |
159 | } | 159 | } |
160 | 160 | ||
161 | 161 | ||
162 | void LoginWindowImpl::toggleEchoMode ( bool t ) | 162 | void LoginWindowImpl::toggleEchoMode ( bool t ) |
163 | { | 163 | { |
164 | m_password-> setEchoMode ( t ? QLineEdit::Normal : QLineEdit::Password ); | 164 | m_password-> setEchoMode ( t ? QLineEdit::Normal : QLineEdit::Password ); |
165 | } | 165 | } |
166 | 166 | ||
167 | void LoginWindowImpl::showIM ( ) | 167 | void LoginWindowImpl::showIM ( ) |
168 | { | 168 | { |
169 | m_input-> showInputMethod ( ); | 169 | m_input-> showInputMethod ( ); |
170 | } | 170 | } |
171 | 171 | ||
172 | void LoginWindowImpl::restart ( ) | 172 | void LoginWindowImpl::restart ( ) |
173 | { | 173 | { |
174 | qApp-> quit ( ); | 174 | qApp-> quit ( ); |
175 | } | 175 | } |
176 | 176 | ||
177 | void LoginWindowImpl::quit ( ) | 177 | void LoginWindowImpl::quit ( ) |
178 | { | 178 | { |
179 | lApp-> quitToConsole ( ); | 179 | lApp-> quitToConsole ( ); |
180 | } | 180 | } |
181 | 181 | ||
182 | void LoginWindowImpl::suspend ( ) | 182 | void LoginWindowImpl::suspend ( ) |
183 | { | 183 | { |
184 | ODevice::inst ( )-> suspend ( ); | 184 | ODevice::inst ( )-> suspend ( ); |
185 | 185 | ||
186 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 186 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
187 | e << -3; // Force on | 187 | e << -3; // Force on |