-rw-r--r-- | core/settings/security/main.cpp | 10 | ||||
-rw-r--r-- | core/settings/security/security.cpp | 5 | ||||
-rw-r--r-- | core/settings/security/security.h | 1 | ||||
-rw-r--r-- | core/settings/security/security.pro | 4 | ||||
-rw-r--r-- | core/settings/security/securitybase.ui | 2 |
5 files changed, 5 insertions, 17 deletions
diff --git a/core/settings/security/main.cpp b/core/settings/security/main.cpp index c15bb31..3141fb8 100644 --- a/core/settings/security/main.cpp +++ b/core/settings/security/main.cpp @@ -3,36 +3,30 @@ ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qpe/qpeapplication.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/global.h> #include "security.h" +#include <opie/oapplicationfactory.h> -int main(int argc, char** argv) -{ - QPEApplication a(argc,argv); +OPIE_EXPORT_APP( OApplicationFactory<Security> ) - Security dlg; - a.showMainWidget(&dlg); - - return a.exec(); -} diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp index 42a39c2..81363d2 100644 --- a/core/settings/security/security.cpp +++ b/core/settings/security/security.cpp @@ -99,49 +99,48 @@ void Security::updateGUI() bool empty = passcode.isEmpty(); changepasscode->setText( empty ? tr("Set passcode" ) : tr("Change passcode" ) ); passcode_poweron->setEnabled( !empty ); clearpasscode->setEnabled( !empty ); autologinToggle->setChecked(autoLogin); userlist->setEnabled(autoLogin); } void Security::show() { //valid=FALSE; setEnabled(FALSE); SecurityBase::show(); if ( passcode.isEmpty() ) { // could insist... //changePassCode(); //if ( passcode.isEmpty() ) //reject(); } else { - if (!valid) // security passcode was not asked yet, so ask now { QString pc = enterPassCode(tr("Enter passcode")); if ( pc != passcode ) { QMessageBox::critical(this, tr("Passcode incorrect"), tr("The passcode entered is incorrect.\nAccess denied")); reject(); return; } } } setEnabled(TRUE); valid=TRUE; } void Security::accept() { applySecurity(); QDialog::accept(); QCopEnvelope env("QPE/System", "securityChanged()" ); } void Security::done(int r) { @@ -218,82 +217,78 @@ void Security::loadUsers ( void ) } void Security::toggleAutoLogin(bool val) { autoLogin=val; userlist->setEnabled(val); if (!autoLogin) autoLoginName=userlist->currentText(); } void Security::setSyncNet(const QString& sn) { int auth_peer,auth_peer_bits; parseNet(sn,auth_peer,auth_peer_bits); selectNet(auth_peer,auth_peer_bits); } void Security::applySecurity() { if ( valid ) { - Config cfg("Security"); cfg.setGroup("Passcode"); cfg.writeEntry("passcode",passcode); cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked()); cfg.setGroup("Sync"); int auth_peer=0; int auth_peer_bits; QString sn = syncnet->currentText(); parseNet(sn,auth_peer,auth_peer_bits); cfg.writeEntry("auth_peer",auth_peer); cfg.writeEntry("auth_peer_bits",auth_peer_bits); /* cfg.setGroup("Remote"); if ( telnetAvailable() ) cfg.writeEntry("allow_telnet",telnet->isChecked()); if ( sshAvailable() ) cfg.writeEntry("allow_ssh",ssh->isChecked()); // ### write ssh/telnet sys config files */ QString configFile = QPEApplication::qpeDir() + "/etc/opie-login.conf"; Config loginCfg(configFile,Config::File); loginCfg.setGroup("General"); if (autoLogin) { loginCfg.writeEntry("AutoLogin",autoLoginName); } else { loginCfg.removeEntry("AutoLogin"); } - cfg.setGroup("SyncMode"); - cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 ); - } } void Security::changeLoginName( int idx ) { autoLoginName = userlist->text(idx);; updateGUI(); } void Security::changePassCode() { QString new1; QString new2; do { new1 = enterPassCode(tr("Enter new passcode")); if ( new1.isNull() ) return; new2 = enterPassCode(tr("Re-enter new passcode")); if ( new2.isNull() ) return; } while (new1 != new2); passcode = new1; diff --git a/core/settings/security/security.h b/core/settings/security/security.h index 2f18f91..52d56de 100644 --- a/core/settings/security/security.h +++ b/core/settings/security/security.h @@ -8,48 +8,49 @@ ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef SECURITY_H #define SECURITY_H #include "securitybase.h" class QPEDialogListener; class Security : public SecurityBase { Q_OBJECT public: + static QString appName() { return QString::fromLatin1("security"); } Security( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~Security(); void show(); protected: void accept(); void applySecurity(); void done(int); private slots: void changePassCode(); void clearPassCode(); void setSyncNet(const QString&); void changeLoginName(int); void toggleAutoLogin(bool); private: void loadUsers(void); bool telnetAvailable() const; bool sshAvailable() const; void updateGUI(); diff --git a/core/settings/security/security.pro b/core/settings/security/security.pro index c359537..67995d4 100644 --- a/core/settings/security/security.pro +++ b/core/settings/security/security.pro @@ -1,27 +1,25 @@ -TEMPLATE = app -CONFIG += qt warn_on release -DESTDIR = $(OPIEDIR)/bin +CONFIG += qt warn_on release quick-app HEADERS = security.h SOURCES = security.cpp main.cpp INTERFACES = securitybase.ui INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += ../$(OPIEDIR)/include LIBS += -lqpe TARGET = security TRANSLATIONS = ../../../i18n/de/security.ts \ ../../../i18n/nl/security.ts \ ../../../i18n/xx/security.ts \ ../../../i18n/en/security.ts \ ../../../i18n/es/security.ts \ ../../../i18n/fr/security.ts \ ../../../i18n/hu/security.ts \ ../../../i18n/ja/security.ts \ ../../../i18n/ko/security.ts \ ../../../i18n/no/security.ts \ ../../../i18n/pl/security.ts \ ../../../i18n/pt/security.ts \ ../../../i18n/pt_BR/security.ts \ ../../../i18n/sl/security.ts \ ../../../i18n/zh_CN/security.ts \ ../../../i18n/zh_TW/security.ts \ diff --git a/core/settings/security/securitybase.ui b/core/settings/security/securitybase.ui index 73290e5..9fb63a8 100644 --- a/core/settings/security/securitybase.ui +++ b/core/settings/security/securitybase.ui @@ -1,38 +1,38 @@ <!DOCTYPE UI><UI> <class>SecurityBase</class> <widget> <class>QDialog</class> <property stdset="1"> <name>name</name> <cstring>SecurityBase</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>339</width> + <width>329</width> <height>483</height> </rect> </property> <property stdset="1"> <name>caption</name> <string>Security Settings</string> </property> <property> <name>layoutMargin</name> </property> <property> <name>layoutSpacing</name> </property> <vbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>0</number> </property> <widget> <class>QTabWidget</class> |