Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/viewmanager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index bec1862..45c7b55 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp | |||
@@ -305,64 +305,69 @@ void ViewManager::editView() | |||
305 | dlg->setWidget( wdg ); | 305 | dlg->setWidget( wdg ); |
306 | 306 | ||
307 | #ifndef DESKTOP_VERSION | 307 | #ifndef DESKTOP_VERSION |
308 | //dlg.setMaximumSize( 640, 480 ); | 308 | //dlg.setMaximumSize( 640, 480 ); |
309 | //dlg->setGeometry( 40,40, 400, 300); | 309 | //dlg->setGeometry( 40,40, 400, 300); |
310 | dlg->showMaximized(); | 310 | dlg->showMaximized(); |
311 | #endif | 311 | #endif |
312 | 312 | ||
313 | KConfigGroupSaver saver( mCore->config(), mActiveView->caption() ); | 313 | KConfigGroupSaver saver( mCore->config(), mActiveView->caption() ); |
314 | 314 | ||
315 | dlg->restoreSettings( mCore->config() ); | 315 | dlg->restoreSettings( mCore->config() ); |
316 | 316 | ||
317 | if ( dlg->exec() ) { | 317 | if ( dlg->exec() ) { |
318 | dlg->saveSettings( mCore->config() ); | 318 | dlg->saveSettings( mCore->config() ); |
319 | mActiveView->readConfig( mCore->config() ); | 319 | mActiveView->readConfig( mCore->config() ); |
320 | 320 | ||
321 | // Set the proper filter in the view. By setting the combo | 321 | // Set the proper filter in the view. By setting the combo |
322 | // box, the activated slot will be called, which will push | 322 | // box, the activated slot will be called, which will push |
323 | // the filter to the view and refresh it. | 323 | // the filter to the view and refresh it. |
324 | if ( mActiveView->defaultFilterType() == KAddressBookView::None ) { | 324 | if ( mActiveView->defaultFilterType() == KAddressBookView::None ) { |
325 | mActionSelectFilter->setCurrentItem( 0 ); | 325 | mActionSelectFilter->setCurrentItem( 0 ); |
326 | setActiveFilter( 0 ); | 326 | setActiveFilter( 0 ); |
327 | } else if ( mActiveView->defaultFilterType() == KAddressBookView::Active ) { | 327 | } else if ( mActiveView->defaultFilterType() == KAddressBookView::Active ) { |
328 | setActiveFilter( mActionSelectFilter->currentItem() ); | 328 | setActiveFilter( mActionSelectFilter->currentItem() ); |
329 | } else { | 329 | } else { |
330 | uint pos = filterPosition( mActiveView->defaultFilterName() ); | 330 | uint pos = filterPosition( mActiveView->defaultFilterName() ); |
331 | mActionSelectFilter->setCurrentItem( pos ); | 331 | mActionSelectFilter->setCurrentItem( pos ); |
332 | setActiveFilter( pos ); | 332 | setActiveFilter( pos ); |
333 | } | 333 | } |
334 | mCore->setSearchFields( mActiveView->fields() ); | 334 | mCore->setSearchFields( mActiveView->fields() ); |
335 | //US performance optimization. setActiveFilter calls also mActiveView->refresh() | 335 | //US performance optimization. setActiveFilter calls also mActiveView->refresh() |
336 | //US mActiveView->refresh(); | 336 | //US mActiveView->refresh(); |
337 | |||
338 | |||
339 | //US this is a bugfix, that we get notified if we change a views configuration | ||
340 | emit modified(); | ||
341 | |||
337 | } | 342 | } |
338 | 343 | ||
339 | } | 344 | } |
340 | delete dlg; | 345 | delete dlg; |
341 | } | 346 | } |
342 | 347 | ||
343 | void ViewManager::deleteView() | 348 | void ViewManager::deleteView() |
344 | { | 349 | { |
345 | QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" ) | 350 | QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" ) |
346 | .arg( mActiveView->caption() ); | 351 | .arg( mActiveView->caption() ); |
347 | QString caption = i18n( "Confirm Delete" ); | 352 | QString caption = i18n( "Confirm Delete" ); |
348 | 353 | ||
349 | 354 | ||
350 | if (QMessageBox::information( this, caption, | 355 | if (QMessageBox::information( this, caption, |
351 | text, | 356 | text, |
352 | i18n("Yes!"), i18n("No"), 0, 0 ) == 0) | 357 | i18n("Yes!"), i18n("No"), 0, 0 ) == 0) |
353 | { | 358 | { |
354 | mViewNameList.remove( mActiveView->caption() ); | 359 | mViewNameList.remove( mActiveView->caption() ); |
355 | 360 | ||
356 | // remove the view from the config file | 361 | // remove the view from the config file |
357 | KConfig *config = mCore->config(); | 362 | KConfig *config = mCore->config(); |
358 | config->deleteGroup( mActiveView->caption() ); | 363 | config->deleteGroup( mActiveView->caption() ); |
359 | 364 | ||
360 | mViewDict.remove( mActiveView->caption() ); | 365 | mViewDict.remove( mActiveView->caption() ); |
361 | mActiveView = 0; | 366 | mActiveView = 0; |
362 | 367 | ||
363 | // we are in an invalid state now, but that should be fixed after | 368 | // we are in an invalid state now, but that should be fixed after |
364 | // we emit the signal | 369 | // we emit the signal |
365 | mActionSelectView->setItems( mViewNameList ); | 370 | mActionSelectView->setItems( mViewNameList ); |
366 | if ( mViewNameList.count() > 0 ) { | 371 | if ( mViewNameList.count() > 0 ) { |
367 | mActionSelectView->setCurrentItem( 0 ); | 372 | mActionSelectView->setCurrentItem( 0 ); |
368 | setActiveView( mViewNameList[ 0 ] ); | 373 | setActiveView( mViewNameList[ 0 ] ); |