summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/.cvsignore1
-rw-r--r--core/apps/embeddedkonsole/MyPty.cpp1
-rw-r--r--core/apps/helpbrowser/helpbrowser.cpp48
-rw-r--r--core/apps/helpbrowser/helpbrowser.h4
-rw-r--r--core/apps/helpbrowser/helpbrowser.pro4
-rw-r--r--core/apps/helpbrowser/magictextbrowser.cpp99
-rw-r--r--core/apps/helpbrowser/magictextbrowser.h42
-rw-r--r--core/apps/helpbrowser/main.cpp9
-rw-r--r--core/apps/textedit/textedit.cpp8
-rw-r--r--core/opie-login/main.cpp28
-rw-r--r--core/opie-login/opie-login.conffiles1
-rw-r--r--core/opiealarm/Makefile4
-rw-r--r--core/opiealarm/config.in2
-rw-r--r--core/opiealarm/opiealarm.c5
-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
18 files changed, 521 insertions, 72 deletions
diff --git a/core/apps/.cvsignore b/core/apps/.cvsignore
index faa68ae..6d678c6 100644
--- a/core/apps/.cvsignore
+++ b/core/apps/.cvsignore
@@ -1,2 +1 @@
1binconfig.in
2config.in config.in
diff --git a/core/apps/embeddedkonsole/MyPty.cpp b/core/apps/embeddedkonsole/MyPty.cpp
index 9adc248..7e820ad 100644
--- a/core/apps/embeddedkonsole/MyPty.cpp
+++ b/core/apps/embeddedkonsole/MyPty.cpp
@@ -165,2 +165,3 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int)
165 tcsetattr( STDIN_FILENO, TCSANOW, &ttmode ); 165 tcsetattr( STDIN_FILENO, TCSANOW, &ttmode );
166 if(strlen(getenv("TERM"))<=0)
166 setenv("TERM","vt100",1); 167 setenv("TERM","vt100",1);
diff --git a/core/apps/helpbrowser/helpbrowser.cpp b/core/apps/helpbrowser/helpbrowser.cpp
index 48da7c6..531dbff 100644
--- a/core/apps/helpbrowser/helpbrowser.cpp
+++ b/core/apps/helpbrowser/helpbrowser.cpp
@@ -1,5 +1,5 @@
1#/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
@@ -20,2 +20,4 @@
20 20
21#define QTOPIA_INTERNAL_LANGLIST
22
21#include "helpbrowser.h" 23#include "helpbrowser.h"
@@ -24,2 +26,4 @@
24#include <qpe/resource.h> 26#include <qpe/resource.h>
27#include <qpe/mimetype.h>
28#include <qpe/applnk.h>
25#include <qpe/global.h> 29#include <qpe/global.h>
@@ -32,2 +36,3 @@
32#include <qpe/qpetoolbar.h> 36#include <qpe/qpetoolbar.h>
37#include <qpe/qcopenvelope_qws.h>
33#include <qtoolbutton.h> 38#include <qtoolbutton.h>
@@ -50,4 +55,5 @@
50 55
51#include <ctype.h> 56#include <cctype>
52 57
58#include "magictextbrowser.h"
53 59
@@ -60,7 +66,10 @@ HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f )
60 66
67
68
61void HelpBrowser::init( const QString& _home ) 69void HelpBrowser::init( const QString& _home )
62{ 70{
63 setIcon( Resource::loadPixmap( "help_icon" ) ); 71 setIcon( Resource::loadPixmap( "HelpBrowser" ) );
72 setBackgroundMode( PaletteButton );
64 73
65 browser = new QTextBrowser( this ); 74 browser = new MagicTextBrowser( this );
66 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 75 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
@@ -82,3 +91,3 @@ void HelpBrowser::init( const QString& _home )
82 91
83 //QPopupMenu* go = new QPopupMenu( this ); 92 QPopupMenu* go = new QPopupMenu( this );
84 backAction = new QAction( tr( "Backward" ), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 ); 93 backAction = new QAction( tr( "Backward" ), Resource::loadIconSet( "back" ), QString::null, 0, this, 0 );
@@ -87,3 +96,3 @@ void HelpBrowser::init( const QString& _home )
87 backAction, SLOT( setEnabled( bool ) ) ); 96 backAction, SLOT( setEnabled( bool ) ) );
88 //backAction->addTo( go ); 97 backAction->addTo( go );
89 backAction->addTo( toolbar ); 98 backAction->addTo( toolbar );
@@ -95,3 +104,3 @@ void HelpBrowser::init( const QString& _home )
95 forwardAction, SLOT( setEnabled( bool ) ) ); 104 forwardAction, SLOT( setEnabled( bool ) ) );
96 //forwardAction->addTo( go ); 105 forwardAction->addTo( go );
97 forwardAction->addTo( toolbar ); 106 forwardAction->addTo( toolbar );
@@ -99,6 +108,5 @@ void HelpBrowser::init( const QString& _home )
99 108
100 QAction *a = new QAction( tr( "Home" ), Resource::loadPixmap( 109 QAction *a = new QAction( tr( "Home" ), Resource::loadIconSet( "home" ), QString::null, 0, this, 0 );
101"home" ), QString::null, 0, this, 0 );
102 connect( a, SIGNAL( activated() ), browser, SLOT( home() ) ); 110 connect( a, SIGNAL( activated() ), browser, SLOT( home() ) );
103 //a->addTo( go ); 111 a->addTo( go );
104 a->addTo( toolbar ); 112 a->addTo( toolbar );
@@ -114,3 +122,3 @@ void HelpBrowser::init( const QString& _home )
114 122
115 //menu->insertItem( tr("Go"), go ); 123 menu->insertItem( tr("Go"), go );
116 menu->insertItem( tr( "Bookmarks" ), bookm ); 124 menu->insertItem( tr( "Bookmarks" ), bookm );
@@ -119,2 +127,9 @@ void HelpBrowser::init( const QString& _home )
119 browser->setFocus(); 127 browser->setFocus();
128 browser->setFrameStyle( QFrame::NoFrame );
129
130#if !defined(QT_NO_COP)
131 QCopChannel *addressChannel = new QCopChannel("QPE/HelpBrowser" , this );
132 connect (addressChannel, SIGNAL( received(const QCString &, const QByteArray &)),
133 this, SLOT ( appMessage(const QCString &, const QByteArray &) ) );
134#endif
120 135
@@ -126,2 +141,3 @@ void HelpBrowser::appMessage(const QCString& msg, const QByteArray& data)
126{ 141{
142 qDebug("reached appMessage");
127 if ( msg == "showFile(QString)" ) { 143 if ( msg == "showFile(QString)" ) {
@@ -131,2 +147,8 @@ void HelpBrowser::appMessage(const QCString& msg, const QByteArray& data)
131 setDocument( fn ); 147 setDocument( fn );
148
149 QPEApplication::setKeepRunning();
150
151 showMaximized();
152 setActiveWindow();
153 raise();
132 } 154 }
diff --git a/core/apps/helpbrowser/helpbrowser.h b/core/apps/helpbrowser/helpbrowser.h
index 2f7153a..5f7e6b6 100644
--- a/core/apps/helpbrowser/helpbrowser.h
+++ b/core/apps/helpbrowser/helpbrowser.h
@@ -1,5 +1,5 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
diff --git a/core/apps/helpbrowser/helpbrowser.pro b/core/apps/helpbrowser/helpbrowser.pro
index 6bb43bd..3525b7e 100644
--- a/core/apps/helpbrowser/helpbrowser.pro
+++ b/core/apps/helpbrowser/helpbrowser.pro
@@ -3,4 +3,4 @@ CONFIG = qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin 3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = helpbrowser.h 4 HEADERS = helpbrowser.h magictextbrowser.h
5 SOURCES = helpbrowser.cpp \ 5 SOURCES = helpbrowser.cpp magictextbrowser.cpp \
6 main.cpp 6 main.cpp
diff --git a/core/apps/helpbrowser/magictextbrowser.cpp b/core/apps/helpbrowser/magictextbrowser.cpp
new file mode 100644
index 0000000..8ce0325
--- a/dev/null
+++ b/core/apps/helpbrowser/magictextbrowser.cpp
@@ -0,0 +1,99 @@
1#include <qfile.h>
2#include <qstring.h>
3#include <qdragobject.h>
4#include <qregexp.h>
5
6/* need to get Global::helpPath() */
7#define QTOPIA_INTERNAL_LANGLIST
8
9#include <qtopia/global.h>
10#include <qtopia/mimetype.h>
11#include <qtopia/applnk.h>
12
13#include "magictextbrowser.h"
14
15
16
17MagicTextBrowser::MagicTextBrowser(QWidget* parent) :
18 QTextBrowser(parent){
19}
20
21void MagicTextBrowser::setSource( const QString& source ) {
22 QTextBrowser::setSource(source);
23 if ( magicQpe(source,"applications") || magicQpe(source,"games") || magicQpe(source,"settings") || magicQpe(source, "1Pim") ) // No tr
24 return;
25 if ( magicOpe(source, "applets") || magicOpe(source, "input") )
26 return;
27 // Just those are magic (for now). Could do CGI here,
28 // or in Qtopia's mime source factory.
29}
30
31bool MagicTextBrowser::magicQpe(const QString& source, const QString& name) {
32 if ( name+".html" == source || "help/"+name+".html" == source) {
33 QString fn = mimeSourceFactory()->makeAbsolute( source, context() );
34 const QMimeSource* m = mimeSourceFactory()->data( fn, context() );
35 if ( m ) {
36 QString txt;
37 if ( QTextDrag::decode(m,txt) ) {
38 QRegExp re("<qtopia-"+name+">.*</qtopia-"+name+">");
39 int start,len;
40 if ( (start=re.match(txt,0,&len))>=0 ) {
41 QString generated = generateQpe(name);
42 txt.replace(start,len,generated);
43 setText(txt);
44 return true;
45 }
46 }
47 }
48 }
49 return false;
50}
51bool MagicTextBrowser::magicOpe( const QString& source, const QString& name ) {
52 if ( name+".html" != source && "help/"+name+".html" != source) return false;
53
54 QString fn = mimeSourceFactory()->makeAbsolute( source, context() );
55 const QMimeSource* m = mimeSourceFactory()->data(fn, context() );
56 if (!m) return false;
57
58 QString txt;
59 if ( !QTextDrag::decode(m, txt ) ) return false;
60
61 QRegExp re("<opie-"+name+">.*</opie-"+name+">");
62 int start,len;
63 if ( (start=re.match(txt,0,&len))>=0 ) {
64 QString generated = generateOpe(name);
65 txt.replace(start,len,generated);
66 setText(txt);
67 return true;
68 }
69 return false;
70}
71QString MagicTextBrowser::generateOpe(const QString& name)const {
72 if ( name == QString::fromLatin1("applets") ) {
73 return QString::fromLatin1("<h3>No Applets found</h3>");
74 }else if ( name == QString::fromLatin1("input") ) {
75 return QString::fromLatin1("<h3>No input methods available</h3>");
76 }else
77 return QString::null;
78}
79
80QString MagicTextBrowser::generateQpe(const QString& name) const {
81 QString dir = MimeType::appsFolderName()+"/"+name[0].upper()+name.mid(1);
82 AppLnkSet lnkset(dir);
83 AppLnk* lnk;
84 QString r;
85 for (QListIterator<AppLnk> it(lnkset.children()); (lnk=it.current()); ++it) {
86 QString name = lnk->name();
87 QString icon = lnk->icon();
88 QString helpFile = lnk->exec()+".html";
89 QStringList helpPath = Global::helpPath();
90 bool helpExists = FALSE;
91 for (QStringList::ConstIterator it=helpPath.begin(); it!=helpPath.end() && !helpExists; ++it)
92 helpExists = QFile::exists( *it + "/" + helpFile );
93
94 if ( helpExists ) {
95 r += "<h3><a href="+helpFile+"><img src="+icon+">"+name+"</a></h3>\n";
96 }
97 }
98 return r;
99}
diff --git a/core/apps/helpbrowser/magictextbrowser.h b/core/apps/helpbrowser/magictextbrowser.h
new file mode 100644
index 0000000..ff91e68
--- a/dev/null
+++ b/core/apps/helpbrowser/magictextbrowser.h
@@ -0,0 +1,42 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** Copyright (C) 2003 zecke
4**
5** This file is part of the Qtopia Environment.
6**
7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file.
11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14**
15** See http://www.trolltech.com/gpl/ for GPL licensing information.
16**
17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you.
19**
20**********************************************************************/
21#ifndef HELP_BROWSER_MAGIC_TEXT_BROWSER_H
22#define HELP_BROWSER_MAGIC_TEXT_BROWSER_H
23
24#include <qtextbrowser.h>
25
26class MagicTextBrowser : public QTextBrowser {
27public:
28 MagicTextBrowser(QWidget* parent);
29
30 void setSource( const QString& source );
31
32 /** honor QPE Attributes */
33 bool magicQpe(const QString& source, const QString& name);
34 /** honor OPIE Attributes */
35 bool magicOpe(const QString& source, const QString& name );
36private:
37
38 QString generateQpe(const QString& name) const;
39 QString generateOpe(const QString& name) const;
40};
41
42#endif
diff --git a/core/apps/helpbrowser/main.cpp b/core/apps/helpbrowser/main.cpp
index 1cb10b7..b1bea56 100644
--- a/core/apps/helpbrowser/main.cpp
+++ b/core/apps/helpbrowser/main.cpp
@@ -1,5 +1,5 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
@@ -22,3 +22,3 @@
22 22
23#include <qpe/qpeapplication.h> 23#include <qtopia/qpeapplication.h>
24 24
@@ -29,4 +29,3 @@ int main( int argc, char ** argv )
29 HelpBrowser mw; 29 HelpBrowser mw;
30 mw.setCaption( HelpBrowser::tr("HelpBrowser") ); 30 a.showMainWidget( &mw );
31 a.showMainDocumentWidget( &mw );
32 31
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 6f96574..1c95a97 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -571,3 +571,2 @@ void TextEdit::fileOpen() {
571 cfg. setGroup ( "View" ); 571 cfg. setGroup ( "View" );
572 QString dir = cfg.readEntry("LastOpenDirectory", QPEApplication::documentDir());
573 QMap<QString, QStringList> map; 572 QMap<QString, QStringList> map;
@@ -580,3 +579,3 @@ void TextEdit::fileOpen() {
580 QString str = OFileDialog::getOpenFileName( 2, 579 QString str = OFileDialog::getOpenFileName( 2,
581 dir , 580 QString::null ,
582 QString::null, map); 581 QString::null, map);
@@ -584,3 +583,2 @@ void TextEdit::fileOpen() {
584 { 583 {
585 cfg.writeEntry("LastOpenDirectory", QFileInfo(str).dirPath(false));
586 openFile( str ); 584 openFile( str );
@@ -978,3 +976,3 @@ void TextEdit::updateCaption( const QString &name ) {
978// s = s.right(s.length()-1); 976// s = s.right(s.length()-1);
979 setCaption( s + " - " + tr("Text Editor") ); 977 setCaption( tr("%1 - Text Editor").arg( s ) );
980 } 978 }
@@ -1024,3 +1022,3 @@ void TextEdit::editDelete() {
1024 "the current file\nfrom the disk?<BR>This is " 1022 "the current file\nfrom the disk?<BR>This is "
1025 "<B>irreversable!!</B>"), 1023 "<B>irreversable!</B>"),
1026 tr("Yes"),tr("No"),0,0,1) ) { 1024 tr("Yes"),tr("No"),0,0,1) ) {
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index d95a59b..7dcb5f6 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -56,2 +56,3 @@
56#include <qfile.h> 56#include <qfile.h>
57#include <qtextstream.h>
57 58
@@ -76,2 +77,3 @@ int main ( int argc, char **argv )
76{ 77{
78 int userExited = 0;
77 pid_t ppid = ::getpid ( ); 79 pid_t ppid = ::getpid ( );
@@ -139,2 +141,8 @@ int main ( int argc, char **argv )
139 int killedbysig = 0; 141 int killedbysig = 0;
142 userExited=0;
143 if (WIFEXITED(status)!=0 ) {
144 if (WEXITSTATUS(status)==137) {
145 userExited=1;
146 }
147 }
140 148
@@ -142,4 +150,4 @@ int main ( int argc, char **argv )
142 switch ( WTERMSIG( status )) { 150 switch ( WTERMSIG( status )) {
143 case SIGINT :
144 case SIGTERM: 151 case SIGTERM:
152 case SIGINT :
145 case SIGKILL: 153 case SIGKILL:
@@ -164,3 +172,3 @@ int main ( int argc, char **argv )
164 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool ); 172 QLabel *l = new QLabel ( 0, "sig", Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool );
165 l-> setText ( LoginWindowImpl::tr( "OPIE was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig )); 173 l-> setText ( LoginWindowImpl::tr( "Opie was terminated\nby an uncaught signal\n(%1)\n" ). arg ( sig ));
166 l-> setAlignment ( Qt::AlignCenter ); 174 l-> setAlignment ( Qt::AlignCenter );
@@ -177,3 +185,4 @@ int main ( int argc, char **argv )
177 if ( !autolog ) { 185 if ( !autolog ) {
178 Config cfg ( "opie-login" ); 186 QString confFile=QPEApplication::qpeDir() + "/etc/opie-login.conf";
187 Config cfg ( confFile, Config::File );
179 cfg. setGroup ( "General" ); 188 cfg. setGroup ( "General" );
@@ -185,5 +194,11 @@ int main ( int argc, char **argv )
185 194
186 if ( autolog ) { 195 if ( autolog && !userExited ) {
196
197 QWSServer::setDesktopBackground( QImage() );
198 ODevice::inst ( )-> setDisplayStatus ( true );
199 ODevice::inst ( )-> setSoftSuspend ( false );
200 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
187 LoginApplication::setLoginAs ( autolog ); 201 LoginApplication::setLoginAs ( autolog );
188 202
203
189 if ( LoginApplication::changeIdentity ( )) 204 if ( LoginApplication::changeIdentity ( ))
@@ -193,3 +208,3 @@ int main ( int argc, char **argv )
193 } 208 }
194 else 209 else {
195 ::exit ( login_main ( argc, argv, ppid )); 210 ::exit ( login_main ( argc, argv, ppid ));
@@ -197,2 +212,3 @@ int main ( int argc, char **argv )
197 } 212 }
213 }
198 return 0; 214 return 0;
@@ -357,3 +373,3 @@ int login_main ( int argc, char **argv, pid_t ppid )
357 373
358 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start OPIE." )); 374 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." ));
359 rc = 1; 375 rc = 1;
diff --git a/core/opie-login/opie-login.conffiles b/core/opie-login/opie-login.conffiles
new file mode 100644
index 0000000..90645ee
--- a/dev/null
+++ b/core/opie-login/opie-login.conffiles
@@ -0,0 +1 @@
/opt/QtPalmtop/etc/opie-login.conf
diff --git a/core/opiealarm/Makefile b/core/opiealarm/Makefile
index 0c8467e..255083d 100644
--- a/core/opiealarm/Makefile
+++ b/core/opiealarm/Makefile
@@ -22,5 +22 @@ clean:
22
23install:
24 cp $(DESTDIR)/opiealarm $(INSTALL_ROOT)/opt/QtPalmtop/bin
25 chown root $(INSTALL_ROOT)/opt/QtPalmtop/bin/opiealarm
26 chmod u+s $(INSTALL_ROOT)/opt/QtPalmtop/bin/opiealarm 2>/dev/null || echo -e "\nopiealarm must be owned by root to work correctly.\n"
diff --git a/core/opiealarm/config.in b/core/opiealarm/config.in
index 2be9bd4..f86d01c 100644
--- a/core/opiealarm/config.in
+++ b/core/opiealarm/config.in
@@ -1,3 +1,3 @@
1config OPIEALARM 1config OPIEALARM
2 boolean "opie-opiealarm (Alarm daemon, sets RTC with wakeup time on suspend)" 2 boolean "Opiealarm (Alarm daemon, sets RTC with wakeup time on suspend)"
3 depends ! TARGET_X86 3 depends ! TARGET_X86
diff --git a/core/opiealarm/opiealarm.c b/core/opiealarm/opiealarm.c
index 998cabd..90a743f 100644
--- a/core/opiealarm/opiealarm.c
+++ b/core/opiealarm/opiealarm.c
@@ -95,2 +95,3 @@ int fork_with_pidfile ( void )
95 } 95 }
96 //sleep( 60 );
96 97
@@ -208,3 +209,3 @@ int suspend ( int fix_rtc )
208{ 209{
209 FILE *fp; 210 FILE *fp = NULL;
210 char buf [64]; 211 char buf [64];
@@ -260,3 +261,3 @@ int suspend ( int fix_rtc )
260 fclose ( fp ); 261 fclose ( fp );
261 fp = 0; 262 fp = NULL;
262 263
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
@@ -93,5 +93,5 @@ public:
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
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
@@ -21,2 +21,3 @@
21 21
22#include <qpe/qpeapplication.h>
22#include <qpe/config.h> 23#include <qpe/config.h>
@@ -29,2 +30,5 @@
29#include <qmessagebox.h> 30#include <qmessagebox.h>
31#include <qfile.h>
32#include <qlistview.h>
33#include <qtextstream.h>
30 34
@@ -58,4 +62,21 @@ Security::Security( QWidget* parent, const char* name, WFlags fl )
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();
@@ -79,2 +100,6 @@ void Security::updateGUI()
79 clearpasscode->setEnabled( !empty ); 100 clearpasscode->setEnabled( !empty );
101
102 autologinToggle->setChecked(autoLogin);
103 userlist->setEnabled(autoLogin);
104
80} 105}
@@ -162,2 +187,32 @@ void Security::parseNet(const QString& sn,int& auth_peer,int& auth_peer_bits)
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)
@@ -191,3 +246,20 @@ void Security::applySecurity()
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}
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
@@ -45,4 +45,8 @@ private slots:
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;
@@ -57,2 +61,4 @@ private:
57 bool valid; 61 bool valid;
62 bool autoLogin;
63 QString autoLoginName;
58 64
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
@@ -13,4 +13,4 @@
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>
@@ -27,6 +27,6 @@
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>
@@ -34,5 +34,52 @@
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>
@@ -78,3 +125,3 @@
78 </widget> 125 </widget>
79 <widget row="1" column="0" > 126 <widget>
80 <class>QCheckBox</class> 127 <class>QCheckBox</class>
@@ -89,8 +136,137 @@
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>
@@ -108,2 +284,21 @@
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>
@@ -124,2 +319,6 @@
124 </property> 319 </property>
320 <property stdset="1">
321 <name>textFormat</name>
322 <enum>RichText</enum>
323 </property>
125 </widget> 324 </widget>
@@ -186,29 +385,27 @@
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>