summaryrefslogtreecommitdiff
path: root/libopie2/opiesecurity/multiauthmainwindow.cpp
Unidiff
Diffstat (limited to 'libopie2/opiesecurity/multiauthmainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiesecurity/multiauthmainwindow.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/libopie2/opiesecurity/multiauthmainwindow.cpp b/libopie2/opiesecurity/multiauthmainwindow.cpp
index fa247ab..fb720bb 100644
--- a/libopie2/opiesecurity/multiauthmainwindow.cpp
+++ b/libopie2/opiesecurity/multiauthmainwindow.cpp
@@ -7,6 +7,9 @@ namespace Opie {
7namespace Security { 7namespace Security {
8 8
9/// Initializes widgets according to allowBypass and explanScreens config 9/// Initializes widgets according to allowBypass argument (false by default) and explanScreens config
10MultiauthMainWindow::MultiauthMainWindow() 10/**
11 * \note if allowBypass is true, we will show explanatory screens anyway
12 */
13MultiauthMainWindow::MultiauthMainWindow(bool allowBypass = false)
11 : QDialog(0, "main Opie multiauth modal dialog", TRUE, 14 : QDialog(0, "main Opie multiauth modal dialog", TRUE,
12 Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop) 15 Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WStyle_StaysOnTop)
@@ -18,9 +21,13 @@ MultiauthMainWindow::MultiauthMainWindow()
18 message2 = 0; 21 message2 = 0;
19 22
20 Config *pcfg = new Config("Security"); 23 if (allowBypass == true)
21 pcfg->setGroup("Misc"); 24 explanScreens = true;
22 explanScreens = pcfg->readBoolEntry("explanScreens", true); 25 else
23 allowBypass = pcfg->readBoolEntry("allowBypass", false); 26 {
24 delete pcfg; 27 Config *pcfg = new Config("Security");
28 pcfg->setGroup("Misc");
29 explanScreens = pcfg->readBoolEntry("explanScreens", true);
30 delete pcfg;
31 }
25 32
26 layout = new QVBoxLayout(this); 33 layout = new QVBoxLayout(this);
@@ -54,5 +61,5 @@ MultiauthMainWindow::MultiauthMainWindow()
54 { 61 {
55 // very important: we can close the widget through the quit button, and bypass authentication, only if allowBypass is set! 62 // very important: we can close the widget through the quit button, and bypass authentication, only if allowBypass is set!
56 message2 = new QLabel("<center><i>" + tr("Note: the 'exit' button should be removed for real protection, through Security config dialog") + ".</i></center>", this); 63 message2 = new QLabel("<center><i>" + tr("Note: this 'exit' button only appears during <b>simulations</b>, like the one we are in.") + "</i></center>", this);
57 layout->addWidget(message2); 64 layout->addWidget(message2);
58 QObject::connect(quit, SIGNAL(clicked()), this, SLOT(close())); 65 QObject::connect(quit, SIGNAL(clicked()), this, SLOT(close()));
@@ -115,8 +122,10 @@ void MultiauthMainWindow::proceed() {
115 { 122 {
116 // authentication has failed, explain that according to allowBypass 123 // authentication has failed, explain that according to allowBypass
117 message->setText( "<center><h3>" + tr("You have not succeeded enough authentication steps!") + "</h3></center>" ); 124 message->setText( "<center><h3>" + tr("You have <b>not</b> succeeded enough authentication steps!") + "</h3></center>" );
118 proceedButton->show(); 125 proceedButton->show();
119 if ( allowBypass == true ) 126 if ( allowBypass == true )
120 message2->setText( "<center><p>" + tr("Note: if 'allow to bypass' was uncheck in Security config, you would have to go back through all the steps now.") + "</p></center>" ); 127 {
128 message2->setText( "<center><p>" + tr("Be careful: if this was not a <b>simulation</b>, you would have to go back through all the steps now.") + "</p></center>" );
129 message2->show();
121 } 130 }
122 } 131 }