author | clem <clem> | 2004-10-08 22:50:28 (UTC) |
---|---|---|
committer | clem <clem> | 2004-10-08 22:50:28 (UTC) |
commit | 2f29d0ec4bb2355f193d744c890add203bd6f2b2 (patch) (unidiff) | |
tree | a703b00b673b9be036415393b53d9c95a5bb87cd | |
parent | dec031cc21181d70e0c806bcf6c228044f7df90b (diff) | |
download | opie-2f29d0ec4bb2355f193d744c890add203bd6f2b2.zip opie-2f29d0ec4bb2355f193d744c890add203bd6f2b2.tar.gz opie-2f29d0ec4bb2355f193d744c890add203bd6f2b2.tar.bz2 |
Big commit thanks to a little feature request :-) We now have an O-menu applet
to lock the PDA immediately, and the internal way to ask for an authentication
(on resume, on start up, on demand or for a simple test) is much cleaner:
it's through MultiauthPassword(int lockMode) (instead of the old bool at_poweron)
-rw-r--r-- | core/applets/lockapplet/.cvsignore | 4 | ||||
-rw-r--r-- | core/applets/lockapplet/config.in | 4 | ||||
-rw-r--r-- | core/applets/lockapplet/lock.cpp | 84 | ||||
-rw-r--r-- | core/applets/lockapplet/lock.h | 36 | ||||
-rw-r--r-- | core/applets/lockapplet/lockapplet.pro | 12 | ||||
-rw-r--r-- | core/applets/lockapplet/opie-lockapplet.control | 11 | ||||
-rw-r--r-- | core/launcher/serverapp.cpp | 3 | ||||
-rw-r--r-- | core/settings/security/demo/main.cpp | 2 | ||||
-rw-r--r-- | core/settings/security/multiauthconfig.cpp | 20 | ||||
-rw-r--r-- | libopie2/opiesecurity/multiauthpassword.cpp | 47 | ||||
-rw-r--r-- | libopie2/opiesecurity/multiauthpassword.h | 10 | ||||
-rw-r--r-- | packages | 1 | ||||
-rw-r--r-- | pics/security/lock.png | bin | 0 -> 419 bytes |
13 files changed, 206 insertions, 28 deletions
diff --git a/core/applets/lockapplet/.cvsignore b/core/applets/lockapplet/.cvsignore new file mode 100644 index 0000000..5e2908c --- a/dev/null +++ b/core/applets/lockapplet/.cvsignore | |||
@@ -0,0 +1,4 @@ | |||
1 | Makefile* | ||
2 | .moc | ||
3 | .obj | ||
4 | |||
diff --git a/core/applets/lockapplet/config.in b/core/applets/lockapplet/config.in new file mode 100644 index 0000000..ddc3522 --- a/dev/null +++ b/core/applets/lockapplet/config.in | |||
@@ -0,0 +1,4 @@ | |||
1 | config LOCKAPPLET | ||
2 | boolean "opie-lockapplet (button in the Opie menu to lock the PDA)" | ||
3 | default "y" | ||
4 | depends ( LIBQPE || LIBQPE-X11 ) && SECURITY | ||
diff --git a/core/applets/lockapplet/lock.cpp b/core/applets/lockapplet/lock.cpp new file mode 100644 index 0000000..89f27bb --- a/dev/null +++ b/core/applets/lockapplet/lock.cpp | |||
@@ -0,0 +1,84 @@ | |||
1 | #include "lock.h" | ||
2 | |||
3 | /* OPIE */ | ||
4 | #include <opie2/multiauthpassword.h> | ||
5 | |||
6 | #include <qpe/applnk.h> | ||
7 | #include <qpe/resource.h> | ||
8 | |||
9 | /* QT */ | ||
10 | #include <qiconset.h> | ||
11 | #include <qpopupmenu.h> | ||
12 | #include <qmessagebox.h> | ||
13 | |||
14 | |||
15 | LockMenuApplet::LockMenuApplet() | ||
16 | :QObject( 0, "LockMenuApplet" ) | ||
17 | { | ||
18 | } | ||
19 | |||
20 | LockMenuApplet::~LockMenuApplet ( ) | ||
21 | {} | ||
22 | |||
23 | int LockMenuApplet::position() const | ||
24 | { | ||
25 | return 3; | ||
26 | } | ||
27 | |||
28 | QString LockMenuApplet::name() const | ||
29 | { | ||
30 | return tr( "Lock shortcut" ); | ||
31 | } | ||
32 | |||
33 | QString LockMenuApplet::text() const | ||
34 | { | ||
35 | return tr( "Lock" ); | ||
36 | } | ||
37 | |||
38 | |||
39 | QIconSet LockMenuApplet::icon() const | ||
40 | { | ||
41 | QPixmap pix; | ||
42 | QImage img = Resource::loadImage( "security/lock" ); | ||
43 | if ( !img.isNull() ) | ||
44 | pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
45 | return pix; | ||
46 | } | ||
47 | |||
48 | QPopupMenu* LockMenuApplet::popup(QWidget*) const | ||
49 | { | ||
50 | /* no subdir */ | ||
51 | return 0; | ||
52 | } | ||
53 | |||
54 | void LockMenuApplet::activated() | ||
55 | { | ||
56 | /* | ||
57 | QMessageBox::information(0,tr("No white rabbit found"), | ||
58 | tr("<qt>No white rabbit was seen near Opie." | ||
59 | "Only the beautiful OpieZilla is available" | ||
60 | "for your pleassure</qt>")); | ||
61 | */ | ||
62 | Opie::Security::MultiauthPassword::authenticate(Opie::Security::LockNow); | ||
63 | } | ||
64 | |||
65 | |||
66 | QRESULT LockMenuApplet::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | ||
67 | { | ||
68 | *iface = 0; | ||
69 | if ( uuid == IID_QUnknown ) | ||
70 | *iface = this; | ||
71 | else if ( uuid == IID_MenuApplet ) | ||
72 | *iface = this; | ||
73 | else | ||
74 | return QS_FALSE; | ||
75 | |||
76 | if ( *iface ) | ||
77 | (*iface)->addRef(); | ||
78 | return QS_OK; | ||
79 | } | ||
80 | |||
81 | Q_EXPORT_INTERFACE() | ||
82 | { | ||
83 | Q_CREATE_INSTANCE( LockMenuApplet ) | ||
84 | } | ||
diff --git a/core/applets/lockapplet/lock.h b/core/applets/lockapplet/lock.h new file mode 100644 index 0000000..ff94bce --- a/dev/null +++ b/core/applets/lockapplet/lock.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /** | ||
2 | * \file lock.h | ||
3 | * \brief defines a lock button that goes in the 'O' Opie menu | ||
4 | * It's based on the examples/menuapplet code of 2004/10/06. | ||
5 | */ | ||
6 | #ifndef CORE_SETTINGS_SECURITY_LOCKAPPLET_LOCK_H | ||
7 | #define CORE_SETTINGS_SECURITY_LOCKAPPLET_LOCK_H | ||
8 | |||
9 | #include <qpe/menuappletinterface.h> | ||
10 | #include <qobject.h> | ||
11 | |||
12 | class LockMenuApplet: public QObject, public MenuAppletInterface | ||
13 | { | ||
14 | |||
15 | Q_OBJECT | ||
16 | |||
17 | public: | ||
18 | LockMenuApplet ( ); | ||
19 | virtual ~LockMenuApplet ( ); | ||
20 | |||
21 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | ||
22 | Q_REFCOUNT | ||
23 | |||
24 | virtual int position() const; | ||
25 | |||
26 | virtual QString name ( ) const; | ||
27 | virtual QIconSet icon ( ) const; | ||
28 | virtual QString text ( ) const; | ||
29 | /* virtual QString tr( const char* ) const; | ||
30 | virtual QString tr( const char*, const char* ) const; | ||
31 | */ | ||
32 | virtual QPopupMenu *popup ( QWidget *parent ) const; | ||
33 | virtual void activated ( ); | ||
34 | }; | ||
35 | |||
36 | #endif | ||
diff --git a/core/applets/lockapplet/lockapplet.pro b/core/applets/lockapplet/lockapplet.pro new file mode 100644 index 0000000..e0ee780 --- a/dev/null +++ b/core/applets/lockapplet/lockapplet.pro | |||
@@ -0,0 +1,12 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt plugn warn_on | ||
3 | HEADERS = lock.h | ||
4 | SOURCES = lock.cpp | ||
5 | TARGET = lockapplet | ||
6 | DESTDIR = $(OPIEDIR)/plugins/applets | ||
7 | INCLUDEPATH += $(OPIEDIR)/include | ||
8 | DEPENDPATH += $(OPIEDIR)/include | ||
9 | LIBS += -lqpe | ||
10 | VERSION = 1.0.0 | ||
11 | |||
12 | include ( $(OPIEDIR)/include.pro ) | ||
diff --git a/core/applets/lockapplet/opie-lockapplet.control b/core/applets/lockapplet/opie-lockapplet.control new file mode 100644 index 0000000..e175a3e --- a/dev/null +++ b/core/applets/lockapplet/opie-lockapplet.control | |||
@@ -0,0 +1,11 @@ | |||
1 | Package: opie-lockapplet | ||
2 | Files: plugins/applets/liblockapplet.so* | ||
3 | Priority: optional | ||
4 | Section: opie/applets | ||
5 | Maintainer: Opie Team <opie@handhelds.org> | ||
6 | Architecture: arm | ||
7 | Depends: task-opie-minimal, opie-security | ||
8 | Description: Lock Opie now | ||
9 | Button to lock Opie (as configured in the Security | ||
10 | settings) on demand. | ||
11 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp index dc1f2c7..e541d10 100644 --- a/core/launcher/serverapp.cpp +++ b/core/launcher/serverapp.cpp | |||
@@ -1,850 +1,851 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2003 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2003 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the 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 "serverapp.h" | 21 | #include "serverapp.h" |
22 | #include "screensaver.h" | 22 | #include "screensaver.h" |
23 | 23 | ||
24 | /* OPIE */ | 24 | /* OPIE */ |
25 | #include <opie2/odebug.h> | 25 | #include <opie2/odebug.h> |
26 | #include <opie2/odevice.h> | 26 | #include <opie2/odevice.h> |
27 | #include <opie2/multiauthpassword.h> | 27 | #include <opie2/multiauthpassword.h> |
28 | 28 | ||
29 | #include <qtopia/config.h> | 29 | #include <qtopia/config.h> |
30 | #include <qtopia/power.h> | 30 | #include <qtopia/power.h> |
31 | 31 | ||
32 | #ifdef Q_WS_QWS | 32 | #ifdef Q_WS_QWS |
33 | #include <qtopia/qcopenvelope_qws.h> | 33 | #include <qtopia/qcopenvelope_qws.h> |
34 | #endif | 34 | #endif |
35 | #include <qtopia/global.h> | 35 | #include <qtopia/global.h> |
36 | using namespace Opie::Core; | 36 | using namespace Opie::Core; |
37 | 37 | ||
38 | /* QT */ | 38 | /* QT */ |
39 | #ifdef Q_WS_QWS | 39 | #ifdef Q_WS_QWS |
40 | #include <qgfx_qws.h> | 40 | #include <qgfx_qws.h> |
41 | #endif | 41 | #endif |
42 | #include <qmessagebox.h> | 42 | #include <qmessagebox.h> |
43 | #include <qtimer.h> | 43 | #include <qtimer.h> |
44 | #include <qpainter.h> | 44 | #include <qpainter.h> |
45 | #include <qfile.h> | 45 | #include <qfile.h> |
46 | #include <qpixmapcache.h> | 46 | #include <qpixmapcache.h> |
47 | 47 | ||
48 | /* STD */ | 48 | /* STD */ |
49 | #ifdef Q_OS_WIN32 | 49 | #ifdef Q_OS_WIN32 |
50 | #include <io.h> | 50 | #include <io.h> |
51 | #include <process.h> | 51 | #include <process.h> |
52 | #else | 52 | #else |
53 | #include <unistd.h> | 53 | #include <unistd.h> |
54 | #endif | 54 | #endif |
55 | #include <stdlib.h> | 55 | #include <stdlib.h> |
56 | 56 | ||
57 | static ServerApplication *serverApp = 0; | 57 | static ServerApplication *serverApp = 0; |
58 | static int loggedin=0; | 58 | static int loggedin=0; |
59 | 59 | ||
60 | QCopKeyRegister::QCopKeyRegister() | 60 | QCopKeyRegister::QCopKeyRegister() |
61 | : m_keyCode( 0 ) | 61 | : m_keyCode( 0 ) |
62 | { | 62 | { |
63 | 63 | ||
64 | } | 64 | } |
65 | 65 | ||
66 | QCopKeyRegister::QCopKeyRegister( int k, const QCString& c, const QCString& m ) | 66 | QCopKeyRegister::QCopKeyRegister( int k, const QCString& c, const QCString& m ) |
67 | :m_keyCode( k ), m_channel( c ), m_message( m ) | 67 | :m_keyCode( k ), m_channel( c ), m_message( m ) |
68 | { | 68 | { |
69 | 69 | ||
70 | } | 70 | } |
71 | 71 | ||
72 | int QCopKeyRegister::keyCode() const | 72 | int QCopKeyRegister::keyCode() const |
73 | { | 73 | { |
74 | return m_keyCode; | 74 | return m_keyCode; |
75 | } | 75 | } |
76 | 76 | ||
77 | QCString QCopKeyRegister::channel() const | 77 | QCString QCopKeyRegister::channel() const |
78 | { | 78 | { |
79 | return m_channel; | 79 | return m_channel; |
80 | } | 80 | } |
81 | 81 | ||
82 | QCString QCopKeyRegister::message() const | 82 | QCString QCopKeyRegister::message() const |
83 | { | 83 | { |
84 | return m_message; | 84 | return m_message; |
85 | } | 85 | } |
86 | 86 | ||
87 | bool QCopKeyRegister::send() | 87 | bool QCopKeyRegister::send() |
88 | { | 88 | { |
89 | if (m_channel.isNull() ) | 89 | if (m_channel.isNull() ) |
90 | return false; | 90 | return false; |
91 | 91 | ||
92 | QCopEnvelope e( m_channel, m_message ); | 92 | QCopEnvelope e( m_channel, m_message ); |
93 | 93 | ||
94 | return true; | 94 | return true; |
95 | } | 95 | } |
96 | 96 | ||
97 | //--------------------------------------------------------------------------- | 97 | //--------------------------------------------------------------------------- |
98 | 98 | ||
99 | /* | 99 | /* |
100 | Priority is number of alerts that are needed to pop up | 100 | Priority is number of alerts that are needed to pop up |
101 | alert. | 101 | alert. |
102 | */ | 102 | */ |
103 | class DesktopPowerAlerter : public QMessageBox | 103 | class DesktopPowerAlerter : public QMessageBox |
104 | { | 104 | { |
105 | Q_OBJECT | 105 | Q_OBJECT |
106 | public: | 106 | public: |
107 | DesktopPowerAlerter( QWidget *parent, const char *name = 0 ) | 107 | DesktopPowerAlerter( QWidget *parent, const char *name = 0 ) |
108 | : QMessageBox( tr("Battery Status"), tr("Low Battery"), | 108 | : QMessageBox( tr("Battery Status"), tr("Low Battery"), |
109 | QMessageBox::Critical, | 109 | QMessageBox::Critical, |
110 | QMessageBox::Ok | QMessageBox::Default, | 110 | QMessageBox::Ok | QMessageBox::Default, |
111 | QMessageBox::NoButton, QMessageBox::NoButton, | 111 | QMessageBox::NoButton, QMessageBox::NoButton, |
112 | parent, name, FALSE ) | 112 | parent, name, FALSE ) |
113 | { | 113 | { |
114 | currentPriority = INT_MAX; | 114 | currentPriority = INT_MAX; |
115 | alertCount = 0; | 115 | alertCount = 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | void alert( const QString &text, int priority ); | 118 | void alert( const QString &text, int priority ); |
119 | void hideEvent( QHideEvent * ); | 119 | void hideEvent( QHideEvent * ); |
120 | private: | 120 | private: |
121 | int currentPriority; | 121 | int currentPriority; |
122 | int alertCount; | 122 | int alertCount; |
123 | }; | 123 | }; |
124 | 124 | ||
125 | void DesktopPowerAlerter::alert( const QString &text, int priority ) | 125 | void DesktopPowerAlerter::alert( const QString &text, int priority ) |
126 | { | 126 | { |
127 | alertCount++; | 127 | alertCount++; |
128 | if ( alertCount < priority ) | 128 | if ( alertCount < priority ) |
129 | return; | 129 | return; |
130 | if ( priority > currentPriority ) | 130 | if ( priority > currentPriority ) |
131 | return; | 131 | return; |
132 | currentPriority = priority; | 132 | currentPriority = priority; |
133 | setText( text ); | 133 | setText( text ); |
134 | show(); | 134 | show(); |
135 | } | 135 | } |
136 | 136 | ||
137 | 137 | ||
138 | void DesktopPowerAlerter::hideEvent( QHideEvent *e ) | 138 | void DesktopPowerAlerter::hideEvent( QHideEvent *e ) |
139 | { | 139 | { |
140 | QMessageBox::hideEvent( e ); | 140 | QMessageBox::hideEvent( e ); |
141 | alertCount = 0; | 141 | alertCount = 0; |
142 | currentPriority = INT_MAX; | 142 | currentPriority = INT_MAX; |
143 | } | 143 | } |
144 | 144 | ||
145 | //--------------------------------------------------------------------------- | 145 | //--------------------------------------------------------------------------- |
146 | 146 | ||
147 | KeyFilter::KeyFilter(QObject* parent) : QObject(parent), held_tid(0), heldButton(0) | 147 | KeyFilter::KeyFilter(QObject* parent) : QObject(parent), held_tid(0), heldButton(0) |
148 | { | 148 | { |
149 | /* We don't do this cause it would interfere with ODevice */ | 149 | /* We don't do this cause it would interfere with ODevice */ |
150 | #if 0 | 150 | #if 0 |
151 | qwsServer->setKeyboardFilter(this); | 151 | qwsServer->setKeyboardFilter(this); |
152 | #endif | 152 | #endif |
153 | } | 153 | } |
154 | 154 | ||
155 | void KeyFilter::timerEvent(QTimerEvent* e) | 155 | void KeyFilter::timerEvent(QTimerEvent* e) |
156 | { | 156 | { |
157 | if ( e->timerId() == held_tid ) { | 157 | if ( e->timerId() == held_tid ) { |
158 | killTimer(held_tid); | 158 | killTimer(held_tid); |
159 | // button held | 159 | // button held |
160 | if ( heldButton ) { | 160 | if ( heldButton ) { |
161 | emit activate(heldButton, TRUE); | 161 | emit activate(heldButton, TRUE); |
162 | heldButton = 0; | 162 | heldButton = 0; |
163 | } | 163 | } |
164 | held_tid = 0; | 164 | held_tid = 0; |
165 | } | 165 | } |
166 | } | 166 | } |
167 | 167 | ||
168 | void KeyFilter::registerKey( const QCopKeyRegister& key ) | 168 | void KeyFilter::registerKey( const QCopKeyRegister& key ) |
169 | { | 169 | { |
170 | 170 | ||
171 | m_keys.insert( key.keyCode(), key ); | 171 | m_keys.insert( key.keyCode(), key ); |
172 | } | 172 | } |
173 | 173 | ||
174 | void KeyFilter::unregisterKey( const QCopKeyRegister& key ) | 174 | void KeyFilter::unregisterKey( const QCopKeyRegister& key ) |
175 | { | 175 | { |
176 | m_keys.remove( key.keyCode() ); | 176 | m_keys.remove( key.keyCode() ); |
177 | } | 177 | } |
178 | 178 | ||
179 | bool KeyFilter::keyRegistered( int key ) | 179 | bool KeyFilter::keyRegistered( int key ) |
180 | { | 180 | { |
181 | /* | 181 | /* |
182 | * Check if we've a key registered | 182 | * Check if we've a key registered |
183 | */ | 183 | */ |
184 | if ( !m_keys[key].send()) | 184 | if ( !m_keys[key].send()) |
185 | return false; | 185 | return false; |
186 | else | 186 | else |
187 | return true; | 187 | return true; |
188 | } | 188 | } |
189 | 189 | ||
190 | bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepeat) | 190 | bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepeat) |
191 | { | 191 | { |
192 | if ( !loggedin | 192 | if ( !loggedin |
193 | // Permitted keys | 193 | // Permitted keys |
194 | && keycode != Key_F34 // power | 194 | && keycode != Key_F34 // power |
195 | && keycode != Key_F30 // select | 195 | && keycode != Key_F30 // select |
196 | && keycode != Key_Enter | 196 | && keycode != Key_Enter |
197 | && keycode != Key_Return | 197 | && keycode != Key_Return |
198 | && keycode != Key_Space | 198 | && keycode != Key_Space |
199 | && keycode != Key_Left | 199 | && keycode != Key_Left |
200 | && keycode != Key_Right | 200 | && keycode != Key_Right |
201 | && keycode != Key_Up | 201 | && keycode != Key_Up |
202 | && keycode != Key_Down ) | 202 | && keycode != Key_Down ) |
203 | return TRUE; | 203 | return TRUE; |
204 | 204 | ||
205 | /* check if it was registered */ | 205 | /* check if it was registered */ |
206 | if (!db ) { | 206 | if (!db ) { |
207 | if (keycode != 0 &&press && !autoRepeat && keyRegistered(keycode) ) | 207 | if (keycode != 0 &&press && !autoRepeat && keyRegistered(keycode) ) |
208 | return true; | 208 | return true; |
209 | } else { | 209 | } else { |
210 | 210 | ||
211 | // First check to see if DeviceButtonManager knows something about this button: | 211 | // First check to see if DeviceButtonManager knows something about this button: |
212 | const ODeviceButton* button = ODevice::inst()->buttonForKeycode(keycode); | 212 | const ODeviceButton* button = ODevice::inst()->buttonForKeycode(keycode); |
213 | if (button && !autoRepeat) { | 213 | if (button && !autoRepeat) { |
214 | if ( held_tid ) { | 214 | if ( held_tid ) { |
215 | killTimer(held_tid); | 215 | killTimer(held_tid); |
216 | held_tid = 0; | 216 | held_tid = 0; |
217 | } | 217 | } |
218 | if ( button->heldAction().isNull() ) { | 218 | if ( button->heldAction().isNull() ) { |
219 | if ( press ) | 219 | if ( press ) |
220 | emit activate(button, FALSE); | 220 | emit activate(button, FALSE); |
221 | } else if ( press ) { | 221 | } else if ( press ) { |
222 | heldButton = button; | 222 | heldButton = button; |
223 | held_tid = startTimer( ODevice::inst ()->buttonHoldTime () ); | 223 | held_tid = startTimer( ODevice::inst ()->buttonHoldTime () ); |
224 | } else if ( heldButton ) { | 224 | } else if ( heldButton ) { |
225 | heldButton = 0; | 225 | heldButton = 0; |
226 | emit activate(button, FALSE); | 226 | emit activate(button, FALSE); |
227 | } | 227 | } |
228 | QWSServer::screenSaverActivate(FALSE); | 228 | QWSServer::screenSaverActivate(FALSE); |
229 | return TRUE; | 229 | return TRUE; |
230 | } | 230 | } |
231 | return false; | 231 | return false; |
232 | } | 232 | } |
233 | if ( keycode == HardKey_Suspend ) { | 233 | if ( keycode == HardKey_Suspend ) { |
234 | if ( press ) emit power(); | 234 | if ( press ) emit power(); |
235 | return TRUE; | 235 | return TRUE; |
236 | } | 236 | } |
237 | if ( keycode == HardKey_Backlight ) { | 237 | if ( keycode == HardKey_Backlight ) { |
238 | if ( press ) emit backlight(); | 238 | if ( press ) emit backlight(); |
239 | return TRUE; | 239 | return TRUE; |
240 | } | 240 | } |
241 | if ( keycode == Key_F32 ) { | 241 | if ( keycode == Key_F32 ) { |
242 | #ifndef QT_NO_COP | 242 | #ifndef QT_NO_COP |
243 | if ( press ) QCopEnvelope e( "QPE/Desktop", "startSync()" ); | 243 | if ( press ) QCopEnvelope e( "QPE/Desktop", "startSync()" ); |
244 | #endif | 244 | #endif |
245 | return TRUE; | 245 | return TRUE; |
246 | } | 246 | } |
247 | if ( keycode == Key_F31 ) { | 247 | if ( keycode == Key_F31 ) { |
248 | if ( press ) emit symbol(); | 248 | if ( press ) emit symbol(); |
249 | QWSServer::screenSaverActivate(FALSE); | 249 | QWSServer::screenSaverActivate(FALSE); |
250 | return TRUE; | 250 | return TRUE; |
251 | } | 251 | } |
252 | 252 | ||
253 | if ( keycode == Key_NumLock ) | 253 | if ( keycode == Key_NumLock ) |
254 | if ( press ) emit numLockStateToggle(); | 254 | if ( press ) emit numLockStateToggle(); |
255 | 255 | ||
256 | if ( keycode == Key_CapsLock ) | 256 | if ( keycode == Key_CapsLock ) |
257 | if ( press ) emit capsLockStateToggle(); | 257 | if ( press ) emit capsLockStateToggle(); |
258 | 258 | ||
259 | if ( serverApp ) | 259 | if ( serverApp ) |
260 | serverApp->keyClick(keycode,press,autoRepeat); | 260 | serverApp->keyClick(keycode,press,autoRepeat); |
261 | 261 | ||
262 | return FALSE; | 262 | return FALSE; |
263 | } | 263 | } |
264 | 264 | ||
265 | enum MemState { MemUnknown, MemVeryLow, MemLow, MemNormal } memstate=MemUnknown; | 265 | enum MemState { MemUnknown, MemVeryLow, MemLow, MemNormal } memstate=MemUnknown; |
266 | 266 | ||
267 | #if defined(QPE_HAVE_MEMALERTER) | 267 | #if defined(QPE_HAVE_MEMALERTER) |
268 | QPE_MEMALERTER_IMPL | 268 | QPE_MEMALERTER_IMPL |
269 | #endif | 269 | #endif |
270 | 270 | ||
271 | 271 | ||
272 | 272 | ||
273 | //--------------------------------------------------------------------------- | 273 | //--------------------------------------------------------------------------- |
274 | 274 | ||
275 | bool ServerApplication::doRestart = FALSE; | 275 | bool ServerApplication::doRestart = FALSE; |
276 | bool ServerApplication::allowRestart = TRUE; | 276 | bool ServerApplication::allowRestart = TRUE; |
277 | bool ServerApplication::ms_is_starting = TRUE; | 277 | bool ServerApplication::ms_is_starting = TRUE; |
278 | 278 | ||
279 | void ServerApplication::switchLCD( bool on ) | 279 | void ServerApplication::switchLCD( bool on ) |
280 | { | 280 | { |
281 | if ( !qApp ) | 281 | if ( !qApp ) |
282 | return; | 282 | return; |
283 | 283 | ||
284 | ServerApplication *dapp = ServerApplication::me() ; | 284 | ServerApplication *dapp = ServerApplication::me() ; |
285 | 285 | ||
286 | if ( !dapp-> m_screensaver ) | 286 | if ( !dapp-> m_screensaver ) |
287 | return; | 287 | return; |
288 | 288 | ||
289 | if ( on ) { | 289 | if ( on ) { |
290 | dapp-> m_screensaver-> setDisplayState ( true ); | 290 | dapp-> m_screensaver-> setDisplayState ( true ); |
291 | dapp-> m_screensaver-> setBacklight ( -3 ); | 291 | dapp-> m_screensaver-> setBacklight ( -3 ); |
292 | } else | 292 | } else |
293 | dapp-> m_screensaver-> setDisplayState ( false ); | 293 | dapp-> m_screensaver-> setDisplayState ( false ); |
294 | 294 | ||
295 | 295 | ||
296 | } | 296 | } |
297 | 297 | ||
298 | ServerApplication::ServerApplication( int& argc, char **argv, Type t ) | 298 | ServerApplication::ServerApplication( int& argc, char **argv, Type t ) |
299 | : QPEApplication( argc, argv, t ) | 299 | : QPEApplication( argc, argv, t ) |
300 | { | 300 | { |
301 | ms_is_starting = true; | 301 | ms_is_starting = true; |
302 | 302 | ||
303 | // We know we'll have lots of cached pixmaps due to App/DocLnks | 303 | // We know we'll have lots of cached pixmaps due to App/DocLnks |
304 | QPixmapCache::setCacheLimit(512); | 304 | QPixmapCache::setCacheLimit(512); |
305 | 305 | ||
306 | m_ps = new PowerStatus; | 306 | m_ps = new PowerStatus; |
307 | m_ps_last = new PowerStatus; | 307 | m_ps_last = new PowerStatus; |
308 | pa = new DesktopPowerAlerter( 0 ); | 308 | pa = new DesktopPowerAlerter( 0 ); |
309 | 309 | ||
310 | m_apm_timer = new QTimer( this ); | 310 | m_apm_timer = new QTimer( this ); |
311 | connect(m_apm_timer, SIGNAL( timeout() ), | 311 | connect(m_apm_timer, SIGNAL( timeout() ), |
312 | this, SLOT( apmTimeout() ) ); | 312 | this, SLOT( apmTimeout() ) ); |
313 | 313 | ||
314 | reloadPowerWarnSettings(); | 314 | reloadPowerWarnSettings(); |
315 | 315 | ||
316 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); | 316 | QCopChannel *channel = new QCopChannel( "QPE/System", this ); |
317 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ), | 317 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ), |
318 | this, SLOT(systemMessage(const QCString&,const QByteArray&) ) ); | 318 | this, SLOT(systemMessage(const QCString&,const QByteArray&) ) ); |
319 | 319 | ||
320 | channel = new QCopChannel("QPE/Launcher", this ); | 320 | channel = new QCopChannel("QPE/Launcher", this ); |
321 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ), | 321 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ), |
322 | this, SLOT(launcherMessage(const QCString&,const QByteArray&) ) ); | 322 | this, SLOT(launcherMessage(const QCString&,const QByteArray&) ) ); |
323 | 323 | ||
324 | m_screensaver = new OpieScreenSaver(); | 324 | m_screensaver = new OpieScreenSaver(); |
325 | m_screensaver->setInterval( -1 ); | 325 | m_screensaver->setInterval( -1 ); |
326 | QWSServer::setScreenSaver( m_screensaver ); | 326 | QWSServer::setScreenSaver( m_screensaver ); |
327 | 327 | ||
328 | connect( qApp, SIGNAL( volumeChanged(bool) ), | 328 | connect( qApp, SIGNAL( volumeChanged(bool) ), |
329 | this, SLOT( rereadVolumes() ) ); | 329 | this, SLOT( rereadVolumes() ) ); |
330 | 330 | ||
331 | 331 | ||
332 | /* ### PluginLoader libqtopia SafeMode */ | 332 | /* ### PluginLoader libqtopia SafeMode */ |
333 | #if 0 | 333 | #if 0 |
334 | if ( PluginLoader::inSafeMode() ) | 334 | if ( PluginLoader::inSafeMode() ) |
335 | QTimer::singleShot(500, this, SLOT(showSafeMode()) ); | 335 | QTimer::singleShot(500, this, SLOT(showSafeMode()) ); |
336 | QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) ); | 336 | QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) ); |
337 | #endif | 337 | #endif |
338 | 338 | ||
339 | kf = new KeyFilter(this); | 339 | kf = new KeyFilter(this); |
340 | 340 | ||
341 | connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) ); | 341 | connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) ); |
342 | connect( kf, SIGNAL(power()), this, SIGNAL(power()) ); | 342 | connect( kf, SIGNAL(power()), this, SIGNAL(power()) ); |
343 | connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) ); | 343 | connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) ); |
344 | connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol())); | 344 | connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol())); |
345 | connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle())); | 345 | connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle())); |
346 | connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle())); | 346 | connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle())); |
347 | connect( kf, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)), | 347 | connect( kf, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)), |
348 | this,SIGNAL(activate(const Opie::Core::ODeviceButton*,bool))); | 348 | this,SIGNAL(activate(const Opie::Core::ODeviceButton*,bool))); |
349 | 349 | ||
350 | 350 | ||
351 | connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) ); | 351 | connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) ); |
352 | 352 | ||
353 | connect( this, SIGNAL(power() ), | 353 | connect( this, SIGNAL(power() ), |
354 | SLOT(togglePower() ) ); | 354 | SLOT(togglePower() ) ); |
355 | 355 | ||
356 | rereadVolumes(); | 356 | rereadVolumes(); |
357 | 357 | ||
358 | serverApp = this; | 358 | serverApp = this; |
359 | 359 | ||
360 | apmTimeout(); | 360 | apmTimeout(); |
361 | grabKeyboard(); | 361 | grabKeyboard(); |
362 | 362 | ||
363 | /* make sure the event filter is installed */ /* std::limits<short>::max() when you've stdc++ */ | 363 | /* make sure the event filter is installed */ /* std::limits<short>::max() when you've stdc++ */ |
364 | const ODeviceButton* but = ODevice::inst()->buttonForKeycode( SHRT_MAX ); | 364 | const ODeviceButton* but = ODevice::inst()->buttonForKeycode( SHRT_MAX ); |
365 | Q_CONST_UNUSED( but ) | 365 | Q_CONST_UNUSED( but ) |
366 | } | 366 | } |
367 | 367 | ||
368 | 368 | ||
369 | ServerApplication::~ServerApplication() | 369 | ServerApplication::~ServerApplication() |
370 | { | 370 | { |
371 | ungrabKeyboard(); | 371 | ungrabKeyboard(); |
372 | 372 | ||
373 | delete pa; | 373 | delete pa; |
374 | delete m_ps; | 374 | delete m_ps; |
375 | delete m_ps_last; | 375 | delete m_ps_last; |
376 | } | 376 | } |
377 | 377 | ||
378 | void ServerApplication::apmTimeout() | 378 | void ServerApplication::apmTimeout() |
379 | { | 379 | { |
380 | serverApp-> checkMemory( ); // in case no events are generated | 380 | serverApp-> checkMemory( ); // in case no events are generated |
381 | *m_ps_last = *m_ps; | 381 | *m_ps_last = *m_ps; |
382 | *m_ps = PowerStatusManager::readStatus(); | 382 | *m_ps = PowerStatusManager::readStatus(); |
383 | 383 | ||
384 | if ( m_ps->acStatus() != m_ps_last-> acStatus() ) | 384 | if ( m_ps->acStatus() != m_ps_last-> acStatus() ) |
385 | m_screensaver-> powerStatusChanged( *m_ps ); | 385 | m_screensaver-> powerStatusChanged( *m_ps ); |
386 | 386 | ||
387 | if ( m_ps->acStatus() == PowerStatus::Online ) { | 387 | if ( m_ps->acStatus() == PowerStatus::Online ) { |
388 | return; | 388 | return; |
389 | } | 389 | } |
390 | 390 | ||
391 | int bat = m_ps-> batteryPercentRemaining(); | 391 | int bat = m_ps-> batteryPercentRemaining(); |
392 | 392 | ||
393 | if ( bat < m_ps_last-> batteryPercentRemaining() ) { | 393 | if ( bat < m_ps_last-> batteryPercentRemaining() ) { |
394 | if ( bat <= m_powerCritical ) { | 394 | if ( bat <= m_powerCritical ) { |
395 | QMessageBox battlow( | 395 | QMessageBox battlow( |
396 | tr("WARNING"), | 396 | tr("WARNING"), |
397 | tr("<p>The battery level is critical!" | 397 | tr("<p>The battery level is critical!" |
398 | "<p>Keep power off until AC is restored"), | 398 | "<p>Keep power off until AC is restored"), |
399 | QMessageBox::Warning, | 399 | QMessageBox::Warning, |
400 | QMessageBox::Cancel, QMessageBox::NoButton, QMessageBox::NoButton, | 400 | QMessageBox::Cancel, QMessageBox::NoButton, QMessageBox::NoButton, |
401 | 0, QString::null, TRUE, WStyle_StaysOnTop); | 401 | 0, QString::null, TRUE, WStyle_StaysOnTop); |
402 | battlow.setButtonText(QMessageBox::Cancel, tr("Ok")); | 402 | battlow.setButtonText(QMessageBox::Cancel, tr("Ok")); |
403 | battlow.exec(); | 403 | battlow.exec(); |
404 | } else if ( bat <= m_powerVeryLow ) | 404 | } else if ( bat <= m_powerVeryLow ) |
405 | pa->alert( tr( "The battery is running very low. "), 2 ); | 405 | pa->alert( tr( "The battery is running very low. "), 2 ); |
406 | } | 406 | } |
407 | 407 | ||
408 | if ( m_ps-> backupBatteryStatus() == PowerStatus::VeryLow ) { | 408 | if ( m_ps-> backupBatteryStatus() == PowerStatus::VeryLow ) { |
409 | QMessageBox battlow( | 409 | QMessageBox battlow( |
410 | tr("WARNING"), | 410 | tr("WARNING"), |
411 | tr("<p>The Back-up battery is very low" | 411 | tr("<p>The Back-up battery is very low" |
412 | "<p>Please charge the back-up battery"), | 412 | "<p>Please charge the back-up battery"), |
413 | QMessageBox::Warning, | 413 | QMessageBox::Warning, |
414 | QMessageBox::Cancel, QMessageBox::NoButton, QMessageBox::NoButton, | 414 | QMessageBox::Cancel, QMessageBox::NoButton, QMessageBox::NoButton, |
415 | 0, QString::null, TRUE, WStyle_StaysOnTop); | 415 | 0, QString::null, TRUE, WStyle_StaysOnTop); |
416 | battlow.setButtonText(QMessageBox::Cancel, tr("Ok")); | 416 | battlow.setButtonText(QMessageBox::Cancel, tr("Ok")); |
417 | battlow.exec(); | 417 | battlow.exec(); |
418 | } | 418 | } |
419 | } | 419 | } |
420 | 420 | ||
421 | void ServerApplication::systemMessage( const QCString& msg, | 421 | void ServerApplication::systemMessage( const QCString& msg, |
422 | const QByteArray& data ) | 422 | const QByteArray& data ) |
423 | { | 423 | { |
424 | QDataStream stream ( data, IO_ReadOnly ); | 424 | QDataStream stream ( data, IO_ReadOnly ); |
425 | 425 | ||
426 | if ( msg == "setScreenSaverInterval(int)" ) { | 426 | if ( msg == "setScreenSaverInterval(int)" ) { |
427 | int time; | 427 | int time; |
428 | stream >> time; | 428 | stream >> time; |
429 | m_screensaver-> setInterval( time ); | 429 | m_screensaver-> setInterval( time ); |
430 | } | 430 | } |
431 | else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { | 431 | else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { |
432 | int t1, t2, t3; | 432 | int t1, t2, t3; |
433 | stream >> t1 >> t2 >> t3; | 433 | stream >> t1 >> t2 >> t3; |
434 | m_screensaver-> setIntervals( t1, t2, t3 ); | 434 | m_screensaver-> setIntervals( t1, t2, t3 ); |
435 | } | 435 | } |
436 | else if ( msg == "setBacklight(int)" ) { | 436 | else if ( msg == "setBacklight(int)" ) { |
437 | int bright; | 437 | int bright; |
438 | stream >> bright; | 438 | stream >> bright; |
439 | m_screensaver-> setBacklight( bright ); | 439 | m_screensaver-> setBacklight( bright ); |
440 | } | 440 | } |
441 | else if ( msg == "setScreenSaverMode(int)" ) { | 441 | else if ( msg == "setScreenSaverMode(int)" ) { |
442 | int mode; | 442 | int mode; |
443 | stream >> mode; | 443 | stream >> mode; |
444 | m_screensaver-> setMode ( mode ); | 444 | m_screensaver-> setMode ( mode ); |
445 | } | 445 | } |
446 | else if ( msg == "reloadPowerWarnSettings()" ) { | 446 | else if ( msg == "reloadPowerWarnSettings()" ) { |
447 | reloadPowerWarnSettings(); | 447 | reloadPowerWarnSettings(); |
448 | } | 448 | } |
449 | else if ( msg == "setDisplayState(int)" ) { | 449 | else if ( msg == "setDisplayState(int)" ) { |
450 | int state; | 450 | int state; |
451 | stream >> state; | 451 | stream >> state; |
452 | m_screensaver-> setDisplayState ( state != 0 ); | 452 | m_screensaver-> setDisplayState ( state != 0 ); |
453 | } | 453 | } |
454 | else if ( msg == "suspend()" ) { | 454 | else if ( msg == "suspend()" ) { |
455 | emit power(); | 455 | emit power(); |
456 | } | 456 | } |
457 | else if ( msg == "sendBusinessCard()" ) { | 457 | else if ( msg == "sendBusinessCard()" ) { |
458 | QString card = ::getenv ( "HOME" ); | 458 | QString card = ::getenv ( "HOME" ); |
459 | card += "/Applications/addressbook/businesscard.vcf"; | 459 | card += "/Applications/addressbook/businesscard.vcf"; |
460 | 460 | ||
461 | if ( QFile::exists( card ) ) { | 461 | if ( QFile::exists( card ) ) { |
462 | QCopEnvelope e ( "QPE/Obex", "send(QString,QString,QString)" ); | 462 | QCopEnvelope e ( "QPE/Obex", "send(QString,QString,QString)" ); |
463 | QString mimetype = "text/x-vCard"; | 463 | QString mimetype = "text/x-vCard"; |
464 | e << tr( "business card" ) << card << mimetype; | 464 | e << tr( "business card" ) << card << mimetype; |
465 | } | 465 | } |
466 | } | 466 | } |
467 | } | 467 | } |
468 | 468 | ||
469 | void ServerApplication::reloadPowerWarnSettings ( ) | 469 | void ServerApplication::reloadPowerWarnSettings ( ) |
470 | { | 470 | { |
471 | Config cfg ( "apm" ); | 471 | Config cfg ( "apm" ); |
472 | cfg. setGroup ( "Warnings" ); | 472 | cfg. setGroup ( "Warnings" ); |
473 | 473 | ||
474 | int iv = cfg. readNumEntry ( "checkinterval", 10000 ); | 474 | int iv = cfg. readNumEntry ( "checkinterval", 10000 ); |
475 | 475 | ||
476 | m_apm_timer-> stop ( ); | 476 | m_apm_timer-> stop ( ); |
477 | if ( iv ) | 477 | if ( iv ) |
478 | m_apm_timer-> start ( iv ); | 478 | m_apm_timer-> start ( iv ); |
479 | 479 | ||
480 | m_powerVeryLow = cfg. readNumEntry ( "powerverylow", 10 ); | 480 | m_powerVeryLow = cfg. readNumEntry ( "powerverylow", 10 ); |
481 | m_powerCritical = cfg. readNumEntry ( "powervcritical", 5 ); | 481 | m_powerCritical = cfg. readNumEntry ( "powervcritical", 5 ); |
482 | } | 482 | } |
483 | 483 | ||
484 | void ServerApplication::launcherMessage( const QCString & msg, const QByteArray & data ) | 484 | void ServerApplication::launcherMessage( const QCString & msg, const QByteArray & data ) |
485 | { | 485 | { |
486 | QDataStream stream ( data, IO_ReadOnly ); | 486 | QDataStream stream ( data, IO_ReadOnly ); |
487 | 487 | ||
488 | if ( msg == "deviceButton(int,int,int)" ) { | 488 | if ( msg == "deviceButton(int,int,int)" ) { |
489 | int keycode, press, autoRepeat; | 489 | int keycode, press, autoRepeat; |
490 | stream >> keycode >> press >> autoRepeat; | 490 | stream >> keycode >> press >> autoRepeat; |
491 | 491 | ||
492 | kf->checkButtonAction ( true, keycode, press, autoRepeat ); | 492 | kf->checkButtonAction ( true, keycode, press, autoRepeat ); |
493 | } | 493 | } |
494 | else if ( msg == "keyRegister(int,QCString,QCString)" ) { | 494 | else if ( msg == "keyRegister(int,QCString,QCString)" ) { |
495 | int k; | 495 | int k; |
496 | QCString c, m; | 496 | QCString c, m; |
497 | stream >> k >> c >> m; | 497 | stream >> k >> c >> m; |
498 | 498 | ||
499 | kf -> registerKey( QCopKeyRegister(k, c, m) ); | 499 | kf -> registerKey( QCopKeyRegister(k, c, m) ); |
500 | } | 500 | } |
501 | } | 501 | } |
502 | 502 | ||
503 | 503 | ||
504 | bool ServerApplication::screenLocked() | 504 | bool ServerApplication::screenLocked() |
505 | { | 505 | { |
506 | return loggedin == 0; | 506 | return loggedin == 0; |
507 | } | 507 | } |
508 | 508 | ||
509 | void ServerApplication::login(bool at_poweron) | 509 | void ServerApplication::login(bool at_poweron) |
510 | { | 510 | { |
511 | if ( !loggedin ) { | 511 | if ( !loggedin ) { |
512 | Global::terminateBuiltin("calibrate"); // No tr | 512 | Global::terminateBuiltin("calibrate"); // No tr |
513 | Opie::Security::MultiauthPassword::authenticate(at_poweron); | 513 | int lockMode = at_poweron ? Opie::Security::IfPowerOn : Opie::Security::IfResume; |
514 | Opie::Security::MultiauthPassword::authenticate(lockMode); | ||
514 | loggedin=1; | 515 | loggedin=1; |
515 | #ifndef QT_NO_COP | 516 | #ifndef QT_NO_COP |
516 | QCopEnvelope e( "QPE/Desktop", "unlocked()" ); | 517 | QCopEnvelope e( "QPE/Desktop", "unlocked()" ); |
517 | #endif | 518 | #endif |
518 | } | 519 | } |
519 | } | 520 | } |
520 | 521 | ||
521 | #if defined(QPE_HAVE_TOGGLELIGHT) | 522 | #if defined(QPE_HAVE_TOGGLELIGHT) |
522 | #include <qtopia/config.h> | 523 | #include <qtopia/config.h> |
523 | 524 | ||
524 | #include <sys/ioctl.h> | 525 | #include <sys/ioctl.h> |
525 | #include <sys/types.h> | 526 | #include <sys/types.h> |
526 | #include <fcntl.h> | 527 | #include <fcntl.h> |
527 | #include <unistd.h> | 528 | #include <unistd.h> |
528 | #include <errno.h> | 529 | #include <errno.h> |
529 | #include <linux/ioctl.h> | 530 | #include <linux/ioctl.h> |
530 | #include <time.h> | 531 | #include <time.h> |
531 | #endif | 532 | #endif |
532 | 533 | ||
533 | namespace { | 534 | namespace { |
534 | void execAutoStart(const QDateTime& suspendTime ) { | 535 | void execAutoStart(const QDateTime& suspendTime ) { |
535 | QString appName; | 536 | QString appName; |
536 | int delay; | 537 | int delay; |
537 | QDateTime now = QDateTime::currentDateTime(); | 538 | QDateTime now = QDateTime::currentDateTime(); |
538 | 539 | ||
539 | Config cfg( "autostart" ); | 540 | Config cfg( "autostart" ); |
540 | cfg.setGroup( "AutoStart" ); | 541 | cfg.setGroup( "AutoStart" ); |
541 | appName = cfg.readEntry( "Apps", "" ); | 542 | appName = cfg.readEntry( "Apps", "" ); |
542 | delay = cfg.readNumEntry( "Delay", 0 ); | 543 | delay = cfg.readNumEntry( "Delay", 0 ); |
543 | 544 | ||
544 | // If the time between suspend and resume was longer then the | 545 | // If the time between suspend and resume was longer then the |
545 | // value saved as delay, start the app | 546 | // value saved as delay, start the app |
546 | if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) { | 547 | if ( suspendTime.secsTo( now ) >= ( delay * 60 ) && !appName.isEmpty() ) { |
547 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | 548 | QCopEnvelope e( "QPE/System", "execute(QString)" ); |
548 | e << QString( appName ); | 549 | e << QString( appName ); |
549 | } | 550 | } |
550 | } | 551 | } |
551 | } | 552 | } |
552 | 553 | ||
553 | 554 | ||
554 | void ServerApplication::togglePower() | 555 | void ServerApplication::togglePower() |
555 | { | 556 | { |
556 | static bool excllock = false; | 557 | static bool excllock = false; |
557 | 558 | ||
558 | if ( excllock ) | 559 | if ( excllock ) |
559 | return ; | 560 | return ; |
560 | 561 | ||
561 | excllock = true; | 562 | excllock = true; |
562 | 563 | ||
563 | bool wasloggedin = loggedin; | 564 | bool wasloggedin = loggedin; |
564 | loggedin = 0; | 565 | loggedin = 0; |
565 | m_suspendTime = QDateTime::currentDateTime(); | 566 | m_suspendTime = QDateTime::currentDateTime(); |
566 | 567 | ||
567 | #ifdef QWS | 568 | #ifdef QWS |
568 | if ( Opie::Security::MultiauthPassword::needToAuthenticate ( true ) && qt_screen ) { | 569 | if ( Opie::Security::MultiauthPassword::needToAuthenticate ( true ) && qt_screen ) { |
569 | // Should use a big black window instead. | 570 | // Should use a big black window instead. |
570 | // But this would not show up fast enough | 571 | // But this would not show up fast enough |
571 | QGfx *g = qt_screen-> screenGfx ( ); | 572 | QGfx *g = qt_screen-> screenGfx ( ); |
572 | g-> fillRect ( 0, 0, qt_screen-> width ( ), qt_screen-> height ( )); | 573 | g-> fillRect ( 0, 0, qt_screen-> width ( ), qt_screen-> height ( )); |
573 | delete g; | 574 | delete g; |
574 | } | 575 | } |
575 | #endif | 576 | #endif |
576 | 577 | ||
577 | ODevice::inst ( )-> suspend ( ); | 578 | ODevice::inst ( )-> suspend ( ); |
578 | 579 | ||
579 | ServerApplication::switchLCD ( true ); // force LCD on without slow qcop call | 580 | ServerApplication::switchLCD ( true ); // force LCD on without slow qcop call |
580 | QWSServer::screenSaverActivate ( false ); | 581 | QWSServer::screenSaverActivate ( false ); |
581 | 582 | ||
582 | { | 583 | { |
583 | QCopEnvelope( "QPE/Card", "mtabChanged()" ); // might have changed while asleep | 584 | QCopEnvelope( "QPE/Card", "mtabChanged()" ); // might have changed while asleep |
584 | } | 585 | } |
585 | 586 | ||
586 | if ( wasloggedin ) | 587 | if ( wasloggedin ) |
587 | login ( true ); | 588 | login ( true ); |
588 | 589 | ||
589 | execAutoStart(m_suspendTime); | 590 | execAutoStart(m_suspendTime); |
590 | //qcopBridge->closeOpenConnections(); | 591 | //qcopBridge->closeOpenConnections(); |
591 | 592 | ||
592 | excllock = false; | 593 | excllock = false; |
593 | } | 594 | } |
594 | 595 | ||
595 | void ServerApplication::toggleLight() | 596 | void ServerApplication::toggleLight() |
596 | { | 597 | { |
597 | #ifndef QT_NO_COP | 598 | #ifndef QT_NO_COP |
598 | QCopEnvelope e("QPE/System", "setBacklight(int)"); | 599 | QCopEnvelope e("QPE/System", "setBacklight(int)"); |
599 | e << -2; // toggle | 600 | e << -2; // toggle |
600 | #endif | 601 | #endif |
601 | } | 602 | } |
602 | 603 | ||
603 | 604 | ||
604 | /* | 605 | /* |
605 | * We still listen to key events but handle them in | 606 | * We still listen to key events but handle them in |
606 | * a special class | 607 | * a special class |
607 | */ | 608 | */ |
608 | 609 | ||
609 | bool ServerApplication::eventFilter( QObject *o, QEvent *e) { | 610 | bool ServerApplication::eventFilter( QObject *o, QEvent *e) { |
610 | if ( e->type() != QEvent::KeyPress && | 611 | if ( e->type() != QEvent::KeyPress && |
611 | e->type() != QEvent::KeyRelease ) | 612 | e->type() != QEvent::KeyRelease ) |
612 | return QPEApplication::eventFilter( o, e ); | 613 | return QPEApplication::eventFilter( o, e ); |
613 | 614 | ||
614 | QKeyEvent *ke = static_cast<QKeyEvent*>( e ); | 615 | QKeyEvent *ke = static_cast<QKeyEvent*>( e ); |
615 | if ( kf->checkButtonAction( true, ke->key(), | 616 | if ( kf->checkButtonAction( true, ke->key(), |
616 | e->type() == QEvent::KeyPress, | 617 | e->type() == QEvent::KeyPress, |
617 | ke-> isAutoRepeat() )) | 618 | ke-> isAutoRepeat() )) |
618 | return true; | 619 | return true; |
619 | 620 | ||
620 | return QPEApplication::eventFilter( o, e ); | 621 | return QPEApplication::eventFilter( o, e ); |
621 | 622 | ||
622 | } | 623 | } |
623 | 624 | ||
624 | #ifdef Q_WS_QWS | 625 | #ifdef Q_WS_QWS |
625 | bool ServerApplication::qwsEventFilter( QWSEvent *e ) | 626 | bool ServerApplication::qwsEventFilter( QWSEvent *e ) |
626 | { | 627 | { |
627 | checkMemory(); | 628 | checkMemory(); |
628 | 629 | ||
629 | if ( e->type == QWSEvent::Mouse ) { | 630 | if ( e->type == QWSEvent::Mouse ) { |
630 | QWSMouseEvent *me = (QWSMouseEvent *)e; | 631 | QWSMouseEvent *me = (QWSMouseEvent *)e; |
631 | static bool up = TRUE; | 632 | static bool up = TRUE; |
632 | if ( me->simpleData.state&LeftButton ) { | 633 | if ( me->simpleData.state&LeftButton ) { |
633 | if ( up ) { | 634 | if ( up ) { |
634 | up = FALSE; | 635 | up = FALSE; |
635 | screenClick(TRUE); | 636 | screenClick(TRUE); |
636 | } | 637 | } |
637 | } else if ( !up ) { | 638 | } else if ( !up ) { |
638 | up = TRUE; | 639 | up = TRUE; |
639 | screenClick(FALSE); | 640 | screenClick(FALSE); |
640 | } | 641 | } |
641 | } else | 642 | } else |
642 | if ( e->type == QWSEvent::Key ) { | 643 | if ( e->type == QWSEvent::Key ) { |
643 | QWSKeyEvent * ke = static_cast<QWSKeyEvent*>( e ); | 644 | QWSKeyEvent * ke = static_cast<QWSKeyEvent*>( e ); |
644 | if ( kf->checkButtonAction( false, | 645 | if ( kf->checkButtonAction( false, |
645 | ke-> simpleData.keycode, | 646 | ke-> simpleData.keycode, |
646 | ke-> simpleData.is_press, | 647 | ke-> simpleData.is_press, |
647 | ke-> simpleData.is_auto_repeat ) ) | 648 | ke-> simpleData.is_auto_repeat ) ) |
648 | return true; | 649 | return true; |
649 | } | 650 | } |
650 | 651 | ||
651 | return QPEApplication::qwsEventFilter( e ); | 652 | return QPEApplication::qwsEventFilter( e ); |
652 | } | 653 | } |
653 | #endif | 654 | #endif |
654 | 655 | ||
655 | 656 | ||
656 | /* ### FIXME libqtopia Plugin Safe Mode */ | 657 | /* ### FIXME libqtopia Plugin Safe Mode */ |
657 | 658 | ||
658 | void ServerApplication::showSafeMode() | 659 | void ServerApplication::showSafeMode() |
659 | { | 660 | { |
660 | #if 0 | 661 | #if 0 |
661 | if ( QMessageBox::warning(0, tr("Safe Mode"), tr("<P>A system startup error occurred, " | 662 | if ( QMessageBox::warning(0, tr("Safe Mode"), tr("<P>A system startup error occurred, " |
662 | "and the system is now in Safe Mode. " | 663 | "and the system is now in Safe Mode. " |
663 | "Plugins are not loaded in Safe Mode. " | 664 | "Plugins are not loaded in Safe Mode. " |
664 | "You can use the Plugin Manager to " | 665 | "You can use the Plugin Manager to " |
665 | "disable plugins that cause system error."), tr("OK"), tr("Plugin Manager..."), 0) == 1 ) | 666 | "disable plugins that cause system error."), tr("OK"), tr("Plugin Manager..."), 0) == 1 ) |
666 | { | 667 | { |
667 | Global::execute( "pluginmanager" ); | 668 | Global::execute( "pluginmanager" ); |
668 | } | 669 | } |
669 | #endif | 670 | #endif |
670 | } | 671 | } |
671 | 672 | ||
672 | void ServerApplication::clearSafeMode() | 673 | void ServerApplication::clearSafeMode() |
673 | { | 674 | { |
674 | #if 0 | 675 | #if 0 |
675 | // If we've been running OK for a while then we won't bother going into | 676 | // If we've been running OK for a while then we won't bother going into |
676 | // safe mode immediately on the next crash. | 677 | // safe mode immediately on the next crash. |
677 | Config cfg( "PluginLoader" ); | 678 | Config cfg( "PluginLoader" ); |
678 | cfg.setGroup( "Global" ); | 679 | cfg.setGroup( "Global" ); |
679 | QString mode = cfg.readEntry( "Mode", "Normal" ); | 680 | QString mode = cfg.readEntry( "Mode", "Normal" ); |
680 | if ( mode == "MaybeSafe" ) { | 681 | if ( mode == "MaybeSafe" ) { |
681 | cfg.writeEntry( "Mode", "Normal" ); | 682 | cfg.writeEntry( "Mode", "Normal" ); |
682 | } | 683 | } |
683 | #endif | 684 | #endif |
684 | } | 685 | } |
685 | 686 | ||
686 | 687 | ||
687 | void ServerApplication::shutdown() | 688 | void ServerApplication::shutdown() |
688 | { | 689 | { |
689 | if ( type() != GuiServer ) | 690 | if ( type() != GuiServer ) |
690 | return; | 691 | return; |
691 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); | 692 | ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose ); |
692 | connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), | 693 | connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)), |
693 | this, SLOT(shutdown(ShutdownImpl::Type)) ); | 694 | this, SLOT(shutdown(ShutdownImpl::Type)) ); |
694 | QPEApplication::showWidget( sd ); | 695 | QPEApplication::showWidget( sd ); |
695 | } | 696 | } |
696 | 697 | ||
697 | void ServerApplication::shutdown( ShutdownImpl::Type t ) | 698 | void ServerApplication::shutdown( ShutdownImpl::Type t ) |
698 | { | 699 | { |
699 | char *opt = 0; | 700 | char *opt = 0; |
700 | 701 | ||
701 | switch ( t ) { | 702 | switch ( t ) { |
702 | case ShutdownImpl::ShutdownSystem: | 703 | case ShutdownImpl::ShutdownSystem: |
703 | opt = "-h"; | 704 | opt = "-h"; |
704 | // fall through | 705 | // fall through |
705 | case ShutdownImpl::RebootSystem: | 706 | case ShutdownImpl::RebootSystem: |
706 | if ( opt == 0 ) | 707 | if ( opt == 0 ) |
707 | opt = "-r"; | 708 | opt = "-r"; |
708 | 709 | ||
709 | if ( execl( "/sbin/shutdown", "shutdown", opt, "now", ( void* ) 0) < 0 ) | 710 | if ( execl( "/sbin/shutdown", "shutdown", opt, "now", ( void* ) 0) < 0 ) |
710 | perror("shutdown"); | 711 | perror("shutdown"); |
711 | // ::syslog ( LOG_ERR, "Erroring execing shutdown\n" ); | 712 | // ::syslog ( LOG_ERR, "Erroring execing shutdown\n" ); |
712 | 713 | ||
713 | break; | 714 | break; |
714 | case ShutdownImpl::RestartDesktop: | 715 | case ShutdownImpl::RestartDesktop: |
715 | restart(); | 716 | restart(); |
716 | break; | 717 | break; |
717 | case ShutdownImpl::TerminateDesktop: | 718 | case ShutdownImpl::TerminateDesktop: |
718 | prepareForTermination( FALSE ); | 719 | prepareForTermination( FALSE ); |
719 | 720 | ||
720 | // This is a workaround for a Qt bug | 721 | // This is a workaround for a Qt bug |
721 | // clipboard applet has to stop its poll timer, or Qt/E | 722 | // clipboard applet has to stop its poll timer, or Qt/E |
722 | // will hang on quit() right before it emits aboutToQuit() | 723 | // will hang on quit() right before it emits aboutToQuit() |
723 | emit aboutToQuit ( ); | 724 | emit aboutToQuit ( ); |
724 | 725 | ||
725 | quit(); | 726 | quit(); |
726 | break; | 727 | break; |
727 | } | 728 | } |
728 | } | 729 | } |
729 | 730 | ||
730 | void ServerApplication::restart() | 731 | void ServerApplication::restart() |
731 | { | 732 | { |
732 | if ( allowRestart ) { | 733 | if ( allowRestart ) { |
733 | 734 | ||
734 | /* | 735 | /* |
735 | * Applets and restart is a problem. Some applets delete | 736 | * Applets and restart is a problem. Some applets delete |
736 | * their widgets even if ownership gets transfered to the | 737 | * their widgets even if ownership gets transfered to the |
737 | * parent (Systray ) but deleting the applet may be unsafe | 738 | * parent (Systray ) but deleting the applet may be unsafe |
738 | * as well ( double deletion ). Some have topLevel widgets | 739 | * as well ( double deletion ). Some have topLevel widgets |
739 | * and when we dlclose and then delete the widget we will | 740 | * and when we dlclose and then delete the widget we will |
740 | * crash and an crash during restart is not nice | 741 | * crash and an crash during restart is not nice |
741 | */ | 742 | */ |
742 | #ifdef ALL_APPLETS_ON_THIS_WORLD_ARE_FIXED | 743 | #ifdef ALL_APPLETS_ON_THIS_WORLD_ARE_FIXED |
743 | /* same as above */ | 744 | /* same as above */ |
744 | emit aboutToQuit(); | 745 | emit aboutToQuit(); |
745 | prepareForTermination(TRUE); | 746 | prepareForTermination(TRUE); |
746 | doRestart = TRUE; | 747 | doRestart = TRUE; |
747 | quit(); | 748 | quit(); |
748 | #else | 749 | #else |
749 | prepareForTermination( true ); | 750 | prepareForTermination( true ); |
750 | for ( int fd = 3; fd < 100; fd++ ) | 751 | for ( int fd = 3; fd < 100; fd++ ) |
751 | close( fd ); | 752 | close( fd ); |
752 | execl( ( qpeDir() + "/bin/qpe" ).latin1(), "qpe", 0 ); | 753 | execl( ( qpeDir() + "/bin/qpe" ).latin1(), "qpe", 0 ); |
753 | exit( 1 ); | 754 | exit( 1 ); |
754 | #endif | 755 | #endif |
755 | } | 756 | } |
756 | } | 757 | } |
757 | 758 | ||
758 | void ServerApplication::rereadVolumes() | 759 | void ServerApplication::rereadVolumes() |
759 | { | 760 | { |
760 | Config cfg( "qpe" ); | 761 | Config cfg( "qpe" ); |
761 | cfg. setGroup ( "Volume" ); | 762 | cfg. setGroup ( "Volume" ); |
762 | 763 | ||
763 | m_screentap_sound = cfg. readBoolEntry ( "TouchSound" ); | 764 | m_screentap_sound = cfg. readBoolEntry ( "TouchSound" ); |
764 | m_keyclick_sound = cfg. readBoolEntry ( "KeySound" ); | 765 | m_keyclick_sound = cfg. readBoolEntry ( "KeySound" ); |
765 | m_alarm_sound = cfg. readBoolEntry ( "AlarmSound" ); | 766 | m_alarm_sound = cfg. readBoolEntry ( "AlarmSound" ); |
766 | } | 767 | } |
767 | 768 | ||
768 | 769 | ||
769 | void ServerApplication::checkMemory() | 770 | void ServerApplication::checkMemory() |
770 | { | 771 | { |
771 | #if defined(QPE_HAVE_MEMALERTER) | 772 | #if defined(QPE_HAVE_MEMALERTER) |
772 | static bool ignoreNormal=TRUE; | 773 | static bool ignoreNormal=TRUE; |
773 | static bool existingMessage=FALSE; | 774 | static bool existingMessage=FALSE; |
774 | 775 | ||
775 | if(existingMessage) | 776 | if(existingMessage) |
776 | return; // don't show a second message while still on first | 777 | return; // don't show a second message while still on first |
777 | 778 | ||
778 | existingMessage = TRUE; | 779 | existingMessage = TRUE; |
779 | switch ( memstate ) { | 780 | switch ( memstate ) { |
780 | case MemUnknown: | 781 | case MemUnknown: |
781 | break; | 782 | break; |
782 | case MemLow: | 783 | case MemLow: |
783 | memstate = MemUnknown; | 784 | memstate = MemUnknown; |
784 | if ( !recoverMemory() ) { | 785 | if ( !recoverMemory() ) { |
785 | QMessageBox::warning( 0 , tr("Memory Status"), | 786 | QMessageBox::warning( 0 , tr("Memory Status"), |
786 | tr("Memory Low\nPlease save data.") ); | 787 | tr("Memory Low\nPlease save data.") ); |
787 | ignoreNormal = FALSE; | 788 | ignoreNormal = FALSE; |
788 | } | 789 | } |
789 | break; | 790 | break; |
790 | case MemNormal: | 791 | case MemNormal: |
791 | memstate = MemUnknown; | 792 | memstate = MemUnknown; |
792 | if ( !ignoreNormal ) { | 793 | if ( !ignoreNormal ) { |
793 | ignoreNormal = TRUE; | 794 | ignoreNormal = TRUE; |
794 | QMessageBox::information ( 0 , tr("Memory Status"), | 795 | QMessageBox::information ( 0 , tr("Memory Status"), |
795 | "Memory OK" ); | 796 | "Memory OK" ); |
796 | } | 797 | } |
797 | break; | 798 | break; |
798 | case MemVeryLow: | 799 | case MemVeryLow: |
799 | memstate = MemUnknown; | 800 | memstate = MemUnknown; |
800 | QMessageBox::critical( 0 , tr("Memory Status"), | 801 | QMessageBox::critical( 0 , tr("Memory Status"), |
801 | tr("Critical Memory Shortage\n" | 802 | tr("Critical Memory Shortage\n" |
802 | "Please end this application\n" | 803 | "Please end this application\n" |
803 | "immediately.") ); | 804 | "immediately.") ); |
804 | recoverMemory(); | 805 | recoverMemory(); |
805 | } | 806 | } |
806 | existingMessage = FALSE; | 807 | existingMessage = FALSE; |
807 | #endif | 808 | #endif |
808 | } | 809 | } |
809 | 810 | ||
810 | bool ServerApplication::recoverMemory() | 811 | bool ServerApplication::recoverMemory() |
811 | { | 812 | { |
812 | return FALSE; | 813 | return FALSE; |
813 | } | 814 | } |
814 | 815 | ||
815 | void ServerApplication::keyClick(int , bool press, bool ) | 816 | void ServerApplication::keyClick(int , bool press, bool ) |
816 | { | 817 | { |
817 | if ( press && m_keyclick_sound ) | 818 | if ( press && m_keyclick_sound ) |
818 | ODevice::inst() -> playKeySound(); | 819 | ODevice::inst() -> playKeySound(); |
819 | 820 | ||
820 | } | 821 | } |
821 | 822 | ||
822 | void ServerApplication::screenClick(bool press) | 823 | void ServerApplication::screenClick(bool press) |
823 | { | 824 | { |
824 | if ( press && m_screentap_sound ) | 825 | if ( press && m_screentap_sound ) |
825 | ODevice::inst() -> playTouchSound(); | 826 | ODevice::inst() -> playTouchSound(); |
826 | } | 827 | } |
827 | 828 | ||
828 | void ServerApplication::soundAlarm() { | 829 | void ServerApplication::soundAlarm() { |
829 | if ( me ()->m_alarm_sound ) | 830 | if ( me ()->m_alarm_sound ) |
830 | ODevice::inst()->playAlarmSound(); | 831 | ODevice::inst()->playAlarmSound(); |
831 | } | 832 | } |
832 | 833 | ||
833 | ServerApplication *ServerApplication::me ( ) | 834 | ServerApplication *ServerApplication::me ( ) |
834 | { | 835 | { |
835 | return static_cast<ServerApplication*>( qApp ); | 836 | return static_cast<ServerApplication*>( qApp ); |
836 | } | 837 | } |
837 | 838 | ||
838 | bool ServerApplication::isStarting() | 839 | bool ServerApplication::isStarting() |
839 | { | 840 | { |
840 | return ms_is_starting; | 841 | return ms_is_starting; |
841 | } | 842 | } |
842 | 843 | ||
843 | int ServerApplication::exec() | 844 | int ServerApplication::exec() |
844 | { | 845 | { |
845 | ms_is_starting = true; | 846 | ms_is_starting = true; |
846 | odebug << "Serverapp - exec" << oendl; | 847 | odebug << "Serverapp - exec" << oendl; |
847 | return QPEApplication::exec(); | 848 | return QPEApplication::exec(); |
848 | } | 849 | } |
849 | 850 | ||
850 | #include "serverapp.moc" | 851 | #include "serverapp.moc" |
diff --git a/core/settings/security/demo/main.cpp b/core/settings/security/demo/main.cpp index 1c49f57..82f940d 100644 --- a/core/settings/security/demo/main.cpp +++ b/core/settings/security/demo/main.cpp | |||
@@ -1,12 +1,12 @@ | |||
1 | #include <opie2/multiauthpassword.h> | 1 | #include <opie2/multiauthpassword.h> |
2 | 2 | ||
3 | #include <opie2/oapplication.h> | 3 | #include <opie2/oapplication.h> |
4 | 4 | ||
5 | /// Run an authentication sequence using the global opie-security settings | 5 | /// Run an authentication sequence using the global opie-security settings |
6 | int main( int argc, char ** argv ) | 6 | int main( int argc, char ** argv ) |
7 | { | 7 | { |
8 | Opie::Core::OApplication app(argc, argv, "Multi-authentication demo"); | 8 | Opie::Core::OApplication app(argc, argv, "Multi-authentication demo"); |
9 | 9 | ||
10 | // Run the authentication process until it succeeds | 10 | // Run the authentication process until it succeeds |
11 | Opie::Security::MultiauthPassword::authenticate(); | 11 | Opie::Security::MultiauthPassword::authenticate(Opie::Security::LockNow); |
12 | } | 12 | } |
diff --git a/core/settings/security/multiauthconfig.cpp b/core/settings/security/multiauthconfig.cpp index 192b8ca..9d5c032 100644 --- a/core/settings/security/multiauthconfig.cpp +++ b/core/settings/security/multiauthconfig.cpp | |||
@@ -1,651 +1,637 @@ | |||
1 | #include <opie2/odebug.h> | 1 | #include <opie2/odebug.h> |
2 | #include <opie2/multiauthmainwindow.h> | 2 | #include <opie2/multiauthpassword.h> |
3 | 3 | ||
4 | #include <qgroupbox.h> | 4 | #include <qgroupbox.h> |
5 | #include <qvgroupbox.h> | 5 | #include <qvgroupbox.h> |
6 | #include <qpe/resource.h> | 6 | #include <qpe/resource.h> |
7 | #include <qlayout.h> | 7 | #include <qlayout.h> |
8 | #include <qlabel.h> | 8 | #include <qlabel.h> |
9 | #include <qhbox.h> | 9 | #include <qhbox.h> |
10 | #include <qheader.h> | 10 | #include <qheader.h> |
11 | #include <qvbox.h> | 11 | #include <qvbox.h> |
12 | #include <qwhatsthis.h> | 12 | #include <qwhatsthis.h> |
13 | #include <qtoolbutton.h> | 13 | #include <qtoolbutton.h> |
14 | #include <qstringlist.h> | 14 | #include <qstringlist.h> |
15 | #include <qdir.h> | 15 | #include <qdir.h> |
16 | #include <qpe/qlibrary.h> | 16 | #include <qpe/qlibrary.h> |
17 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
18 | 18 | ||
19 | #include "multiauthconfig.h" | 19 | #include "multiauthconfig.h" |
20 | 20 | ||
21 | 21 | ||
22 | using Opie::Security::MultiauthPluginInterface; | 22 | using Opie::Security::MultiauthPluginInterface; |
23 | using Opie::Security::MultiauthPluginObject; | 23 | using Opie::Security::MultiauthPluginObject; |
24 | using Opie::Security::MultiauthConfigWidget; | 24 | using Opie::Security::MultiauthConfigWidget; |
25 | /// keeps information about MultiauthPluginObject plugins | 25 | /// keeps information about MultiauthPluginObject plugins |
26 | struct MultiauthPlugin { | 26 | struct MultiauthPlugin { |
27 | MultiauthPlugin() : library( 0 ), iface( 0 ), pluginObject( 0 ) {} | 27 | MultiauthPlugin() : library( 0 ), iface( 0 ), pluginObject( 0 ) {} |
28 | /// plugin file | 28 | /// plugin file |
29 | QLibrary *library; | 29 | QLibrary *library; |
30 | /// the plugin object interface | 30 | /// the plugin object interface |
31 | QInterfacePtr<MultiauthPluginInterface> iface; | 31 | QInterfacePtr<MultiauthPluginInterface> iface; |
32 | /// the plugin object itself | 32 | /// the plugin object itself |
33 | MultiauthPluginObject *pluginObject; | 33 | MultiauthPluginObject *pluginObject; |
34 | /// name of the plugin file | 34 | /// name of the plugin file |
35 | QString name; | 35 | QString name; |
36 | /// should the plugin be launched during authentication or not | 36 | /// should the plugin be launched during authentication or not |
37 | bool active; | 37 | bool active; |
38 | /// order of the plugin, in the pluginListWidget and during authentication | 38 | /// order of the plugin, in the pluginListWidget and during authentication |
39 | int pos; | 39 | int pos; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | /// list of available MultiauthPlugin objects | 42 | /// list of available MultiauthPlugin objects |
43 | static QValueList<MultiauthPlugin> pluginList; | 43 | static QValueList<MultiauthPlugin> pluginList; |
44 | 44 | ||
45 | 45 | ||
46 | /// extension of QToolButton that adds signals, icons and stuff (taken from todayconfig.cpp) | 46 | /// extension of QToolButton that adds signals, icons and stuff (taken from todayconfig.cpp) |
47 | class ToolButton : public QToolButton { | 47 | class ToolButton : public QToolButton { |
48 | 48 | ||
49 | public: | 49 | public: |
50 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) | 50 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) |
51 | : QToolButton( parent, name ) { | 51 | : QToolButton( parent, name ) { |
52 | setPixmap( Resource::loadPixmap( icon ) ); | 52 | setPixmap( Resource::loadPixmap( icon ) ); |
53 | setAutoRaise( TRUE ); | 53 | setAutoRaise( TRUE ); |
54 | setFocusPolicy( QWidget::NoFocus ); | 54 | setFocusPolicy( QWidget::NoFocus ); |
55 | setToggleButton( t ); | 55 | setToggleButton( t ); |
56 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 56 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
57 | } | 57 | } |
58 | }; | 58 | }; |
59 | 59 | ||
60 | MultiauthGeneralConfig::MultiauthGeneralConfig(MultiauthConfig * parentConfig, QWidget * parent, const char * name = "general Opie-multiauthentication config widget") | 60 | MultiauthGeneralConfig::MultiauthGeneralConfig(MultiauthConfig * parentConfig, QWidget * parent, const char * name = "general Opie-multiauthentication config widget") |
61 | : QWidget(parent, name), m_onStart(0), m_onResume(0), m_noProtectConfig(0), m_explanScreens(0), m_nbSuccessMin(0), m_tryButton(0) | 61 | : QWidget(parent, name), m_onStart(0), m_onResume(0), m_noProtectConfig(0), m_explanScreens(0), m_nbSuccessMin(0), m_tryButton(0) |
62 | { | 62 | { |
63 | // keep track of the MultiauthConfig parent in one of our attributes | 63 | // keep track of the MultiauthConfig parent in one of our attributes |
64 | m_parentConfig = parentConfig; | 64 | m_parentConfig = parentConfig; |
65 | QVBoxLayout *vb = new QVBoxLayout(this); | 65 | QVBoxLayout *vb = new QVBoxLayout(this); |
66 | vb->setSpacing(11); | 66 | vb->setSpacing(11); |
67 | vb->setMargin(11); | 67 | vb->setMargin(11); |
68 | vb->setAlignment( Qt::AlignTop ); | 68 | vb->setAlignment( Qt::AlignTop ); |
69 | 69 | ||
70 | QGroupBox *lockBox = new QGroupBox(0, Qt::Vertical, tr("When to lock Opie"), this, "lock box"); | 70 | QGroupBox *lockBox = new QGroupBox(0, Qt::Vertical, tr("When to lock Opie"), this, "lock box"); |
71 | vb->addWidget(lockBox); | 71 | vb->addWidget(lockBox); |
72 | QGridLayout *boxLayout = new QGridLayout( lockBox->layout() ); | 72 | QGridLayout *boxLayout = new QGridLayout( lockBox->layout() ); |
73 | m_onStart = new QCheckBox( tr( "on Opie start" ), lockBox, "lock on opie start"); | 73 | m_onStart = new QCheckBox( tr( "on Opie start" ), lockBox, "lock on opie start"); |
74 | m_onResume = new QCheckBox( tr( "on Opie resume" ), lockBox, "lock on opie resume"); | 74 | m_onResume = new QCheckBox( tr( "on Opie resume" ), lockBox, "lock on opie resume"); |
75 | boxLayout->addWidget(m_onStart, 0, 0); | 75 | boxLayout->addWidget(m_onStart, 0, 0); |
76 | boxLayout->addWidget(m_onResume, 0, 1); | 76 | boxLayout->addWidget(m_onResume, 0, 1); |
77 | 77 | ||
78 | QGroupBox *nbBox = new QGroupBox(0, Qt::Vertical, tr("Multiple plugins authentication"), this, "nb box"); | 78 | QGroupBox *nbBox = new QGroupBox(0, Qt::Vertical, tr("Multiple plugins authentication"), this, "nb box"); |
79 | vb->addWidget(nbBox); | 79 | vb->addWidget(nbBox); |
80 | QGridLayout *nbBoxLayout = new QGridLayout( nbBox->layout() ); | 80 | QGridLayout *nbBoxLayout = new QGridLayout( nbBox->layout() ); |
81 | m_nbSuccessMin = new QSpinBox(nbBox); | 81 | m_nbSuccessMin = new QSpinBox(nbBox); |
82 | QLabel *lNbSuccessMin = new QLabel( tr( "Required successes" ), nbBox); | 82 | QLabel *lNbSuccessMin = new QLabel( tr( "Required successes" ), nbBox); |
83 | nbBoxLayout->addWidget(m_nbSuccessMin, 0, 0); | 83 | nbBoxLayout->addWidget(m_nbSuccessMin, 0, 0); |
84 | nbBoxLayout->addWidget(lNbSuccessMin, 0, 1); | 84 | nbBoxLayout->addWidget(lNbSuccessMin, 0, 1); |
85 | m_nbSuccessMin->setMinValue(1); // the max value is defined in MultiauthConfig constructor | 85 | m_nbSuccessMin->setMinValue(1); // the max value is defined in MultiauthConfig constructor |
86 | 86 | ||
87 | QGroupBox *devBox = new QGroupBox(0, Qt::Vertical, tr("Options"), this, "dev box"); | 87 | QGroupBox *devBox = new QGroupBox(0, Qt::Vertical, tr("Options"), this, "dev box"); |
88 | vb->addWidget(devBox); | 88 | vb->addWidget(devBox); |
89 | QGridLayout *devBoxLayout = new QGridLayout( devBox->layout() ); | 89 | QGridLayout *devBoxLayout = new QGridLayout( devBox->layout() ); |
90 | m_noProtectConfig = new QCheckBox( tr("Don't protect this config screen"), devBox, "don't protect config"); | 90 | m_noProtectConfig = new QCheckBox( tr("Don't protect this config screen"), devBox, "don't protect config"); |
91 | m_explanScreens = new QCheckBox( tr("Show explanatory screens"), devBox, "Show explan. screens"); | 91 | m_explanScreens = new QCheckBox( tr("Show explanatory screens"), devBox, "Show explan. screens"); |
92 | devBoxLayout->addWidget(m_noProtectConfig, 0, 0); | 92 | devBoxLayout->addWidget(m_noProtectConfig, 0, 0); |
93 | devBoxLayout->addWidget(m_explanScreens, 1, 0); | 93 | devBoxLayout->addWidget(m_explanScreens, 1, 0); |
94 | 94 | ||
95 | QVGroupBox *tryBox = new QVGroupBox(tr("Testing"), this, "try box"); | 95 | QVGroupBox *tryBox = new QVGroupBox(tr("Testing"), this, "try box"); |
96 | vb->addWidget(tryBox); | 96 | vb->addWidget(tryBox); |
97 | m_tryButton = new QPushButton( tr("Test the authentication now"), tryBox, "try button"); | 97 | m_tryButton = new QPushButton( tr("Test the authentication now"), tryBox, "try button"); |
98 | connect( m_tryButton, SIGNAL(clicked()), this, SLOT(tryAuth()) ); | 98 | connect( m_tryButton, SIGNAL(clicked()), this, SLOT(tryAuth()) ); |
99 | 99 | ||
100 | } | 100 | } |
101 | 101 | ||
102 | /// nothing to do | 102 | /// nothing to do |
103 | MultiauthGeneralConfig::~MultiauthGeneralConfig() | 103 | MultiauthGeneralConfig::~MultiauthGeneralConfig() |
104 | {} | 104 | {} |
105 | 105 | ||
106 | /// launches the authentication process, as configured, with the option to bypass it | 106 | /// launches the authentication process, as configured, with the option to bypass it |
107 | void MultiauthGeneralConfig::tryAuth() | 107 | void MultiauthGeneralConfig::tryAuth() |
108 | { | 108 | { |
109 | QMessageBox confirmSave( | 109 | QMessageBox confirmSave( |
110 | tr("Attention"), | 110 | tr("Attention"), |
111 | "<p>" + tr("You must save your current settings before trying to authenticate. Press OK to accept and launch a simulated authentication process.") + "</p><p><em>" + | 111 | "<p>" + tr("You must save your current settings before trying to authenticate. Press OK to accept and launch a simulated authentication process.") + "</p><p><em>" + |
112 | tr("If you don't like the result of this test, don't forget to change your settings before you exit the configuration application!") + "</em></p>", | 112 | tr("If you don't like the result of this test, don't forget to change your settings before you exit the configuration application!") + "</em></p>", |
113 | QMessageBox::Warning, | 113 | QMessageBox::Warning, |
114 | QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, | 114 | QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, |
115 | 0, QString::null, TRUE, WStyle_StaysOnTop); | 115 | 0, QString::null, TRUE, WStyle_StaysOnTop); |
116 | confirmSave.setButtonText(QMessageBox::Cancel, tr("Cancel")); | 116 | confirmSave.setButtonText(QMessageBox::Cancel, tr("Cancel")); |
117 | confirmSave.setButtonText(QMessageBox::Yes, tr("OK")); | 117 | confirmSave.setButtonText(QMessageBox::Yes, tr("OK")); |
118 | 118 | ||
119 | if ( confirmSave.exec() == QMessageBox::Yes) | 119 | if ( confirmSave.exec() == QMessageBox::Yes) |
120 | { | 120 | { |
121 | owarn << "writing config as user accepted" << oendl; | 121 | owarn << "writing config as user accepted" << oendl; |
122 | m_parentConfig->writeConfigs(); | 122 | m_parentConfig->writeConfigs(); |
123 | owarn << "testing authentication" << oendl; | 123 | owarn << "testing authentication" << oendl; |
124 | 124 | // launch the authentication in testing mode | |
125 | /* launch the authentication in debug, aka "allowBypass == true", mode | 125 | Opie::Security::MultiauthPassword::authenticate(Opie::Security::TestNow); |
126 | */ | ||
127 | |||
128 | Opie::Security::MultiauthMainWindow win(true); | ||
129 | // resize the QDialog object so it fills all the screen | ||
130 | QRect desk = qApp->desktop()->geometry(); | ||
131 | win.setGeometry( 0, 0, desk.width(), desk.height() ); | ||
132 | |||
133 | // the authentication has already succeeded (without win interactions) | ||
134 | if ( win.isAlreadyDone() ) | ||
135 | return; | ||
136 | |||
137 | win.exec(); | ||
138 | |||
139 | } | ||
140 | 126 | ||
141 | } | 127 | } |
142 | 128 | ||
143 | 129 | ||
144 | /// Builds and displays the Opie multi-authentication configuration dialog | 130 | /// Builds and displays the Opie multi-authentication configuration dialog |
145 | static void test_and_start() { | 131 | static void test_and_start() { |
146 | Config pcfg("Security"); | 132 | Config pcfg("Security"); |
147 | pcfg.setGroup( "Misc" ); | 133 | pcfg.setGroup( "Misc" ); |
148 | bool protectConfigDialog = ! pcfg.readBoolEntry("noProtectConfig", true); | 134 | bool protectConfigDialog = ! pcfg.readBoolEntry("noProtectConfig", true); |
149 | 135 | ||
150 | if (protectConfigDialog && Opie::Security::Internal::runPlugins() != 0) { | 136 | if (protectConfigDialog && Opie::Security::Internal::runPlugins() != 0) { |
151 | owarn << "authentication failed, not showing opie-security" << oendl; | 137 | owarn << "authentication failed, not showing opie-security" << oendl; |
152 | exit( -1 ); | 138 | exit( -1 ); |
153 | } | 139 | } |
154 | } | 140 | } |
155 | 141 | ||
156 | 142 | ||
157 | 143 | ||
158 | MultiauthConfig::MultiauthConfig(QWidget* par, const char* w = "MultiauthConfig dialog", WFlags f = 0) | 144 | MultiauthConfig::MultiauthConfig(QWidget* par, const char* w = "MultiauthConfig dialog", WFlags f = 0) |
159 | : QDialog(par, w, TRUE, f), | 145 | : QDialog(par, w, TRUE, f), |
160 | m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0), | 146 | m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0), |
161 | m_generalConfig(0), m_loginWidget(0), m_syncWidget(0), | 147 | m_generalConfig(0), m_loginWidget(0), m_syncWidget(0), |
162 | m_nbSuccessReq(0), m_plugins_changed(false) | 148 | m_nbSuccessReq(0), m_plugins_changed(false) |
163 | { | 149 | { |
164 | /* Initializes the global configuration window | 150 | /* Initializes the global configuration window |
165 | */ | 151 | */ |
166 | test_and_start(); | 152 | test_and_start(); |
167 | 153 | ||
168 | /* Checks (and memorizes) if any authentication plugins are | 154 | /* Checks (and memorizes) if any authentication plugins are |
169 | * installed on the system | 155 | * installed on the system |
170 | */ | 156 | */ |
171 | QString path = QPEApplication::qpeDir() + "/plugins/security"; | 157 | QString path = QPEApplication::qpeDir() + "/plugins/security"; |
172 | QDir dir( path, "lib*.so" ); | 158 | QDir dir( path, "lib*.so" ); |
173 | QStringList list = dir.entryList(); | 159 | QStringList list = dir.entryList(); |
174 | 160 | ||
175 | m_pluginsInstalled = ! list.isEmpty(); | 161 | m_pluginsInstalled = ! list.isEmpty(); |
176 | if (m_pluginsInstalled == false) | 162 | if (m_pluginsInstalled == false) |
177 | owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl; | 163 | owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl; |
178 | 164 | ||
179 | setCaption( tr( "Security configuration" ) ); | 165 | setCaption( tr( "Security configuration" ) ); |
180 | QVBoxLayout *layout = new QVBoxLayout( this ); | 166 | QVBoxLayout *layout = new QVBoxLayout( this ); |
181 | m_mainTW = new Opie::Ui::OTabWidget( this, "main tab widget" ); | 167 | m_mainTW = new Opie::Ui::OTabWidget( this, "main tab widget" ); |
182 | layout->addWidget(m_mainTW); | 168 | layout->addWidget(m_mainTW); |
183 | 169 | ||
184 | if (m_pluginsInstalled) | 170 | if (m_pluginsInstalled) |
185 | { | 171 | { |
186 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget"); | 172 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget"); |
187 | QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); | 173 | QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); |
188 | pluginListLayout->setSpacing(6); | 174 | pluginListLayout->setSpacing(6); |
189 | pluginListLayout->setMargin(11); | 175 | pluginListLayout->setMargin(11); |
190 | QLabel * pluginListTitle = new QLabel( tr( "Load which plugins in what order:" ), m_pluginListWidget ); | 176 | QLabel * pluginListTitle = new QLabel( tr( "Load which plugins in what order:" ), m_pluginListWidget ); |
191 | pluginListLayout->addWidget(pluginListTitle); | 177 | pluginListLayout->addWidget(pluginListTitle); |
192 | QHBox * pluginListHB = new QHBox(m_pluginListWidget); | 178 | QHBox * pluginListHB = new QHBox(m_pluginListWidget); |
193 | pluginListLayout->addWidget(pluginListHB); | 179 | pluginListLayout->addWidget(pluginListHB); |
194 | 180 | ||
195 | m_pluginListView = new QListView(pluginListHB); | 181 | m_pluginListView = new QListView(pluginListHB); |
196 | m_pluginListView->addColumn("PluginList"); | 182 | m_pluginListView->addColumn("PluginList"); |
197 | m_pluginListView->header()->hide(); | 183 | m_pluginListView->header()->hide(); |
198 | m_pluginListView->setSorting(-1); | 184 | m_pluginListView->setSorting(-1); |
199 | QWhatsThis::add(m_pluginListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the order they will appear in" )); | 185 | QWhatsThis::add(m_pluginListView, tr( "Check a checkbox to activate/deactivate a plugin or use the arrow buttons on the right to change the order they will appear in" )); |
200 | 186 | ||
201 | QVBox * pluginListVB = new QVBox(pluginListHB); | 187 | QVBox * pluginListVB = new QVBox(pluginListHB); |
202 | new ToolButton( pluginListVB, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); | 188 | new ToolButton( pluginListVB, tr( "Move Up" ), "up", this , SLOT( moveSelectedUp() ) ); |
203 | new ToolButton( pluginListVB, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); | 189 | new ToolButton( pluginListVB, tr( "Move Down" ), "down", this , SLOT( moveSelectedDown() ) ); |
204 | m_mainTW->addTab( m_pluginListWidget, "pass", tr( "plugins" ) ); | 190 | m_mainTW->addTab( m_pluginListWidget, "pass", tr( "plugins" ) ); |
205 | 191 | ||
206 | connect ( m_pluginListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( pluginsChanged ( ) ) ); | 192 | connect ( m_pluginListView , SIGNAL( clicked ( QListViewItem * ) ), this, SLOT( pluginsChanged ( ) ) ); |
207 | 193 | ||
208 | // general Opie multi-authentication configuration tab | 194 | // general Opie multi-authentication configuration tab |
209 | m_generalConfig = new MultiauthGeneralConfig(this, m_mainTW); | 195 | m_generalConfig = new MultiauthGeneralConfig(this, m_mainTW); |
210 | m_mainTW->addTab(m_generalConfig, "SettingsIcon", tr( "Authentication") ); | 196 | m_mainTW->addTab(m_generalConfig, "SettingsIcon", tr( "Authentication") ); |
211 | 197 | ||
212 | } | 198 | } |
213 | // login settings page | 199 | // login settings page |
214 | m_loginWidget = new LoginBase(m_mainTW, "login config widget"); | 200 | m_loginWidget = new LoginBase(m_mainTW, "login config widget"); |
215 | m_mainTW->addTab(m_loginWidget, "security/users", tr( "Login") ); | 201 | m_mainTW->addTab(m_loginWidget, "security/users", tr( "Login") ); |
216 | 202 | ||
217 | // sync settings page | 203 | // sync settings page |
218 | m_syncWidget = new SyncBase( m_mainTW, "sync config widget" ); | 204 | m_syncWidget = new SyncBase( m_mainTW, "sync config widget" ); |
219 | m_mainTW->addTab(m_syncWidget, "security/sync", tr( "Sync") ); | 205 | m_mainTW->addTab(m_syncWidget, "security/sync", tr( "Sync") ); |
220 | 206 | ||
221 | // read the "Security" Config file and update our UI | 207 | // read the "Security" Config file and update our UI |
222 | readConfig(); | 208 | readConfig(); |
223 | 209 | ||
224 | 210 | ||
225 | if (m_pluginsInstalled) | 211 | if (m_pluginsInstalled) |
226 | { | 212 | { |
227 | /* loads plugins configuration widgets in mainTW tabs and in pluginListView | 213 | /* loads plugins configuration widgets in mainTW tabs and in pluginListView |
228 | */ | 214 | */ |
229 | 215 | ||
230 | loadPlugins(); | 216 | loadPlugins(); |
231 | 217 | ||
232 | for ( int i = pluginList.count() - 1; i >= 0; i-- ) { | 218 | for ( int i = pluginList.count() - 1; i >= 0; i-- ) { |
233 | MultiauthPlugin plugin = pluginList[i]; | 219 | MultiauthPlugin plugin = pluginList[i]; |
234 | 220 | ||
235 | // load the config widgets in the tabs | 221 | // load the config widgets in the tabs |
236 | // (configWidget will return 0l if there is no configuration GUI) | 222 | // (configWidget will return 0l if there is no configuration GUI) |
237 | MultiauthConfigWidget* widget = plugin.pluginObject->configWidget(m_mainTW); | 223 | MultiauthConfigWidget* widget = plugin.pluginObject->configWidget(m_mainTW); |
238 | if ( widget != 0l ) { | 224 | if ( widget != 0l ) { |
239 | odebug << "plugin " << plugin.name << " has a configuration widget" << oendl; | 225 | odebug << "plugin " << plugin.name << " has a configuration widget" << oendl; |
240 | configWidgetList.append(widget); | 226 | configWidgetList.append(widget); |
241 | m_mainTW->addTab( widget, plugin.pluginObject->pixmapNameConfig(), | 227 | m_mainTW->addTab( widget, plugin.pluginObject->pixmapNameConfig(), |
242 | plugin.pluginObject->pluginName() ); | 228 | plugin.pluginObject->pluginName() ); |
243 | } | 229 | } |
244 | // set the order/activate tab | 230 | // set the order/activate tab |
245 | QPixmap icon = Resource::loadPixmap( plugin.pluginObject->pixmapNameWidget() ); | 231 | QPixmap icon = Resource::loadPixmap( plugin.pluginObject->pixmapNameWidget() ); |
246 | QCheckListItem * item = new QCheckListItem(m_pluginListView, plugin.pluginObject->pluginName(), QCheckListItem::CheckBox ); | 232 | QCheckListItem * item = new QCheckListItem(m_pluginListView, plugin.pluginObject->pluginName(), QCheckListItem::CheckBox ); |
247 | if ( !icon.isNull() ) { | 233 | if ( !icon.isNull() ) { |
248 | item->setPixmap( 0, icon ); | 234 | item->setPixmap( 0, icon ); |
249 | } | 235 | } |
250 | if ( m_excludePlugins.find( plugin.name ) == m_excludePlugins.end() ) { | 236 | if ( m_excludePlugins.find( plugin.name ) == m_excludePlugins.end() ) { |
251 | item->setOn( TRUE ); | 237 | item->setOn( TRUE ); |
252 | } | 238 | } |
253 | m_plugins[plugin.name] = item; | 239 | m_plugins[plugin.name] = item; |
254 | } | 240 | } |
255 | 241 | ||
256 | // set the first tab as default. | 242 | // set the first tab as default. |
257 | m_mainTW->setCurrentTab(m_pluginListWidget); | 243 | m_mainTW->setCurrentTab(m_pluginListWidget); |
258 | 244 | ||
259 | // put the number of plugins as the max number of req. auth. | 245 | // put the number of plugins as the max number of req. auth. |
260 | m_generalConfig->m_nbSuccessMin->setMaxValue( pluginList.count() ); | 246 | m_generalConfig->m_nbSuccessMin->setMaxValue( pluginList.count() ); |
261 | } | 247 | } |
262 | else | 248 | else |
263 | { | 249 | { |
264 | /* we don't have any installed plugin there. Let's tell | 250 | /* we don't have any installed plugin there. Let's tell |
265 | * that to the user in a third tab, using the m_pluginListWidget widget | 251 | * that to the user in a third tab, using the m_pluginListWidget widget |
266 | */ | 252 | */ |
267 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget (no plugins warning)"); | 253 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget (no plugins warning)"); |
268 | QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); | 254 | QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); |
269 | pluginListLayout->setSpacing(11); | 255 | pluginListLayout->setSpacing(11); |
270 | pluginListLayout->setMargin(11); | 256 | pluginListLayout->setMargin(11); |
271 | pluginListLayout->setAlignment( Qt::AlignTop ); | 257 | pluginListLayout->setAlignment( Qt::AlignTop ); |
272 | QVGroupBox *warningBox = new QVGroupBox(tr("Important notice"), m_pluginListWidget, "noPlugins warning box"); | 258 | QVGroupBox *warningBox = new QVGroupBox(tr("Important notice"), m_pluginListWidget, "noPlugins warning box"); |
273 | pluginListLayout->addWidget(warningBox); | 259 | pluginListLayout->addWidget(warningBox); |
274 | QLabel * warningText = new QLabel( "<p>" + tr("To be able to protect your PDA with one or more authentication plugins (for example, a simple PIN authentication), you must install at least one <em>opie-multiauth-*</em> package! Once you have done that, you will be able to configure your PDA protection here.") + "</p>", warningBox ); | 260 | QLabel * warningText = new QLabel( "<p>" + tr("To be able to protect your PDA with one or more authentication plugins (for example, a simple PIN authentication), you must install at least one <em>opie-multiauth-*</em> package! Once you have done that, you will be able to configure your PDA protection here.") + "</p>", warningBox ); |
275 | 261 | ||
276 | m_mainTW->addTab(m_pluginListWidget, "security/Security", tr( "Locking") ); | 262 | m_mainTW->addTab(m_pluginListWidget, "security/Security", tr( "Locking") ); |
277 | 263 | ||
278 | // set the first tab as default. | 264 | // set the first tab as default. |
279 | m_mainTW->setCurrentTab(m_loginWidget); | 265 | m_mainTW->setCurrentTab(m_loginWidget); |
280 | } | 266 | } |
281 | 267 | ||
282 | showMaximized(); | 268 | showMaximized(); |
283 | } | 269 | } |
284 | 270 | ||
285 | /// nothing to do | 271 | /// nothing to do |
286 | MultiauthConfig::~MultiauthConfig() | 272 | MultiauthConfig::~MultiauthConfig() |
287 | { | 273 | { |
288 | } | 274 | } |
289 | 275 | ||
290 | /// saves the general and plugin(s) configurations | 276 | /// saves the general and plugin(s) configurations |
291 | void MultiauthConfig::writeConfigs() { | 277 | void MultiauthConfig::writeConfigs() { |
292 | writeConfig(); | 278 | writeConfig(); |
293 | 279 | ||
294 | MultiauthConfigWidget* confWidget = 0; | 280 | MultiauthConfigWidget* confWidget = 0; |
295 | for ( confWidget = configWidgetList.first(); confWidget != 0; | 281 | for ( confWidget = configWidgetList.first(); confWidget != 0; |
296 | confWidget = configWidgetList.next() ) | 282 | confWidget = configWidgetList.next() ) |
297 | confWidget->writeConfig(); | 283 | confWidget->writeConfig(); |
298 | } | 284 | } |
299 | 285 | ||
300 | /// on QDialog::accept, we save all the configurations and exit the QDialog normally | 286 | /// on QDialog::accept, we save all the configurations and exit the QDialog normally |
301 | void MultiauthConfig::accept() { | 287 | void MultiauthConfig::accept() { |
302 | writeConfigs(); | 288 | writeConfigs(); |
303 | QDialog::accept(); | 289 | QDialog::accept(); |
304 | } | 290 | } |
305 | 291 | ||
306 | void MultiauthConfig::done( int r ) { | 292 | void MultiauthConfig::done( int r ) { |
307 | QDialog::done( r ); | 293 | QDialog::done( r ); |
308 | close(); | 294 | close(); |
309 | } | 295 | } |
310 | 296 | ||
311 | /// moves up the selected plugin | 297 | /// moves up the selected plugin |
312 | void MultiauthConfig::moveSelectedUp() | 298 | void MultiauthConfig::moveSelectedUp() |
313 | { | 299 | { |
314 | QListViewItem *item = m_pluginListView->selectedItem(); | 300 | QListViewItem *item = m_pluginListView->selectedItem(); |
315 | if ( item && item->itemAbove() ) { | 301 | if ( item && item->itemAbove() ) { |
316 | item->itemAbove()->moveItem( item ); | 302 | item->itemAbove()->moveItem( item ); |
317 | } | 303 | } |
318 | } | 304 | } |
319 | 305 | ||
320 | /// moves down the selected plugin | 306 | /// moves down the selected plugin |
321 | void MultiauthConfig::moveSelectedDown() | 307 | void MultiauthConfig::moveSelectedDown() |
322 | { | 308 | { |
323 | QListViewItem *item = m_pluginListView->selectedItem(); | 309 | QListViewItem *item = m_pluginListView->selectedItem(); |
324 | if ( item && item->itemBelow() ) { | 310 | if ( item && item->itemBelow() ) { |
325 | item->moveItem( item->itemBelow() ); | 311 | item->moveItem( item->itemBelow() ); |
326 | } | 312 | } |
327 | } | 313 | } |
328 | 314 | ||
329 | /// reads the <code>Security.conf</code> Config file, and updates parts of the user interface | 315 | /// reads the <code>Security.conf</code> Config file, and updates parts of the user interface |
330 | void MultiauthConfig::readConfig() | 316 | void MultiauthConfig::readConfig() |
331 | { | 317 | { |
332 | // pointer, so we release this Config when we want | 318 | // pointer, so we release this Config when we want |
333 | Config* pcfg = new Config("Security"); | 319 | Config* pcfg = new Config("Security"); |
334 | 320 | ||
335 | if (m_pluginsInstalled) | 321 | if (m_pluginsInstalled) |
336 | { | 322 | { |
337 | pcfg->setGroup( "Misc" ); | 323 | pcfg->setGroup( "Misc" ); |
338 | m_generalConfig->m_onStart->setChecked( pcfg->readBoolEntry( "onStart", false ) ); | 324 | m_generalConfig->m_onStart->setChecked( pcfg->readBoolEntry( "onStart", false ) ); |
339 | m_generalConfig->m_onResume->setChecked( pcfg->readBoolEntry( "onResume", false ) ); | 325 | m_generalConfig->m_onResume->setChecked( pcfg->readBoolEntry( "onResume", false ) ); |
340 | m_generalConfig->m_nbSuccessMin->setValue( pcfg->readNumEntry( "nbSuccessMin", 1 ) ); | 326 | m_generalConfig->m_nbSuccessMin->setValue( pcfg->readNumEntry( "nbSuccessMin", 1 ) ); |
341 | m_generalConfig->m_noProtectConfig->setChecked( pcfg->readBoolEntry( "noProtectConfig", true) ); | 327 | m_generalConfig->m_noProtectConfig->setChecked( pcfg->readBoolEntry( "noProtectConfig", true) ); |
342 | m_generalConfig->m_explanScreens->setChecked( pcfg->readBoolEntry( "explanScreens", true ) ); | 328 | m_generalConfig->m_explanScreens->setChecked( pcfg->readBoolEntry( "explanScreens", true ) ); |
343 | 329 | ||
344 | pcfg->setGroup( "Plugins" ); | 330 | pcfg->setGroup( "Plugins" ); |
345 | m_excludePlugins = pcfg->readListEntry( "ExcludePlugins", ',' ); | 331 | m_excludePlugins = pcfg->readListEntry( "ExcludePlugins", ',' ); |
346 | m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' ); | 332 | m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' ); |
347 | } | 333 | } |
348 | 334 | ||
349 | /* Login and Sync stuff */ | 335 | /* Login and Sync stuff */ |
350 | pcfg->setGroup("Sync"); | 336 | pcfg->setGroup("Sync"); |
351 | int auth_peer = pcfg->readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 | 337 | int auth_peer = pcfg->readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 |
352 | int auth_peer_bits = pcfg->readNumEntry("auth_peer_bits",24); | 338 | int auth_peer_bits = pcfg->readNumEntry("auth_peer_bits",24); |
353 | 339 | ||
354 | pcfg->setGroup("SyncMode"); | 340 | pcfg->setGroup("SyncMode"); |
355 | int mode = pcfg->readNumEntry("Mode",2); // Default to Sharp | 341 | int mode = pcfg->readNumEntry("Mode",2); // Default to Sharp |
356 | switch( mode ) { | 342 | switch( mode ) { |
357 | case 0x01: | 343 | case 0x01: |
358 | m_syncWidget->syncModeCombo->setCurrentItem( 0 ); | 344 | m_syncWidget->syncModeCombo->setCurrentItem( 0 ); |
359 | break; | 345 | break; |
360 | case 0x02: | 346 | case 0x02: |
361 | default: | 347 | default: |
362 | m_syncWidget->syncModeCombo->setCurrentItem( 1 ); | 348 | m_syncWidget->syncModeCombo->setCurrentItem( 1 ); |
363 | break; | 349 | break; |
364 | case 0x04: | 350 | case 0x04: |
365 | m_syncWidget->syncModeCombo->setCurrentItem( 2 ); | 351 | m_syncWidget->syncModeCombo->setCurrentItem( 2 ); |
366 | break; | 352 | break; |
367 | } | 353 | } |
368 | /* | 354 | /* |
369 | cfg.setGroup("Remote"); | 355 | cfg.setGroup("Remote"); |
370 | if ( telnetAvailable() ) | 356 | if ( telnetAvailable() ) |
371 | telnet->setChecked(cfg.readEntry("allow_telnet")); | 357 | telnet->setChecked(cfg.readEntry("allow_telnet")); |
372 | else | 358 | else |
373 | telnet->hide(); | 359 | telnet->hide(); |
374 | 360 | ||
375 | if ( sshAvailable() ) | 361 | if ( sshAvailable() ) |
376 | ssh->setChecked(cfg.readEntry("allow_ssh")); | 362 | ssh->setChecked(cfg.readEntry("allow_ssh")); |
377 | else | 363 | else |
378 | ssh->hide(); | 364 | ssh->hide(); |
379 | */ | 365 | */ |
380 | 366 | ||
381 | // release the Config handler | 367 | // release the Config handler |
382 | delete pcfg; | 368 | delete pcfg; |
383 | // indeed, selectNet will open the config file... | 369 | // indeed, selectNet will open the config file... |
384 | selectNet(auth_peer,auth_peer_bits,TRUE); | 370 | selectNet(auth_peer,auth_peer_bits,TRUE); |
385 | 371 | ||
386 | connect( m_syncWidget->syncnet, SIGNAL(textChanged(const QString&)), | 372 | connect( m_syncWidget->syncnet, SIGNAL(textChanged(const QString&)), |
387 | this, SLOT(setSyncNet(const QString&))); | 373 | this, SLOT(setSyncNet(const QString&))); |
388 | 374 | ||
389 | 375 | ||
390 | 376 | ||
391 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; | 377 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; |
392 | Config loginCfg(configFile,Config::File); | 378 | Config loginCfg(configFile,Config::File); |
393 | 379 | ||
394 | loginCfg.setGroup("General"); | 380 | loginCfg.setGroup("General"); |
395 | autoLoginName=loginCfg.readEntry("AutoLogin",""); | 381 | autoLoginName=loginCfg.readEntry("AutoLogin",""); |
396 | 382 | ||
397 | if (autoLoginName.stripWhiteSpace().isEmpty()) { | 383 | if (autoLoginName.stripWhiteSpace().isEmpty()) { |
398 | autoLogin=false; | 384 | autoLogin=false; |
399 | } else { | 385 | } else { |
400 | autoLogin=true; | 386 | autoLogin=true; |
401 | } | 387 | } |
402 | 388 | ||
403 | 389 | ||
404 | connect(m_loginWidget->autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); | 390 | connect(m_loginWidget->autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool))); |
405 | connect(m_loginWidget->userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); | 391 | connect(m_loginWidget->userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int))); |
406 | connect(m_syncWidget->restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults())); | 392 | connect(m_syncWidget->restoredefaults,SIGNAL(clicked()), this, SLOT(restoreDefaults())); |
407 | connect(m_syncWidget->deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry())); | 393 | connect(m_syncWidget->deleteentry,SIGNAL(clicked()), this, SLOT(deleteListEntry())); |
408 | 394 | ||
409 | loadUsers(); | 395 | loadUsers(); |
410 | updateGUI(); | 396 | updateGUI(); |
411 | 397 | ||
412 | } | 398 | } |
413 | 399 | ||
414 | void MultiauthConfig::writeConfig() | 400 | void MultiauthConfig::writeConfig() |
415 | { | 401 | { |
416 | Config* pcfg = new Config("Security"); | 402 | Config* pcfg = new Config("Security"); |
417 | 403 | ||
418 | if (m_pluginsInstalled) | 404 | if (m_pluginsInstalled) |
419 | { | 405 | { |
420 | pcfg->setGroup( "Plugins" ); | 406 | pcfg->setGroup( "Plugins" ); |
421 | QStringList exclude; | 407 | QStringList exclude; |
422 | QStringList include; | 408 | QStringList include; |
423 | QStringList allPlugins; | 409 | QStringList allPlugins; |
424 | 410 | ||
425 | QListViewItemIterator list_it( m_pluginListView ); | 411 | QListViewItemIterator list_it( m_pluginListView ); |
426 | 412 | ||
427 | // this makes sure the names get saved in the order selected | 413 | // this makes sure the names get saved in the order selected |
428 | for ( ; list_it.current(); ++list_it ) { | 414 | for ( ; list_it.current(); ++list_it ) { |
429 | QMap <QString, QCheckListItem *>::Iterator it; | 415 | QMap <QString, QCheckListItem *>::Iterator it; |
430 | for ( it = m_plugins.begin(); it != m_plugins. end (); ++it ) { | 416 | for ( it = m_plugins.begin(); it != m_plugins. end (); ++it ) { |
431 | if ( list_it.current() == (*it) && !(*it)-> isOn () ) { | 417 | if ( list_it.current() == (*it) && !(*it)-> isOn () ) { |
432 | exclude << it.key(); | 418 | exclude << it.key(); |
433 | } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ | 419 | } else if ( list_it.current() == (*it) && (*it)-> isOn () ){ |
434 | include << it.key(); | 420 | include << it.key(); |
435 | } | 421 | } |
436 | if ( list_it.current() == (*it) ) { | 422 | if ( list_it.current() == (*it) ) { |
437 | allPlugins << it.key(); | 423 | allPlugins << it.key(); |
438 | } | 424 | } |
439 | } | 425 | } |
440 | } | 426 | } |
441 | pcfg->writeEntry( "ExcludePlugins", exclude, ',' ); | 427 | pcfg->writeEntry( "ExcludePlugins", exclude, ',' ); |
442 | pcfg->writeEntry( "IncludePlugins", include, ',' ); | 428 | pcfg->writeEntry( "IncludePlugins", include, ',' ); |
443 | pcfg->writeEntry( "AllPlugins", allPlugins, ',' ); | 429 | pcfg->writeEntry( "AllPlugins", allPlugins, ',' ); |
444 | 430 | ||
445 | pcfg->setGroup( "Misc" ); | 431 | pcfg->setGroup( "Misc" ); |
446 | pcfg->writeEntry( "onStart", m_generalConfig->m_onStart->isChecked() ); | 432 | pcfg->writeEntry( "onStart", m_generalConfig->m_onStart->isChecked() ); |
447 | pcfg->writeEntry( "onResume", m_generalConfig->m_onResume->isChecked() ); | 433 | pcfg->writeEntry( "onResume", m_generalConfig->m_onResume->isChecked() ); |
448 | pcfg->writeEntry( "nbSuccessMin", m_generalConfig->m_nbSuccessMin->text() ); | 434 | pcfg->writeEntry( "nbSuccessMin", m_generalConfig->m_nbSuccessMin->text() ); |
449 | pcfg->writeEntry( "noProtectConfig", m_generalConfig->m_noProtectConfig->isChecked() ); | 435 | pcfg->writeEntry( "noProtectConfig", m_generalConfig->m_noProtectConfig->isChecked() ); |
450 | pcfg->writeEntry( "explanScreens", m_generalConfig->m_explanScreens->isChecked() ); | 436 | pcfg->writeEntry( "explanScreens", m_generalConfig->m_explanScreens->isChecked() ); |
451 | } | 437 | } |
452 | 438 | ||
453 | /* Login and Sync stuff */ | 439 | /* Login and Sync stuff */ |
454 | 440 | ||
455 | pcfg->setGroup("Sync"); | 441 | pcfg->setGroup("Sync"); |
456 | int auth_peer=0; | 442 | int auth_peer=0; |
457 | int auth_peer_bits; | 443 | int auth_peer_bits; |
458 | QString sn = m_syncWidget->syncnet->currentText(); | 444 | QString sn = m_syncWidget->syncnet->currentText(); |
459 | parseNet(sn,auth_peer,auth_peer_bits); | 445 | parseNet(sn,auth_peer,auth_peer_bits); |
460 | 446 | ||
461 | //this is the *selected* (active) net range | 447 | //this is the *selected* (active) net range |
462 | pcfg->writeEntry("auth_peer",auth_peer); | 448 | pcfg->writeEntry("auth_peer",auth_peer); |
463 | pcfg->writeEntry("auth_peer_bits",auth_peer_bits); | 449 | pcfg->writeEntry("auth_peer_bits",auth_peer_bits); |
464 | 450 | ||
465 | //write back all other net ranges in *cleartext* | 451 | //write back all other net ranges in *cleartext* |
466 | for (int i=0; i<10; i++) { | 452 | for (int i=0; i<10; i++) { |
467 | QString target; | 453 | QString target; |
468 | target.sprintf("net%d", i); | 454 | target.sprintf("net%d", i); |
469 | if ( i < m_syncWidget->syncnet->count() ) | 455 | if ( i < m_syncWidget->syncnet->count() ) |
470 | pcfg->writeEntry(target, m_syncWidget->syncnet->text(i)); | 456 | pcfg->writeEntry(target, m_syncWidget->syncnet->text(i)); |
471 | else // no more entry in the syncnet list -> we clear the line | 457 | else // no more entry in the syncnet list -> we clear the line |
472 | pcfg->writeEntry(target, ""); | 458 | pcfg->writeEntry(target, ""); |
473 | } | 459 | } |
474 | 460 | ||
475 | #ifdef ODP | 461 | #ifdef ODP |
476 | #error "Use 0,1,2 and use Launcher" | 462 | #error "Use 0,1,2 and use Launcher" |
477 | #endif | 463 | #endif |
478 | /* keep the old code so we don't use currentItem directly */ | 464 | /* keep the old code so we don't use currentItem directly */ |
479 | int value = 0x02; | 465 | int value = 0x02; |
480 | switch( m_syncWidget->syncModeCombo->currentItem() ) { | 466 | switch( m_syncWidget->syncModeCombo->currentItem() ) { |
481 | case 0: | 467 | case 0: |
482 | value = 0x01; | 468 | value = 0x01; |
483 | break; | 469 | break; |
484 | case 1: | 470 | case 1: |
485 | value = 0x02; | 471 | value = 0x02; |
486 | break; | 472 | break; |
487 | case 2: | 473 | case 2: |
488 | value = 0x04; | 474 | value = 0x04; |
489 | break; | 475 | break; |
490 | } | 476 | } |
491 | pcfg->setGroup("SyncMode"); | 477 | pcfg->setGroup("SyncMode"); |
492 | pcfg->writeEntry( "Mode", value ); | 478 | pcfg->writeEntry( "Mode", value ); |
493 | 479 | ||
494 | /* | 480 | /* |
495 | pcfg->setGroup("Remote"); | 481 | pcfg->setGroup("Remote"); |
496 | if ( telnetAvailable() ) | 482 | if ( telnetAvailable() ) |
497 | pcfg->writeEntry("allow_telnet",telnet->isChecked()); | 483 | pcfg->writeEntry("allow_telnet",telnet->isChecked()); |
498 | if ( sshAvailable() ) | 484 | if ( sshAvailable() ) |
499 | pcfg->writeEntry("allow_ssh",ssh->isChecked()); | 485 | pcfg->writeEntry("allow_ssh",ssh->isChecked()); |
500 | // ### write ssh/telnet sys config files | 486 | // ### write ssh/telnet sys config files |
501 | */ | 487 | */ |
502 | 488 | ||
503 | //release the Config handler | 489 | //release the Config handler |
504 | delete pcfg; | 490 | delete pcfg; |
505 | 491 | ||
506 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; | 492 | QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; |
507 | Config loginCfg(configFile,Config::File); | 493 | Config loginCfg(configFile,Config::File); |
508 | loginCfg.setGroup("General"); | 494 | loginCfg.setGroup("General"); |
509 | 495 | ||
510 | if (autoLogin) { | 496 | if (autoLogin) { |
511 | loginCfg.writeEntry("AutoLogin",autoLoginName); | 497 | loginCfg.writeEntry("AutoLogin",autoLoginName); |
512 | } else { | 498 | } else { |
513 | loginCfg.removeEntry("AutoLogin"); | 499 | loginCfg.removeEntry("AutoLogin"); |
514 | } | 500 | } |
515 | 501 | ||
516 | } | 502 | } |
517 | 503 | ||
518 | /// slot used to record the fact plugins order has been modified | 504 | /// slot used to record the fact plugins order has been modified |
519 | void MultiauthConfig::pluginsChanged() { | 505 | void MultiauthConfig::pluginsChanged() { |
520 | m_plugins_changed = true; | 506 | m_plugins_changed = true; |
521 | } | 507 | } |
522 | 508 | ||
523 | /// loads each multiauth plugin | 509 | /// loads each multiauth plugin |
524 | void MultiauthConfig::loadPlugins() { | 510 | void MultiauthConfig::loadPlugins() { |
525 | 511 | ||
526 | QString path = QPEApplication::qpeDir() + "/plugins/security"; | 512 | QString path = QPEApplication::qpeDir() + "/plugins/security"; |
527 | QDir dir( path, "lib*.so" ); | 513 | QDir dir( path, "lib*.so" ); |
528 | 514 | ||
529 | QStringList list = dir.entryList(); | 515 | QStringList list = dir.entryList(); |
530 | QStringList::Iterator it; | 516 | QStringList::Iterator it; |
531 | 517 | ||
532 | // temporary list used to sort plugins | 518 | // temporary list used to sort plugins |
533 | QMap<QString, MultiauthPlugin> sortList; | 519 | QMap<QString, MultiauthPlugin> sortList; |
534 | 520 | ||
535 | for ( it = list.begin(); it != list.end(); ++it ) { | 521 | for ( it = list.begin(); it != list.end(); ++it ) { |
536 | QInterfacePtr<MultiauthPluginInterface> iface; | 522 | QInterfacePtr<MultiauthPluginInterface> iface; |
537 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 523 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
538 | QString libPath(path + "/" + *it); | 524 | QString libPath(path + "/" + *it); |
539 | 525 | ||
540 | if ( lib->queryInterface( IID_MultiauthPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { | 526 | if ( lib->queryInterface( IID_MultiauthPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { |
541 | MultiauthPlugin plugin; | 527 | MultiauthPlugin plugin; |
542 | plugin.library = lib; | 528 | plugin.library = lib; |
543 | plugin.iface = iface; | 529 | plugin.iface = iface; |
544 | plugin.name = QString(*it); | 530 | plugin.name = QString(*it); |
545 | 531 | ||
546 | // find out if plugins should be launched | 532 | // find out if plugins should be launched |
547 | if ( m_excludePlugins.grep( *it ).isEmpty() ) { | 533 | if ( m_excludePlugins.grep( *it ).isEmpty() ) { |
548 | plugin.active = true; | 534 | plugin.active = true; |
549 | } else { | 535 | } else { |
550 | plugin.active = false; | 536 | plugin.active = false; |
551 | } | 537 | } |
552 | 538 | ||
553 | plugin.pluginObject = plugin.iface->plugin(); | 539 | plugin.pluginObject = plugin.iface->plugin(); |
554 | 540 | ||
555 | // "prebuffer" it in one more list, to get the sorting done | 541 | // "prebuffer" it in one more list, to get the sorting done |
556 | sortList.insert( plugin.name, plugin ); | 542 | sortList.insert( plugin.name, plugin ); |
557 | 543 | ||
558 | // on first start the list is off course empty | 544 | // on first start the list is off course empty |
559 | if ( m_allPlugins.isEmpty() ) { | 545 | if ( m_allPlugins.isEmpty() ) { |
560 | pluginList.append( plugin ); | 546 | pluginList.append( plugin ); |
561 | } | 547 | } |
562 | // if plugin is not yet in the list, add it to the layout too | 548 | // if plugin is not yet in the list, add it to the layout too |
563 | else if ( !m_allPlugins.contains( plugin.name ) ) { | 549 | else if ( !m_allPlugins.contains( plugin.name ) ) { |
564 | pluginList.append( plugin ); | 550 | pluginList.append( plugin ); |
565 | } | 551 | } |
566 | 552 | ||
567 | } else { | 553 | } else { |
568 | delete lib; | 554 | delete lib; |
569 | } | 555 | } |
570 | 556 | ||
571 | } // end for | 557 | } // end for |
572 | 558 | ||
573 | // put m_allPlugins tempPlugin objects into pluginList | 559 | // put m_allPlugins tempPlugin objects into pluginList |
574 | if ( !m_allPlugins.isEmpty() ) { | 560 | if ( !m_allPlugins.isEmpty() ) { |
575 | MultiauthPlugin tempPlugin; | 561 | MultiauthPlugin tempPlugin; |
576 | QStringList::Iterator stringit; | 562 | QStringList::Iterator stringit; |
577 | for( stringit = m_allPlugins.begin(); stringit != m_allPlugins.end(); ++stringit ) { | 563 | for( stringit = m_allPlugins.begin(); stringit != m_allPlugins.end(); ++stringit ) { |
578 | tempPlugin = ( sortList.find( *stringit ) ).data(); | 564 | tempPlugin = ( sortList.find( *stringit ) ).data(); |
579 | if ( !( (tempPlugin.name).isEmpty() ) ) { | 565 | if ( !( (tempPlugin.name).isEmpty() ) ) { |
580 | pluginList.append( tempPlugin ); | 566 | pluginList.append( tempPlugin ); |
581 | } | 567 | } |
582 | } | 568 | } |
583 | } | 569 | } |
584 | 570 | ||
585 | } | 571 | } |
586 | 572 | ||
587 | void MultiauthConfig::deleteListEntry() | 573 | void MultiauthConfig::deleteListEntry() |
588 | { | 574 | { |
589 | m_syncWidget->syncnet->removeItem(m_syncWidget->syncnet->currentItem()); | 575 | m_syncWidget->syncnet->removeItem(m_syncWidget->syncnet->currentItem()); |
590 | } | 576 | } |
591 | 577 | ||
592 | void MultiauthConfig::restoreDefaults() | 578 | void MultiauthConfig::restoreDefaults() |
593 | { | 579 | { |
594 | QMessageBox unrecbox( | 580 | QMessageBox unrecbox( |
595 | tr("Attention"), | 581 | tr("Attention"), |
596 | "<p>" + tr("All user-defined net ranges will be lost.") + "</p>", | 582 | "<p>" + tr("All user-defined net ranges will be lost.") + "</p>", |
597 | QMessageBox::Warning, | 583 | QMessageBox::Warning, |
598 | QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, | 584 | QMessageBox::Cancel, QMessageBox::Yes, QMessageBox::NoButton, |
599 | 0, QString::null, TRUE, WStyle_StaysOnTop); | 585 | 0, QString::null, TRUE, WStyle_StaysOnTop); |
600 | unrecbox.setButtonText(QMessageBox::Cancel, tr("Cancel")); | 586 | unrecbox.setButtonText(QMessageBox::Cancel, tr("Cancel")); |
601 | unrecbox.setButtonText(QMessageBox::Yes, tr("OK")); | 587 | unrecbox.setButtonText(QMessageBox::Yes, tr("OK")); |
602 | 588 | ||
603 | if ( unrecbox.exec() == QMessageBox::Yes) | 589 | if ( unrecbox.exec() == QMessageBox::Yes) |
604 | { | 590 | { |
605 | m_syncWidget->syncnet->clear(); | 591 | m_syncWidget->syncnet->clear(); |
606 | insertDefaultRanges(); | 592 | insertDefaultRanges(); |
607 | } | 593 | } |
608 | m_syncWidget->syncModeCombo->setCurrentItem( 2 ); | 594 | m_syncWidget->syncModeCombo->setCurrentItem( 2 ); |
609 | } | 595 | } |
610 | 596 | ||
611 | void MultiauthConfig::insertDefaultRanges() | 597 | void MultiauthConfig::insertDefaultRanges() |
612 | { | 598 | { |
613 | m_syncWidget->syncnet->insertItem( "192.168.129.0/24" ); | 599 | m_syncWidget->syncnet->insertItem( "192.168.129.0/24" ); |
614 | m_syncWidget->syncnet->insertItem( "192.168.1.0/24" ); | 600 | m_syncWidget->syncnet->insertItem( "192.168.1.0/24" ); |
615 | m_syncWidget->syncnet->insertItem( "192.168.0.0/16" ); | 601 | m_syncWidget->syncnet->insertItem( "192.168.0.0/16" ); |
616 | m_syncWidget->syncnet->insertItem( "172.16.0.0/12" ); | 602 | m_syncWidget->syncnet->insertItem( "172.16.0.0/12" ); |
617 | m_syncWidget->syncnet->insertItem( "10.0.0.0/8" ); | 603 | m_syncWidget->syncnet->insertItem( "10.0.0.0/8" ); |
618 | m_syncWidget->syncnet->insertItem( "1.0.0.0/8" ); | 604 | m_syncWidget->syncnet->insertItem( "1.0.0.0/8" ); |
619 | m_syncWidget->syncnet->insertItem( tr( "Any" ) ); | 605 | m_syncWidget->syncnet->insertItem( tr( "Any" ) ); |
620 | m_syncWidget->syncnet->insertItem( tr( "None" ) ); | 606 | m_syncWidget->syncnet->insertItem( tr( "None" ) ); |
621 | } | 607 | } |
622 | 608 | ||
623 | void MultiauthConfig::updateGUI() | 609 | void MultiauthConfig::updateGUI() |
624 | { | 610 | { |
625 | m_loginWidget->autologinToggle->setChecked(autoLogin); | 611 | m_loginWidget->autologinToggle->setChecked(autoLogin); |
626 | m_loginWidget->userlist->setEnabled(autoLogin); | 612 | m_loginWidget->userlist->setEnabled(autoLogin); |
627 | } | 613 | } |
628 | 614 | ||
629 | void MultiauthConfig::selectNet(int auth_peer,int auth_peer_bits, bool update) | 615 | void MultiauthConfig::selectNet(int auth_peer,int auth_peer_bits, bool update) |
630 | { | 616 | { |
631 | QString sn; | 617 | QString sn; |
632 | if ( auth_peer_bits == 0 && auth_peer == 0 ) { | 618 | if ( auth_peer_bits == 0 && auth_peer == 0 ) { |
633 | sn = tr("Any"); | 619 | sn = tr("Any"); |
634 | } else if ( auth_peer_bits == 32 && auth_peer == 0 ) { | 620 | } else if ( auth_peer_bits == 32 && auth_peer == 0 ) { |
635 | sn = tr("None"); | 621 | sn = tr("None"); |
636 | } else { | 622 | } else { |
637 | sn = | 623 | sn = |
638 | QString::number((auth_peer>>24)&0xff) + "." | 624 | QString::number((auth_peer>>24)&0xff) + "." |
639 | + QString::number((auth_peer>>16)&0xff) + "." | 625 | + QString::number((auth_peer>>16)&0xff) + "." |
640 | + QString::number((auth_peer>>8)&0xff) + "." | 626 | + QString::number((auth_peer>>8)&0xff) + "." |
641 | + QString::number((auth_peer>>0)&0xff) + "/" | 627 | + QString::number((auth_peer>>0)&0xff) + "/" |
642 | + QString::number(auth_peer_bits); | 628 | + QString::number(auth_peer_bits); |
643 | } | 629 | } |
644 | 630 | ||
645 | //insert user-defined list of netranges upon start | 631 | //insert user-defined list of netranges upon start |
646 | if (update) { | 632 | if (update) { |
647 | //User selected/active netrange first | 633 | //User selected/active netrange first |
648 | m_syncWidget->syncnet->insertItem( tr(sn) ); | 634 | m_syncWidget->syncnet->insertItem( tr(sn) ); |
649 | Config cfg("Security"); | 635 | Config cfg("Security"); |
650 | cfg.setGroup("Sync"); | 636 | cfg.setGroup("Sync"); |
651 | 637 | ||
diff --git a/libopie2/opiesecurity/multiauthpassword.cpp b/libopie2/opiesecurity/multiauthpassword.cpp index 42341f7..8eda554 100644 --- a/libopie2/opiesecurity/multiauthpassword.cpp +++ b/libopie2/opiesecurity/multiauthpassword.cpp | |||
@@ -1,105 +1,138 @@ | |||
1 | /** | 1 | /** |
2 | * \file multiauthpassword.cpp | 2 | * \file multiauthpassword.cpp |
3 | * \brief Password Dialog dropin. | 3 | * \brief Password Dialog dropin. |
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | 4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) |
5 | */ | 5 | */ |
6 | /* | 6 | /* |
7 | =. This file is part of the Opie Project | 7 | =. This file is part of the Opie Project |
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | 8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This library is free software; you can | 10 | _;:, .> :=|. This library is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This library is distributed in the hope that | 17 | .i_,=:_. -<s. This library is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | 34 | ||
35 | /* OPIE */ | 35 | /* OPIE */ |
36 | #include <opie2/multiauthcommon.h> | 36 | #include <opie2/multiauthcommon.h> |
37 | #include <opie2/multiauthmainwindow.h> | 37 | #include <opie2/multiauthmainwindow.h> |
38 | #include <qpe/config.h> | 38 | #include <qpe/config.h> |
39 | #include <qpe/qlibrary.h> | 39 | #include <qpe/qlibrary.h> |
40 | #include <qpe/qcom.h> | 40 | #include <qpe/qcom.h> |
41 | 41 | ||
42 | /* QT */ | 42 | /* QT */ |
43 | #include <qapplication.h> | 43 | #include <qapplication.h> |
44 | #include <qvbox.h> | 44 | #include <qvbox.h> |
45 | #include <qpushbutton.h> | 45 | #include <qpushbutton.h> |
46 | #include <qlabel.h> | 46 | #include <qlabel.h> |
47 | #include <qdir.h> | 47 | #include <qdir.h> |
48 | 48 | ||
49 | #include "multiauthpassword.h" | 49 | #include "multiauthpassword.h" |
50 | 50 | ||
51 | namespace Opie { | 51 | namespace Opie { |
52 | namespace Security { | 52 | namespace Security { |
53 | 53 | ||
54 | 54 | ||
55 | /** | 55 | /** |
56 | * If the users requires authentication... #fixme | 56 | * Tells if the users requires authentication (used internally to |
57 | * know whether to repaint the screen on resume) | ||
57 | * | 58 | * |
58 | * @todo fix up at_poweron attribute | 59 | * \param at_poweron true if we are booting Opie, false if we are resuming it |
60 | * \return true if authenticate() launched right now would trigger an authentication | ||
59 | */ | 61 | */ |
60 | bool MultiauthPassword::needToAuthenticate(bool at_poweron) | 62 | bool MultiauthPassword::needToAuthenticate(bool at_poweron) |
61 | { | 63 | { |
62 | Config cfg("Security"); | 64 | Config cfg("Security"); |
63 | cfg.setGroup("Misc"); | 65 | cfg.setGroup("Misc"); |
64 | if ( !at_poweron && cfg.readBoolEntry("onStart", false) ) | 66 | if ( !at_poweron && cfg.readBoolEntry("onStart", false) ) |
65 | return true; | 67 | return true; |
66 | else if ( at_poweron && cfg.readBoolEntry("onResume", false) ) | 68 | else if ( at_poweron && cfg.readBoolEntry("onResume", false) ) |
67 | return true; | 69 | return true; |
68 | else | 70 | else |
69 | return false; | 71 | return false; |
70 | } | 72 | } |
71 | 73 | ||
72 | 74 | ||
75 | |||
73 | /** | 76 | /** |
74 | * \brief Require user authentication to unlock and continue | 77 | * \brief Require (if configured so) user authentication to unlock and continue |
75 | * | 78 | * |
76 | * This method will check if you require authentication | 79 | * This method will check if you require authentication |
77 | * and then will lock the screen and ask for a successful | 80 | * and then will lock the screen and ask for a successful |
78 | * authentication (explaining what it does or not, depending | 81 | * authentication (explaining what it does or not, depending |
79 | * on your local configuration). | 82 | * on your local configuration). |
80 | * It may go into an event loop, but anyhow it will only end | 83 | * It may go into an event loop, but anyhow it will only end |
81 | * when the user has successfully authenticated to the system. | 84 | * when the user has successfully authenticated to the system. |
82 | */ | 85 | */ |
83 | void MultiauthPassword::authenticate(bool at_poweron) | 86 | void MultiauthPassword::authenticate(int lockMode) |
84 | { | 87 | { |
85 | if ( ! needToAuthenticate(at_poweron) ) | 88 | /** |
86 | return; | 89 | * \par Conditions |
90 | * | ||
91 | * If lockMode is an If, it's conditional: | ||
92 | * \li IfPowerOn will not trigger an authentication if | ||
93 | * onStart is set to false in Security.conf, | ||
94 | * \li IfResume will not trigger an authentication if | ||
95 | * onResume is set to false in Security.conf. | ||
96 | */ | ||
97 | if ( (lockMode == IfPowerOn) || (lockMode == IfResume) ) | ||
98 | { | ||
99 | Config cfg("Security"); | ||
100 | cfg.setGroup("Misc"); | ||
101 | if ( ( | ||
102 | (lockMode == IfPowerOn) && cfg.readBoolEntry("onStart", false) | ||
103 | ) || ( | ||
104 | (lockMode == IfResume) && cfg.readBoolEntry("onResume", false) | ||
105 | ) ) | ||
106 | return; | ||
107 | } | ||
108 | |||
109 | /** | ||
110 | * \li TestNow will ensure that the authentication window will let | ||
111 | * people escape through the last screen (which they can reach skipping | ||
112 | * all the authentication steps) | ||
113 | * \li LockNow will always go on with the authentication, and won't let | ||
114 | * people escape. | ||
115 | */ | ||
116 | bool allowByPass = false; | ||
117 | |||
118 | if (lockMode == TestNow) | ||
119 | allowByPass = true; | ||
87 | 120 | ||
88 | /* Constructs the main window, which displays messages and blocks | 121 | /* Constructs the main window, which displays messages and blocks |
89 | * access to the desktop | 122 | * access to the desktop |
90 | */ | 123 | */ |
91 | MultiauthMainWindow win; | 124 | MultiauthMainWindow win(allowByPass); |
92 | 125 | ||
93 | // resize the QDialog object so it fills all the screen | 126 | // resize the QDialog object so it fills all the screen |
94 | QRect desk = qApp->desktop()->geometry(); | 127 | QRect desk = qApp->desktop()->geometry(); |
95 | win.setGeometry( 0, 0, desk.width(), desk.height() ); | 128 | win.setGeometry( 0, 0, desk.width(), desk.height() ); |
96 | 129 | ||
97 | // the authentication has already succeeded (without win interactions) | 130 | // the authentication has already succeeded (without win interactions) |
98 | if ( win.isAlreadyDone() ) | 131 | if ( win.isAlreadyDone() ) |
99 | return; | 132 | return; |
100 | 133 | ||
101 | win.exec(); | 134 | win.exec(); |
102 | } | 135 | } |
103 | 136 | ||
104 | } | 137 | } |
105 | } | 138 | } |
diff --git a/libopie2/opiesecurity/multiauthpassword.h b/libopie2/opiesecurity/multiauthpassword.h index fe276da..effdaa1 100644 --- a/libopie2/opiesecurity/multiauthpassword.h +++ b/libopie2/opiesecurity/multiauthpassword.h | |||
@@ -1,59 +1,65 @@ | |||
1 | /** | 1 | /** |
2 | * \file multiauthpassword.h | 2 | * \file multiauthpassword.h |
3 | * \brief Password Dialog dropin. | 3 | * \brief Password Dialog dropin. |
4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) | 4 | * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr) |
5 | */ | 5 | */ |
6 | /* | 6 | /* |
7 | =. This file is part of the Opie Project | 7 | =. This file is part of the Opie Project |
8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> | 8 | .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This library is free software; you can | 10 | _;:, .> :=|. This library is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This library is distributed in the hope that | 17 | .i_,=:_. -<s. This library is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | 34 | ||
35 | #ifndef OPIE_SEC_MULTIAUTHPASSWORD_H | 35 | #ifndef OPIE_SEC_MULTIAUTHPASSWORD_H |
36 | #define OPIE_SEC_MULTIAUTHPASSWORD_H | 36 | #define OPIE_SEC_MULTIAUTHPASSWORD_H |
37 | 37 | ||
38 | namespace Opie { | 38 | namespace Opie { |
39 | namespace Security { | 39 | namespace Security { |
40 | 40 | ||
41 | enum lockMode { | ||
42 | IfPowerOn, | ||
43 | IfResume, | ||
44 | TestNow, | ||
45 | LockNow }; | ||
41 | /** | 46 | /** |
42 | * This is the dropin replacement for the libqpe Password class. | 47 | * This is the dropin replacement for the libqpe Password class. |
43 | * If you call authenticate() a widget will cover the whole screen | 48 | * If you call authenticate() a widget will cover the whole screen |
44 | * and only return if the user is able to authenticate with any of the | 49 | * and only return if the user is able to authenticate with any of the |
45 | * configured Authentication Plugins. | 50 | * configured Authentication Plugins. |
46 | * It uses the Opie::Security::MultiauthMainWindow QDialog internally. | 51 | * It uses the Opie::Security::MultiauthMainWindow QDialog internally. |
47 | * | 52 | * |
48 | * @author Clement Séveillac, Holger Freyther | 53 | * @author Clement Séveillac, Holger Freyther |
49 | */ | 54 | */ |
50 | class MultiauthPassword { | 55 | class MultiauthPassword { |
56 | |||
51 | public: | 57 | public: |
52 | static bool needToAuthenticate( bool atpoweron = false ); | 58 | static void authenticate(int authMode = LockNow); |
53 | static void authenticate(bool atpoweron = false); | 59 | static bool needToAuthenticate( bool atpoweron = false ); |
54 | }; | 60 | }; |
55 | 61 | ||
56 | 62 | ||
57 | } | 63 | } |
58 | } | 64 | } |
59 | #endif | 65 | #endif |
@@ -1,240 +1,241 @@ | |||
1 | CONFIG_ABOUTAPPLET core/applets/aboutappletaboutapplet.pro | 1 | CONFIG_ABOUTAPPLET core/applets/aboutappletaboutapplet.pro |
2 | CONFIG_ADDRESSBOOK core/pim/addressbookaddressbook.pro | 2 | CONFIG_ADDRESSBOOK core/pim/addressbookaddressbook.pro |
3 | CONFIG_ADVANCEDFM noncore/apps/advancedfmadvancedfm.pro | 3 | CONFIG_ADVANCEDFM noncore/apps/advancedfmadvancedfm.pro |
4 | CONFIG_APPEARANCE2 noncore/settings/appearance2appearance2.pro | 4 | CONFIG_APPEARANCE2 noncore/settings/appearance2appearance2.pro |
5 | CONFIG_APPLET_EXAMPLE examples/applet example.pro | 5 | CONFIG_APPLET_EXAMPLE examples/applet example.pro |
6 | CONFIG_APPSKEY noncore/settings/appskeyappskey.pro | 6 | CONFIG_APPSKEY noncore/settings/appskeyappskey.pro |
7 | CONFIG_AQPKG noncore/settings/aqpkgaqpkg.pro | 7 | CONFIG_AQPKG noncore/settings/aqpkgaqpkg.pro |
8 | CONFIG_AUTOROTATEAPPLET noncore/applets/autorotateappletautorotateapplet.pro | 8 | CONFIG_AUTOROTATEAPPLET noncore/applets/autorotateappletautorotateapplet.pro |
9 | CONFIG_BACKGAMMONnoncore/games/backgammon backgammon.pro | 9 | CONFIG_BACKGAMMONnoncore/games/backgammon backgammon.pro |
10 | CONFIG_BACKUP noncore/settings/backupbackup.pro | 10 | CONFIG_BACKUP noncore/settings/backupbackup.pro |
11 | CONFIG_BARTENDER noncore/apps/opie-bartenderbartender.pro | 11 | CONFIG_BARTENDER noncore/apps/opie-bartenderbartender.pro |
12 | CONFIG_BATTERYAPPLET core/applets/batteryappletbatteryapplet.pro | 12 | CONFIG_BATTERYAPPLET core/applets/batteryappletbatteryapplet.pro |
13 | CONFIG_BEND noncore/unsupported/mail2/bendbend.pro | 13 | CONFIG_BEND noncore/unsupported/mail2/bendbend.pro |
14 | CONFIG_BIGSCREEN_EXAMPLE libopie/big-screen/example osplitter_mail.pro | 14 | CONFIG_BIGSCREEN_EXAMPLE libopie/big-screen/example osplitter_mail.pro |
15 | CONFIG_BINARY noncore/tools/calc2/binarybinary.pro | 15 | CONFIG_BINARY noncore/tools/calc2/binarybinary.pro |
16 | CONFIG_BLUE-PIN noncore/net/opietooth/blue-pinblue-pin.pro | 16 | CONFIG_BLUE-PIN noncore/net/opietooth/blue-pinblue-pin.pro |
17 | CONFIG_BOUNCE noncore/games/bouncebounce.pro | 17 | CONFIG_BOUNCE noncore/games/bouncebounce.pro |
18 | CONFIG_BRIGHTNESSAPPLET noncore/applets/brightnessappletbrightnessapplet.pro | 18 | CONFIG_BRIGHTNESSAPPLET noncore/applets/brightnessappletbrightnessapplet.pro |
19 | CONFIG_BUTTON-SETTINGS core/settings/buttonbutton.pro | 19 | CONFIG_BUTTON-SETTINGS core/settings/buttonbutton.pro |
20 | CONFIG_BUZZWORD noncore/games/buzzwordbuzzword.pro | 20 | CONFIG_BUZZWORD noncore/games/buzzwordbuzzword.pro |
21 | CONFIG_CALC2 noncore/tools/calc2calc.pro | 21 | CONFIG_CALC2 noncore/tools/calc2calc.pro |
22 | CONFIG_CALCULATOR noncore/tools/calculatorcalculator.pro | 22 | CONFIG_CALCULATOR noncore/tools/calculatorcalculator.pro |
23 | CONFIG_CALIBRATE core/apps/calibratecalibrate.pro | 23 | CONFIG_CALIBRATE core/apps/calibratecalibrate.pro |
24 | CONFIG_CAMERA noncore/multimedia/cameracamera.pro | 24 | CONFIG_CAMERA noncore/multimedia/cameracamera.pro |
25 | CONFIG_CARDMON core/applets/cardmoncardmon.pro | 25 | CONFIG_CARDMON core/applets/cardmoncardmon.pro |
26 | CONFIG_CHECKBOOK noncore/apps/checkbookcheckbook.pro | 26 | CONFIG_CHECKBOOK noncore/apps/checkbookcheckbook.pro |
27 | CONFIG_CITYTIME core/settings/citytimecitytime.pro | 27 | CONFIG_CITYTIME core/settings/citytimecitytime.pro |
28 | CONFIG_CLIPBOARDAPPLET core/applets/clipboardappletclipboardapplet.pro | 28 | CONFIG_CLIPBOARDAPPLET core/applets/clipboardappletclipboardapplet.pro |
29 | CONFIG_CLOCKAPPLET core/applets/clockappletclockapplet.pro | 29 | CONFIG_CLOCKAPPLET core/applets/clockappletclockapplet.pro |
30 | CONFIG_CLOCK noncore/tools/clockclock.pro | 30 | CONFIG_CLOCK noncore/tools/clockclock.pro |
31 | CONFIG_CONFEDIT noncore/apps/confeditconfedit.pro | 31 | CONFIG_CONFEDIT noncore/apps/confeditconfedit.pro |
32 | CONFIG_DAGGER noncore/apps/dagger dagger.pro | 32 | CONFIG_DAGGER noncore/apps/dagger dagger.pro |
33 | CONFIG_DASHER inputmethods/dasherdasher.pro | 33 | CONFIG_DASHER inputmethods/dasherdasher.pro |
34 | CONFIG_DATEBOOK2 core/pim/datebook2datebook2.pro | 34 | CONFIG_DATEBOOK2 core/pim/datebook2datebook2.pro |
35 | CONFIG_DATEBOOK core/pim/datebookdatebook.pro | 35 | CONFIG_DATEBOOK core/pim/datebookdatebook.pro |
36 | CONFIG_DECO_FLAT noncore/decorations/flatflat.pro | 36 | CONFIG_DECO_FLAT noncore/decorations/flatflat.pro |
37 | CONFIG_DECO_LIQUID noncore/decorations/liquidliquid.pro | 37 | CONFIG_DECO_LIQUID noncore/decorations/liquidliquid.pro |
38 | CONFIG_DECO_POLISHED noncore/decorations/polishedpolished.pro | 38 | CONFIG_DECO_POLISHED noncore/decorations/polishedpolished.pro |
39 | CONFIG_DICTIONARY noncore/apps/dictionarydictionary.pro | 39 | CONFIG_DICTIONARY noncore/apps/dictionarydictionary.pro |
40 | CONFIG_DOCTAB noncore/settings/doctab doctab.pro | 40 | CONFIG_DOCTAB noncore/settings/doctab doctab.pro |
41 | CONFIG_DRAWPAD noncore/graphics/drawpaddrawpad.pro | 41 | CONFIG_DRAWPAD noncore/graphics/drawpaddrawpad.pro |
42 | CONFIG_DVORAK inputmethods/dvorakdvorak.pro | 42 | CONFIG_DVORAK inputmethods/dvorakdvorak.pro |
43 | CONFIG_EMBEDDEDKONSOLE core/apps/embeddedkonsoleembeddedkonsole.pro | 43 | CONFIG_EMBEDDEDKONSOLE core/apps/embeddedkonsoleembeddedkonsole.pro |
44 | CONFIG_EUROCONV noncore/tools/euroconv/ euroconv.pro | 44 | CONFIG_EUROCONV noncore/tools/euroconv/ euroconv.pro |
45 | CONFIG_EXAMPLE_BOARD examples/inputmethod example.pro | 45 | CONFIG_EXAMPLE_BOARD examples/inputmethod example.pro |
46 | CONFIG_EXAMPLE_MENU examples/menuapplet menuapplet.pro | 46 | CONFIG_EXAMPLE_MENU examples/menuapplet menuapplet.pro |
47 | CONFIG_EXAMPLE_VPN examples/networksettings example.pro | 47 | CONFIG_EXAMPLE_VPN examples/networksettings example.pro |
48 | CONFIG_FIFTEEN noncore/games/fifteenfifteen.pro | 48 | CONFIG_FIFTEEN noncore/games/fifteenfifteen.pro |
49 | CONFIG_FILEBROWSER noncore/unsupported/filebrowserfilebrowser.pro | 49 | CONFIG_FILEBROWSER noncore/unsupported/filebrowserfilebrowser.pro |
50 | CONFIG_FLAT noncore/styles/flatflat.pro | 50 | CONFIG_FLAT noncore/styles/flatflat.pro |
51 | CONFIG_FORMATTER noncore/tools/formatterformatter.pro | 51 | CONFIG_FORMATTER noncore/tools/formatterformatter.pro |
52 | CONFIG_FREETYPE freetypefreetype.pro | 52 | CONFIG_FREETYPE freetypefreetype.pro |
53 | CONFIG_FRESH noncore/styles/freshfresh.pro | 53 | CONFIG_FRESH noncore/styles/freshfresh.pro |
54 | CONFIG_FTPLIB noncore/net/ftplibftplib.pro | 54 | CONFIG_FTPLIB noncore/net/ftplibftplib.pro |
55 | CONFIG_GO noncore/games/gogo.pro | 55 | CONFIG_GO noncore/games/gogo.pro |
56 | CONFIG_GSMTOOL noncore/unsupported/gsmtoolgsmtool.pro | 56 | CONFIG_GSMTOOL noncore/unsupported/gsmtoolgsmtool.pro |
57 | CONFIG_GUTENBROWSER noncore/apps/opie-gutenbrowseropie-gutenbrowser.pro | 57 | CONFIG_GUTENBROWSER noncore/apps/opie-gutenbrowseropie-gutenbrowser.pro |
58 | CONFIG_HANDWRITING inputmethods/handwritinghandwriting.pro | 58 | CONFIG_HANDWRITING inputmethods/handwritinghandwriting.pro |
59 | CONFIG_HELPBROWSER core/apps/helpbrowserhelpbrowser.pro | 59 | CONFIG_HELPBROWSER core/apps/helpbrowserhelpbrowser.pro |
60 | CONFIG_HOMEAPPLET core/applets/homeapplethomeapplet.pro | 60 | CONFIG_HOMEAPPLET core/applets/homeapplethomeapplet.pro |
61 | CONFIG_INTERFACES noncore/settings/networksettings/interfacesinterfaces.pro | 61 | CONFIG_INTERFACES noncore/settings/networksettings/interfacesinterfaces.pro |
62 | CONFIG_IRDAAPPLET core/applets/irdaappletirdaapplet.pro | 62 | CONFIG_IRDAAPPLET core/applets/irdaappletirdaapplet.pro |
63 | CONFIG_JUMPX inputmethods/jumpxjumpx.pro | 63 | CONFIG_JUMPX inputmethods/jumpxjumpx.pro |
64 | CONFIG_KBILL noncore/games/kbillkbill.pro | 64 | CONFIG_KBILL noncore/games/kbillkbill.pro |
65 | CONFIG_KCHECKERS noncore/games/kcheckerskcheckers.pro | 65 | CONFIG_KCHECKERS noncore/games/kcheckerskcheckers.pro |
66 | CONFIG_KEYBOARD inputmethods/keyboardkeyboard.pro | 66 | CONFIG_KEYBOARD inputmethods/keyboardkeyboard.pro |
67 | CONFIG_KEYPEBBLE noncore/comm/keypebblekeypebble.pro | 67 | CONFIG_KEYPEBBLE noncore/comm/keypebblekeypebble.pro |
68 | CONFIG_KEYVIEW development/keyviewkeyview.pro | 68 | CONFIG_KEYVIEW development/keyviewkeyview.pro |
69 | CONFIG_KJUMPX inputmethods/kjumpxkjumpx.pro | 69 | CONFIG_KJUMPX inputmethods/kjumpxkjumpx.pro |
70 | CONFIG_KPACMAN noncore/games/kpacmankpacman.pro | 70 | CONFIG_KPACMAN noncore/games/kpacmankpacman.pro |
71 | CONFIG_LANGUAGE noncore/settings/languagelanguage.pro | 71 | CONFIG_LANGUAGE noncore/settings/languagelanguage.pro |
72 | CONFIG_LAUNCHER core/launcherserver.pro | 72 | CONFIG_LAUNCHER core/launcherserver.pro |
73 | CONFIG_LAUNCHER-SETTINGS core/settings/launcherlauncher.pro | 73 | CONFIG_LAUNCHER-SETTINGS core/settings/launcherlauncher.pro |
74 | CONFIG_LIBFFMPEG core/multimedia/opieplayer/libffmpeglibffmpeg.pro | 74 | CONFIG_LIBFFMPEG core/multimedia/opieplayer/libffmpeglibffmpeg.pro |
75 | CONFIG_LIBFLASH core/multimedia/opieplayer/libflashlibflash.pro | 75 | CONFIG_LIBFLASH core/multimedia/opieplayer/libflashlibflash.pro |
76 | CONFIG_LIBMAD core/multimedia/opieplayer/libmadlibmad.pro | 76 | CONFIG_LIBMAD core/multimedia/opieplayer/libmadlibmad.pro |
77 | CONFIG_LIBMAIL noncore/unsupported/mail2/libmaillibmail.pro | 77 | CONFIG_LIBMAIL noncore/unsupported/mail2/libmaillibmail.pro |
78 | CONFIG_LIBMAILWRAPPER noncore/net/mail/libmailwrapper libmailwrapper.pro | 78 | CONFIG_LIBMAILWRAPPER noncore/net/mail/libmailwrapper libmailwrapper.pro |
79 | CONFIG_LIBMPEG3 core/multimedia/opieplayer/libmpeg3libmpeg3.pro | 79 | CONFIG_LIBMPEG3 core/multimedia/opieplayer/libmpeg3libmpeg3.pro |
80 | CONFIG_LIBOPIE2CORE libopie2/opiecoreopiecore.pro | 80 | CONFIG_LIBOPIE2CORE libopie2/opiecoreopiecore.pro |
81 | CONFIG_LIBOPIE2DB libopie2/opiedbopiedb.pro | 81 | CONFIG_LIBOPIE2DB libopie2/opiedbopiedb.pro |
82 | CONFIG_LIBOPIE2EXAMPLES libopie2/examplesexamples.pro | 82 | CONFIG_LIBOPIE2EXAMPLES libopie2/examplesexamples.pro |
83 | CONFIG_LIBOPIE2MM libopie2/opiemmopiemm.pro | 83 | CONFIG_LIBOPIE2MM libopie2/opiemmopiemm.pro |
84 | CONFIG_LIBOPIE2NET libopie2/opienetopienet.pro | 84 | CONFIG_LIBOPIE2NET libopie2/opienetopienet.pro |
85 | CONFIG_LIBOPIE2PIM libopie2/opiepimopiepim.pro | 85 | CONFIG_LIBOPIE2PIM libopie2/opiepimopiepim.pro |
86 | CONFIG_LIBOPIE2SECURITYlibopie2/opiesecurity opiesecurity.pro | 86 | CONFIG_LIBOPIE2SECURITYlibopie2/opiesecurity opiesecurity.pro |
87 | CONFIG_LIBOPIE2UI libopie2/opieuiopieui.pro | 87 | CONFIG_LIBOPIE2UI libopie2/opieuiopieui.pro |
88 | CONFIG_LIBOPIE libopielibopie.pro | 88 | CONFIG_LIBOPIE libopielibopie.pro |
89 | CONFIG_LIBOPIE_PIM libopie/pimpim.pro | 89 | CONFIG_LIBOPIE_PIM libopie/pimpim.pro |
90 | CONFIG_LIBOPIETOOTH noncore/net/opietooth/liblib.pro | 90 | CONFIG_LIBOPIETOOTH noncore/net/opietooth/liblib.pro |
91 | CONFIG_LIBQPE librarylibrary.pro | 91 | CONFIG_LIBQPE librarylibrary.pro |
92 | CONFIG_LIBQPE-X11 x11/libqpe-x11libqpe-x11.pro | 92 | CONFIG_LIBQPE-X11 x11/libqpe-x11libqpe-x11.pro |
93 | CONFIG_LIBQRSYNC rsync rsync.pro | 93 | CONFIG_LIBQRSYNC rsync rsync.pro |
94 | CONFIG_LIBQTAUX libqtauxlibqtaux.pro | 94 | CONFIG_LIBQTAUX libqtauxlibqtaux.pro |
95 | CONFIG_LIBSLCOMPAT libslcompatlibslcompat.pro | 95 | CONFIG_LIBSLCOMPAT libslcompatlibslcompat.pro |
96 | CONFIG_LIBSQL libsqllibsql.pro | 96 | CONFIG_LIBSQL libsqllibsql.pro |
97 | CONFIG_LIBTREMOR core/multimedia/opieplayer/vorbis/tremor tremor.pro | 97 | CONFIG_LIBTREMOR core/multimedia/opieplayer/vorbis/tremor tremor.pro |
98 | CONFIG_LIBTREMORPLUGIN core/multimedia/opieplayer/vorbis libtremor.pro | 98 | CONFIG_LIBTREMORPLUGIN core/multimedia/opieplayer/vorbis libtremor.pro |
99 | CONFIG_LIGHT-AND-POWER core/settings/light-and-powerlight-and-power.pro | 99 | CONFIG_LIGHT-AND-POWER core/settings/light-and-powerlight-and-power.pro |
100 | CONFIG_LIQUID noncore/styles/liquidliquid.pro | 100 | CONFIG_LIQUID noncore/styles/liquidliquid.pro |
101 | CONFIG_LOCKAPPLET core/applets/lockappletlockapplet.pro | ||
101 | CONFIG_LOGOUTAPPLET core/applets/logoutappletlogoutapplet.pro | 102 | CONFIG_LOGOUTAPPLET core/applets/logoutappletlogoutapplet.pro |
102 | CONFIG_MAIL3 noncore/net/mail mail.pro | 103 | CONFIG_MAIL3 noncore/net/mail mail.pro |
103 | CONFIG_MAILAPPLET noncore/net/mail/taskbarapplet taskbarapplet.pro | 104 | CONFIG_MAILAPPLET noncore/net/mail/taskbarapplet taskbarapplet.pro |
104 | CONFIG_MAILIT noncore/unsupported/mailit mailit.pro | 105 | CONFIG_MAILIT noncore/unsupported/mailit mailit.pro |
105 | CONFIG_MAIN_TAB_EXAMPLE examples/main-tab example.pro | 106 | CONFIG_MAIN_TAB_EXAMPLE examples/main-tab example.pro |
106 | CONFIG_MEDIUMMOUNT noncore/settings/mediummountmediummount.pro | 107 | CONFIG_MEDIUMMOUNT noncore/settings/mediummountmediummount.pro |
107 | CONFIG_MEMORYAPPLET noncore/applets/memoryappletmemoryapplet.pro | 108 | CONFIG_MEMORYAPPLET noncore/applets/memoryappletmemoryapplet.pro |
108 | CONFIG_METAL noncore/styles/metalmetal.pro | 109 | CONFIG_METAL noncore/styles/metalmetal.pro |
109 | CONFIG_MINDBREAKER noncore/games/mindbreakermindbreaker.pro | 110 | CONFIG_MINDBREAKER noncore/games/mindbreakermindbreaker.pro |
110 | CONFIG_MINESWEEP noncore/games/minesweepminesweep.pro | 111 | CONFIG_MINESWEEP noncore/games/minesweepminesweep.pro |
111 | CONFIG_MOBILEMSG noncore/comm/mobilemsgmobilemsg.pro | 112 | CONFIG_MOBILEMSG noncore/comm/mobilemsgmobilemsg.pro |
112 | CONFIG_MODPLUG core/multimedia/opieplayer/modplugmodplug.pro | 113 | CONFIG_MODPLUG core/multimedia/opieplayer/modplugmodplug.pro |
113 | CONFIG_MULTIAUTH_BLUEPING noncore/securityplugins/blueping bluepingplugin.pro | 114 | CONFIG_MULTIAUTH_BLUEPING noncore/securityplugins/blueping bluepingplugin.pro |
114 | CONFIG_MULTIAUTH_DUMMY noncore/securityplugins/dummy dummyplugin.pro | 115 | CONFIG_MULTIAUTH_DUMMY noncore/securityplugins/dummy dummyplugin.pro |
115 | CONFIG_MULTIAUTH_NOTICE noncore/securityplugins/notice noticeplugin.pro | 116 | CONFIG_MULTIAUTH_NOTICE noncore/securityplugins/notice noticeplugin.pro |
116 | CONFIG_MULTIAUTH_PIN noncore/securityplugins/pin pinplugin.pro | 117 | CONFIG_MULTIAUTH_PIN noncore/securityplugins/pin pinplugin.pro |
117 | CONFIG_MULTIKEYAPPLET core/applets/multikeyappletmultikeyapplet.pro | 118 | CONFIG_MULTIKEYAPPLET core/applets/multikeyappletmultikeyapplet.pro |
118 | CONFIG_MULTIKEY inputmethods/multikeymultikey.pro | 119 | CONFIG_MULTIKEY inputmethods/multikeymultikey.pro |
119 | CONFIG_NETSYSTEMTIME noncore/settings/netsystemtimenetsystemtime.pro | 120 | CONFIG_NETSYSTEMTIME noncore/settings/netsystemtimenetsystemtime.pro |
120 | CONFIG_NETWORKAPPLET noncore/applets/networkappletnetworkapplet.pro | 121 | CONFIG_NETWORKAPPLET noncore/applets/networkappletnetworkapplet.pro |
121 | CONFIG_NETWORKSETUP noncore/settings/networksettingsnetworksettings.pro | 122 | CONFIG_NETWORKSETUP noncore/settings/networksettingsnetworksettings.pro |
122 | CONFIG_NOTESAPPLET noncore/applets/notesappletnotesapplet.pro | 123 | CONFIG_NOTESAPPLET noncore/applets/notesappletnotesapplet.pro |
123 | CONFIG_NS2BT noncore/settings/networksettings2/bluetoothbluetooth.pro | 124 | CONFIG_NS2BT noncore/settings/networksettings2/bluetoothbluetooth.pro |
124 | CONFIG_NS2CABLE noncore/settings/networksettings2/cablecable.pro | 125 | CONFIG_NS2CABLE noncore/settings/networksettings2/cablecable.pro |
125 | CONFIG_NS2CORE noncore/settings/networksettings2/networksettings2networksettings2.pro | 126 | CONFIG_NS2CORE noncore/settings/networksettings2/networksettings2networksettings2.pro |
126 | CONFIG_NS2IRDA noncore/settings/networksettings2/irdairda.pro | 127 | CONFIG_NS2IRDA noncore/settings/networksettings2/irdairda.pro |
127 | CONFIG_NS2LANCARD noncore/settings/networksettings2/lancardlancard.pro | 128 | CONFIG_NS2LANCARD noncore/settings/networksettings2/lancardlancard.pro |
128 | CONFIG_NS2MODEM noncore/settings/networksettings2/modemmodem.pro | 129 | CONFIG_NS2MODEM noncore/settings/networksettings2/modemmodem.pro |
129 | CONFIG_NS2NETWORK noncore/settings/networksettings2/networknetwork.pro | 130 | CONFIG_NS2NETWORK noncore/settings/networksettings2/networknetwork.pro |
130 | CONFIG_NS2 noncore/settings/networksettings2networksettings.pro | 131 | CONFIG_NS2 noncore/settings/networksettings2networksettings.pro |
131 | CONFIG_NS2PPP noncore/settings/networksettings2/pppppp.pro | 132 | CONFIG_NS2PPP noncore/settings/networksettings2/pppppp.pro |
132 | CONFIG_NS2PROFILE noncore/settings/networksettings2/profileprofile.pro | 133 | CONFIG_NS2PROFILE noncore/settings/networksettings2/profileprofile.pro |
133 | CONFIG_NS2USB noncore/settings/networksettings2/usbusb.pro | 134 | CONFIG_NS2USB noncore/settings/networksettings2/usbusb.pro |
134 | CONFIG_NS2VPN noncore/settings/networksettings2/vpnvpn.pro | 135 | CONFIG_NS2VPN noncore/settings/networksettings2/vpnvpn.pro |
135 | CONFIG_NS2WLAN noncore/settings/networksettings2/wlanwlan.pro | 136 | CONFIG_NS2WLAN noncore/settings/networksettings2/wlanwlan.pro |
136 | CONFIG_OAPP core/apps/oappoapp.pro | 137 | CONFIG_OAPP core/apps/oappoapp.pro |
137 | CONFIG_OBEX core/obexobex.pro | 138 | CONFIG_OBEX core/obexobex.pro |
138 | CONFIG_ODICT noncore/apps/odictodict.pro | 139 | CONFIG_ODICT noncore/apps/odictodict.pro |
139 | CONFIG_OIPKG noncore/unsupported/oipkgoipkg.pro | 140 | CONFIG_OIPKG noncore/unsupported/oipkgoipkg.pro |
140 | CONFIG_OPIEALARM core/opiealarmopiealarm.pro | 141 | CONFIG_OPIEALARM core/opiealarmopiealarm.pro |
141 | CONFIG_OPIE-CONSOLE noncore/apps/opie-consoleopie-console.pro | 142 | CONFIG_OPIE-CONSOLE noncore/apps/opie-consoleopie-console.pro |
142 | CONFIG_OPIE_EYE noncore/graphics/opie-eyephunk_view.pro | 143 | CONFIG_OPIE_EYE noncore/graphics/opie-eyephunk_view.pro |
143 | CONFIG_OPIE_EYE_SLAVE noncore/graphics/opie-eye/slaveslave.pro | 144 | CONFIG_OPIE_EYE_SLAVE noncore/graphics/opie-eye/slaveslave.pro |
144 | CONFIG_OPIEFTP noncore/net/opieftpopieftp.pro | 145 | CONFIG_OPIEFTP noncore/net/opieftpopieftp.pro |
145 | CONFIG_OPIEIRC noncore/net/opieircopieirc.pro | 146 | CONFIG_OPIEIRC noncore/net/opieircopieirc.pro |
146 | CONFIG_OPIE-LOGIN core/opie-loginopie-login.pro | 147 | CONFIG_OPIE-LOGIN core/opie-loginopie-login.pro |
147 | CONFIG_OPIEMAIL2noncore/unsupported/mail2 mail.pro | 148 | CONFIG_OPIEMAIL2noncore/unsupported/mail2 mail.pro |
148 | CONFIG_OPIEPLAYER2 noncore/multimedia/opieplayer2opieplayer2.pro | 149 | CONFIG_OPIEPLAYER2 noncore/multimedia/opieplayer2opieplayer2.pro |
149 | CONFIG_OPIEPLAYER core/multimedia/opieplayeropieplayer.pro | 150 | CONFIG_OPIEPLAYER core/multimedia/opieplayeropieplayer.pro |
150 | CONFIG_OPIE-RDESKTOP noncore/net/opierdesktopopierdesktop.pro | 151 | CONFIG_OPIE-RDESKTOP noncore/net/opierdesktopopierdesktop.pro |
151 | CONFIG_OPIE-READER noncore/apps/opie-readeropie-reader.pro | 152 | CONFIG_OPIE-READER noncore/apps/opie-readeropie-reader.pro |
152 | CONFIG_OPIEREC noncore/multimedia/opierecopierec.pro | 153 | CONFIG_OPIEREC noncore/multimedia/opierecopierec.pro |
153 | CONFIG_OPIE-SHEET noncore/apps/opie-sheetopie-sheet.pro | 154 | CONFIG_OPIE-SHEET noncore/apps/opie-sheetopie-sheet.pro |
154 | CONFIG_OPIE-SH noncore/tools/opie-shopie-sh.pro | 155 | CONFIG_OPIE-SH noncore/tools/opie-shopie-sh.pro |
155 | CONFIG_OPIETOOTH-APPLET noncore/net/opietooth/appletapplet.pro | 156 | CONFIG_OPIETOOTH-APPLET noncore/net/opietooth/appletapplet.pro |
156 | CONFIG_OPIETOOTH-MANAGER noncore/net/opietooth/managermanager.pro | 157 | CONFIG_OPIETOOTH-MANAGER noncore/net/opietooth/managermanager.pro |
157 | CONFIG_OPIE-WRITE noncore/apps/opie-writeopie-write.pro | 158 | CONFIG_OPIE-WRITE noncore/apps/opie-writeopie-write.pro |
158 | CONFIG_OSEARCH core/pim/osearchosearch.pro | 159 | CONFIG_OSEARCH core/pim/osearchosearch.pro |
159 | CONFIG_OXYGEN noncore/apps/oxygenoxygen.pro | 160 | CONFIG_OXYGEN noncore/apps/oxygenoxygen.pro |
160 | CONFIG_PACKAGEMANAGER noncore/settings/packagemanagerpackagemanager.pro | 161 | CONFIG_PACKAGEMANAGER noncore/settings/packagemanagerpackagemanager.pro |
161 | CONFIG_PARASHOOT noncore/games/parashootparashoot.pro | 162 | CONFIG_PARASHOOT noncore/games/parashootparashoot.pro |
162 | CONFIG_PHASE noncore/styles/phasephase.pro | 163 | CONFIG_PHASE noncore/styles/phasephase.pro |
163 | CONFIG_PICKBOARD inputmethods/pickboardpickboard.pro | 164 | CONFIG_PICKBOARD inputmethods/pickboardpickboard.pro |
164 | CONFIG_PIMCONVERTER noncore/tools/pimconverter converter.pro | 165 | CONFIG_PIMCONVERTER noncore/tools/pimconverter converter.pro |
165 | CONFIG_POWERCHORD noncore/multimedia/powerchordpowerchord.pro | 166 | CONFIG_POWERCHORD noncore/multimedia/powerchordpowerchord.pro |
166 | CONFIG_PPP noncore/settings/networksettings/ppp ppp.pro | 167 | CONFIG_PPP noncore/settings/networksettings/ppp ppp.pro |
167 | CONFIG_PYQUICKLAUNCH-APPLET noncore/applets/pyquicklaunchpyquicklaunch.pro | 168 | CONFIG_PYQUICKLAUNCH-APPLET noncore/applets/pyquicklaunchpyquicklaunch.pro |
168 | CONFIG_PYQUICKLAUNCHER noncore/tools/pyquicklauncherpyquicklauncher.pro | 169 | CONFIG_PYQUICKLAUNCHER noncore/tools/pyquicklauncherpyquicklauncher.pro |
169 | CONFIG_PYTHON-EXAMPLESexamples/python bla.pro | 170 | CONFIG_PYTHON-EXAMPLESexamples/python bla.pro |
170 | CONFIG_QASHMONEY noncore/apps/qashmoneyqashmoney.pro | 171 | CONFIG_QASHMONEY noncore/apps/qashmoneyqashmoney.pro |
171 | CONFIG_QASTEROIDS noncore/games/qasteroidsqasteroids.pro | 172 | CONFIG_QASTEROIDS noncore/games/qasteroidsqasteroids.pro |
172 | CONFIG_QCOP core/apps/qcopqcop.pro | 173 | CONFIG_QCOP core/apps/qcopqcop.pro |
173 | CONFIG_QPDF noncore/unsupported/qpdfqpdf.pro | 174 | CONFIG_QPDF noncore/unsupported/qpdfqpdf.pro |
174 | CONFIG_QUICKLAUNCHER core/tools/quicklauncher quicklauncher.pro | 175 | CONFIG_QUICKLAUNCHER core/tools/quicklauncher quicklauncher.pro |
175 | CONFIG_QWS core/qwsqws.pro | 176 | CONFIG_QWS core/qwsqws.pro |
176 | CONFIG_REMOTE noncore/tools/remoteremote.pro | 177 | CONFIG_REMOTE noncore/tools/remoteremote.pro |
177 | CONFIG_RESTARTAPPLET2 core/applets/restartapplet2restartapplet2.pro | 178 | CONFIG_RESTARTAPPLET2 core/applets/restartapplet2restartapplet2.pro |
178 | CONFIG_RESTARTAPPLET core/applets/restartappletrestartapplet.pro | 179 | CONFIG_RESTARTAPPLET core/applets/restartappletrestartapplet.pro |
179 | CONFIG_ROTATEAPPLET core/applets/rotateappletrotateapplet.pro | 180 | CONFIG_ROTATEAPPLET core/applets/rotateappletrotateapplet.pro |
180 | CONFIG_ROTATION noncore/settings/rotationrotation.pro | 181 | CONFIG_ROTATION noncore/settings/rotationrotation.pro |
181 | CONFIG_RUNAPPLET core/applets/runappletrunapplet.pro | 182 | CONFIG_RUNAPPLET core/applets/runappletrunapplet.pro |
182 | CONFIG_SCREENSHOTAPPLET core/applets/screenshotappletscreenshotapplet.pro | 183 | CONFIG_SCREENSHOTAPPLET core/applets/screenshotappletscreenshotapplet.pro |
183 | CONFIG_SECURITY core/settings/securitysecurity.pro | 184 | CONFIG_SECURITY core/settings/securitysecurity.pro |
184 | CONFIG_MULTIAUTH_DEMO core/settings/security/demomultiauth.pro | 185 | CONFIG_MULTIAUTH_DEMO core/settings/security/demomultiauth.pro |
185 | CONFIG_SFCAVE noncore/games/sfcavesfcave.pro | 186 | CONFIG_SFCAVE noncore/games/sfcavesfcave.pro |
186 | CONFIG_SFCAVE-SDL noncore/games/sfcave-sdlsfcave-sdl.pro | 187 | CONFIG_SFCAVE-SDL noncore/games/sfcave-sdlsfcave-sdl.pro |
187 | CONFIG_SHOWIMG noncore/multimedia/showimgshowimg.pro | 188 | CONFIG_SHOWIMG noncore/multimedia/showimgshowimg.pro |
188 | CONFIG_SIMPLE_EXAMPLE examples/simple example.pro | 189 | CONFIG_SIMPLE_EXAMPLE examples/simple example.pro |
189 | CONFIG_SIMPLE_ICON examples/simple-icon example.pro | 190 | CONFIG_SIMPLE_ICON examples/simple-icon example.pro |
190 | CONFIG_SIMPLE_MAIN examples/simple-main example.pro | 191 | CONFIG_SIMPLE_MAIN examples/simple-main example.pro |
191 | CONFIG_SIMPLE noncore/tools/calc2/simplesimple.pro | 192 | CONFIG_SIMPLE noncore/tools/calc2/simplesimple.pro |
192 | CONFIG_SIMPLE_PIM examples/simple-pim example.pro | 193 | CONFIG_SIMPLE_PIM examples/simple-pim example.pro |
193 | CONFIG_SINGLE singlesingle.pro | 194 | CONFIG_SINGLE singlesingle.pro |
194 | CONFIG_SNAKE noncore/games/snakesnake.pro | 195 | CONFIG_SNAKE noncore/games/snakesnake.pro |
195 | CONFIG_SOLITAIRE noncore/games/solitairesolitaire.pro | 196 | CONFIG_SOLITAIRE noncore/games/solitairesolitaire.pro |
196 | CONFIG_SOUND noncore/settings/soundsound.pro | 197 | CONFIG_SOUND noncore/settings/soundsound.pro |
197 | CONFIG_SSHKEYS noncore/settings/sshkeyssshkeys.pro | 198 | CONFIG_SSHKEYS noncore/settings/sshkeyssshkeys.pro |
198 | CONFIG_SUSPENDAPPLET core/applets/suspendappletsuspendapplet.pro | 199 | CONFIG_SUSPENDAPPLET core/applets/suspendappletsuspendapplet.pro |
199 | CONFIG_SYMLINKER core/symlinker symlinker.pro | 200 | CONFIG_SYMLINKER core/symlinker symlinker.pro |
200 | CONFIG_SYSINFO noncore/settings/sysinfosysinfo.pro | 201 | CONFIG_SYSINFO noncore/settings/sysinfosysinfo.pro |
201 | CONFIG_TABLEVIEWER noncore/apps/tableviewertableviewer.pro | 202 | CONFIG_TABLEVIEWER noncore/apps/tableviewertableviewer.pro |
202 | CONFIG_TABMANAGER noncore/settings/tabmanagertabmanager.pro | 203 | CONFIG_TABMANAGER noncore/settings/tabmanagertabmanager.pro |
203 | CONFIG_TABOAPP core/apps/taboapptaboapp.pro | 204 | CONFIG_TABOAPP core/apps/taboapptaboapp.pro |
204 | CONFIG_TEST libsql/testtest.pro | 205 | CONFIG_TEST libsql/testtest.pro |
205 | CONFIG_TEST noncore/apps/opie-console/testtest.pro | 206 | CONFIG_TEST noncore/apps/opie-console/testtest.pro |
206 | CONFIG_TETRIX noncore/games/tetrixtetrix.pro | 207 | CONFIG_TETRIX noncore/games/tetrixtetrix.pro |
207 | CONFIG_TEXTEDIT core/apps/textedittextedit.pro | 208 | CONFIG_TEXTEDIT core/apps/textedittextedit.pro |
208 | CONFIG_THEME noncore/styles/themetheme.pro | 209 | CONFIG_THEME noncore/styles/themetheme.pro |
209 | CONFIG_TICTAC noncore/games/tictactictac.pro | 210 | CONFIG_TICTAC noncore/games/tictactictac.pro |
210 | CONFIG_TINYKATE noncore/apps/tinykatetinykate.pro | 211 | CONFIG_TINYKATE noncore/apps/tinykatetinykate.pro |
211 | CONFIG_TODAY_ADDRESSBOOK core/pim/today/plugins/addressbook addressbook.pro | 212 | CONFIG_TODAY_ADDRESSBOOK core/pim/today/plugins/addressbook addressbook.pro |
212 | CONFIG_TODAY core/pim/todaytoday.pro | 213 | CONFIG_TODAY core/pim/todaytoday.pro |
213 | CONFIG_TODAY_DATEBOOK core/pim/today/plugins/datebookdatebook.pro | 214 | CONFIG_TODAY_DATEBOOK core/pim/today/plugins/datebookdatebook.pro |
214 | CONFIG_TODAY_EXAMPLE examples/todayplugin example.pro | 215 | CONFIG_TODAY_EXAMPLE examples/todayplugin example.pro |
215 | CONFIG_TODAY_FORTUNE noncore/todayplugins/fortunefortune.pro | 216 | CONFIG_TODAY_FORTUNE noncore/todayplugins/fortunefortune.pro |
216 | CONFIG_TODAY_MAIL core/pim/today/plugins/mailmail.pro | 217 | CONFIG_TODAY_MAIL core/pim/today/plugins/mailmail.pro |
217 | CONFIG_TODAY_STOCKTICKERLIB noncore/todayplugins/stockticker/stocktickerlibstocktickerlib.pro | 218 | CONFIG_TODAY_STOCKTICKERLIB noncore/todayplugins/stockticker/stocktickerlibstocktickerlib.pro |
218 | CONFIG_TODAY_STOCKTICKER noncore/todayplugins/stockticker/stocktickerstockticker.pro | 219 | CONFIG_TODAY_STOCKTICKER noncore/todayplugins/stockticker/stocktickerstockticker.pro |
219 | CONFIG_TODAY_TODOLIST core/pim/today/plugins/todolisttodolist.pro | 220 | CONFIG_TODAY_TODOLIST core/pim/today/plugins/todolisttodolist.pro |
220 | CONFIG_TODAY_WEATHERnoncore/todayplugins/weather weather.pro | 221 | CONFIG_TODAY_WEATHERnoncore/todayplugins/weather weather.pro |
221 | CONFIG_TODO core/pim/todotodo.pro | 222 | CONFIG_TODO core/pim/todotodo.pro |
222 | CONFIG_TONLEITER noncore/multimedia/tonleitertonleiter.pro | 223 | CONFIG_TONLEITER noncore/multimedia/tonleitertonleiter.pro |
223 | CONFIG_TRACKER noncore/multimedia/trackertracker.pro | 224 | CONFIG_TRACKER noncore/multimedia/trackertracker.pro |
224 | CONFIG_UBROWSER noncore/net/ubrowserubrowser.pro | 225 | CONFIG_UBROWSER noncore/net/ubrowserubrowser.pro |
225 | CONFIG_UNIKEYBOARD inputmethods/unikeyboardunikeyboard.pro | 226 | CONFIG_UNIKEYBOARD inputmethods/unikeyboardunikeyboard.pro |
226 | CONFIG_USERMANAGER noncore/settings/usermanagerusermanager.pro | 227 | CONFIG_USERMANAGER noncore/settings/usermanagerusermanager.pro |
227 | CONFIG_VMEMO core/applets/vmemovmemo.pro | 228 | CONFIG_VMEMO core/applets/vmemovmemo.pro |
228 | CONFIG_VOLUMEAPPLET core/applets/volumeappletvolumeapplet.pro | 229 | CONFIG_VOLUMEAPPLET core/applets/volumeappletvolumeapplet.pro |
229 | CONFIG_VTAPPLET core/applets/vtappletvtapplet.pro | 230 | CONFIG_VTAPPLET core/applets/vtappletvtapplet.pro |
230 | CONFIG_WAVPLUGIN core/multimedia/opieplayer/wavpluginwavplugin.pro | 231 | CONFIG_WAVPLUGIN core/multimedia/opieplayer/wavpluginwavplugin.pro |
231 | CONFIG_WEBSTYLE noncore/styles/webweb.pro | 232 | CONFIG_WEBSTYLE noncore/styles/webweb.pro |
232 | CONFIG_WELLENREITER noncore/net/wellenreiterwellenreiter.pro | 233 | CONFIG_WELLENREITER noncore/net/wellenreiterwellenreiter.pro |
233 | CONFIG_WIRELESSAPPLET noncore/applets/wirelessappletwirelessapplet.pro | 234 | CONFIG_WIRELESSAPPLET noncore/applets/wirelessappletwirelessapplet.pro |
234 | CONFIG_WLAN noncore/settings/networksettings/wlanwlan.pro | 235 | CONFIG_WLAN noncore/settings/networksettings/wlanwlan.pro |
235 | CONFIG_WORDGAME noncore/games/wordgamewordgame.pro | 236 | CONFIG_WORDGAME noncore/games/wordgamewordgame.pro |
236 | CONFIG_YATZEE noncore/games/oyatzeeoyatzee.pro | 237 | CONFIG_YATZEE noncore/games/oyatzeeoyatzee.pro |
237 | CONFIG_ZKBAPPLET noncore/applets/zkbapplet zkbapplet.pro | 238 | CONFIG_ZKBAPPLET noncore/applets/zkbapplet zkbapplet.pro |
238 | CONFIG_ZLINES noncore/games/zlines zlines.pro | 239 | CONFIG_ZLINES noncore/games/zlines zlines.pro |
239 | CONFIG_ZSAFEnoncore/apps/zsafe zsafe.pro | 240 | CONFIG_ZSAFEnoncore/apps/zsafe zsafe.pro |
240 | CONFIG_ZSAME noncore/games/zsame zsame.pro | 241 | CONFIG_ZSAME noncore/games/zsame zsame.pro |
diff --git a/pics/security/lock.png b/pics/security/lock.png new file mode 100644 index 0000000..94d1dbc --- a/dev/null +++ b/pics/security/lock.png | |||
Binary files differ | |||