-rw-r--r-- | kaddressbook/kabcore.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 4098dda..e61f65f 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1856,61 +1856,58 @@ void KABCore::initGUI() | |||
1856 | SLOT( incrementalSearch( const QString& ) ) ); | 1856 | SLOT( incrementalSearch( const QString& ) ) ); |
1857 | connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); | 1857 | connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); |
1858 | connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); | 1858 | connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); |
1859 | 1859 | ||
1860 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1860 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1861 | 1861 | ||
1862 | topLayout->addWidget( mJumpButtonBar ); | 1862 | topLayout->addWidget( mJumpButtonBar ); |
1863 | //US topLayout->setStretchFactor( mJumpButtonBar, 10 ); | 1863 | //US topLayout->setStretchFactor( mJumpButtonBar, 10 ); |
1864 | 1864 | ||
1865 | // mMainWindow->getIconToolBar()->raise(); | 1865 | // mMainWindow->getIconToolBar()->raise(); |
1866 | 1866 | ||
1867 | #endif //KAB_EMBEDDED | 1867 | #endif //KAB_EMBEDDED |
1868 | 1868 | ||
1869 | } | 1869 | } |
1870 | void KABCore::initActions() | 1870 | void KABCore::initActions() |
1871 | { | 1871 | { |
1872 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1872 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1873 | 1873 | ||
1874 | #ifndef KAB_EMBEDDED | 1874 | #ifndef KAB_EMBEDDED |
1875 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), | 1875 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), |
1876 | SLOT( clipboardDataChanged() ) ); | 1876 | SLOT( clipboardDataChanged() ) ); |
1877 | #endif //KAB_EMBEDDED | 1877 | #endif //KAB_EMBEDDED |
1878 | 1878 | ||
1879 | // file menu | 1879 | // file menu |
1880 | if ( mIsPart ) { | ||
1881 | mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, | ||
1882 | SLOT( sendMail() ), actionCollection(), | ||
1883 | "kaddressbook_mail" ); | ||
1884 | mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, | ||
1885 | SLOT( print() ), actionCollection(), "kaddressbook_print" ); | ||
1886 | 1880 | ||
1887 | } else { | ||
1888 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); | 1881 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); |
1889 | mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); | 1882 | //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); |
1890 | } | 1883 | mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, |
1884 | SLOT( printView() ), actionCollection(), "kaddressbook_print" ); | ||
1891 | 1885 | ||
1892 | 1886 | ||
1887 | mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, | ||
1888 | SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); | ||
1889 | |||
1893 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, | 1890 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, |
1894 | SLOT( save() ), actionCollection(), "file_sync" ); | 1891 | SLOT( save() ), actionCollection(), "file_sync" ); |
1895 | 1892 | ||
1896 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, | 1893 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, |
1897 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); | 1894 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); |
1898 | 1895 | ||
1899 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, | 1896 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, |
1900 | this, SLOT( mailVCard() ), | 1897 | this, SLOT( mailVCard() ), |
1901 | actionCollection(), "file_mail_vcard"); | 1898 | actionCollection(), "file_mail_vcard"); |
1902 | 1899 | ||
1903 | mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, | 1900 | mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, |
1904 | SLOT( export2phone() ), actionCollection(), | 1901 | SLOT( export2phone() ), actionCollection(), |
1905 | "kaddressbook_ex2phone" ); | 1902 | "kaddressbook_ex2phone" ); |
1906 | 1903 | ||
1907 | mActionBeamVCard = 0; | 1904 | mActionBeamVCard = 0; |
1908 | mActionBeam = 0; | 1905 | mActionBeam = 0; |
1909 | 1906 | ||
1910 | #ifndef DESKTOP_VERSION | 1907 | #ifndef DESKTOP_VERSION |
1911 | if ( Ir::supported() ) { | 1908 | if ( Ir::supported() ) { |
1912 | mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this, | 1909 | mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this, |
1913 | SLOT( beamVCard() ), actionCollection(), | 1910 | SLOT( beamVCard() ), actionCollection(), |
1914 | "kaddressbook_beam_vcard" ); | 1911 | "kaddressbook_beam_vcard" ); |
1915 | 1912 | ||
1916 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, | 1913 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, |
@@ -2118,48 +2115,50 @@ void KABCore::addActionsManually() | |||
2118 | tb->insertWidget(-1, 0, menuBarTB); | 2115 | tb->insertWidget(-1, 0, menuBarTB); |
2119 | mIncSearchWidget = new IncSearchWidget( tb ); | 2116 | mIncSearchWidget = new IncSearchWidget( tb ); |
2120 | 2117 | ||
2121 | tb->enableMoving(false); | 2118 | tb->enableMoving(false); |
2122 | popupBarTB->insertItem( i18n("&File"), fileMenu ); | 2119 | popupBarTB->insertItem( i18n("&File"), fileMenu ); |
2123 | popupBarTB->insertItem( i18n("&Edit"), editMenu ); | 2120 | popupBarTB->insertItem( i18n("&Edit"), editMenu ); |
2124 | popupBarTB->insertItem( i18n("&View"), viewMenu ); | 2121 | popupBarTB->insertItem( i18n("&View"), viewMenu ); |
2125 | popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); | 2122 | popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); |
2126 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); | 2123 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); |
2127 | mViewManager->getFilterAction()->plug ( popupBarTB); | 2124 | mViewManager->getFilterAction()->plug ( popupBarTB); |
2128 | //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); | 2125 | //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); |
2129 | popupBarTB->insertItem( i18n("&Help"), helpMenu ); | 2126 | popupBarTB->insertItem( i18n("&Help"), helpMenu ); |
2130 | if (QApplication::desktop()->width() > 320 ) { | 2127 | if (QApplication::desktop()->width() > 320 ) { |
2131 | // mViewManager->getFilterAction()->plug ( tb); | 2128 | // mViewManager->getFilterAction()->plug ( tb); |
2132 | } | 2129 | } |
2133 | } | 2130 | } |
2134 | #endif | 2131 | #endif |
2135 | // mActionQuit->plug ( mMainWindow->toolBar()); | 2132 | // mActionQuit->plug ( mMainWindow->toolBar()); |
2136 | 2133 | ||
2137 | 2134 | ||
2138 | 2135 | ||
2139 | //US Now connect the actions with the menue entries. | 2136 | //US Now connect the actions with the menue entries. |
2140 | #ifdef DESKTOP_VERSION | 2137 | #ifdef DESKTOP_VERSION |
2141 | mActionPrint->plug( fileMenu ); | 2138 | mActionPrint->plug( fileMenu ); |
2139 | mActionPrintDetails->plug( fileMenu ); | ||
2140 | fileMenu->insertSeparator(); | ||
2142 | #endif | 2141 | #endif |
2143 | mActionMail->plug( fileMenu ); | 2142 | mActionMail->plug( fileMenu ); |
2144 | fileMenu->insertSeparator(); | 2143 | fileMenu->insertSeparator(); |
2145 | 2144 | ||
2146 | mActionNewContact->plug( fileMenu ); | 2145 | mActionNewContact->plug( fileMenu ); |
2147 | mActionNewContact->plug( tb ); | 2146 | mActionNewContact->plug( tb ); |
2148 | 2147 | ||
2149 | mActionEditAddressee->plug( fileMenu ); | 2148 | mActionEditAddressee->plug( fileMenu ); |
2150 | // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || | 2149 | // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || |
2151 | // (!KABPrefs::instance()->mMultipleViewsAtOnce )) | 2150 | // (!KABPrefs::instance()->mMultipleViewsAtOnce )) |
2152 | mActionEditAddressee->plug( tb ); | 2151 | mActionEditAddressee->plug( tb ); |
2153 | 2152 | ||
2154 | fileMenu->insertSeparator(); | 2153 | fileMenu->insertSeparator(); |
2155 | mActionSave->plug( fileMenu ); | 2154 | mActionSave->plug( fileMenu ); |
2156 | fileMenu->insertItem( "&Import", ImportMenu ); | 2155 | fileMenu->insertItem( "&Import", ImportMenu ); |
2157 | fileMenu->insertItem( "&Export", ExportMenu ); | 2156 | fileMenu->insertItem( "&Export", ExportMenu ); |
2158 | fileMenu->insertItem( i18n("&Change"), changeMenu ); | 2157 | fileMenu->insertItem( i18n("&Change"), changeMenu ); |
2159 | #ifndef DESKTOP_VERSION | 2158 | #ifndef DESKTOP_VERSION |
2160 | if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); | 2159 | if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); |
2161 | #endif | 2160 | #endif |
2162 | #if 0 | 2161 | #if 0 |
2163 | // PENDING fix MailVCard | 2162 | // PENDING fix MailVCard |
2164 | fileMenu->insertSeparator(); | 2163 | fileMenu->insertSeparator(); |
2165 | mActionMailVCard->plug( fileMenu ); | 2164 | mActionMailVCard->plug( fileMenu ); |
@@ -2747,49 +2746,49 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i | |||
2747 | return 1; | 2746 | return 1; |
2748 | break; | 2747 | break; |
2749 | case SYNC_PREF_REMOTE: | 2748 | case SYNC_PREF_REMOTE: |
2750 | if ( lastSync > remoteMod ) | 2749 | if ( lastSync > remoteMod ) |
2751 | return 1; | 2750 | return 1; |
2752 | if ( lastSync > localMod ) | 2751 | if ( lastSync > localMod ) |
2753 | return 2; | 2752 | return 2; |
2754 | return 2; | 2753 | return 2; |
2755 | break; | 2754 | break; |
2756 | case SYNC_PREF_NEWEST: | 2755 | case SYNC_PREF_NEWEST: |
2757 | if ( localMod > remoteMod ) | 2756 | if ( localMod > remoteMod ) |
2758 | return 1; | 2757 | return 1; |
2759 | else | 2758 | else |
2760 | return 2; | 2759 | return 2; |
2761 | break; | 2760 | break; |
2762 | case SYNC_PREF_ASK: | 2761 | case SYNC_PREF_ASK: |
2763 | //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); | 2762 | //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); |
2764 | if ( lastSync > remoteMod ) | 2763 | if ( lastSync > remoteMod ) |
2765 | return 1; | 2764 | return 1; |
2766 | if ( lastSync > localMod ) | 2765 | if ( lastSync > localMod ) |
2767 | return 2; | 2766 | return 2; |
2768 | localIsNew = localMod >= remoteMod; | 2767 | localIsNew = localMod >= remoteMod; |
2769 | //qDebug("conflict! ************************************** "); | 2768 | //qDebug("conflict! ************************************** "); |
2770 | { | 2769 | { |
2771 | KPIM::AddresseeChooser acd ( *local,*remote, localIsNew , this ); | 2770 | KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this ); |
2772 | result = acd.executeD(localIsNew); | 2771 | result = acd.executeD(localIsNew); |
2773 | return result; | 2772 | return result; |
2774 | } | 2773 | } |
2775 | break; | 2774 | break; |
2776 | case SYNC_PREF_FORCE_LOCAL: | 2775 | case SYNC_PREF_FORCE_LOCAL: |
2777 | return 1; | 2776 | return 1; |
2778 | break; | 2777 | break; |
2779 | case SYNC_PREF_FORCE_REMOTE: | 2778 | case SYNC_PREF_FORCE_REMOTE: |
2780 | return 2; | 2779 | return 2; |
2781 | break; | 2780 | break; |
2782 | 2781 | ||
2783 | default: | 2782 | default: |
2784 | // SYNC_PREF_TAKE_BOTH not implemented | 2783 | // SYNC_PREF_TAKE_BOTH not implemented |
2785 | break; | 2784 | break; |
2786 | } | 2785 | } |
2787 | return 0; | 2786 | return 0; |
2788 | } | 2787 | } |
2789 | 2788 | ||
2790 | 2789 | ||
2791 | bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode) | 2790 | bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode) |
2792 | { | 2791 | { |
2793 | bool syncOK = true; | 2792 | bool syncOK = true; |
2794 | int addedAddressee = 0; | 2793 | int addedAddressee = 0; |
2795 | int addedAddresseeR = 0; | 2794 | int addedAddresseeR = 0; |