-rw-r--r-- | core/settings/security/multiauthconfig.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/settings/security/multiauthconfig.cpp b/core/settings/security/multiauthconfig.cpp index 7a5f7b9..da99804 100644 --- a/core/settings/security/multiauthconfig.cpp +++ b/core/settings/security/multiauthconfig.cpp | |||
@@ -196,151 +196,151 @@ static void test_and_start() { | |||
196 | m_mainTW->addTab(m_generalConfig, "SettingsIcon", tr( "Authentication") ); | 196 | m_mainTW->addTab(m_generalConfig, "SettingsIcon", tr( "Authentication") ); |
197 | 197 | ||
198 | } | 198 | } |
199 | // login settings page | 199 | // login settings page |
200 | m_loginWidget = new LoginBase(m_mainTW, "login config widget"); | 200 | m_loginWidget = new LoginBase(m_mainTW, "login config widget"); |
201 | m_mainTW->addTab(m_loginWidget, "security/users", tr( "Login") ); | 201 | m_mainTW->addTab(m_loginWidget, "security/users", tr( "Login") ); |
202 | 202 | ||
203 | // sync settings page | 203 | // sync settings page |
204 | m_syncWidget = new SyncBase( m_mainTW, "sync config widget" ); | 204 | m_syncWidget = new SyncBase( m_mainTW, "sync config widget" ); |
205 | m_mainTW->addTab(m_syncWidget, "security/sync", tr( "Sync") ); | 205 | m_mainTW->addTab(m_syncWidget, "security/sync", tr( "Sync") ); |
206 | 206 | ||
207 | // read the "Security" Config file and update our UI | 207 | // read the "Security" Config file and update our UI |
208 | readConfig(); | 208 | readConfig(); |
209 | 209 | ||
210 | 210 | ||
211 | if (m_pluginsInstalled) | 211 | if (m_pluginsInstalled) |
212 | { | 212 | { |
213 | /* loads plugins configuration widgets in mainTW tabs and in pluginListView | 213 | /* loads plugins configuration widgets in mainTW tabs and in pluginListView |
214 | */ | 214 | */ |
215 | 215 | ||
216 | loadPlugins(); | 216 | loadPlugins(); |
217 | 217 | ||
218 | for ( int i = pluginList.count() - 1; i >= 0; i-- ) { | 218 | for ( int i = pluginList.count() - 1; i >= 0; i-- ) { |
219 | MultiauthPlugin plugin = pluginList[i]; | 219 | MultiauthPlugin plugin = pluginList[i]; |
220 | 220 | ||
221 | // load the config widgets in the tabs | 221 | // load the config widgets in the tabs |
222 | // (configWidget will return 0l if there is no configuration GUI) | 222 | // (configWidget will return 0l if there is no configuration GUI) |
223 | MultiauthConfigWidget* widget = plugin.pluginObject->configWidget(m_mainTW); | 223 | MultiauthConfigWidget* widget = plugin.pluginObject->configWidget(m_mainTW); |
224 | if ( widget != 0l ) { | 224 | if ( widget != 0l ) { |
225 | odebug << "plugin " << plugin.name << " has a configuration widget" << oendl; | 225 | odebug << "plugin " << plugin.name << " has a configuration widget" << oendl; |
226 | configWidgetList.append(widget); | 226 | configWidgetList.append(widget); |
227 | m_mainTW->addTab( widget, plugin.pluginObject->pixmapNameConfig(), | 227 | m_mainTW->addTab( widget, plugin.pluginObject->pixmapNameConfig(), |
228 | plugin.pluginObject->pluginName() ); | 228 | plugin.pluginObject->pluginName() ); |
229 | } | 229 | } |
230 | // set the order/activate tab | 230 | // set the order/activate tab |
231 | QPixmap icon = Resource::loadPixmap( plugin.pluginObject->pixmapNameWidget() ); | 231 | QPixmap icon = Resource::loadPixmap( plugin.pluginObject->pixmapNameWidget() ); |
232 | QCheckListItem * item = new QCheckListItem(m_pluginListView, plugin.pluginObject->pluginName(), QCheckListItem::CheckBox ); | 232 | QCheckListItem * item = new QCheckListItem(m_pluginListView, plugin.pluginObject->pluginName(), QCheckListItem::CheckBox ); |
233 | if ( !icon.isNull() ) { | 233 | if ( !icon.isNull() ) { |
234 | item->setPixmap( 0, icon ); | 234 | item->setPixmap( 0, icon ); |
235 | } | 235 | } |
236 | if ( m_excludePlugins.find( plugin.name ) == m_excludePlugins.end() ) { | 236 | if ( m_excludePlugins.find( plugin.name ) == m_excludePlugins.end() ) { |
237 | item->setOn( TRUE ); | 237 | item->setOn( TRUE ); |
238 | } | 238 | } |
239 | m_plugins[plugin.name] = item; | 239 | m_plugins[plugin.name] = item; |
240 | } | 240 | } |
241 | 241 | ||
242 | // set the first tab as default. | 242 | // set the first tab as default. |
243 | m_mainTW->setCurrentTab(m_pluginListWidget); | 243 | m_mainTW->setCurrentTab(m_pluginListWidget); |
244 | 244 | ||
245 | // put the number of plugins as the max number of req. auth. | 245 | // put the number of plugins as the max number of req. auth. |
246 | m_generalConfig->m_nbSuccessMin->setMaxValue( pluginList.count() ); | 246 | m_generalConfig->m_nbSuccessMin->setMaxValue( pluginList.count() ); |
247 | } | 247 | } |
248 | else | 248 | else |
249 | { | 249 | { |
250 | /* we don't have any installed plugin there. Let's tell | 250 | /* we don't have any installed plugin there. Let's tell |
251 | * that to the user in a third tab, using the m_pluginListWidget widget | 251 | * that to the user in a third tab, using the m_pluginListWidget widget |
252 | */ | 252 | */ |
253 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget (no plugins warning)"); | 253 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget (no plugins warning)"); |
254 | QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); | 254 | QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); |
255 | pluginListLayout->setSpacing(11); | 255 | pluginListLayout->setSpacing(11); |
256 | pluginListLayout->setMargin(11); | 256 | pluginListLayout->setMargin(11); |
257 | pluginListLayout->setAlignment( Qt::AlignTop ); | 257 | pluginListLayout->setAlignment( Qt::AlignTop ); |
258 | QVGroupBox *warningBox = new QVGroupBox(tr("Important notice"), m_pluginListWidget, "noPlugins warning box"); | 258 | QVGroupBox *warningBox = new QVGroupBox(tr("Important notice"), m_pluginListWidget, "noPlugins warning box"); |
259 | pluginListLayout->addWidget(warningBox); | 259 | pluginListLayout->addWidget(warningBox); |
260 | 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 ); | 260 | 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-securityplugin-*</em> package! Once you have done that, you will be able to configure your PDA protection here.") + "</p>", warningBox ); |
261 | 261 | ||
262 | m_mainTW->addTab(m_pluginListWidget, "security/Security", tr( "Locking") ); | 262 | m_mainTW->addTab(m_pluginListWidget, "security/Security", tr( "Locking") ); |
263 | 263 | ||
264 | // set the first tab as default. | 264 | // set the first tab as default. |
265 | m_mainTW->setCurrentTab(m_loginWidget); | 265 | m_mainTW->setCurrentTab(m_loginWidget); |
266 | } | 266 | } |
267 | 267 | ||
268 | showMaximized(); | 268 | showMaximized(); |
269 | } | 269 | } |
270 | 270 | ||
271 | /// nothing to do | 271 | /// nothing to do |
272 | MultiauthConfig::~MultiauthConfig() | 272 | MultiauthConfig::~MultiauthConfig() |
273 | { | 273 | { |
274 | } | 274 | } |
275 | 275 | ||
276 | /// saves the general and plugin(s) configurations | 276 | /// saves the general and plugin(s) configurations |
277 | void MultiauthConfig::writeConfigs() { | 277 | void MultiauthConfig::writeConfigs() { |
278 | MultiauthConfigWidget* confWidget = 0; | 278 | MultiauthConfigWidget* confWidget = 0; |
279 | for ( confWidget = configWidgetList.first(); confWidget != 0; | 279 | for ( confWidget = configWidgetList.first(); confWidget != 0; |
280 | confWidget = configWidgetList.next() ) | 280 | confWidget = configWidgetList.next() ) |
281 | confWidget->writeConfig(); | 281 | confWidget->writeConfig(); |
282 | 282 | ||
283 | writeConfig(); | 283 | writeConfig(); |
284 | } | 284 | } |
285 | 285 | ||
286 | /// on QDialog::accept, we save all the configurations and exit the QDialog normally | 286 | /// on QDialog::accept, we save all the configurations and exit the QDialog normally |
287 | void MultiauthConfig::accept() { | 287 | void MultiauthConfig::accept() { |
288 | writeConfigs(); | 288 | writeConfigs(); |
289 | QDialog::accept(); | 289 | QDialog::accept(); |
290 | } | 290 | } |
291 | 291 | ||
292 | void MultiauthConfig::done( int r ) { | 292 | void MultiauthConfig::done( int r ) { |
293 | QDialog::done( r ); | 293 | QDialog::done( r ); |
294 | close(); | 294 | close(); |
295 | } | 295 | } |
296 | 296 | ||
297 | /// moves up the selected plugin | 297 | /// moves up the selected plugin |
298 | void MultiauthConfig::moveSelectedUp() | 298 | void MultiauthConfig::moveSelectedUp() |
299 | { | 299 | { |
300 | QListViewItem *item = m_pluginListView->selectedItem(); | 300 | QListViewItem *item = m_pluginListView->selectedItem(); |
301 | if ( item && item->itemAbove() ) { | 301 | if ( item && item->itemAbove() ) { |
302 | item->itemAbove()->moveItem( item ); | 302 | item->itemAbove()->moveItem( item ); |
303 | } | 303 | } |
304 | } | 304 | } |
305 | 305 | ||
306 | /// moves down the selected plugin | 306 | /// moves down the selected plugin |
307 | void MultiauthConfig::moveSelectedDown() | 307 | void MultiauthConfig::moveSelectedDown() |
308 | { | 308 | { |
309 | QListViewItem *item = m_pluginListView->selectedItem(); | 309 | QListViewItem *item = m_pluginListView->selectedItem(); |
310 | if ( item && item->itemBelow() ) { | 310 | if ( item && item->itemBelow() ) { |
311 | item->moveItem( item->itemBelow() ); | 311 | item->moveItem( item->itemBelow() ); |
312 | } | 312 | } |
313 | } | 313 | } |
314 | 314 | ||
315 | /// reads the <code>Security.conf</code> Config file, and updates parts of the user interface | 315 | /// reads the <code>Security.conf</code> Config file, and updates parts of the user interface |
316 | void MultiauthConfig::readConfig() | 316 | void MultiauthConfig::readConfig() |
317 | { | 317 | { |
318 | // pointer, so we release this Config when we want | 318 | // pointer, so we release this Config when we want |
319 | Config* pcfg = new Config("Security"); | 319 | Config* pcfg = new Config("Security"); |
320 | 320 | ||
321 | if (m_pluginsInstalled) | 321 | if (m_pluginsInstalled) |
322 | { | 322 | { |
323 | pcfg->setGroup( "Misc" ); | 323 | pcfg->setGroup( "Misc" ); |
324 | m_generalConfig->m_onStart->setChecked( pcfg->readBoolEntry( "onStart", false ) ); | 324 | m_generalConfig->m_onStart->setChecked( pcfg->readBoolEntry( "onStart", false ) ); |
325 | m_generalConfig->m_onResume->setChecked( pcfg->readBoolEntry( "onResume", false ) ); | 325 | m_generalConfig->m_onResume->setChecked( pcfg->readBoolEntry( "onResume", false ) ); |
326 | m_generalConfig->m_nbSuccessMin->setValue( pcfg->readNumEntry( "nbSuccessMin", 1 ) ); | 326 | m_generalConfig->m_nbSuccessMin->setValue( pcfg->readNumEntry( "nbSuccessMin", 1 ) ); |
327 | m_generalConfig->m_noProtectConfig->setChecked( pcfg->readBoolEntry( "noProtectConfig", true) ); | 327 | m_generalConfig->m_noProtectConfig->setChecked( pcfg->readBoolEntry( "noProtectConfig", true) ); |
328 | m_generalConfig->m_explanScreens->setChecked( pcfg->readBoolEntry( "explanScreens", true ) ); | 328 | m_generalConfig->m_explanScreens->setChecked( pcfg->readBoolEntry( "explanScreens", true ) ); |
329 | 329 | ||
330 | pcfg->setGroup( "Plugins" ); | 330 | pcfg->setGroup( "Plugins" ); |
331 | m_excludePlugins = pcfg->readListEntry( "ExcludePlugins", ',' ); | 331 | m_excludePlugins = pcfg->readListEntry( "ExcludePlugins", ',' ); |
332 | m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' ); | 332 | m_allPlugins = pcfg->readListEntry( "AllPlugins", ',' ); |
333 | } | 333 | } |
334 | 334 | ||
335 | /* Login and Sync stuff */ | 335 | /* Login and Sync stuff */ |
336 | pcfg->setGroup("Sync"); | 336 | pcfg->setGroup("Sync"); |
337 | int auth_peer = pcfg->readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 | 337 | int auth_peer = pcfg->readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24 |
338 | int auth_peer_bits = pcfg->readNumEntry("auth_peer_bits",24); | 338 | int auth_peer_bits = pcfg->readNumEntry("auth_peer_bits",24); |
339 | 339 | ||
340 | pcfg->setGroup("SyncMode"); | 340 | pcfg->setGroup("SyncMode"); |
341 | int mode = pcfg->readNumEntry("Mode",2); // Default to Sharp | 341 | int mode = pcfg->readNumEntry("Mode",2); // Default to Sharp |
342 | switch( mode ) { | 342 | switch( mode ) { |
343 | case 0x01: | 343 | case 0x01: |
344 | m_syncWidget->syncModeCombo->setCurrentItem( 0 ); | 344 | m_syncWidget->syncModeCombo->setCurrentItem( 0 ); |
345 | break; | 345 | break; |
346 | case 0x02: | 346 | case 0x02: |