author | zautrix <zautrix> | 2004-12-13 12:35:00 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-12-13 12:35:00 (UTC) |
commit | 7ac6c21e832b7d16bd0888d0b66252b6e152005a (patch) (unidiff) | |
tree | c7610e0e25020f19af82ac6257c2debab2638316 /kaddressbook | |
parent | 17b25691f0332e648dd1d800e89ccf4e1da8955d (diff) | |
download | kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.zip kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.gz kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.bz2 |
many bugfixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 11 | ||||
-rw-r--r-- | kaddressbook/viewmanager.cpp | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index b7edccd..f6bdda4 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -774,32 +774,33 @@ void KABCore::beamMySelf() | |||
774 | } else { | 774 | } else { |
775 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); | 775 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); |
776 | 776 | ||
777 | 777 | ||
778 | } | 778 | } |
779 | } | 779 | } |
780 | void KABCore::updateMainWindow() | 780 | void KABCore::updateMainWindow() |
781 | { | 781 | { |
782 | 782 | ||
783 | mMainWindow->showMaximized(); | 783 | mMainWindow->showMaximized(); |
784 | mMainWindow->update(); | 784 | mMainWindow->update(); |
785 | } | 785 | } |
786 | void KABCore::resizeEvent(QResizeEvent* e ) | 786 | void KABCore::resizeEvent(QResizeEvent* e ) |
787 | { | 787 | { |
788 | if ( !mMiniSplitter ) | 788 | if ( !mMiniSplitter ) |
789 | return; | 789 | return; |
790 | //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); | ||
790 | if ( QApplication::desktop()->width() >= 480 ) { | 791 | if ( QApplication::desktop()->width() >= 480 ) { |
791 | if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 | 792 | if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 |
792 | if ( mMiniSplitter->orientation() == Qt::Vertical ) { | 793 | if ( mMiniSplitter->orientation() == Qt::Vertical ) { |
793 | mMiniSplitter->setOrientation( Qt::Horizontal); | 794 | mMiniSplitter->setOrientation( Qt::Horizontal); |
794 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 795 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
795 | if ( QApplication::desktop()->width() <= 640 ) { | 796 | if ( QApplication::desktop()->width() <= 640 ) { |
796 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | 797 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); |
797 | mViewManager->getFilterAction()->setComboWidth( 150 ); | 798 | mViewManager->getFilterAction()->setComboWidth( 150 ); |
798 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | 799 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); |
799 | } | 800 | } |
800 | } | 801 | } |
801 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 | 802 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 |
802 | if ( mMiniSplitter->orientation() == Qt::Horizontal ) { | 803 | if ( mMiniSplitter->orientation() == Qt::Horizontal ) { |
803 | mMiniSplitter->setOrientation( Qt::Vertical ); | 804 | mMiniSplitter->setOrientation( Qt::Vertical ); |
804 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 805 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
805 | if ( QApplication::desktop()->width() <= 640 ) { | 806 | if ( QApplication::desktop()->width() <= 640 ) { |
@@ -2179,37 +2180,39 @@ void KABCore::addActionsManually() | |||
2179 | mActionCategories->plug( settingsMenu ); | 2180 | mActionCategories->plug( settingsMenu ); |
2180 | mActionManageCategories->plug( settingsMenu ); | 2181 | mActionManageCategories->plug( settingsMenu ); |
2181 | 2182 | ||
2182 | 2183 | ||
2183 | mActionWN->plug( helpMenu ); | 2184 | mActionWN->plug( helpMenu ); |
2184 | mActionSyncHowto->plug( helpMenu ); | 2185 | mActionSyncHowto->plug( helpMenu ); |
2185 | mActionKdeSyncHowto->plug( helpMenu ); | 2186 | mActionKdeSyncHowto->plug( helpMenu ); |
2186 | mActionMultiSyncHowto->plug( helpMenu ); | 2187 | mActionMultiSyncHowto->plug( helpMenu ); |
2187 | mActionFaq->plug( helpMenu ); | 2188 | mActionFaq->plug( helpMenu ); |
2188 | mActionLicence->plug( helpMenu ); | 2189 | mActionLicence->plug( helpMenu ); |
2189 | mActionAboutKAddressbook->plug( helpMenu ); | 2190 | mActionAboutKAddressbook->plug( helpMenu ); |
2190 | 2191 | ||
2191 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { | 2192 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { |
2192 | 2193 | ||
2193 | mActionSave->plug( tb ); | 2194 | mActionSave->plug( tb ); |
2194 | mViewManager->getFilterAction()->plug ( tb); | 2195 | mViewManager->getFilterAction()->plug ( tb); |
2195 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { | 2196 | //LR hide filteraction on started in 480x640 |
2196 | mActionUndo->plug( tb ); | 2197 | if (QApplication::desktop()->width() == 480 ) { |
2197 | mActionDelete->plug( tb ); | 2198 | mViewManager->getFilterAction()->setComboWidth( 0 ); |
2198 | mActionRedo->plug( tb ); | ||
2199 | } | 2199 | } |
2200 | mActionUndo->plug( tb ); | ||
2201 | mActionDelete->plug( tb ); | ||
2202 | mActionRedo->plug( tb ); | ||
2200 | } else { | 2203 | } else { |
2201 | mActionSave->plug( tb ); | 2204 | mActionSave->plug( tb ); |
2202 | tb->enableMoving(false); | 2205 | tb->enableMoving(false); |
2203 | } | 2206 | } |
2204 | //mActionQuit->plug ( tb ); | 2207 | //mActionQuit->plug ( tb ); |
2205 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 2208 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
2206 | 2209 | ||
2207 | //US link the searchwidget first to this. | 2210 | //US link the searchwidget first to this. |
2208 | // The real linkage to the toolbar happens later. | 2211 | // The real linkage to the toolbar happens later. |
2209 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 2212 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
2210 | //US tb->insertItem( mIncSearchWidget ); | 2213 | //US tb->insertItem( mIncSearchWidget ); |
2211 | /*US | 2214 | /*US |
2212 | mIncSearchWidget = new IncSearchWidget( tb ); | 2215 | mIncSearchWidget = new IncSearchWidget( tb ); |
2213 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 2216 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
2214 | SLOT( incrementalSearch( const QString& ) ) ); | 2217 | SLOT( incrementalSearch( const QString& ) ) ); |
2215 | 2218 | ||
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp index 0d91c12..33bef5a 100644 --- a/kaddressbook/viewmanager.cpp +++ b/kaddressbook/viewmanager.cpp | |||
@@ -47,32 +47,33 @@ $Id$ | |||
47 | #include "views/kaddressbooktableview.h" | 47 | #include "views/kaddressbooktableview.h" |
48 | #include "views/kaddressbookcardview.h" | 48 | #include "views/kaddressbookcardview.h" |
49 | #include "kaddressbookview.h" | 49 | #include "kaddressbookview.h" |
50 | 50 | ||
51 | #include <qaction.h> | 51 | #include <qaction.h> |
52 | #include <qmessagebox.h> | 52 | #include <qmessagebox.h> |
53 | #include <qpopupmenu.h> | 53 | #include <qpopupmenu.h> |
54 | #include <kconfigbase.h> | 54 | #include <kconfigbase.h> |
55 | 55 | ||
56 | #endif //KAB_EMBEDDED | 56 | #endif //KAB_EMBEDDED |
57 | 57 | ||
58 | 58 | ||
59 | #include <kdebug.h> | 59 | #include <kdebug.h> |
60 | #include <kactionclasses.h> | 60 | #include <kactionclasses.h> |
61 | 61 | ||
62 | #include <qlayout.h> | 62 | #include <qlayout.h> |
63 | #include <qapplication.h> | ||
63 | #include <qwidgetstack.h> | 64 | #include <qwidgetstack.h> |
64 | 65 | ||
65 | #include <kabc/addressbook.h> | 66 | #include <kabc/addressbook.h> |
66 | #include "filtereditdialog.h" | 67 | #include "filtereditdialog.h" |
67 | #include "addviewdialog.h" | 68 | #include "addviewdialog.h" |
68 | #include "kabcore.h" | 69 | #include "kabcore.h" |
69 | #include "kabprefs.h" | 70 | #include "kabprefs.h" |
70 | #include "viewmanager.h" | 71 | #include "viewmanager.h" |
71 | 72 | ||
72 | ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name ) | 73 | ViewManager::ViewManager( KABCore *core, QWidget *parent, const char *name ) |
73 | : QWidget( parent, name ), mCore( core ), mActiveView( 0 ) | 74 | : QWidget( parent, name ), mCore( core ), mActiveView( 0 ) |
74 | { | 75 | { |
75 | initGUI(); | 76 | initGUI(); |
76 | initActions(); | 77 | initActions(); |
77 | 78 | ||
78 | mViewDict.setAutoDelete( true ); | 79 | mViewDict.setAutoDelete( true ); |
@@ -93,33 +94,36 @@ void ViewManager::scrollUP() | |||
93 | void ViewManager::scrollDOWN() | 94 | void ViewManager::scrollDOWN() |
94 | { | 95 | { |
95 | if ( mActiveView ) | 96 | if ( mActiveView ) |
96 | mActiveView->scrollDOWN(); | 97 | mActiveView->scrollDOWN(); |
97 | } | 98 | } |
98 | void ViewManager::restoreSettings() | 99 | void ViewManager::restoreSettings() |
99 | { | 100 | { |
100 | mViewNameList = KABPrefs::instance()->mViewNames; | 101 | mViewNameList = KABPrefs::instance()->mViewNames; |
101 | QString activeViewName = KABPrefs::instance()->mCurrentView; | 102 | QString activeViewName = KABPrefs::instance()->mCurrentView; |
102 | 103 | ||
103 | mActionSelectView->setItems( mViewNameList ); | 104 | mActionSelectView->setItems( mViewNameList ); |
104 | 105 | ||
105 | // Filter | 106 | // Filter |
106 | mFilterList = Filter::restore( mCore->config(), "Filter" ); | 107 | mFilterList = Filter::restore( mCore->config(), "Filter" ); |
107 | mActionSelectFilter->setItems( filterNames() ); | 108 | mActionSelectFilter->setItems( filterNames() ); |
108 | mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); | 109 | mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); |
109 | mActionSelectFilter->setComboWidth( 150 ); | 110 | int cw = 150; |
111 | if (QApplication::desktop()->width() == 480 ) | ||
112 | cw = 0; | ||
113 | mActionSelectFilter->setComboWidth( cw ); | ||
110 | // Tell the views to reread their config, since they may have | 114 | // Tell the views to reread their config, since they may have |
111 | // been modified by global settings | 115 | // been modified by global settings |
112 | QString _oldgroup = mCore->config()->group(); | 116 | QString _oldgroup = mCore->config()->group(); |
113 | 117 | ||
114 | QDictIterator<KAddressBookView> it( mViewDict ); | 118 | QDictIterator<KAddressBookView> it( mViewDict ); |
115 | for ( it.toFirst(); it.current(); ++it ) { | 119 | for ( it.toFirst(); it.current(); ++it ) { |
116 | KConfigGroupSaver saver( mCore->config(), it.currentKey() ); | 120 | KConfigGroupSaver saver( mCore->config(), it.currentKey() ); |
117 | it.current()->readConfig( mCore->config() ); | 121 | it.current()->readConfig( mCore->config() ); |
118 | } | 122 | } |
119 | setActiveView( activeViewName ); | 123 | setActiveView( activeViewName ); |
120 | 124 | ||
121 | mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); | 125 | mActionDeleteView->setEnabled( mViewNameList.count() > 1 ); |
122 | } | 126 | } |
123 | 127 | ||
124 | void ViewManager::saveSettings() | 128 | void ViewManager::saveSettings() |
125 | { | 129 | { |
@@ -584,33 +588,36 @@ void ViewManager::setActiveFilter( int index ) | |||
584 | } | 588 | } |
585 | } | 589 | } |
586 | 590 | ||
587 | void ViewManager::configureFilters() | 591 | void ViewManager::configureFilters() |
588 | { | 592 | { |
589 | FilterDialog dlg( this ); | 593 | FilterDialog dlg( this ); |
590 | 594 | ||
591 | dlg.setFilters( mFilterList ); | 595 | dlg.setFilters( mFilterList ); |
592 | 596 | ||
593 | if ( dlg.exec() ) | 597 | if ( dlg.exec() ) |
594 | mFilterList = dlg.filters(); | 598 | mFilterList = dlg.filters(); |
595 | 599 | ||
596 | uint pos = mActionSelectFilter->currentItem(); | 600 | uint pos = mActionSelectFilter->currentItem(); |
597 | mActionSelectFilter->setItems( filterNames() ); | 601 | mActionSelectFilter->setItems( filterNames() ); |
598 | mActionSelectFilter->setCurrentItem( pos ); | 602 | mActionSelectFilter->setCurrentItem( pos ); |
599 | setActiveFilter( pos ); | 603 | setActiveFilter( pos ); |
600 | mActionSelectFilter->setComboWidth( 150 ); | 604 | int cw = 150; |
605 | if (QApplication::desktop()->width() == 480 ) | ||
606 | cw = 0; | ||
607 | mActionSelectFilter->setComboWidth( cw ); | ||
601 | } | 608 | } |
602 | 609 | ||
603 | QStringList ViewManager::filterNames() const | 610 | QStringList ViewManager::filterNames() const |
604 | { | 611 | { |
605 | QStringList names( i18n( "No Filter" ) ); | 612 | QStringList names( i18n( "No Filter" ) ); |
606 | 613 | ||
607 | Filter::List::ConstIterator it; | 614 | Filter::List::ConstIterator it; |
608 | for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) | 615 | for ( it = mFilterList.begin(); it != mFilterList.end(); ++it ) |
609 | names.append( (*it).name() ); | 616 | names.append( (*it).name() ); |
610 | 617 | ||
611 | return names; | 618 | return names; |
612 | } | 619 | } |
613 | 620 | ||
614 | int ViewManager::filterPosition( const QString &name ) const | 621 | int ViewManager::filterPosition( const QString &name ) const |
615 | { | 622 | { |
616 | int pos = 0; | 623 | int pos = 0; |