author | zecke <zecke> | 2004-07-17 20:03:12 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-07-17 20:03:12 (UTC) |
commit | d68baedc489a7ab4ab1419144608d28d5336a884 (patch) (side-by-side diff) | |
tree | 487ee1528b6696a7bd1954eeae0d6b600cd57e9f /core/settings/security/main.cpp | |
parent | 658ea4b6442d26b4ef0cbde5e9f98433b01dff57 (diff) | |
download | opie-d68baedc489a7ab4ab1419144608d28d5336a884.zip opie-d68baedc489a7ab4ab1419144608d28d5336a884.tar.gz opie-d68baedc489a7ab4ab1419144608d28d5336a884.tar.bz2 |
Add Clements reworked and OMAF capable Security Settings application
This adds configuration of OMAF
For now it disables quicklaunch which will be changed
Also a demo application is added
Diffstat (limited to 'core/settings/security/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/settings/security/main.cpp | 68 |
1 files changed, 42 insertions, 26 deletions
diff --git a/core/settings/security/main.cpp b/core/settings/security/main.cpp index 200a541..f161109 100644 --- a/core/settings/security/main.cpp +++ b/core/settings/security/main.cpp @@ -1,30 +1,46 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** 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 "multiauthconfig.h" +#include <opie2/oapplication.h> +#include <opie2/odebug.h> -#include "security.h" - -#include <opie2/oapplicationfactory.h> - -using namespace Opie::Core; -OPIE_EXPORT_APP( OApplicationFactory<Security> ) - +int main(int argc, char **argv) { + Opie::Core::OApplication app(argc, argv, "MultiAuthentication Config"); + // protect this dialog if option set + Config* pcfg = new Config("Security"); + pcfg->setGroup( "Misc" ); + bool protectConfigDialog = ! pcfg->readBoolEntry("noProtectConfig", true); + delete pcfg; + bool show = true; + if ( protectConfigDialog ) + { + if (Opie::Security::Internal::runPlugins() != 0) + { + // authentication failed + show = false; + } + } + if ( show == true ) + { + printf("building dialog\n"); + MultiauthConfig dialog; + app.setMainWidget(&dialog); + if ( dialog.exec() == QDialog::Accepted ) { + // write the general, login and sync config + dialog.writeConfig(); + // call writeConfig() on each plugin config widget + Opie::Security::MultiauthConfigWidget *confWidget; + for ( confWidget = dialog.configWidgetList.first(); confWidget != 0; + confWidget = dialog.configWidgetList.next() ) { + confWidget->writeConfig(); + } + } + dialog.close(); + app.quit(); + return 0; + } else { + owarn << "authentication failed, not showing opie-security" << oendl; + return 1; + } +} |