Diffstat (limited to 'core/settings/security/main.cpp') (more/less context) (ignore 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 @@ | |||
1 | /********************************************************************** | 1 | #include "multiauthconfig.h" |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | #include <opie2/oapplication.h> |
3 | ** | 3 | #include <opie2/odebug.h> |
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | 4 | ||
21 | 5 | ||
22 | #include "security.h" | ||
23 | |||
24 | #include <opie2/oapplicationfactory.h> | ||
25 | |||
26 | using namespace Opie::Core; | ||
27 | OPIE_EXPORT_APP( OApplicationFactory<Security> ) | ||
28 | |||
29 | 6 | ||
7 | int main(int argc, char **argv) { | ||
8 | Opie::Core::OApplication app(argc, argv, "MultiAuthentication Config"); | ||
9 | // protect this dialog if option set | ||
10 | Config* pcfg = new Config("Security"); | ||
11 | pcfg->setGroup( "Misc" ); | ||
12 | bool protectConfigDialog = ! pcfg->readBoolEntry("noProtectConfig", true); | ||
13 | delete pcfg; | ||
14 | bool show = true; | ||
15 | if ( protectConfigDialog ) | ||
16 | { | ||
17 | if (Opie::Security::Internal::runPlugins() != 0) | ||
18 | { | ||
19 | // authentication failed | ||
20 | show = false; | ||
21 | } | ||
22 | } | ||
23 | if ( show == true ) | ||
24 | { | ||
25 | printf("building dialog\n"); | ||
26 | MultiauthConfig dialog; | ||
27 | app.setMainWidget(&dialog); | ||
30 | 28 | ||
29 | if ( dialog.exec() == QDialog::Accepted ) { | ||
30 | // write the general, login and sync config | ||
31 | dialog.writeConfig(); | ||
32 | // call writeConfig() on each plugin config widget | ||
33 | Opie::Security::MultiauthConfigWidget *confWidget; | ||
34 | for ( confWidget = dialog.configWidgetList.first(); confWidget != 0; | ||
35 | confWidget = dialog.configWidgetList.next() ) { | ||
36 | confWidget->writeConfig(); | ||
37 | } | ||
38 | } | ||
39 | dialog.close(); | ||
40 | app.quit(); | ||
41 | return 0; | ||
42 | } else { | ||
43 | owarn << "authentication failed, not showing opie-security" << oendl; | ||
44 | return 1; | ||
45 | } | ||
46 | } | ||