-rw-r--r-- | core/apps/calibrate/calibrate.cpp | 2 | ||||
-rw-r--r-- | core/opie-login/loginwindowimpl.cpp | 1 | ||||
-rw-r--r-- | core/opie-login/main.cpp | 1 | ||||
-rw-r--r-- | core/opie-login/opie-login.pro | 4 |
4 files changed, 6 insertions, 2 deletions
diff --git a/core/apps/calibrate/calibrate.cpp b/core/apps/calibrate/calibrate.cpp index 1f4fb1b..b9ad73d 100644 --- a/core/apps/calibrate/calibrate.cpp +++ b/core/apps/calibrate/calibrate.cpp | |||
@@ -1,52 +1,54 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <math.h> | ||
22 | |||
21 | #include "calibrate.h" | 23 | #include "calibrate.h" |
22 | 24 | ||
23 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
24 | 26 | ||
25 | #include <qapplication.h> | 27 | #include <qapplication.h> |
26 | 28 | ||
27 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 29 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
28 | 30 | ||
29 | #include <qpainter.h> | 31 | #include <qpainter.h> |
30 | #include <qtimer.h> | 32 | #include <qtimer.h> |
31 | #include <qwindowsystem_qws.h> | 33 | #include <qwindowsystem_qws.h> |
32 | #include <qgfx_qws.h> | 34 | #include <qgfx_qws.h> |
33 | 35 | ||
34 | 36 | ||
35 | Calibrate::Calibrate( QWidget* parent, const char * name, WFlags wf ) : | 37 | Calibrate::Calibrate( QWidget* parent, const char * name, WFlags wf ) : |
36 | QDialog( parent, name, TRUE, wf | WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop ) | 38 | QDialog( parent, name, TRUE, wf | WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop ) |
37 | { | 39 | { |
38 | showCross = TRUE; | 40 | showCross = TRUE; |
39 | const int offset = 30; | 41 | const int offset = 30; |
40 | QRect desk = qApp->desktop() ->geometry(); | 42 | QRect desk = qApp->desktop() ->geometry(); |
41 | setGeometry( 0, 0, desk.width(), desk.height() ); | 43 | setGeometry( 0, 0, desk.width(), desk.height() ); |
42 | if ( desk.height() < 250 ) { | 44 | if ( desk.height() < 250 ) { |
43 | int w = desk.height() / 3; | 45 | int w = desk.height() / 3; |
44 | logo.convertFromImage( Resource::loadImage( "launcher/opielogo" ).smoothScale( w, w ) ); | 46 | logo.convertFromImage( Resource::loadImage( "launcher/opielogo" ).smoothScale( w, w ) ); |
45 | } | 47 | } |
46 | else { | 48 | else { |
47 | logo = Resource::loadPixmap( "launcher/opielogo" ); | 49 | logo = Resource::loadPixmap( "launcher/opielogo" ); |
48 | } | 50 | } |
49 | cd.screenPoints[ QWSPointerCalibrationData::TopLeft ] = QPoint( offset, offset ); | 51 | cd.screenPoints[ QWSPointerCalibrationData::TopLeft ] = QPoint( offset, offset ); |
50 | cd.screenPoints[ QWSPointerCalibrationData::BottomLeft ] = QPoint( offset, qt_screen->deviceHeight() - offset ); | 52 | cd.screenPoints[ QWSPointerCalibrationData::BottomLeft ] = QPoint( offset, qt_screen->deviceHeight() - offset ); |
51 | cd.screenPoints[ QWSPointerCalibrationData::BottomRight ] = QPoint( qt_screen->deviceWidth() - offset, qt_screen->deviceHeight() - offset ); | 53 | cd.screenPoints[ QWSPointerCalibrationData::BottomRight ] = QPoint( qt_screen->deviceWidth() - offset, qt_screen->deviceHeight() - offset ); |
52 | cd.screenPoints[ QWSPointerCalibrationData::TopRight ] = QPoint( qt_screen->deviceWidth() - offset, offset ); | 54 | cd.screenPoints[ QWSPointerCalibrationData::TopRight ] = QPoint( qt_screen->deviceWidth() - offset, offset ); |
diff --git a/core/opie-login/loginwindowimpl.cpp b/core/opie-login/loginwindowimpl.cpp index 3265b46..26d9225 100644 --- a/core/opie-login/loginwindowimpl.cpp +++ b/core/opie-login/loginwindowimpl.cpp | |||
@@ -1,55 +1,56 @@ | |||
1 | #include <qapplication.h> | 1 | #include <qapplication.h> |
2 | #include <qpushbutton.h> | 2 | #include <qpushbutton.h> |
3 | #include <qlayout.h> | 3 | #include <qlayout.h> |
4 | #include <qframe.h> | 4 | #include <qframe.h> |
5 | #include <qlineedit.h> | 5 | #include <qlineedit.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qcombobox.h> | 7 | #include <qcombobox.h> |
8 | #include <qpixmap.h> | 8 | #include <qpixmap.h> |
9 | #include <qlabel.h> | 9 | #include <qlabel.h> |
10 | #include <qpopupmenu.h> | 10 | #include <qpopupmenu.h> |
11 | #include <qmessagebox.h> | 11 | #include <qmessagebox.h> |
12 | 12 | ||
13 | #include <qpe/qcopenvelope_qws.h> | 13 | #include <qpe/qcopenvelope_qws.h> |
14 | 14 | ||
15 | #include <opie/odevice.h> | 15 | #include <opie/odevice.h> |
16 | 16 | ||
17 | #include <stdio.h> | 17 | #include <stdio.h> |
18 | 18 | ||
19 | #include <pwd.h> | 19 | #include <pwd.h> |
20 | #include <grp.h> | 20 | #include <grp.h> |
21 | #include <unistd.h> | 21 | #include <unistd.h> |
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | 23 | ||
24 | #undef USEPAM // FOR my toolchain | ||
24 | #ifdef USEPAM | 25 | #ifdef USEPAM |
25 | extern "C" { | 26 | extern "C" { |
26 | #include <security/pam_appl.h> | 27 | #include <security/pam_appl.h> |
27 | } | 28 | } |
28 | #else | 29 | #else |
29 | #include <crypt.h> | 30 | #include <crypt.h> |
30 | #include <shadow.h> | 31 | #include <shadow.h> |
31 | #endif | 32 | #endif |
32 | 33 | ||
33 | #include "loginwindowimpl.h" | 34 | #include "loginwindowimpl.h" |
34 | #include "inputmethods.h" | 35 | #include "inputmethods.h" |
35 | 36 | ||
36 | LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose ) | 37 | LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose ) |
37 | { | 38 | { |
38 | QPopupMenu *pop = new QPopupMenu ( this ); | 39 | QPopupMenu *pop = new QPopupMenu ( this ); |
39 | pop-> insertItem ( tr( "Restart" ), this, SLOT( restart ( ))); | 40 | pop-> insertItem ( tr( "Restart" ), this, SLOT( restart ( ))); |
40 | m_menu-> setPopup ( pop ); | 41 | m_menu-> setPopup ( pop ); |
41 | 42 | ||
42 | QHBoxLayout *lay = new QHBoxLayout ( m_taskbar, 4, 4 ); | 43 | QHBoxLayout *lay = new QHBoxLayout ( m_taskbar, 4, 4 ); |
43 | m_input = new InputMethods ( m_taskbar ); | 44 | m_input = new InputMethods ( m_taskbar ); |
44 | lay-> addWidget ( m_input ); | 45 | lay-> addWidget ( m_input ); |
45 | lay-> addStretch ( 10 ); | 46 | lay-> addStretch ( 10 ); |
46 | 47 | ||
47 | setActiveWindow ( ); | 48 | setActiveWindow ( ); |
48 | m_password-> setFocus ( ); | 49 | m_password-> setFocus ( ); |
49 | 50 | ||
50 | m_user-> insertStringList ( getAllUsers ( )); | 51 | m_user-> insertStringList ( getAllUsers ( )); |
51 | 52 | ||
52 | QTimer::singleShot ( 0, this, SLOT( showIM ( ))); | 53 | QTimer::singleShot ( 0, this, SLOT( showIM ( ))); |
53 | 54 | ||
54 | QString opiedir = ::getenv ( "OPIEDIR" ); | 55 | QString opiedir = ::getenv ( "OPIEDIR" ); |
55 | QPixmap bgpix ( opiedir + "/pics/launcher/opie-background.jpg" ); | 56 | QPixmap bgpix ( opiedir + "/pics/launcher/opie-background.jpg" ); |
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp index 9d52b75..44d6f8d 100644 --- a/core/opie-login/main.cpp +++ b/core/opie-login/main.cpp | |||
@@ -1,39 +1,40 @@ | |||
1 | #include <sys/time.h> | 1 | #include <sys/time.h> |
2 | #include <sys/resource.h> | 2 | #include <sys/resource.h> |
3 | #include <unistd.h> | 3 | #include <unistd.h> |
4 | #include <syslog.h> | 4 | #include <syslog.h> |
5 | #include <sys/types.h> | 5 | #include <sys/types.h> |
6 | #include <sys/wait.h> | 6 | #include <sys/wait.h> |
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <stdlib.h> | ||
8 | 9 | ||
9 | #include <qpe/qpeapplication.h> | 10 | #include <qpe/qpeapplication.h> |
10 | #include <qpe/qcopenvelope_qws.h> | 11 | #include <qpe/qcopenvelope_qws.h> |
11 | 12 | ||
12 | #include <opie/odevice.h> | 13 | #include <opie/odevice.h> |
13 | 14 | ||
14 | #include <qwindowsystem_qws.h> | 15 | #include <qwindowsystem_qws.h> |
15 | #include <qfile.h> | 16 | #include <qfile.h> |
16 | 17 | ||
17 | #include "loginwindowimpl.h" | 18 | #include "loginwindowimpl.h" |
18 | #include "calibrate.h" | 19 | #include "calibrate.h" |
19 | 20 | ||
20 | int login_main ( int argc, char **argv ); | 21 | int login_main ( int argc, char **argv ); |
21 | 22 | ||
22 | 23 | ||
23 | int main ( int argc, char **argv ) | 24 | int main ( int argc, char **argv ) |
24 | { | 25 | { |
25 | if ( geteuid ( ) != 0 ) { | 26 | if ( geteuid ( ) != 0 ) { |
26 | fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] ); | 27 | fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] ); |
27 | return 1; | 28 | return 1; |
28 | } | 29 | } |
29 | 30 | ||
30 | //struct rlimit rl; | 31 | //struct rlimit rl; |
31 | //getrlimit ( RLIMIT_NOFILE, &rl ); | 32 | //getrlimit ( RLIMIT_NOFILE, &rl ); |
32 | 33 | ||
33 | //for ( unsigned int i = 0; i < rl. rlim_cur; i++ ) | 34 | //for ( unsigned int i = 0; i < rl. rlim_cur; i++ ) |
34 | // close ( i ); | 35 | // close ( i ); |
35 | 36 | ||
36 | setpgid ( 0, 0 ); | 37 | setpgid ( 0, 0 ); |
37 | setsid ( ); | 38 | setsid ( ); |
38 | 39 | ||
39 | openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV ); | 40 | openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV ); |
diff --git a/core/opie-login/opie-login.pro b/core/opie-login/opie-login.pro index 35c1ed0..ef449ab 100644 --- a/core/opie-login/opie-login.pro +++ b/core/opie-login/opie-login.pro | |||
@@ -1,25 +1,25 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on debug usepam | 2 | CONFIG = qt warn_on debug usepam |
3 | 3 | ||
4 | HEADERS = loginwindowimpl.h \ | 4 | HEADERS = loginwindowimpl.h \ |
5 | ../launcher/inputmethods.h \ | 5 | ../launcher/inputmethods.h \ |
6 | ../apps/calibrate/calibrate.h | 6 | ../apps/calibrate/calibrate.h |
7 | 7 | ||
8 | SOURCES = loginwindowimpl.cpp \ | 8 | SOURCES = loginwindowimpl.cpp \ |
9 | ../launcher/inputmethods.cpp \ | 9 | ../launcher/inputmethods.cpp \ |
10 | ../apps/calibrate/calibrate.cpp \ | 10 | ../apps/calibrate/calibrate.cpp \ |
11 | main.cpp | 11 | main.cpp |
12 | 12 | ||
13 | INTERFACES = loginwindow.ui | 13 | INTERFACES = loginwindow.ui |
14 | 14 | ||
15 | INCLUDEPATH += $(OPIEDIR)/include ../launcher ../apps/calibrate | 15 | INCLUDEPATH += $(OPIEDIR)/include ../launcher ../apps/calibrate |
16 | DEPENDPATH += $(OPIEDIR)/include ../launcher ../apps/calibrate | 16 | DEPENDPATH += $(OPIEDIR)/include ../launcher ../apps/calibrate |
17 | 17 | ||
18 | LIBS += -lqpe -lopie | 18 | LIBS += -lqpe -lopie |
19 | 19 | ||
20 | usepam:LIBS += -lpam | 20 | #usepam:LIBS += -lpam |
21 | usepam:DEFINES += USEPAM | 21 | #usepam:DEFINES += USEPAM |
22 | 22 | ||
23 | DESTDIR = $(OPIEDIR)/bin | 23 | DESTDIR = $(OPIEDIR)/bin |
24 | TARGET = opie-login | 24 | TARGET = opie-login |
25 | 25 | ||