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/kabcore.cpp | |
parent | 17b25691f0332e648dd1d800e89ccf4e1da8955d (diff) | |
download | kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.zip kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.gz kdepimpi-7ac6c21e832b7d16bd0888d0b66252b6e152005a.tar.bz2 |
many bugfixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index b7edccd..f6bdda4 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -694,192 +694,193 @@ void KABCore::sendMail( const QString& emaillist ) | |||
694 | if (emaillist.contains(",") > 0) | 694 | if (emaillist.contains(",") > 0) |
695 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); | 695 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); |
696 | else | 696 | else |
697 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); | 697 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); |
698 | } | 698 | } |
699 | 699 | ||
700 | 700 | ||
701 | 701 | ||
702 | void KABCore::mailVCard() | 702 | void KABCore::mailVCard() |
703 | { | 703 | { |
704 | QStringList uids = mViewManager->selectedUids(); | 704 | QStringList uids = mViewManager->selectedUids(); |
705 | if ( !uids.isEmpty() ) | 705 | if ( !uids.isEmpty() ) |
706 | mailVCard( uids ); | 706 | mailVCard( uids ); |
707 | } | 707 | } |
708 | 708 | ||
709 | void KABCore::mailVCard( const QStringList& uids ) | 709 | void KABCore::mailVCard( const QStringList& uids ) |
710 | { | 710 | { |
711 | QStringList urls; | 711 | QStringList urls; |
712 | 712 | ||
713 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); | 713 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); |
714 | 714 | ||
715 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); | 715 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); |
716 | 716 | ||
717 | 717 | ||
718 | 718 | ||
719 | QDir().mkdir( dirName, true ); | 719 | QDir().mkdir( dirName, true ); |
720 | 720 | ||
721 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 721 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
722 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 722 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
723 | 723 | ||
724 | if ( a.isEmpty() ) | 724 | if ( a.isEmpty() ) |
725 | continue; | 725 | continue; |
726 | 726 | ||
727 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; | 727 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; |
728 | 728 | ||
729 | QString fileName = dirName + "/" + name; | 729 | QString fileName = dirName + "/" + name; |
730 | 730 | ||
731 | QFile outFile(fileName); | 731 | QFile outFile(fileName); |
732 | 732 | ||
733 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully | 733 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully |
734 | KABC::VCardConverter converter; | 734 | KABC::VCardConverter converter; |
735 | QString vcard; | 735 | QString vcard; |
736 | 736 | ||
737 | converter.addresseeToVCard( a, vcard ); | 737 | converter.addresseeToVCard( a, vcard ); |
738 | 738 | ||
739 | QTextStream t( &outFile ); // use a text stream | 739 | QTextStream t( &outFile ); // use a text stream |
740 | t.setEncoding( QTextStream::UnicodeUTF8 ); | 740 | t.setEncoding( QTextStream::UnicodeUTF8 ); |
741 | t << vcard; | 741 | t << vcard; |
742 | 742 | ||
743 | outFile.close(); | 743 | outFile.close(); |
744 | 744 | ||
745 | urls.append( fileName ); | 745 | urls.append( fileName ); |
746 | } | 746 | } |
747 | } | 747 | } |
748 | 748 | ||
749 | bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); | 749 | bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); |
750 | 750 | ||
751 | 751 | ||
752 | /*US | 752 | /*US |
753 | kapp->invokeMailer( QString::null, QString::null, QString::null, | 753 | kapp->invokeMailer( QString::null, QString::null, QString::null, |
754 | QString::null, // subject | 754 | QString::null, // subject |
755 | QString::null, // body | 755 | QString::null, // body |
756 | QString::null, | 756 | QString::null, |
757 | urls ); // attachments | 757 | urls ); // attachments |
758 | */ | 758 | */ |
759 | 759 | ||
760 | } | 760 | } |
761 | 761 | ||
762 | /** | 762 | /** |
763 | Beams the "WhoAmI contact. | 763 | Beams the "WhoAmI contact. |
764 | */ | 764 | */ |
765 | void KABCore::beamMySelf() | 765 | void KABCore::beamMySelf() |
766 | { | 766 | { |
767 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); | 767 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); |
768 | if (!a.isEmpty()) | 768 | if (!a.isEmpty()) |
769 | { | 769 | { |
770 | QStringList uids; | 770 | QStringList uids; |
771 | uids << a.uid(); | 771 | uids << a.uid(); |
772 | 772 | ||
773 | beamVCard(uids); | 773 | beamVCard(uids); |
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 ) { |
806 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | 807 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); |
807 | mMainWindow->showMinimized(); | 808 | mMainWindow->showMinimized(); |
808 | mViewManager->getFilterAction()->setComboWidth( 0 ); | 809 | mViewManager->getFilterAction()->setComboWidth( 0 ); |
809 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | 810 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); |
810 | } | 811 | } |
811 | } | 812 | } |
812 | } | 813 | } |
813 | } | 814 | } |
814 | 815 | ||
815 | } | 816 | } |
816 | void KABCore::export2phone() | 817 | void KABCore::export2phone() |
817 | { | 818 | { |
818 | 819 | ||
819 | QStringList uids; | 820 | QStringList uids; |
820 | XXPortSelectDialog dlg( this, false, this ); | 821 | XXPortSelectDialog dlg( this, false, this ); |
821 | if ( dlg.exec() ) | 822 | if ( dlg.exec() ) |
822 | uids = dlg.uids(); | 823 | uids = dlg.uids(); |
823 | else | 824 | else |
824 | return; | 825 | return; |
825 | if ( uids.isEmpty() ) | 826 | if ( uids.isEmpty() ) |
826 | return; | 827 | return; |
827 | // qDebug("count %d ", uids.count()); | 828 | // qDebug("count %d ", uids.count()); |
828 | 829 | ||
829 | KAex2phonePrefs ex2phone; | 830 | KAex2phonePrefs ex2phone; |
830 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 831 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
831 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 832 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
832 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 833 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
833 | 834 | ||
834 | if ( !ex2phone.exec() ) { | 835 | if ( !ex2phone.exec() ) { |
835 | return; | 836 | return; |
836 | } | 837 | } |
837 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 838 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
838 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 839 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
839 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 840 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
840 | 841 | ||
841 | 842 | ||
842 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 843 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
843 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 844 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
844 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 845 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
845 | 846 | ||
846 | QString fileName = getPhoneFile(); | 847 | QString fileName = getPhoneFile(); |
847 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) | 848 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) |
848 | return; | 849 | return; |
849 | 850 | ||
850 | message(i18n("Exporting to phone...")); | 851 | message(i18n("Exporting to phone...")); |
851 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); | 852 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); |
852 | 853 | ||
853 | } | 854 | } |
854 | QString KABCore::getPhoneFile() | 855 | QString KABCore::getPhoneFile() |
855 | { | 856 | { |
856 | #ifdef DESKTOP_VERSION | 857 | #ifdef DESKTOP_VERSION |
857 | return locateLocal("tmp", "phonefile.vcf"); | 858 | return locateLocal("tmp", "phonefile.vcf"); |
858 | #else | 859 | #else |
859 | return "/tmp/phonefile.vcf"; | 860 | return "/tmp/phonefile.vcf"; |
860 | #endif | 861 | #endif |
861 | 862 | ||
862 | } | 863 | } |
863 | void KABCore::writeToPhone( ) | 864 | void KABCore::writeToPhone( ) |
864 | { | 865 | { |
865 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) | 866 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) |
866 | message(i18n("Export to phone finished!")); | 867 | message(i18n("Export to phone finished!")); |
867 | else | 868 | else |
868 | qDebug(i18n("Error exporting to phone")); | 869 | qDebug(i18n("Error exporting to phone")); |
869 | } | 870 | } |
870 | void KABCore::beamVCard() | 871 | void KABCore::beamVCard() |
871 | { | 872 | { |
872 | QStringList uids; | 873 | QStringList uids; |
873 | XXPortSelectDialog dlg( this, false, this ); | 874 | XXPortSelectDialog dlg( this, false, this ); |
874 | if ( dlg.exec() ) | 875 | if ( dlg.exec() ) |
875 | uids = dlg.uids(); | 876 | uids = dlg.uids(); |
876 | else | 877 | else |
877 | return; | 878 | return; |
878 | if ( uids.isEmpty() ) | 879 | if ( uids.isEmpty() ) |
879 | return; | 880 | return; |
880 | beamVCard( uids ); | 881 | beamVCard( uids ); |
881 | } | 882 | } |
882 | 883 | ||
883 | 884 | ||
884 | void KABCore::beamVCard(const QStringList& uids) | 885 | void KABCore::beamVCard(const QStringList& uids) |
885 | { | 886 | { |
@@ -2099,197 +2100,199 @@ void KABCore::addActionsManually() | |||
2099 | mActionMail->plug( fileMenu ); | 2100 | mActionMail->plug( fileMenu ); |
2100 | fileMenu->insertSeparator(); | 2101 | fileMenu->insertSeparator(); |
2101 | 2102 | ||
2102 | mActionNewContact->plug( fileMenu ); | 2103 | mActionNewContact->plug( fileMenu ); |
2103 | mActionNewContact->plug( tb ); | 2104 | mActionNewContact->plug( tb ); |
2104 | 2105 | ||
2105 | mActionEditAddressee->plug( fileMenu ); | 2106 | mActionEditAddressee->plug( fileMenu ); |
2106 | // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || | 2107 | // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || |
2107 | // (!KABPrefs::instance()->mMultipleViewsAtOnce )) | 2108 | // (!KABPrefs::instance()->mMultipleViewsAtOnce )) |
2108 | mActionEditAddressee->plug( tb ); | 2109 | mActionEditAddressee->plug( tb ); |
2109 | 2110 | ||
2110 | fileMenu->insertSeparator(); | 2111 | fileMenu->insertSeparator(); |
2111 | mActionSave->plug( fileMenu ); | 2112 | mActionSave->plug( fileMenu ); |
2112 | fileMenu->insertItem( "&Import", ImportMenu ); | 2113 | fileMenu->insertItem( "&Import", ImportMenu ); |
2113 | fileMenu->insertItem( "&Export", ExportMenu ); | 2114 | fileMenu->insertItem( "&Export", ExportMenu ); |
2114 | fileMenu->insertItem( i18n("&Change"), changeMenu ); | 2115 | fileMenu->insertItem( i18n("&Change"), changeMenu ); |
2115 | #ifndef DESKTOP_VERSION | 2116 | #ifndef DESKTOP_VERSION |
2116 | if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); | 2117 | if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); |
2117 | #endif | 2118 | #endif |
2118 | 2119 | ||
2119 | fileMenu->insertSeparator(); | 2120 | fileMenu->insertSeparator(); |
2120 | mActionMailVCard->plug( fileMenu ); | 2121 | mActionMailVCard->plug( fileMenu ); |
2121 | #ifndef DESKTOP_VERSION | 2122 | #ifndef DESKTOP_VERSION |
2122 | if ( Ir::supported() ) mActionBR->plug( beamMenu ); | 2123 | if ( Ir::supported() ) mActionBR->plug( beamMenu ); |
2123 | if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu ); | 2124 | if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu ); |
2124 | if ( Ir::supported() ) mActionBeam->plug( beamMenu ); | 2125 | if ( Ir::supported() ) mActionBeam->plug( beamMenu ); |
2125 | #endif | 2126 | #endif |
2126 | fileMenu->insertSeparator(); | 2127 | fileMenu->insertSeparator(); |
2127 | mActionQuit->plug( fileMenu ); | 2128 | mActionQuit->plug( fileMenu ); |
2128 | #ifdef _WIN32_ | 2129 | #ifdef _WIN32_ |
2129 | mActionImportOL->plug( ImportMenu ); | 2130 | mActionImportOL->plug( ImportMenu ); |
2130 | #endif | 2131 | #endif |
2131 | // edit menu | 2132 | // edit menu |
2132 | mActionUndo->plug( editMenu ); | 2133 | mActionUndo->plug( editMenu ); |
2133 | mActionRedo->plug( editMenu ); | 2134 | mActionRedo->plug( editMenu ); |
2134 | editMenu->insertSeparator(); | 2135 | editMenu->insertSeparator(); |
2135 | mActionCut->plug( editMenu ); | 2136 | mActionCut->plug( editMenu ); |
2136 | mActionCopy->plug( editMenu ); | 2137 | mActionCopy->plug( editMenu ); |
2137 | mActionPaste->plug( editMenu ); | 2138 | mActionPaste->plug( editMenu ); |
2138 | mActionDelete->plug( editMenu ); | 2139 | mActionDelete->plug( editMenu ); |
2139 | editMenu->insertSeparator(); | 2140 | editMenu->insertSeparator(); |
2140 | mActionSelectAll->plug( editMenu ); | 2141 | mActionSelectAll->plug( editMenu ); |
2141 | 2142 | ||
2142 | mActionRemoveVoice->plug( changeMenu ); | 2143 | mActionRemoveVoice->plug( changeMenu ); |
2143 | // settings menu | 2144 | // settings menu |
2144 | //US special menuentry to configure the addressbook resources. On KDE | 2145 | //US special menuentry to configure the addressbook resources. On KDE |
2145 | // you do that through the control center !!! | 2146 | // you do that through the control center !!! |
2146 | mActionConfigResources->plug( settingsMenu ); | 2147 | mActionConfigResources->plug( settingsMenu ); |
2147 | settingsMenu->insertSeparator(); | 2148 | settingsMenu->insertSeparator(); |
2148 | 2149 | ||
2149 | mActionConfigKAddressbook->plug( settingsMenu ); | 2150 | mActionConfigKAddressbook->plug( settingsMenu ); |
2150 | 2151 | ||
2151 | if ( mIsPart ) { | 2152 | if ( mIsPart ) { |
2152 | //US not implemented yet | 2153 | //US not implemented yet |
2153 | //mActionConfigShortcuts->plug( settingsMenu ); | 2154 | //mActionConfigShortcuts->plug( settingsMenu ); |
2154 | //mActionConfigureToolbars->plug( settingsMenu ); | 2155 | //mActionConfigureToolbars->plug( settingsMenu ); |
2155 | 2156 | ||
2156 | } else { | 2157 | } else { |
2157 | //US not implemented yet | 2158 | //US not implemented yet |
2158 | //mActionKeyBindings->plug( settingsMenu ); | 2159 | //mActionKeyBindings->plug( settingsMenu ); |
2159 | } | 2160 | } |
2160 | 2161 | ||
2161 | settingsMenu->insertSeparator(); | 2162 | settingsMenu->insertSeparator(); |
2162 | 2163 | ||
2163 | mActionJumpBar->plug( settingsMenu ); | 2164 | mActionJumpBar->plug( settingsMenu ); |
2164 | mActionDetails->plug( settingsMenu ); | 2165 | mActionDetails->plug( settingsMenu ); |
2165 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) | 2166 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) |
2166 | mActionDetails->plug( tb ); | 2167 | mActionDetails->plug( tb ); |
2167 | settingsMenu->insertSeparator(); | 2168 | settingsMenu->insertSeparator(); |
2168 | #ifndef DESKTOP_VERSION | 2169 | #ifndef DESKTOP_VERSION |
2169 | if ( Ir::supported() ) mActionBR->plug(settingsMenu ); | 2170 | if ( Ir::supported() ) mActionBR->plug(settingsMenu ); |
2170 | #endif | 2171 | #endif |
2171 | settingsMenu->insertSeparator(); | 2172 | settingsMenu->insertSeparator(); |
2172 | 2173 | ||
2173 | mActionWhoAmI->plug( settingsMenu ); | 2174 | mActionWhoAmI->plug( settingsMenu ); |
2174 | mActionEditCategories->plug( settingsMenu ); | 2175 | mActionEditCategories->plug( settingsMenu ); |
2175 | mActionEditCategories->plug( changeMenu ); | 2176 | mActionEditCategories->plug( changeMenu ); |
2176 | mActionCategories->plug( changeMenu ); | 2177 | mActionCategories->plug( changeMenu ); |
2177 | mActionManageCategories->plug( changeMenu ); | 2178 | mActionManageCategories->plug( changeMenu ); |
2178 | 2179 | ||
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 | ||
2216 | mJumpButtonBar = new JumpButtonBar( this, this ); | 2219 | mJumpButtonBar = new JumpButtonBar( this, this ); |
2217 | 2220 | ||
2218 | //US topLayout->addWidget( mJumpButtonBar ); | 2221 | //US topLayout->addWidget( mJumpButtonBar ); |
2219 | this->layout()->add( mJumpButtonBar ); | 2222 | this->layout()->add( mJumpButtonBar ); |
2220 | */ | 2223 | */ |
2221 | 2224 | ||
2222 | #endif //KAB_EMBEDDED | 2225 | #endif //KAB_EMBEDDED |
2223 | 2226 | ||
2224 | mActionExport2phone->plug( ExportMenu ); | 2227 | mActionExport2phone->plug( ExportMenu ); |
2225 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); | 2228 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); |
2226 | syncManager->fillSyncMenu(); | 2229 | syncManager->fillSyncMenu(); |
2227 | 2230 | ||
2228 | } | 2231 | } |
2229 | void KABCore::showLicence() | 2232 | void KABCore::showLicence() |
2230 | { | 2233 | { |
2231 | KApplication::showLicence(); | 2234 | KApplication::showLicence(); |
2232 | } | 2235 | } |
2233 | 2236 | ||
2234 | void KABCore::manageCategories( ) | 2237 | void KABCore::manageCategories( ) |
2235 | { | 2238 | { |
2236 | KABCatPrefs* cp = new KABCatPrefs(); | 2239 | KABCatPrefs* cp = new KABCatPrefs(); |
2237 | cp->show(); | 2240 | cp->show(); |
2238 | int w =cp->sizeHint().width() ; | 2241 | int w =cp->sizeHint().width() ; |
2239 | int h = cp->sizeHint().height() ; | 2242 | int h = cp->sizeHint().height() ; |
2240 | int dw = QApplication::desktop()->width(); | 2243 | int dw = QApplication::desktop()->width(); |
2241 | int dh = QApplication::desktop()->height(); | 2244 | int dh = QApplication::desktop()->height(); |
2242 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2245 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2243 | if ( !cp->exec() ) { | 2246 | if ( !cp->exec() ) { |
2244 | delete cp; | 2247 | delete cp; |
2245 | return; | 2248 | return; |
2246 | } | 2249 | } |
2247 | int count = 0; | 2250 | int count = 0; |
2248 | message( i18n("Please wait, processing categories...")); | 2251 | message( i18n("Please wait, processing categories...")); |
2249 | if ( cp->addCat() ) { | 2252 | if ( cp->addCat() ) { |
2250 | KABC::AddressBook::Iterator it; | 2253 | KABC::AddressBook::Iterator it; |
2251 | QStringList catList = KABPrefs::instance()->mCustomCategories; | 2254 | QStringList catList = KABPrefs::instance()->mCustomCategories; |
2252 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2255 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2253 | QStringList catIncList = (*it).categories(); | 2256 | QStringList catIncList = (*it).categories(); |
2254 | int i; | 2257 | int i; |
2255 | for( i = 0; i< catIncList.count(); ++i ) { | 2258 | for( i = 0; i< catIncList.count(); ++i ) { |
2256 | if ( !catList.contains (catIncList[i])) { | 2259 | if ( !catList.contains (catIncList[i])) { |
2257 | catList.append( catIncList[i] ); | 2260 | catList.append( catIncList[i] ); |
2258 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2261 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2259 | ++count; | 2262 | ++count; |
2260 | } | 2263 | } |
2261 | } | 2264 | } |
2262 | } | 2265 | } |
2263 | catList.sort(); | 2266 | catList.sort(); |
2264 | KABPrefs::instance()->mCustomCategories = catList; | 2267 | KABPrefs::instance()->mCustomCategories = catList; |
2265 | KABPrefs::instance()->writeConfig(); | 2268 | KABPrefs::instance()->writeConfig(); |
2266 | message(QString::number( count )+ i18n(" categories added to list! ")); | 2269 | message(QString::number( count )+ i18n(" categories added to list! ")); |
2267 | } else { | 2270 | } else { |
2268 | QStringList catList = KABPrefs::instance()->mCustomCategories; | 2271 | QStringList catList = KABPrefs::instance()->mCustomCategories; |
2269 | QStringList catIncList; | 2272 | QStringList catIncList; |
2270 | QStringList newCatList; | 2273 | QStringList newCatList; |
2271 | KABC::AddressBook::Iterator it; | 2274 | KABC::AddressBook::Iterator it; |
2272 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2275 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2273 | QStringList catIncList = (*it).categories(); | 2276 | QStringList catIncList = (*it).categories(); |
2274 | int i; | 2277 | int i; |
2275 | if ( catIncList.count() ) { | 2278 | if ( catIncList.count() ) { |
2276 | newCatList.clear(); | 2279 | newCatList.clear(); |
2277 | for( i = 0; i< catIncList.count(); ++i ) { | 2280 | for( i = 0; i< catIncList.count(); ++i ) { |
2278 | if ( catList.contains (catIncList[i])) { | 2281 | if ( catList.contains (catIncList[i])) { |
2279 | newCatList.append( catIncList[i] ); | 2282 | newCatList.append( catIncList[i] ); |
2280 | } | 2283 | } |
2281 | } | 2284 | } |
2282 | newCatList.sort(); | 2285 | newCatList.sort(); |
2283 | (*it).setCategories( newCatList ); | 2286 | (*it).setCategories( newCatList ); |
2284 | mAddressBook->insertAddressee( (*it) ); | 2287 | mAddressBook->insertAddressee( (*it) ); |
2285 | } | 2288 | } |
2286 | } | 2289 | } |
2287 | setModified( true ); | 2290 | setModified( true ); |
2288 | mViewManager->refreshView(); | 2291 | mViewManager->refreshView(); |
2289 | mDetails->refreshView(); | 2292 | mDetails->refreshView(); |
2290 | message( i18n("Removing categories done!")); | 2293 | message( i18n("Removing categories done!")); |
2291 | } | 2294 | } |
2292 | delete cp; | 2295 | delete cp; |
2293 | } | 2296 | } |
2294 | void KABCore::removeVoice() | 2297 | void KABCore::removeVoice() |
2295 | { | 2298 | { |