From d68baedc489a7ab4ab1419144608d28d5336a884 Mon Sep 17 00:00:00 2001 From: zecke Date: Sat, 17 Jul 2004 20:03:12 +0000 Subject: 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 --- (limited to 'core/settings/security/main.cpp') 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 +#include -#include "security.h" - -#include - -using namespace Opie::Core; -OPIE_EXPORT_APP( OApplicationFactory ) - +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; + } +} -- cgit v0.9.0.2