-rw-r--r-- | core/settings/security/multiauthconfig.cpp | 50 | ||||
-rw-r--r-- | core/settings/security/multiauthconfig.h | 1 |
2 files changed, 51 insertions, 0 deletions
diff --git a/core/settings/security/multiauthconfig.cpp b/core/settings/security/multiauthconfig.cpp index ff11e49..3c73d7b 100644 --- a/core/settings/security/multiauthconfig.cpp +++ b/core/settings/security/multiauthconfig.cpp | |||
@@ -5,2 +5,3 @@ | |||
5 | #include <qgroupbox.h> | 5 | #include <qgroupbox.h> |
6 | #include <qvgroupbox.h> | ||
6 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
@@ -150,2 +151,13 @@ MultiauthConfig::MultiauthConfig(QWidget* par, const char* w, WFlags f) | |||
150 | 151 | ||
152 | /* Checks (and memorizes) if any authentication plugins are | ||
153 | * installed on the system | ||
154 | */ | ||
155 | QString path = QPEApplication::qpeDir() + "/plugins/security"; | ||
156 | QDir dir( path, "lib*.so" ); | ||
157 | QStringList list = dir.entryList(); | ||
158 | |||
159 | m_pluginsInstalled = ! list.isEmpty(); | ||
160 | if (m_pluginsInstalled == false) | ||
161 | owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl; | ||
162 | |||
151 | setCaption( tr( "Security configuration" ) ); | 163 | setCaption( tr( "Security configuration" ) ); |
@@ -154,2 +166,5 @@ MultiauthConfig::MultiauthConfig(QWidget* par, const char* w, WFlags f) | |||
154 | layout->addWidget(m_mainTW); | 166 | layout->addWidget(m_mainTW); |
167 | |||
168 | if (m_pluginsInstalled) | ||
169 | { | ||
155 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget"); | 170 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget"); |
@@ -180,2 +195,3 @@ MultiauthConfig::MultiauthConfig(QWidget* par, const char* w, WFlags f) | |||
180 | 195 | ||
196 | } | ||
181 | // login settings page | 197 | // login settings page |
@@ -191,2 +207,5 @@ MultiauthConfig::MultiauthConfig(QWidget* par, const char* w, WFlags f) | |||
191 | 207 | ||
208 | |||
209 | if (m_pluginsInstalled) | ||
210 | { | ||
192 | /* loads plugins configuration widgets in mainTW tabs and in pluginListView | 211 | /* loads plugins configuration widgets in mainTW tabs and in pluginListView |
@@ -225,2 +244,22 @@ MultiauthConfig::MultiauthConfig(QWidget* par, const char* w, WFlags f) | |||
225 | m_generalConfig->nbSuccessMin->setMaxValue( pluginList.count() ); | 244 | m_generalConfig->nbSuccessMin->setMaxValue( pluginList.count() ); |
245 | } | ||
246 | else | ||
247 | { | ||
248 | /* we don't have any installed plugin there. Let's tell | ||
249 | * that to the user in a third tab, using the m_pluginListWidget widget | ||
250 | */ | ||
251 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget (no plugins warning)"); | ||
252 | QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); | ||
253 | pluginListLayout->setSpacing(11); | ||
254 | pluginListLayout->setMargin(11); | ||
255 | pluginListLayout->setAlignment( Qt::AlignTop ); | ||
256 | QVGroupBox *warningBox = new QVGroupBox(tr("Important notice"), m_pluginListWidget, "noPlugins warning box"); | ||
257 | pluginListLayout->addWidget(warningBox); | ||
258 | QLabel * warningText = new QLabel( "<p>" + tr("To be able to protect your PDA with one or more authentication plugins (for example, a simple PIN authentication), you must install at least one <em>opie-multiauth-*</em> package! Once you have done that, you will be able to configure your PDA protection here.") + "</p>", warningBox ); | ||
259 | |||
260 | m_mainTW->addTab(m_pluginListWidget, "security/Security", tr( "Locking") ); | ||
261 | |||
262 | // set the first tab as default. | ||
263 | m_mainTW->setCurrentTab(m_loginWidget); | ||
264 | } | ||
226 | 265 | ||
@@ -273,2 +312,5 @@ void MultiauthConfig::readConfig() | |||
273 | Config* pcfg = new Config("Security"); | 312 | Config* pcfg = new Config("Security"); |
313 | |||
314 | if (m_pluginsInstalled) | ||
315 | { | ||
274 | pcfg->setGroup( "Misc" ); | 316 | pcfg->setGroup( "Misc" ); |
@@ -284,2 +326,3 @@ void MultiauthConfig::readConfig() | |||
284 | m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' ); | 326 | m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' ); |
327 | } | ||
285 | 328 | ||
@@ -353,2 +396,5 @@ void MultiauthConfig::writeConfig() | |||
353 | Config* pcfg = new Config("Security"); | 396 | Config* pcfg = new Config("Security"); |
397 | |||
398 | if (m_pluginsInstalled) | ||
399 | { | ||
354 | pcfg->setGroup( "Plugins" ); | 400 | pcfg->setGroup( "Plugins" ); |
@@ -385,2 +431,3 @@ void MultiauthConfig::writeConfig() | |||
385 | pcfg->writeEntry( "allowBypass", m_generalConfig->allowBypass->isChecked() ); | 431 | pcfg->writeEntry( "allowBypass", m_generalConfig->allowBypass->isChecked() ); |
432 | } | ||
386 | 433 | ||
@@ -402,3 +449,6 @@ void MultiauthConfig::writeConfig() | |||
402 | target.sprintf("net%d", i); | 449 | target.sprintf("net%d", i); |
450 | if ( i < m_syncWidget->syncnet->count() ) | ||
403 | pcfg->writeEntry(target,m_syncWidget->syncnet->text(i)); | 451 | pcfg->writeEntry(target,m_syncWidget->syncnet->text(i)); |
452 | else // no more entry in the syncnet list -> we clear the line | ||
453 | pcfg->writeEntry(target, ""); | ||
404 | } | 454 | } |
diff --git a/core/settings/security/multiauthconfig.h b/core/settings/security/multiauthconfig.h index 649815d..5287083 100644 --- a/core/settings/security/multiauthconfig.h +++ b/core/settings/security/multiauthconfig.h | |||
@@ -123,2 +123,3 @@ private: | |||
123 | bool m_plugins_changed; | 123 | bool m_plugins_changed; |
124 | bool m_pluginsInstalled; | ||
124 | 125 | ||