-rw-r--r-- | kaddressbook/kabcore.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index af12f2b..4e2523e 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -591,49 +591,49 @@ void KABCore::restoreSettings() | |||
591 | } else { | 591 | } else { |
592 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | 592 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); |
593 | } | 593 | } |
594 | #endif | 594 | #endif |
595 | } | 595 | } |
596 | 596 | ||
597 | void KABCore::saveSettings() | 597 | void KABCore::saveSettings() |
598 | { | 598 | { |
599 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); | 599 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); |
600 | if ( mExtensionBarSplitter ) | 600 | if ( mExtensionBarSplitter ) |
601 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 601 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
602 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); | 602 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); |
603 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); | 603 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); |
604 | #ifndef KAB_EMBEDDED | 604 | #ifndef KAB_EMBEDDED |
605 | 605 | ||
606 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 606 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
607 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 607 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
608 | #endif //KAB_EMBEDDED | 608 | #endif //KAB_EMBEDDED |
609 | mExtensionManager->saveSettings(); | 609 | mExtensionManager->saveSettings(); |
610 | mViewManager->saveSettings(); | 610 | mViewManager->saveSettings(); |
611 | 611 | ||
612 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 612 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
613 | 613 | ||
614 | KABPrefs::instance()->writeConfig(); | 614 | KABPrefs::instance()->writeConfig(); |
615 | qDebug("KA: KABCore::saveSettings() "); | 615 | //qDebug("KA: KABCore::saveSettings() "); |
616 | } | 616 | } |
617 | 617 | ||
618 | KABC::AddressBook *KABCore::addressBook() const | 618 | KABC::AddressBook *KABCore::addressBook() const |
619 | { | 619 | { |
620 | return mAddressBook; | 620 | return mAddressBook; |
621 | } | 621 | } |
622 | 622 | ||
623 | KConfig *KABCore::config() | 623 | KConfig *KABCore::config() |
624 | { | 624 | { |
625 | #ifndef KAB_EMBEDDED | 625 | #ifndef KAB_EMBEDDED |
626 | return KABPrefs::instance()->config(); | 626 | return KABPrefs::instance()->config(); |
627 | #else //KAB_EMBEDDED | 627 | #else //KAB_EMBEDDED |
628 | return KABPrefs::instance()->getConfig(); | 628 | return KABPrefs::instance()->getConfig(); |
629 | #endif //KAB_EMBEDDED | 629 | #endif //KAB_EMBEDDED |
630 | } | 630 | } |
631 | 631 | ||
632 | KActionCollection *KABCore::actionCollection() const | 632 | KActionCollection *KABCore::actionCollection() const |
633 | { | 633 | { |
634 | return mGUIClient->actionCollection(); | 634 | return mGUIClient->actionCollection(); |
635 | } | 635 | } |
636 | 636 | ||
637 | KABC::Field *KABCore::currentSearchField() const | 637 | KABC::Field *KABCore::currentSearchField() const |
638 | { | 638 | { |
639 | if (mIncSearchWidget) | 639 | if (mIncSearchWidget) |
@@ -823,90 +823,100 @@ void KABCore::mailVCard( const QStringList& uids ) | |||
823 | 823 | ||
824 | } | 824 | } |
825 | 825 | ||
826 | /** | 826 | /** |
827 | Beams the "WhoAmI contact. | 827 | Beams the "WhoAmI contact. |
828 | */ | 828 | */ |
829 | void KABCore::beamMySelf() | 829 | void KABCore::beamMySelf() |
830 | { | 830 | { |
831 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); | 831 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); |
832 | if (!a.isEmpty()) | 832 | if (!a.isEmpty()) |
833 | { | 833 | { |
834 | QStringList uids; | 834 | QStringList uids; |
835 | uids << a.uid(); | 835 | uids << a.uid(); |
836 | 836 | ||
837 | beamVCard(uids); | 837 | beamVCard(uids); |
838 | } else { | 838 | } else { |
839 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); | 839 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); |
840 | 840 | ||
841 | 841 | ||
842 | } | 842 | } |
843 | } | 843 | } |
844 | void KABCore::updateMainWindow() | 844 | void KABCore::updateMainWindow() |
845 | { | 845 | { |
846 | mMainWindow->showMaximized(); | 846 | mMainWindow->showMaximized(); |
847 | mMainWindow->update(); | 847 | //mMainWindow->repaint(); |
848 | } | 848 | } |
849 | void KABCore::resizeEvent(QResizeEvent* e ) | 849 | void KABCore::resizeEvent(QResizeEvent* e ) |
850 | { | 850 | { |
851 | if ( !mMiniSplitter ) | 851 | if ( !mMiniSplitter ) |
852 | return; | 852 | return; |
853 | //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); | 853 | static int desktop_width = 0; |
854 | if ( e->oldSize().width() != e->size().width() ) | 854 | //qDebug("KABCore::resizeEvent %d %d ",desktop_width,QApplication::desktop()->width() ); |
855 | if ( desktop_width != QApplication::desktop()->width() ) | ||
855 | if ( QApplication::desktop()->width() >= 480 ) { | 856 | if ( QApplication::desktop()->width() >= 480 ) { |
856 | if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 | 857 | if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 |
858 | //qDebug("640 "); | ||
857 | if ( mMiniSplitter->orientation() == Qt::Vertical ) { | 859 | if ( mMiniSplitter->orientation() == Qt::Vertical ) { |
860 | //qDebug("switch V->H "); | ||
858 | mMiniSplitter->setOrientation( Qt::Horizontal); | 861 | mMiniSplitter->setOrientation( Qt::Horizontal); |
859 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 862 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
860 | } | 863 | } |
861 | if ( QApplication::desktop()->width() <= 640 ) { | 864 | if ( QApplication::desktop()->width() <= 640 ) { |
865 | bool shot = mMainWindow->isVisible(); | ||
862 | mMainWindow->showMinimized(); | 866 | mMainWindow->showMinimized(); |
863 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | 867 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); |
864 | mViewManager->getFilterAction()->setComboWidth( 150 ); | 868 | mViewManager->getFilterAction()->setComboWidth( 150 ); |
865 | if ( mIncSearchWidget ) | 869 | if ( mIncSearchWidget ) |
866 | mIncSearchWidget->setSize(); | 870 | mIncSearchWidget->setSize(); |
871 | if ( shot ) | ||
867 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | 872 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); |
868 | } | 873 | } |
869 | 874 | ||
870 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 | 875 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 |
876 | //qDebug("480 "); | ||
871 | if ( mMiniSplitter->orientation() == Qt::Horizontal ) { | 877 | if ( mMiniSplitter->orientation() == Qt::Horizontal ) { |
878 | //qDebug("switch H->V "); | ||
872 | mMiniSplitter->setOrientation( Qt::Vertical ); | 879 | mMiniSplitter->setOrientation( Qt::Vertical ); |
873 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 880 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
874 | } | 881 | } |
875 | if ( QApplication::desktop()->width() <= 640 ) { | 882 | if ( QApplication::desktop()->width() <= 640 ) { |
876 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | 883 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); |
884 | bool shot = mMainWindow->isVisible(); | ||
877 | mMainWindow->showMinimized(); | 885 | mMainWindow->showMinimized(); |
878 | if ( KABPrefs::instance()->mHideSearchOnSwitch ) { | 886 | if ( KABPrefs::instance()->mHideSearchOnSwitch ) { |
879 | if ( mIncSearchWidget ) { | 887 | if ( mIncSearchWidget ) { |
880 | mIncSearchWidget->setSize(); | 888 | mIncSearchWidget->setSize(); |
881 | } | 889 | } |
882 | } else { | 890 | } else { |
883 | mViewManager->getFilterAction()->setComboWidth( 0 ); | 891 | mViewManager->getFilterAction()->setComboWidth( 0 ); |
884 | } | 892 | } |
893 | if ( shot ) | ||
885 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | 894 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); |
886 | } | 895 | } |
887 | } | 896 | } |
888 | } | 897 | } |
898 | desktop_width = QApplication::desktop()->width(); | ||
889 | QWidget::resizeEvent( e ); | 899 | QWidget::resizeEvent( e ); |
890 | 900 | ||
891 | } | 901 | } |
892 | void KABCore::export2phone() | 902 | void KABCore::export2phone() |
893 | { | 903 | { |
894 | 904 | ||
895 | QStringList uids; | 905 | QStringList uids; |
896 | XXPortSelectDialog dlg( this, false, this ); | 906 | XXPortSelectDialog dlg( this, false, this ); |
897 | if ( dlg.exec() ) | 907 | if ( dlg.exec() ) |
898 | uids = dlg.uids(); | 908 | uids = dlg.uids(); |
899 | else | 909 | else |
900 | return; | 910 | return; |
901 | if ( uids.isEmpty() ) | 911 | if ( uids.isEmpty() ) |
902 | return; | 912 | return; |
903 | // qDebug("count %d ", uids.count()); | 913 | // qDebug("count %d ", uids.count()); |
904 | 914 | ||
905 | KAex2phonePrefs ex2phone; | 915 | KAex2phonePrefs ex2phone; |
906 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 916 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
907 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 917 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
908 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 918 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
909 | 919 | ||
910 | if ( !ex2phone.exec() ) { | 920 | if ( !ex2phone.exec() ) { |
911 | return; | 921 | return; |
912 | } | 922 | } |