author | zautrix <zautrix> | 2005-01-17 15:26:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-17 15:26:56 (UTC) |
commit | 1525820e30e14de83a15533a3c67aa2756a544f4 (patch) (side-by-side diff) | |
tree | cb8083c4675c874b5cac9355acc4d746077b6692 | |
parent | 214b82c86bd5365d7a5fc786c8c9c7231ec6dc77 (diff) | |
download | kdepimpi-1525820e30e14de83a15533a3c67aa2756a544f4.zip kdepimpi-1525820e30e14de83a15533a3c67aa2756a544f4.tar.gz kdepimpi-1525820e30e14de83a15533a3c67aa2756a544f4.tar.bz2 |
AB fixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/viewmanager.cpp | 9 | ||||
-rw-r--r-- | kaddressbook/viewmanager.h | 1 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.cpp | 2 |
4 files changed, 10 insertions, 6 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index a480baf..9526f23 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -392,33 +392,33 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const setModified( false ); mBRdisabled = false; #ifndef DESKTOP_VERSION infrared = 0; #endif //toggleBeamReceive( ); //mMainWindow->toolBar()->show(); // we have a toolbar repainting error on the Zaurus when starting KA/Pi QTimer::singleShot( 10, this , SLOT ( updateToolBar())); } void KABCore::updateToolBar() { static int iii = 0; ++iii; mMainWindow->toolBar()->repaintMe(); - if ( iii < 5 ) + if ( iii < 3 ) QTimer::singleShot( 10, this , SLOT ( updateToolBar())); } KABCore::~KABCore() { // save(); //saveSettings(); //KABPrefs::instance()->writeConfig(); delete AddresseeConfig::instance(); mAddressBook = 0; KABC::StdAddressBook::close(); delete syncManager; #ifndef DESKTOP_VERSION if ( infrared ) delete infrared; #endif @@ -553,33 +553,33 @@ void KABCore::saveSettings() { KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); if ( mExtensionBarSplitter ) KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); #ifndef KAB_EMBEDDED KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); #endif //KAB_EMBEDDED mExtensionManager->saveSettings(); mViewManager->saveSettings(); KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); KABPrefs::instance()->writeConfig(); - qDebug("KABPrefs::instance()->writeConfig() "); + qDebug("KABCore::saveSettings() "); } KABC::AddressBook *KABCore::addressBook() const { return mAddressBook; } KConfig *KABCore::config() { #ifndef KAB_EMBEDDED return KABPrefs::instance()->config(); #else //KAB_EMBEDDED return KABPrefs::instance()->getConfig(); #endif //KAB_EMBEDDED } diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index 4be860e..04759a7 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp @@ -191,32 +191,37 @@ void ViewManager::setSelected( const QString &uid, bool selected ) mActiveView->setSelected( uid, selected ); } void ViewManager::setListSelected(QStringList list) { int i, count = list.count(); for ( i = 0; i < count;++i ) setSelected( list[i], true ); } void ViewManager::unloadViews() { mViewDict.clear(); mActiveView = 0; } +void ViewManager::selectView( const QString &name ) +{ + setActiveView( name ); + mCore->saveSettings(); +} void ViewManager::setActiveView( const QString &name ) { KAddressBookView *view = 0; // Check that this isn't the same as the current active view if ( mActiveView && ( mActiveView->caption() == name ) ) return; // At this point we know the view that should be active is not // currently active. We will try to find the new on in the list. If // we can't find it, it means it hasn't been instantiated, so we will // create it on demand. view = mViewDict.find( name ); // Check if we found the view. If we didn't, then we need to create it @@ -270,33 +275,32 @@ void ViewManager::setActiveView( const QString &name ) setActiveFilter( 0 ); } else if ( view->defaultFilterType() == KAddressBookView::Active ) { setActiveFilter( mActionSelectFilter->currentItem() ); } else { uint pos = filterPosition( view->defaultFilterName() ); mActionSelectFilter->setCurrentItem( pos ); setActiveFilter( pos ); } //US qDebug("ViewManager::setActiveView 6" ); // Update the inc search widget to show the fields in the new active // view. mCore->setSearchFields( mActiveView->fields() ); //US performance optimization. setActiveFilter calls also mActiveView->refresh() //US mActiveView->refresh(); - mCore->saveSettings(); } else { qDebug("ViewManager::setActiveView: unable to find view" ); } } //US added another method with no parameter, since my moc compiler does not support default parameters. void ViewManager::refreshView() { refreshView( QString::null ); } void ViewManager::refreshView( const QString &uid ) { if ( mActiveView ) @@ -476,33 +480,32 @@ void ViewManager::createViewFactories() // qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1()); viewFactory = new TableViewFactory(); mViewFactoryDict.insert( viewFactory->type(), viewFactory ); // qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1()); viewFactory = new CardViewFactory(); mViewFactoryDict.insert( viewFactory->type(), viewFactory ); // qDebug("ViewManager::createViewFactories() Loading factory: %s", viewFactory->type().latin1()); #endif //KAB_EMBEDDED } void ViewManager::dropped( QDropEvent *e ) { - kdDebug(5720) << "ViewManager::dropped: got a drop event" << endl; #ifndef KAB_EMBEDDED QString clipText, vcards; KURL::List urls; if ( KURLDrag::decode( e, urls) ) { KURL::List::Iterator it = urls.begin(); int c = urls.count(); if ( c > 1 ) { QString questionString = i18n( "Import one contact into your addressbook?", "Import %n contacts into your addressbook?", c ); if ( KMessageBox::questionYesNo( this, questionString, i18n( "Import Contacts?" ) ) == KMessageBox::Yes ) { for ( ; it != urls.end(); ++it ) emit urlDropped( *it ); } } else if ( c == 1 ) @@ -642,33 +645,33 @@ int ViewManager::filterPosition( const QString &name ) const void ViewManager::initActions() { //US <ActionList name="view_loadedviews"/> //US <Separator/> #ifdef KAB_EMBEDDED QPopupMenu *viewmenu = (QPopupMenu*)mCore->getViewMenu(); QPopupMenu *settingsmenu = (QPopupMenu*)mCore->getSettingsMenu(); QPopupMenu *filtermenu = (QPopupMenu*)mCore->getFilterMenu(); #endif //KAB_EMBEDDED mActionSelectView = new KSelectAction( i18n( "Select View" ), 0, mCore->actionCollection(), "select_view" ); #if KDE_VERSION >= 309 mActionSelectView->setMenuAccelsEnabled( false ); #endif connect( mActionSelectView, SIGNAL( activated( const QString& ) ), - SLOT( setActiveView( const QString& ) ) ); + SLOT( selectView( const QString& ) ) ); #ifdef KAB_EMBEDDED mActionSelectView->plug(viewmenu); viewmenu->insertSeparator(); #endif //KAB_EMBEDDED KAction *action; action = new KAction( i18n( "Modify View..." ), "configure", 0, this, SLOT( editView() ), mCore->actionCollection(), "view_modify" ); #ifndef KAB_EMBEDDED action->setWhatsThis( i18n( "By pressing this button a dialog opens that allows you to modify the view of the addressbook. There you can add or remove fields that you want to be shown or hidden in the addressbook like the name for example." ) ); #else //KAB_EMBEDDED action->plug(viewmenu); #endif //KAB_EMBEDDED diff --git a/kaddressbook/viewmanager.h b/kaddressbook/viewmanager.h index dff9998..ab5d372 100644 --- a/kaddressbook/viewmanager.h +++ b/kaddressbook/viewmanager.h @@ -113,32 +113,33 @@ class ViewManager : public QWidget /** Emitted whenever the user activates an entry in the view. */ void executed( const QString &uid ); /** Emitted whenever the address book is modified in some way. */ void modified(); /** Emitted whenever a url is dragged on a view. */ void urlDropped( const KURL& ); private slots: + void selectView( const QString &name ); void setActiveView( const QString &name ); void setActiveFilter( int index ); void configureFilters(); private: void createViewFactories(); QStringList filterNames() const; int filterPosition( const QString &name ) const; QStringList viewNames() const; int viewPosition( const QString &name ) const; void initActions(); void initGUI(); KABCore *mCore; Filter mCurrentFilter; diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp index e9226c0..1ad1728 100644 --- a/microkde/kdeui/ktoolbar.cpp +++ b/microkde/kdeui/ktoolbar.cpp @@ -1401,33 +1401,33 @@ void KToolBar::insertWidgetInternal( QWidget *w, int &index, int id ) this, SLOT( widgetDestroyed() ) ); if ( index == -1 || index > (int)widgets.count() ) { widgets.append( w ); index = (int)widgets.count(); } else widgets.insert( index, w ); if ( id == -1 ) id = id2widget.count(); id2widget.insert( id, w ); widget2id.insert( w, id ); } void KToolBar::repaintMe() { setUpdatesEnabled( true ); QToolBar::repaint( true ); - qDebug(" KToolBar::repaintMe() "); + //qDebug(" KToolBar::repaintMe() "); } void KToolBar::showEvent( QShowEvent *e ) { QToolBar::showEvent( e ); rebuildLayout(); } void KToolBar::setStretchableWidget( QWidget *w ) { QToolBar::setStretchableWidget( w ); stretchableWidget = w; } QSizePolicy KToolBar::sizePolicy() const { |