summaryrefslogtreecommitdiff
path: root/core/settings
Unidiff
Diffstat (limited to 'core/settings') (more/less context) (show whitespace changes)
-rw-r--r--core/settings/launcher/tabdialog.cpp6
-rw-r--r--core/settings/security/security.cpp72
-rw-r--r--core/settings/security/security.h6
-rw-r--r--core/settings/security/securitybase.ui253
4 files changed, 306 insertions, 31 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp
index 5f68010..de99a09 100644
--- a/core/settings/launcher/tabdialog.cpp
+++ b/core/settings/launcher/tabdialog.cpp
@@ -91,9 +91,9 @@ public:
91 calculateGrid ( Bottom ); 91 calculateGrid ( Bottom );
92 92
93 93
94 new SampleItem ( this, tr( "Sample 1" ), Resource::loadPixmap ( "datebook/DateBook" )); 94 new SampleItem ( this, QObject::tr( "Sample 1" ), Resource::loadPixmap ( "datebook/DateBook" ));
95 new SampleItem ( this, tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); 95 new SampleItem ( this, QObject::tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" ));
96 new SampleItem ( this, tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); 96 new SampleItem ( this, QObject::tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" ));
97 97
98 setBackgroundType ( TabConfig::Ruled, QString::null ); 98 setBackgroundType ( TabConfig::Ruled, QString::null );
99 99
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp
index 4701506..75a181b 100644
--- a/core/settings/security/security.cpp
+++ b/core/settings/security/security.cpp
@@ -19,6 +19,7 @@
19**********************************************************************/ 19**********************************************************************/
20#include "security.h" 20#include "security.h"
21 21
22#include <qpe/qpeapplication.h>
22#include <qpe/config.h> 23#include <qpe/config.h>
23#include <qpe/password.h> 24#include <qpe/password.h>
24#include <qpe/qpedialog.h> 25#include <qpe/qpedialog.h>
@@ -27,6 +28,9 @@
27#include <qpushbutton.h> 28#include <qpushbutton.h>
28#include <qcombobox.h> 29#include <qcombobox.h>
29#include <qmessagebox.h> 30#include <qmessagebox.h>
31#include <qfile.h>
32#include <qlistview.h>
33#include <qtextstream.h>
30 34
31Security::Security( QWidget* parent, const char* name, WFlags fl ) 35Security::Security( QWidget* parent, const char* name, WFlags fl )
32 : SecurityBase( parent, name, TRUE, fl ) 36 : SecurityBase( parent, name, TRUE, fl )
@@ -56,8 +60,25 @@ Security::Security( QWidget* parent, const char* name, WFlags fl )
56 ssh->hide(); 60 ssh->hide();
57 */ 61 */
58 62
63 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf";
64 Config loginCfg(configFile,Config::File);
65
66 loginCfg.setGroup("General");
67 autoLoginName=loginCfg.readEntry("AutoLogin","");
68
69 if (autoLoginName.stripWhiteSpace().isEmpty()) {
70 autoLogin=false;
71 } else {
72 autoLogin=true;
73 }
74
75
76 connect(autologinToggle, SIGNAL(toggled(bool)), this, SLOT(toggleAutoLogin(bool)));
77 connect(userlist, SIGNAL(activated(int)), this, SLOT(changeLoginName(int)));
59 connect(changepasscode,SIGNAL(clicked()), this, SLOT(changePassCode())); 78 connect(changepasscode,SIGNAL(clicked()), this, SLOT(changePassCode()));
60 connect(clearpasscode,SIGNAL(clicked()), this, SLOT(clearPassCode())); 79 connect(clearpasscode,SIGNAL(clicked()), this, SLOT(clearPassCode()));
80
81 loadUsers();
61 updateGUI(); 82 updateGUI();
62 83
63 dl = new QPEDialogListener(this); 84 dl = new QPEDialogListener(this);
@@ -77,6 +98,10 @@ void Security::updateGUI()
77 : tr("Change passcode" ) ); 98 : tr("Change passcode" ) );
78 passcode_poweron->setEnabled( !empty ); 99 passcode_poweron->setEnabled( !empty );
79 clearpasscode->setEnabled( !empty ); 100 clearpasscode->setEnabled( !empty );
101
102 autologinToggle->setChecked(autoLogin);
103 userlist->setEnabled(autoLogin);
104
80} 105}
81 106
82 107
@@ -160,6 +185,36 @@ void Security::parseNet(const QString& sn,int& auth_peer,int& auth_peer_bits)
160 } 185 }
161} 186}
162 187
188void Security::loadUsers ( void )
189{
190 QFile passwd("/etc/passwd");
191 if ( passwd.open(IO_ReadOnly) ) {
192 QTextStream t( &passwd );
193 QString s;
194 QStringList account;
195 while ( !t.eof() ) {
196 account = QStringList::split(':',t.readLine());
197
198 // Hide disabled accounts
199 if (*account.at(1)!="*") {
200
201 userlist->insertItem(*account.at(0));
202 // Highlight this item if it is set to autologinToggle
203 if ( *account.at(0) == autoLoginName)
204 userlist->setCurrentItem(userlist->count()-1);
205 }
206 }
207 passwd.close();
208 }
209
210}
211void Security::toggleAutoLogin(bool val)
212{
213 autoLogin=val;
214 userlist->setEnabled(val);
215 if (!autoLogin)
216 autoLoginName=userlist->currentText();
217}
163void Security::setSyncNet(const QString& sn) 218void Security::setSyncNet(const QString& sn)
164{ 219{
165 int auth_peer,auth_peer_bits; 220 int auth_peer,auth_peer_bits;
@@ -189,7 +244,24 @@ void Security::applySecurity()
189 cfg.writeEntry("allow_ssh",ssh->isChecked()); 244 cfg.writeEntry("allow_ssh",ssh->isChecked());
190 // ### write ssh/telnet sys config files 245 // ### write ssh/telnet sys config files
191 */ 246 */
247
248 QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf";
249 Config loginCfg(configFile,Config::File);
250 loginCfg.setGroup("General");
251
252 if (autoLogin) {
253 loginCfg.writeEntry("AutoLogin",autoLoginName);
254 } else {
255 loginCfg.removeEntry("AutoLogin");
256 }
257
258 }
192 } 259 }
260
261void Security::changeLoginName( int idx )
262{
263 autoLoginName = userlist->text(idx);;
264 updateGUI();
193} 265}
194 266
195void Security::changePassCode() 267void Security::changePassCode()
diff --git a/core/settings/security/security.h b/core/settings/security/security.h
index efc83a2..2f18f91 100644
--- a/core/settings/security/security.h
+++ b/core/settings/security/security.h
@@ -43,8 +43,12 @@ private slots:
43 void changePassCode(); 43 void changePassCode();
44 void clearPassCode(); 44 void clearPassCode();
45 void setSyncNet(const QString&); 45 void setSyncNet(const QString&);
46 void changeLoginName(int);
47 void toggleAutoLogin(bool);
48
46 49
47private: 50private:
51 void loadUsers(void);
48 bool telnetAvailable() const; 52 bool telnetAvailable() const;
49 bool sshAvailable() const; 53 bool sshAvailable() const;
50 void updateGUI(); 54 void updateGUI();
@@ -55,6 +59,8 @@ private:
55 QString enterPassCode(const QString&); 59 QString enterPassCode(const QString&);
56 QString passcode; 60 QString passcode;
57 bool valid; 61 bool valid;
62 bool autoLogin;
63 QString autoLoginName;
58 64
59 QPEDialogListener *dl; 65 QPEDialogListener *dl;
60}; 66};
diff --git a/core/settings/security/securitybase.ui b/core/settings/security/securitybase.ui
index c2a8953..da25f39 100644
--- a/core/settings/security/securitybase.ui
+++ b/core/settings/security/securitybase.ui
@@ -11,8 +11,8 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>277</width> 14 <width>329</width>
15 <height>328</height> 15 <height>483</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
@@ -25,16 +25,63 @@
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <grid> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>3</number> 31 <number>0</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>3</number> 35 <number>0</number>
36 </property>
37 <widget>
38 <class>QTabWidget</class>
39 <property stdset="1">
40 <name>name</name>
41 <cstring>TabWidget2</cstring>
42 </property>
43 <property>
44 <name>layoutMargin</name>
36 </property> 45 </property>
37 <widget row="0" column="0" > 46 <widget>
47 <class>QWidget</class>
48 <property stdset="1">
49 <name>name</name>
50 <cstring>tab</cstring>
51 </property>
52 <attribute>
53 <name>title</name>
54 <string>Passcode</string>
55 </attribute>
56 <vbox>
57 <property stdset="1">
58 <name>margin</name>
59 <number>6</number>
60 </property>
61 <property stdset="1">
62 <name>spacing</name>
63 <number>6</number>
64 </property>
65 <widget>
66 <class>QGroupBox</class>
67 <property stdset="1">
68 <name>name</name>
69 <cstring>GroupBox4</cstring>
70 </property>
71 <property stdset="1">
72 <name>title</name>
73 <string>Passcode</string>
74 </property>
75 <vbox>
76 <property stdset="1">
77 <name>margin</name>
78 <number>11</number>
79 </property>
80 <property stdset="1">
81 <name>spacing</name>
82 <number>6</number>
83 </property>
84 <widget>
38 <class>QLayoutWidget</class> 85 <class>QLayoutWidget</class>
39 <property stdset="1"> 86 <property stdset="1">
40 <name>name</name> 87 <name>name</name>
@@ -76,7 +123,7 @@
76 </widget> 123 </widget>
77 </hbox> 124 </hbox>
78 </widget> 125 </widget>
79 <widget row="1" column="0" > 126 <widget>
80 <class>QCheckBox</class> 127 <class>QCheckBox</class>
81 <property stdset="1"> 128 <property stdset="1">
82 <name>name</name> 129 <name>name</name>
@@ -87,12 +134,141 @@
87 <string>Require pass code at power-on</string> 134 <string>Require pass code at power-on</string>
88 </property> 135 </property>
89 </widget> 136 </widget>
90 <widget row="3" column="0" > 137 <widget>
91 <class>QTabWidget</class> 138 <class>QLabel</class>
92 <property stdset="1"> 139 <property stdset="1">
93 <name>name</name> 140 <name>name</name>
94 <cstring>TabWidget2</cstring> 141 <cstring>TextLabel1</cstring>
142 </property>
143 <property stdset="1">
144 <name>sizePolicy</name>
145 <sizepolicy>
146 <hsizetype>5</hsizetype>
147 <vsizetype>7</vsizetype>
148 </sizepolicy>
149 </property>
150 <property stdset="1">
151 <name>text</name>
152 <string>&lt;P&gt;Pass code protection provides a minimal level of protection from casual access to this device.</string>
153 </property>
154 <property stdset="1">
155 <name>textFormat</name>
156 <enum>RichText</enum>
157 </property>
158 <property stdset="1">
159 <name>alignment</name>
160 <set>AlignTop|AlignLeft</set>
161 </property>
162 <property>
163 <name>vAlign</name>
164 </property>
165 </widget>
166 </vbox>
167 </widget>
168 <spacer>
169 <property>
170 <name>name</name>
171 <cstring>Spacer3</cstring>
172 </property>
173 <property stdset="1">
174 <name>orientation</name>
175 <enum>Vertical</enum>
176 </property>
177 <property stdset="1">
178 <name>sizeType</name>
179 <enum>Expanding</enum>
180 </property>
181 <property>
182 <name>sizeHint</name>
183 <size>
184 <width>20</width>
185 <height>20</height>
186 </size>
187 </property>
188 </spacer>
189 </vbox>
190 </widget>
191 <widget>
192 <class>QWidget</class>
193 <property stdset="1">
194 <name>name</name>
195 <cstring>tab</cstring>
196 </property>
197 <attribute>
198 <name>title</name>
199 <string>Login</string>
200 </attribute>
201 <vbox>
202 <property stdset="1">
203 <name>margin</name>
204 <number>6</number>
205 </property>
206 <property stdset="1">
207 <name>spacing</name>
208 <number>6</number>
209 </property>
210 <widget>
211 <class>QGroupBox</class>
212 <property stdset="1">
213 <name>name</name>
214 <cstring>GroupBox3</cstring>
215 </property>
216 <property stdset="1">
217 <name>title</name>
218 <string>Login</string>
219 </property>
220 <vbox>
221 <property stdset="1">
222 <name>margin</name>
223 <number>11</number>
224 </property>
225 <property stdset="1">
226 <name>spacing</name>
227 <number>6</number>
228 </property>
229 <widget>
230 <class>QCheckBox</class>
231 <property stdset="1">
232 <name>name</name>
233 <cstring>autologinToggle</cstring>
234 </property>
235 <property stdset="1">
236 <name>text</name>
237 <string>Login Automatically</string>
238 </property>
239 </widget>
240 <widget>
241 <class>QComboBox</class>
242 <property stdset="1">
243 <name>name</name>
244 <cstring>userlist</cstring>
245 </property>
246 </widget>
247 </vbox>
248 </widget>
249 <spacer>
250 <property>
251 <name>name</name>
252 <cstring>Spacer2</cstring>
95 </property> 253 </property>
254 <property stdset="1">
255 <name>orientation</name>
256 <enum>Vertical</enum>
257 </property>
258 <property stdset="1">
259 <name>sizeType</name>
260 <enum>Expanding</enum>
261 </property>
262 <property>
263 <name>sizeHint</name>
264 <size>
265 <width>20</width>
266 <height>20</height>
267 </size>
268 </property>
269 </spacer>
270 </vbox>
271 </widget>
96 <widget> 272 <widget>
97 <class>QWidget</class> 273 <class>QWidget</class>
98 <property stdset="1"> 274 <property stdset="1">
@@ -106,6 +282,25 @@
106 <vbox> 282 <vbox>
107 <property stdset="1"> 283 <property stdset="1">
108 <name>margin</name> 284 <name>margin</name>
285 <number>6</number>
286 </property>
287 <property stdset="1">
288 <name>spacing</name>
289 <number>6</number>
290 </property>
291 <widget>
292 <class>QGroupBox</class>
293 <property stdset="1">
294 <name>name</name>
295 <cstring>GroupBox2</cstring>
296 </property>
297 <property stdset="1">
298 <name>title</name>
299 <string>Sync</string>
300 </property>
301 <vbox>
302 <property stdset="1">
303 <name>margin</name>
109 <number>11</number> 304 <number>11</number>
110 </property> 305 </property>
111 <property stdset="1"> 306 <property stdset="1">
@@ -122,6 +317,10 @@
122 <name>text</name> 317 <name>text</name>
123 <string>Accept sync from network:</string> 318 <string>Accept sync from network:</string>
124 </property> 319 </property>
320 <property stdset="1">
321 <name>textFormat</name>
322 <enum>RichText</enum>
323 </property>
125 </widget> 324 </widget>
126 <widget> 325 <widget>
127 <class>QComboBox</class> 326 <class>QComboBox</class>
@@ -184,32 +383,30 @@
184 </widget> 383 </widget>
185 </vbox> 384 </vbox>
186 </widget> 385 </widget>
187 </widget> 386 <spacer>
188 <widget row="2" column="0" > 387 <property>
189 <class>QLabel</class>
190 <property stdset="1">
191 <name>name</name> 388 <name>name</name>
192 <cstring>TextLabel1</cstring> 389 <cstring>Spacer1</cstring>
193 </property> 390 </property>
194 <property stdset="1"> 391 <property stdset="1">
195 <name>sizePolicy</name> 392 <name>orientation</name>
196 <sizepolicy> 393 <enum>Vertical</enum>
197 <hsizetype>5</hsizetype>
198 <vsizetype>7</vsizetype>
199 </sizepolicy>
200 </property> 394 </property>
201 <property stdset="1"> 395 <property stdset="1">
202 <name>text</name> 396 <name>sizeType</name>
203 <string>&lt;P&gt;Pass code protection provides a minimal level of protection from casual access to this device.</string> 397 <enum>Expanding</enum>
204 </property>
205 <property stdset="1">
206 <name>alignment</name>
207 <set>AlignTop|AlignLeft</set>
208 </property> 398 </property>
209 <property> 399 <property>
210 <name>vAlign</name> 400 <name>sizeHint</name>
401 <size>
402 <width>20</width>
403 <height>20</height>
404 </size>
211 </property> 405 </property>
406 </spacer>
407 </vbox>
212 </widget> 408 </widget>
213 </grid> 409 </widget>
410 </vbox>
214</widget> 411</widget>
215</UI> 412</UI>