summaryrefslogtreecommitdiffabout
path: root/kaddressbook/viewmanager.cpp
authorzautrix <zautrix>2004-10-27 21:34:55 (UTC)
committer zautrix <zautrix>2004-10-27 21:34:55 (UTC)
commit9c88346fc757fd1dc54b3fca151a2a610159d8cf (patch) (unidiff)
tree4a5de97ba71ce66eea914d55923d88aff3515c93 /kaddressbook/viewmanager.cpp
parent7f3cc07fab5f5f6ddd402c458341f1df3a144e2c (diff)
downloadkdepimpi-9c88346fc757fd1dc54b3fca151a2a610159d8cf.zip
kdepimpi-9c88346fc757fd1dc54b3fca151a2a610159d8cf.tar.gz
kdepimpi-9c88346fc757fd1dc54b3fca151a2a610159d8cf.tar.bz2
several fixes
Diffstat (limited to 'kaddressbook/viewmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/viewmanager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 81e0d99..3d0c275 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -97,25 +97,25 @@ void ViewManager::scrollDOWN()
97} 97}
98void ViewManager::restoreSettings() 98void ViewManager::restoreSettings()
99{ 99{
100 mViewNameList = KABPrefs::instance()->mViewNames; 100 mViewNameList = KABPrefs::instance()->mViewNames;
101 QString activeViewName = KABPrefs::instance()->mCurrentView; 101 QString activeViewName = KABPrefs::instance()->mCurrentView;
102 102
103 mActionSelectView->setItems( mViewNameList ); 103 mActionSelectView->setItems( mViewNameList );
104 104
105 // Filter 105 // Filter
106 mFilterList = Filter::restore( mCore->config(), "Filter" ); 106 mFilterList = Filter::restore( mCore->config(), "Filter" );
107 mActionSelectFilter->setItems( filterNames() ); 107 mActionSelectFilter->setItems( filterNames() );
108 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); 108 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter );
109 109 mActionSelectFilter->setComboWidth( 100 );
110 // Tell the views to reread their config, since they may have 110 // Tell the views to reread their config, since they may have
111 // been modified by global settings 111 // been modified by global settings
112 QString _oldgroup = mCore->config()->group(); 112 QString _oldgroup = mCore->config()->group();
113 113
114 QDictIterator<KAddressBookView> it( mViewDict ); 114 QDictIterator<KAddressBookView> it( mViewDict );
115 for ( it.toFirst(); it.current(); ++it ) { 115 for ( it.toFirst(); it.current(); ++it ) {
116 KConfigGroupSaver saver( mCore->config(), it.currentKey() ); 116 KConfigGroupSaver saver( mCore->config(), it.currentKey() );
117 it.current()->readConfig( mCore->config() ); 117 it.current()->readConfig( mCore->config() );
118 } 118 }
119 setActiveView( activeViewName ); 119 setActiveView( activeViewName );
120 120
121 mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); 121 mActionDeleteView->setEnabled( mViewNameList.count() > 1 );
@@ -294,25 +294,25 @@ void ViewManager::refreshView()
294 refreshView( QString::null ); 294 refreshView( QString::null );
295} 295}
296 296
297void ViewManager::refreshView( const QString &uid ) 297void ViewManager::refreshView( const QString &uid )
298{ 298{
299 if ( mActiveView ) 299 if ( mActiveView )
300 mActiveView->refresh( uid ); 300 mActiveView->refresh( uid );
301} 301}
302 302
303void ViewManager::setFocusAV() 303void ViewManager::setFocusAV()
304{ 304{
305 if ( mActiveView ) 305 if ( mActiveView )
306 mActiveView->setFocus(); 306 mActiveView->setFocusAV();
307} 307}
308void ViewManager::editView() 308void ViewManager::editView()
309{ 309{
310 if ( !mActiveView ) 310 if ( !mActiveView )
311 return; 311 return;
312 312
313 ViewFactory *factory = mViewFactoryDict.find( mActiveView->type() ); 313 ViewFactory *factory = mViewFactoryDict.find( mActiveView->type() );
314 ViewConfigureWidget *wdg = 0; 314 ViewConfigureWidget *wdg = 0;
315 ViewConfigureDialog* dlg = 0; 315 ViewConfigureDialog* dlg = 0;
316 if ( factory ) { 316 if ( factory ) {
317 // Save the filters so the dialog has the latest set 317 // Save the filters so the dialog has the latest set
318 Filter::save( mCore->config(), "Filter", mFilterList ); 318 Filter::save( mCore->config(), "Filter", mFilterList );
@@ -588,24 +588,25 @@ void ViewManager::configureFilters()
588{ 588{
589 FilterDialog dlg( this ); 589 FilterDialog dlg( this );
590 590
591 dlg.setFilters( mFilterList ); 591 dlg.setFilters( mFilterList );
592 592
593 if ( dlg.exec() ) 593 if ( dlg.exec() )
594 mFilterList = dlg.filters(); 594 mFilterList = dlg.filters();
595 595
596 uint pos = mActionSelectFilter->currentItem(); 596 uint pos = mActionSelectFilter->currentItem();
597 mActionSelectFilter->setItems( filterNames() ); 597 mActionSelectFilter->setItems( filterNames() );
598 mActionSelectFilter->setCurrentItem( pos ); 598 mActionSelectFilter->setCurrentItem( pos );
599 setActiveFilter( pos ); 599 setActiveFilter( pos );
600 //mActionSelectFilter->setComboWidth( 150 );
600} 601}
601 602
602QStringList ViewManager::filterNames() const 603QStringList ViewManager::filterNames() const
603{ 604{
604 QStringList names( i18n( "No Filter" ) ); 605 QStringList names( i18n( "No Filter" ) );
605 606
606 Filter::List::ConstIterator it; 607 Filter::List::ConstIterator it;
607 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) 608 for ( it = mFilterList.begin(); it != mFilterList.end(); ++it )
608 names.append( (*it).name() ); 609 names.append( (*it).name() );
609 610
610 return names; 611 return names;
611} 612}
@@ -683,25 +684,24 @@ void ViewManager::initActions()
683 action = new KAction( i18n( "Refresh View" ), "reload", 0, this, 684 action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
684 SLOT( refreshView()), mCore->actionCollection(), 685 SLOT( refreshView()), mCore->actionCollection(),
685 "view_refresh" ); 686 "view_refresh" );
686 action->plug(viewmenu); 687 action->plug(viewmenu);
687 viewmenu->insertSeparator(); 688 viewmenu->insertSeparator();
688#endif //KAB_EMBEDDED 689#endif //KAB_EMBEDDED
689 690
690 action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this, 691 action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this,
691 SLOT( configureFilters() ), mCore->actionCollection(), 692 SLOT( configureFilters() ), mCore->actionCollection(),
692 "options_edit_filters" ); 693 "options_edit_filters" );
693 694
694 mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" ); 695 mActionSelectFilter = new KSelectAction( i18n( "Select Filter" ), "filter", mCore->actionCollection(), "select_filter" );
695
696#if KDE_VERSION >= 309 696#if KDE_VERSION >= 309
697 mActionSelectFilter->setMenuAccelsEnabled( false ); 697 mActionSelectFilter->setMenuAccelsEnabled( false );
698#endif 698#endif
699 connect( mActionSelectFilter, SIGNAL( activated( int ) ), 699 connect( mActionSelectFilter, SIGNAL( activated( int ) ),
700 SLOT( setActiveFilter( int ) ) ); 700 SLOT( setActiveFilter( int ) ) );
701 701
702#ifdef KAB_EMBEDDED 702#ifdef KAB_EMBEDDED
703 action->plug(settingsmenu); 703 action->plug(settingsmenu);
704 mActionSelectFilter->plug(viewmenu); 704 mActionSelectFilter->plug(viewmenu);
705#endif //KAB_EMBEDDED 705#endif //KAB_EMBEDDED
706 706
707} 707}