author | zautrix <zautrix> | 2004-10-28 11:03:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-28 11:03:42 (UTC) |
commit | 01cd4ef94b8604532181c390e9abd560aebaf372 (patch) (unidiff) | |
tree | 96ca1a524512ae2e2868f0bd3df03e4da5c445f9 | |
parent | 61d9eb436349a841410559f51e2601a34ceb5794 (diff) | |
download | kdepimpi-01cd4ef94b8604532181c390e9abd560aebaf372.zip kdepimpi-01cd4ef94b8604532181c390e9abd560aebaf372.tar.gz kdepimpi-01cd4ef94b8604532181c390e9abd560aebaf372.tar.bz2 |
added howto to menus
-rw-r--r-- | kaddressbook/kabcore.cpp | 32 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 12 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 48 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 2 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 4 |
6 files changed, 74 insertions, 28 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 5ebd3a4..bdc5bd8 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1881,64 +1881,70 @@ void KABCore::initActions() | |||
1881 | 1881 | ||
1882 | 1882 | ||
1883 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1883 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1884 | SLOT( setWhoAmI() ), actionCollection(), | 1884 | SLOT( setWhoAmI() ), actionCollection(), |
1885 | "set_personal" ); | 1885 | "set_personal" ); |
1886 | 1886 | ||
1887 | 1887 | ||
1888 | 1888 | ||
1889 | 1889 | ||
1890 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1890 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1891 | SLOT( setCategories() ), actionCollection(), | 1891 | SLOT( setCategories() ), actionCollection(), |
1892 | "edit_set_categories" ); | 1892 | "edit_set_categories" ); |
1893 | 1893 | ||
1894 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1894 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1895 | SLOT( removeVoice() ), actionCollection(), | 1895 | SLOT( removeVoice() ), actionCollection(), |
1896 | "remove_voice" ); | 1896 | "remove_voice" ); |
1897 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, | 1897 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, |
1898 | SLOT( importFromOL() ), actionCollection(), | 1898 | SLOT( importFromOL() ), actionCollection(), |
1899 | "import_OL" ); | 1899 | "import_OL" ); |
1900 | #ifdef KAB_EMBEDDED | 1900 | #ifdef KAB_EMBEDDED |
1901 | mActionLicence = new KAction( i18n( "Licence" ), 0, | 1901 | mActionLicence = new KAction( i18n( "Licence" ), 0, |
1902 | this, SLOT( showLicence() ), actionCollection(), | 1902 | this, SLOT( showLicence() ), actionCollection(), |
1903 | "licence_about_data" ); | 1903 | "licence_about_data" ); |
1904 | mActionFaq = new KAction( i18n( "Faq" ), 0, | 1904 | mActionFaq = new KAction( i18n( "Faq" ), 0, |
1905 | this, SLOT( faq() ), actionCollection(), | 1905 | this, SLOT( faq() ), actionCollection(), |
1906 | "faq_about_data" ); | 1906 | "faq_about_data" ); |
1907 | mActionWN = new KAction( i18n( "What's New?" ), 0, | 1907 | mActionWN = new KAction( i18n( "What's New?" ), 0, |
1908 | this, SLOT( whatsnew() ), actionCollection(), | 1908 | this, SLOT( whatsnew() ), actionCollection(), |
1909 | "wn" ); | 1909 | "wn" ); |
1910 | mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, | 1910 | mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, |
1911 | this, SLOT( synchowto() ), actionCollection(), | 1911 | this, SLOT( synchowto() ), actionCollection(), |
1912 | "sync" ); | 1912 | "sync" ); |
1913 | mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, | ||
1914 | this, SLOT( kdesynchowto() ), actionCollection(), | ||
1915 | "kdesync" ); | ||
1916 | mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, | ||
1917 | this, SLOT( multisynchowto() ), actionCollection(), | ||
1918 | "multisync" ); | ||
1913 | 1919 | ||
1914 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1920 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1915 | this, SLOT( createAboutData() ), actionCollection(), | 1921 | this, SLOT( createAboutData() ), actionCollection(), |
1916 | "kaddressbook_about_data" ); | 1922 | "kaddressbook_about_data" ); |
1917 | #endif //KAB_EMBEDDED | 1923 | #endif //KAB_EMBEDDED |
1918 | 1924 | ||
1919 | clipboardDataChanged(); | 1925 | clipboardDataChanged(); |
1920 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1926 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1921 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1927 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1922 | } | 1928 | } |
1923 | 1929 | ||
1924 | //US we need this function, to plug all actions into the correct menues. | 1930 | //US we need this function, to plug all actions into the correct menues. |
1925 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1931 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1926 | void KABCore::addActionsManually() | 1932 | void KABCore::addActionsManually() |
1927 | { | 1933 | { |
1928 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1934 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1929 | 1935 | ||
1930 | #ifdef KAB_EMBEDDED | 1936 | #ifdef KAB_EMBEDDED |
1931 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 1937 | QPopupMenu *fileMenu = new QPopupMenu( this ); |
1932 | QPopupMenu *editMenu = new QPopupMenu( this ); | 1938 | QPopupMenu *editMenu = new QPopupMenu( this ); |
1933 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 1939 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
1934 | 1940 | ||
1935 | KToolBar* tb = mMainWindow->toolBar(); | 1941 | KToolBar* tb = mMainWindow->toolBar(); |
1936 | 1942 | ||
1937 | #ifndef DESKTOP_VERSION | 1943 | #ifndef DESKTOP_VERSION |
1938 | if ( KABPrefs::instance()->mFullMenuBarVisible ) { | 1944 | if ( KABPrefs::instance()->mFullMenuBarVisible ) { |
1939 | #endif | 1945 | #endif |
1940 | QMenuBar* mb = mMainWindow->menuBar(); | 1946 | QMenuBar* mb = mMainWindow->menuBar(); |
1941 | 1947 | ||
1942 | //US setup menubar. | 1948 | //US setup menubar. |
1943 | //Disable the following block if you do not want to have a menubar. | 1949 | //Disable the following block if you do not want to have a menubar. |
1944 | mb->insertItem( "&File", fileMenu ); | 1950 | mb->insertItem( "&File", fileMenu ); |
@@ -2022,66 +2028,68 @@ void KABCore::addActionsManually() | |||
2022 | // you do that through the control center !!! | 2028 | // you do that through the control center !!! |
2023 | mActionConfigResources->plug( settingsMenu ); | 2029 | mActionConfigResources->plug( settingsMenu ); |
2024 | settingsMenu->insertSeparator(); | 2030 | settingsMenu->insertSeparator(); |
2025 | 2031 | ||
2026 | mActionConfigKAddressbook->plug( settingsMenu ); | 2032 | mActionConfigKAddressbook->plug( settingsMenu ); |
2027 | 2033 | ||
2028 | if ( mIsPart ) { | 2034 | if ( mIsPart ) { |
2029 | //US not implemented yet | 2035 | //US not implemented yet |
2030 | //mActionConfigShortcuts->plug( settingsMenu ); | 2036 | //mActionConfigShortcuts->plug( settingsMenu ); |
2031 | //mActionConfigureToolbars->plug( settingsMenu ); | 2037 | //mActionConfigureToolbars->plug( settingsMenu ); |
2032 | 2038 | ||
2033 | } else { | 2039 | } else { |
2034 | //US not implemented yet | 2040 | //US not implemented yet |
2035 | //mActionKeyBindings->plug( settingsMenu ); | 2041 | //mActionKeyBindings->plug( settingsMenu ); |
2036 | } | 2042 | } |
2037 | 2043 | ||
2038 | settingsMenu->insertSeparator(); | 2044 | settingsMenu->insertSeparator(); |
2039 | 2045 | ||
2040 | mActionJumpBar->plug( settingsMenu ); | 2046 | mActionJumpBar->plug( settingsMenu ); |
2041 | mActionDetails->plug( settingsMenu ); | 2047 | mActionDetails->plug( settingsMenu ); |
2042 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) | 2048 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) |
2043 | mActionDetails->plug( tb ); | 2049 | mActionDetails->plug( tb ); |
2044 | settingsMenu->insertSeparator(); | 2050 | settingsMenu->insertSeparator(); |
2045 | mActionBR->plug(settingsMenu ); | 2051 | mActionBR->plug(settingsMenu ); |
2046 | settingsMenu->insertSeparator(); | 2052 | settingsMenu->insertSeparator(); |
2047 | 2053 | ||
2048 | mActionWhoAmI->plug( settingsMenu ); | 2054 | mActionWhoAmI->plug( settingsMenu ); |
2049 | mActionCategories->plug( settingsMenu ); | 2055 | mActionCategories->plug( settingsMenu ); |
2050 | 2056 | ||
2051 | 2057 | ||
2052 | mActionWN->plug( helpMenu ); | 2058 | mActionWN->plug( helpMenu ); |
2053 | mActionSyncHowto->plug( helpMenu ); | 2059 | mActionSyncHowto->plug( helpMenu ); |
2054 | mActionLicence->plug( helpMenu ); | 2060 | mActionKdeSyncHowto->plug( helpMenu ); |
2061 | mActionMultiSyncHowto->plug( helpMenu ); | ||
2055 | mActionFaq->plug( helpMenu ); | 2062 | mActionFaq->plug( helpMenu ); |
2063 | mActionLicence->plug( helpMenu ); | ||
2056 | mActionAboutKAddressbook->plug( helpMenu ); | 2064 | mActionAboutKAddressbook->plug( helpMenu ); |
2057 | 2065 | ||
2058 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { | 2066 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { |
2059 | 2067 | ||
2060 | mActionSave->plug( tb ); | 2068 | mActionSave->plug( tb ); |
2061 | mViewManager->getFilterAction()->plug ( tb); | 2069 | mViewManager->getFilterAction()->plug ( tb); |
2062 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { | 2070 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { |
2063 | mActionUndo->plug( tb ); | 2071 | mActionUndo->plug( tb ); |
2064 | mActionDelete->plug( tb ); | 2072 | mActionDelete->plug( tb ); |
2065 | mActionRedo->plug( tb ); | 2073 | mActionRedo->plug( tb ); |
2066 | } | 2074 | } |
2067 | } else { | 2075 | } else { |
2068 | mActionSave->plug( tb ); | 2076 | mActionSave->plug( tb ); |
2069 | tb->enableMoving(false); | 2077 | tb->enableMoving(false); |
2070 | } | 2078 | } |
2071 | //mActionQuit->plug ( tb ); | 2079 | //mActionQuit->plug ( tb ); |
2072 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 2080 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
2073 | 2081 | ||
2074 | //US link the searchwidget first to this. | 2082 | //US link the searchwidget first to this. |
2075 | // The real linkage to the toolbar happens later. | 2083 | // The real linkage to the toolbar happens later. |
2076 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 2084 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
2077 | //US tb->insertItem( mIncSearchWidget ); | 2085 | //US tb->insertItem( mIncSearchWidget ); |
2078 | /*US | 2086 | /*US |
2079 | mIncSearchWidget = new IncSearchWidget( tb ); | 2087 | mIncSearchWidget = new IncSearchWidget( tb ); |
2080 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 2088 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
2081 | SLOT( incrementalSearch( const QString& ) ) ); | 2089 | SLOT( incrementalSearch( const QString& ) ) ); |
2082 | 2090 | ||
2083 | mJumpButtonBar = new JumpButtonBar( this, this ); | 2091 | mJumpButtonBar = new JumpButtonBar( this, this ); |
2084 | 2092 | ||
2085 | //US topLayout->addWidget( mJumpButtonBar ); | 2093 | //US topLayout->addWidget( mJumpButtonBar ); |
2086 | this->layout()->add( mJumpButtonBar ); | 2094 | this->layout()->add( mJumpButtonBar ); |
2087 | */ | 2095 | */ |
@@ -2321,65 +2329,72 @@ void KABCore::requestForDetails(const QString& sourceChannel, const QString& ses | |||
2321 | 2329 | ||
2322 | // raise Ka/Pi if it is in the background | 2330 | // raise Ka/Pi if it is in the background |
2323 | #ifndef DESKTOP_VERSION | 2331 | #ifndef DESKTOP_VERSION |
2324 | #ifndef KORG_NODCOP | 2332 | #ifndef KORG_NODCOP |
2325 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); | 2333 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); |
2326 | #endif | 2334 | #endif |
2327 | #endif | 2335 | #endif |
2328 | 2336 | ||
2329 | mMainWindow->showMaximized(); | 2337 | mMainWindow->showMaximized(); |
2330 | mMainWindow-> raise(); | 2338 | mMainWindow-> raise(); |
2331 | 2339 | ||
2332 | mViewManager->setSelected( "", false); | 2340 | mViewManager->setSelected( "", false); |
2333 | mViewManager->refreshView( "" ); | 2341 | mViewManager->refreshView( "" ); |
2334 | mViewManager->setSelected( foundUid, true ); | 2342 | mViewManager->setSelected( foundUid, true ); |
2335 | mViewManager->refreshView( foundUid ); | 2343 | mViewManager->refreshView( foundUid ); |
2336 | 2344 | ||
2337 | if ( !mMultipleViewsAtOnce ) | 2345 | if ( !mMultipleViewsAtOnce ) |
2338 | { | 2346 | { |
2339 | setDetailsVisible( true ); | 2347 | setDetailsVisible( true ); |
2340 | mActionDetails->setChecked(true); | 2348 | mActionDetails->setChecked(true); |
2341 | } | 2349 | } |
2342 | } | 2350 | } |
2343 | } | 2351 | } |
2344 | 2352 | ||
2345 | void KABCore::whatsnew() | 2353 | void KABCore::whatsnew() |
2346 | { | 2354 | { |
2347 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 2355 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
2348 | } | 2356 | } |
2349 | void KABCore::synchowto() | 2357 | void KABCore::synchowto() |
2350 | { | 2358 | { |
2351 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 2359 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
2352 | } | 2360 | } |
2353 | 2361 | void KABCore::kdesynchowto() | |
2362 | { | ||
2363 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | ||
2364 | } | ||
2365 | void KABCore::multisynchowto() | ||
2366 | { | ||
2367 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | ||
2368 | } | ||
2354 | void KABCore::faq() | 2369 | void KABCore::faq() |
2355 | { | 2370 | { |
2356 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); | 2371 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); |
2357 | } | 2372 | } |
2358 | 2373 | ||
2359 | #include <libkcal/syncdefines.h> | 2374 | #include <libkcal/syncdefines.h> |
2360 | 2375 | ||
2361 | KABC::Addressee KABCore::getLastSyncAddressee() | 2376 | KABC::Addressee KABCore::getLastSyncAddressee() |
2362 | { | 2377 | { |
2363 | Addressee lse; | 2378 | Addressee lse; |
2364 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2379 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2365 | 2380 | ||
2366 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); | 2381 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); |
2367 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2382 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2368 | if (lse.isEmpty()) { | 2383 | if (lse.isEmpty()) { |
2369 | qDebug("Creating new last-syncAddressee "); | 2384 | qDebug("Creating new last-syncAddressee "); |
2370 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2385 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2371 | QString sum = ""; | 2386 | QString sum = ""; |
2372 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 2387 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
2373 | sum = "E: "; | 2388 | sum = "E: "; |
2374 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); | 2389 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); |
2375 | lse.setRevision( mLastAddressbookSync ); | 2390 | lse.setRevision( mLastAddressbookSync ); |
2376 | lse.setCategories( i18n("SyncEvent") ); | 2391 | lse.setCategories( i18n("SyncEvent") ); |
2377 | mAddressBook->insertAddressee( lse ); | 2392 | mAddressBook->insertAddressee( lse ); |
2378 | } | 2393 | } |
2379 | return lse; | 2394 | return lse; |
2380 | } | 2395 | } |
2381 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) | 2396 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) |
2382 | { | 2397 | { |
2383 | 2398 | ||
2384 | //void setZaurusId(int id); | 2399 | //void setZaurusId(int id); |
2385 | // int zaurusId() const; | 2400 | // int zaurusId() const; |
@@ -2749,68 +2764,72 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2749 | inR.setResource( 0 ); | 2764 | inR.setResource( 0 ); |
2750 | remote->insertAddressee( inR, false ); | 2765 | remote->insertAddressee( inR, false ); |
2751 | } | 2766 | } |
2752 | } | 2767 | } |
2753 | } | 2768 | } |
2754 | } | 2769 | } |
2755 | } | 2770 | } |
2756 | } | 2771 | } |
2757 | ++incCounter; | 2772 | ++incCounter; |
2758 | } | 2773 | } |
2759 | el.clear(); | 2774 | el.clear(); |
2760 | syncManager->hideProgressBar(); | 2775 | syncManager->hideProgressBar(); |
2761 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); | 2776 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); |
2762 | // get rid of micro seconds | 2777 | // get rid of micro seconds |
2763 | QTime t = mLastAddressbookSync.time(); | 2778 | QTime t = mLastAddressbookSync.time(); |
2764 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); | 2779 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); |
2765 | addresseeLSync.setRevision( mLastAddressbookSync ); | 2780 | addresseeLSync.setRevision( mLastAddressbookSync ); |
2766 | addresseeRSync.setRevision( mLastAddressbookSync ); | 2781 | addresseeRSync.setRevision( mLastAddressbookSync ); |
2767 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; | 2782 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; |
2768 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); | 2783 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); |
2769 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; | 2784 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; |
2770 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); | 2785 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); |
2771 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; | 2786 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; |
2772 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); | 2787 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); |
2773 | addresseeRSync.setNote( "" ) ; | 2788 | addresseeRSync.setNote( "" ) ; |
2774 | addresseeLSync.setNote( "" ); | 2789 | addresseeLSync.setNote( "" ); |
2775 | 2790 | ||
2776 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) | 2791 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) |
2777 | remote->insertAddressee( addresseeRSync, false ); | 2792 | remote->insertAddressee( addresseeRSync, false ); |
2778 | local->insertAddressee( addresseeLSync, false ); | 2793 | local->insertAddressee( addresseeLSync, false ); |
2779 | QString mes; | 2794 | QString mes; |
2780 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); | 2795 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); |
2781 | if ( syncManager->mShowSyncSummary ) { | ||
2782 | KMessageBox::information(this, mes, i18n("KA/Pi Synchronization") ); | ||
2783 | } | ||
2784 | qDebug( mes ); | 2796 | qDebug( mes ); |
2797 | if ( syncManager->mShowSyncSummary ) { | ||
2798 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, | ||
2799 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { | ||
2800 | qDebug("cancelled "); | ||
2801 | return false; | ||
2802 | } | ||
2803 | } | ||
2785 | return syncOK; | 2804 | return syncOK; |
2786 | } | 2805 | } |
2787 | 2806 | ||
2788 | 2807 | ||
2789 | //this is a overwritten callbackmethods from the syncinterface | 2808 | //this is a overwritten callbackmethods from the syncinterface |
2790 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | 2809 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) |
2791 | { | 2810 | { |
2792 | 2811 | ||
2793 | //pending prepare addresseeview for output | 2812 | //pending prepare addresseeview for output |
2794 | //pending detect, if remote file has REV field. if not switch to external sync | 2813 | //pending detect, if remote file has REV field. if not switch to external sync |
2795 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 2814 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
2796 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 2815 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
2797 | 2816 | ||
2798 | AddressBook abLocal(filename,"syncContact"); | 2817 | AddressBook abLocal(filename,"syncContact"); |
2799 | bool syncOK = false; | 2818 | bool syncOK = false; |
2800 | if ( abLocal.load() ) { | 2819 | if ( abLocal.load() ) { |
2801 | qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); | 2820 | qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); |
2802 | bool external = false; | 2821 | bool external = false; |
2803 | bool isXML = false; | 2822 | bool isXML = false; |
2804 | if ( filename.right(4) == ".xml") { | 2823 | if ( filename.right(4) == ".xml") { |
2805 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2824 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2806 | isXML = true; | 2825 | isXML = true; |
2807 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 2826 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
2808 | } else { | 2827 | } else { |
2809 | external = !manager->mIsKapiFile; | 2828 | external = !manager->mIsKapiFile; |
2810 | if ( external ) { | 2829 | if ( external ) { |
2811 | qDebug("Setting vcf mode to external "); | 2830 | qDebug("Setting vcf mode to external "); |
2812 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2831 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2813 | AddressBook::Iterator it; | 2832 | AddressBook::Iterator it; |
2814 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 2833 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
2815 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); | 2834 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); |
2816 | (*it).computeCsum( mCurrentSyncDevice ); | 2835 | (*it).computeCsum( mCurrentSyncDevice ); |
@@ -2845,65 +2864,66 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
2845 | return syncOK; | 2864 | return syncOK; |
2846 | 2865 | ||
2847 | } | 2866 | } |
2848 | void KABCore::removeSyncInfo( QString syncProfile) | 2867 | void KABCore::removeSyncInfo( QString syncProfile) |
2849 | { | 2868 | { |
2850 | qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1()); | 2869 | qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1()); |
2851 | mAddressBook->removeSyncInfo( syncProfile ); | 2870 | mAddressBook->removeSyncInfo( syncProfile ); |
2852 | setModified(); | 2871 | setModified(); |
2853 | } | 2872 | } |
2854 | 2873 | ||
2855 | 2874 | ||
2856 | //this is a overwritten callbackmethods from the syncinterface | 2875 | //this is a overwritten callbackmethods from the syncinterface |
2857 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) | 2876 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) |
2858 | { | 2877 | { |
2859 | if ( resource == "phone" ) | 2878 | if ( resource == "phone" ) |
2860 | return syncPhone(); | 2879 | return syncPhone(); |
2861 | disableBR( true ); | 2880 | disableBR( true ); |
2862 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 2881 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
2863 | 2882 | ||
2864 | AddressBook abLocal( resource,"syncContact"); | 2883 | AddressBook abLocal( resource,"syncContact"); |
2865 | bool syncOK = false; | 2884 | bool syncOK = false; |
2866 | if ( abLocal.load() ) { | 2885 | if ( abLocal.load() ) { |
2867 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2886 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2868 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2887 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2869 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); | 2888 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); |
2870 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 2889 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
2871 | if ( syncOK ) { | 2890 | if ( syncOK ) { |
2872 | if ( syncManager->mWriteBackFile ) { | 2891 | if ( syncManager->mWriteBackFile ) { |
2873 | abLocal.removeSyncAddressees( false ); | 2892 | abLocal.removeSyncAddressees( false ); |
2874 | abLocal.saveAB(); | 2893 | abLocal.saveAB(); |
2875 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); | 2894 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
2876 | } | 2895 | } |
2877 | } | 2896 | } else |
2897 | message( i18n("Sync cancelled or failed.") ); | ||
2878 | setModified(); | 2898 | setModified(); |
2879 | } | 2899 | } |
2880 | if ( syncOK ) | 2900 | if ( syncOK ) |
2881 | mViewManager->refreshView(); | 2901 | mViewManager->refreshView(); |
2882 | disableBR( false ); | 2902 | disableBR( false ); |
2883 | return syncOK; | 2903 | return syncOK; |
2884 | 2904 | ||
2885 | } | 2905 | } |
2886 | void KABCore::message( QString m ) | 2906 | void KABCore::message( QString m ) |
2887 | { | 2907 | { |
2888 | topLevelWidget()->setCaption( m ); | 2908 | topLevelWidget()->setCaption( m ); |
2889 | mMessageTimer->start( 15000, true ); | 2909 | mMessageTimer->start( 15000, true ); |
2890 | } | 2910 | } |
2891 | bool KABCore::syncPhone() | 2911 | bool KABCore::syncPhone() |
2892 | { | 2912 | { |
2893 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2913 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2894 | QString fileName = getPhoneFile(); | 2914 | QString fileName = getPhoneFile(); |
2895 | if ( !PhoneAccess::readFromPhone( fileName) ) { | 2915 | if ( !PhoneAccess::readFromPhone( fileName) ) { |
2896 | message(i18n("Phone access failed!")); | 2916 | message(i18n("Phone access failed!")); |
2897 | return false; | 2917 | return false; |
2898 | } | 2918 | } |
2899 | AddressBook abLocal( fileName,"syncContact"); | 2919 | AddressBook abLocal( fileName,"syncContact"); |
2900 | bool syncOK = false; | 2920 | bool syncOK = false; |
2901 | { | 2921 | { |
2902 | abLocal.importFromFile( fileName ); | 2922 | abLocal.importFromFile( fileName ); |
2903 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2923 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2904 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2924 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2905 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); | 2925 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); |
2906 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 2926 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
2907 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 2927 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
2908 | if ( syncOK ) { | 2928 | if ( syncOK ) { |
2909 | if ( syncManager->mWriteBackFile ) { | 2929 | if ( syncManager->mWriteBackFile ) { |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 6831ec9..c01d598 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -123,64 +123,66 @@ class KABCore : public QWidget, public KSyncInterface | |||
123 | 123 | ||
124 | /** | 124 | /** |
125 | Returns the uid list of the currently selected contacts. | 125 | Returns the uid list of the currently selected contacts. |
126 | */ | 126 | */ |
127 | QStringList selectedUIDs() const; | 127 | QStringList selectedUIDs() const; |
128 | 128 | ||
129 | /** | 129 | /** |
130 | Displays the ResourceSelectDialog and returns the selected | 130 | Displays the ResourceSelectDialog and returns the selected |
131 | resource or a null pointer if no resource was selected by | 131 | resource or a null pointer if no resource was selected by |
132 | the user. | 132 | the user. |
133 | */ | 133 | */ |
134 | KABC::Resource *requestResource( QWidget *parent ); | 134 | KABC::Resource *requestResource( QWidget *parent ); |
135 | 135 | ||
136 | #ifndef KAB_EMBEDDED | 136 | #ifndef KAB_EMBEDDED |
137 | static KAboutData *createAboutData(); | 137 | static KAboutData *createAboutData(); |
138 | #endif //KAB_EMBEDDED | 138 | #endif //KAB_EMBEDDED |
139 | 139 | ||
140 | #ifdef KAB_EMBEDDED | 140 | #ifdef KAB_EMBEDDED |
141 | inline QPopupMenu* getImportMenu() { return ImportMenu;} | 141 | inline QPopupMenu* getImportMenu() { return ImportMenu;} |
142 | inline QPopupMenu* getExportMenu() { return ExportMenu;} | 142 | inline QPopupMenu* getExportMenu() { return ExportMenu;} |
143 | #endif //KAB_EMBEDDED | 143 | #endif //KAB_EMBEDDED |
144 | 144 | ||
145 | public slots: | 145 | public slots: |
146 | #ifdef KAB_EMBEDDED | 146 | #ifdef KAB_EMBEDDED |
147 | void createAboutData(); | 147 | void createAboutData(); |
148 | #endif //KAB_EMBEDDED | 148 | #endif //KAB_EMBEDDED |
149 | void setDetailsToggle(); | 149 | void setDetailsToggle(); |
150 | 150 | ||
151 | void showLicence(); | 151 | void showLicence(); |
152 | void faq(); | 152 | void faq(); |
153 | void whatsnew() ; | 153 | void whatsnew() ; |
154 | void synchowto() ; | 154 | void synchowto() ; |
155 | void multisynchowto() ; | ||
156 | void kdesynchowto() ; | ||
155 | void writeToPhone(); | 157 | void writeToPhone(); |
156 | 158 | ||
157 | /** | 159 | /** |
158 | Is called whenever a contact is selected in the view. | 160 | Is called whenever a contact is selected in the view. |
159 | */ | 161 | */ |
160 | void setContactSelected( const QString &uid ); | 162 | void setContactSelected( const QString &uid ); |
161 | 163 | ||
162 | /** | 164 | /** |
163 | Opens the preferred mail composer with all selected contacts as | 165 | Opens the preferred mail composer with all selected contacts as |
164 | arguments. | 166 | arguments. |
165 | */ | 167 | */ |
166 | void sendMail(); | 168 | void sendMail(); |
167 | 169 | ||
168 | /** | 170 | /** |
169 | Opens the preferred mail composer with the given contacts as | 171 | Opens the preferred mail composer with the given contacts as |
170 | arguments. | 172 | arguments. |
171 | */ | 173 | */ |
172 | void sendMail( const QString& email ); | 174 | void sendMail( const QString& email ); |
173 | 175 | ||
174 | 176 | ||
175 | void mailVCard(); | 177 | void mailVCard(); |
176 | void mailVCard(const QStringList& uids); | 178 | void mailVCard(const QStringList& uids); |
177 | 179 | ||
178 | /** | 180 | /** |
179 | Beams the "WhoAmI contact. | 181 | Beams the "WhoAmI contact. |
180 | */ | 182 | */ |
181 | void beamMySelf(); | 183 | void beamMySelf(); |
182 | 184 | ||
183 | void beamVCard(); | 185 | void beamVCard(); |
184 | void export2phone(); | 186 | void export2phone(); |
185 | void beamVCard(const QStringList& uids); | 187 | void beamVCard(const QStringList& uids); |
186 | void beamDone( Ir *ir ); | 188 | void beamDone( Ir *ir ); |
@@ -425,64 +427,66 @@ class KABCore : public QWidget, public KSyncInterface | |||
425 | KAction* mActionNewContact; | 427 | KAction* mActionNewContact; |
426 | KAction *mActionSave; | 428 | KAction *mActionSave; |
427 | KAction *mActionEditAddressee; | 429 | KAction *mActionEditAddressee; |
428 | KAction *mActionMailVCard; | 430 | KAction *mActionMailVCard; |
429 | KAction *mActionBeamVCard; | 431 | KAction *mActionBeamVCard; |
430 | 432 | ||
431 | KAction *mActionQuit; | 433 | KAction *mActionQuit; |
432 | 434 | ||
433 | //US edit menu | 435 | //US edit menu |
434 | KAction *mActionCopy; | 436 | KAction *mActionCopy; |
435 | KAction *mActionCut; | 437 | KAction *mActionCut; |
436 | KAction *mActionPaste; | 438 | KAction *mActionPaste; |
437 | KAction *mActionSelectAll; | 439 | KAction *mActionSelectAll; |
438 | KAction *mActionUndo; | 440 | KAction *mActionUndo; |
439 | KAction *mActionRedo; | 441 | KAction *mActionRedo; |
440 | KAction *mActionDelete; | 442 | KAction *mActionDelete; |
441 | 443 | ||
442 | //US settings menu | 444 | //US settings menu |
443 | KAction *mActionConfigResources; | 445 | KAction *mActionConfigResources; |
444 | KAction *mActionConfigKAddressbook; | 446 | KAction *mActionConfigKAddressbook; |
445 | KAction *mActionConfigShortcuts; | 447 | KAction *mActionConfigShortcuts; |
446 | KAction *mActionConfigureToolbars; | 448 | KAction *mActionConfigureToolbars; |
447 | KAction *mActionKeyBindings; | 449 | KAction *mActionKeyBindings; |
448 | KToggleAction *mActionJumpBar; | 450 | KToggleAction *mActionJumpBar; |
449 | KToggleAction *mActionDetails; | 451 | KToggleAction *mActionDetails; |
450 | KAction *mActionWhoAmI; | 452 | KAction *mActionWhoAmI; |
451 | KAction *mActionCategories; | 453 | KAction *mActionCategories; |
452 | KAction *mActionAboutKAddressbook; | 454 | KAction *mActionAboutKAddressbook; |
453 | KAction *mActionLicence; | 455 | KAction *mActionLicence; |
454 | KAction *mActionFaq; | 456 | KAction *mActionFaq; |
455 | KAction *mActionWN; | 457 | KAction *mActionWN; |
456 | KAction *mActionSyncHowto; | 458 | KAction *mActionSyncHowto; |
459 | KAction *mActionKdeSyncHowto; | ||
460 | KAction *mActionMultiSyncHowto; | ||
457 | 461 | ||
458 | KAction *mActionDeleteView; | 462 | KAction *mActionDeleteView; |
459 | 463 | ||
460 | QPopupMenu *viewMenu; | 464 | QPopupMenu *viewMenu; |
461 | QPopupMenu *filterMenu; | 465 | QPopupMenu *filterMenu; |
462 | QPopupMenu *settingsMenu; | 466 | QPopupMenu *settingsMenu; |
463 | QPopupMenu *changeMenu; | 467 | QPopupMenu *changeMenu; |
464 | //US QAction *mActionSave; | 468 | //US QAction *mActionSave; |
465 | QPopupMenu *ImportMenu; | 469 | QPopupMenu *ImportMenu; |
466 | QPopupMenu *ExportMenu; | 470 | QPopupMenu *ExportMenu; |
467 | //LR additional methods | 471 | //LR additional methods |
468 | KAction *mActionRemoveVoice; | 472 | KAction *mActionRemoveVoice; |
469 | KAction * mActionImportOL; | 473 | KAction * mActionImportOL; |
470 | 474 | ||
471 | #ifndef KAB_EMBEDDED | 475 | #ifndef KAB_EMBEDDED |
472 | KAddressBookService *mAddressBookService; | 476 | KAddressBookService *mAddressBookService; |
473 | #endif //KAB_EMBEDDED | 477 | #endif //KAB_EMBEDDED |
474 | 478 | ||
475 | class KABCorePrivate; | 479 | class KABCorePrivate; |
476 | KABCorePrivate *d; | 480 | KABCorePrivate *d; |
477 | //US bool mBlockSaveFlag; | 481 | //US bool mBlockSaveFlag; |
478 | 482 | ||
479 | #ifdef KAB_EMBEDDED | 483 | #ifdef KAB_EMBEDDED |
480 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient | 484 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient |
481 | #endif //KAB_EMBEDDED | 485 | #endif //KAB_EMBEDDED |
482 | 486 | ||
483 | //this are the overwritten callbackmethods from the syncinterface | 487 | //this are the overwritten callbackmethods from the syncinterface |
484 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 488 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
485 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 489 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
486 | virtual void removeSyncInfo( QString syncProfile); | 490 | virtual void removeSyncInfo( QString syncProfile); |
487 | bool syncPhone(); | 491 | bool syncPhone(); |
488 | void message( QString m ); | 492 | void message( QString m ); |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 6e61351..4667918 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1165,69 +1165,73 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1165 | dt = cur.addSecs( -62 ); | 1165 | dt = cur.addSecs( -62 ); |
1166 | } | 1166 | } |
1167 | else | 1167 | else |
1168 | dt = inR->dtStart(); | 1168 | dt = inR->dtStart(); |
1169 | if ( dt < cur || dt > end ) { | 1169 | if ( dt < cur || dt > end ) { |
1170 | remote->deleteIncidence( inR ); | 1170 | remote->deleteIncidence( inR ); |
1171 | ++delFut; | 1171 | ++delFut; |
1172 | } | 1172 | } |
1173 | inR = er.next(); | 1173 | inR = er.next(); |
1174 | } | 1174 | } |
1175 | } | 1175 | } |
1176 | bar.hide(); | 1176 | bar.hide(); |
1177 | mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); | 1177 | mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); |
1178 | eventLSync->setReadOnly( false ); | 1178 | eventLSync->setReadOnly( false ); |
1179 | eventLSync->setDtStart( mLastCalendarSync ); | 1179 | eventLSync->setDtStart( mLastCalendarSync ); |
1180 | eventRSync->setDtStart( mLastCalendarSync ); | 1180 | eventRSync->setDtStart( mLastCalendarSync ); |
1181 | eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); | 1181 | eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); |
1182 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); | 1182 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); |
1183 | eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; | 1183 | eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; |
1184 | eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); | 1184 | eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); |
1185 | eventLSync->setReadOnly( true ); | 1185 | eventLSync->setReadOnly( true ); |
1186 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... | 1186 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... |
1187 | remote->addEvent( eventRSync ); | 1187 | remote->addEvent( eventRSync ); |
1188 | else | 1188 | else |
1189 | delete eventRSync; | 1189 | delete eventRSync; |
1190 | QString mes; | 1190 | QString mes; |
1191 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR ); | 1191 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR ); |
1192 | QString delmess; | 1192 | QString delmess; |
1193 | if ( delFut ) { | 1193 | if ( delFut ) { |
1194 | delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInFuture, remRem-delFut); | 1194 | delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInFuture, remRem-delFut); |
1195 | mes += delmess; | 1195 | mes += delmess; |
1196 | } | 1196 | } |
1197 | mCalendar->checkAlarmForIncidence( 0, true ); | ||
1198 | qDebug( mes ); | ||
1197 | if ( mSyncManager->mShowSyncSummary ) { | 1199 | if ( mSyncManager->mShowSyncSummary ) { |
1198 | KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") ); | 1200 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, |
1201 | i18n("KO/Pi Synchronization"),i18n("Write back"))) { | ||
1202 | qDebug("cancelled "); | ||
1203 | return false; | ||
1204 | } | ||
1199 | } | 1205 | } |
1200 | qDebug( mes ); | ||
1201 | mCalendar->checkAlarmForIncidence( 0, true ); | ||
1202 | return syncOK; | 1206 | return syncOK; |
1203 | } | 1207 | } |
1204 | 1208 | ||
1205 | void CalendarView::setSyncDevice( QString s ) | 1209 | void CalendarView::setSyncDevice( QString s ) |
1206 | { | 1210 | { |
1207 | mCurrentSyncDevice= s; | 1211 | mCurrentSyncDevice= s; |
1208 | } | 1212 | } |
1209 | void CalendarView::setSyncName( QString s ) | 1213 | void CalendarView::setSyncName( QString s ) |
1210 | { | 1214 | { |
1211 | mCurrentSyncName= s; | 1215 | mCurrentSyncName= s; |
1212 | } | 1216 | } |
1213 | bool CalendarView::syncCalendar(QString filename, int mode) | 1217 | bool CalendarView::syncCalendar(QString filename, int mode) |
1214 | { | 1218 | { |
1215 | //qDebug("syncCalendar %s ", filename.latin1()); | 1219 | //qDebug("syncCalendar %s ", filename.latin1()); |
1216 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 1220 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
1217 | CalendarLocal* calendar = new CalendarLocal(); | 1221 | CalendarLocal* calendar = new CalendarLocal(); |
1218 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 1222 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
1219 | FileStorage* storage = new FileStorage( calendar ); | 1223 | FileStorage* storage = new FileStorage( calendar ); |
1220 | bool syncOK = false; | 1224 | bool syncOK = false; |
1221 | storage->setFileName( filename ); | 1225 | storage->setFileName( filename ); |
1222 | // qDebug("loading ... "); | 1226 | // qDebug("loading ... "); |
1223 | if ( storage->load() ) { | 1227 | if ( storage->load() ) { |
1224 | getEventViewerDialog()->setSyncMode( true ); | 1228 | getEventViewerDialog()->setSyncMode( true ); |
1225 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); | 1229 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); |
1226 | getEventViewerDialog()->setSyncMode( false ); | 1230 | getEventViewerDialog()->setSyncMode( false ); |
1227 | if ( syncOK ) { | 1231 | if ( syncOK ) { |
1228 | if ( mSyncManager->mWriteBackFile ) | 1232 | if ( mSyncManager->mWriteBackFile ) |
1229 | { | 1233 | { |
1230 | storage->setSaveFormat( new ICalFormat() ); | 1234 | storage->setSaveFormat( new ICalFormat() ); |
1231 | storage->save(); | 1235 | storage->save(); |
1232 | } | 1236 | } |
1233 | } | 1237 | } |
@@ -1283,64 +1287,66 @@ void CalendarView::syncExternal( int mode ) | |||
1283 | if ( phoneFormat ) { | 1287 | if ( phoneFormat ) { |
1284 | while ( inc ) { | 1288 | while ( inc ) { |
1285 | inc->removeID(mCurrentSyncDevice); | 1289 | inc->removeID(mCurrentSyncDevice); |
1286 | inc = iL.next(); | 1290 | inc = iL.next(); |
1287 | } | 1291 | } |
1288 | } | 1292 | } |
1289 | #ifndef DESKTOP_VERSION | 1293 | #ifndef DESKTOP_VERSION |
1290 | if ( sharpFormat ) | 1294 | if ( sharpFormat ) |
1291 | sharpFormat->save(calendar); | 1295 | sharpFormat->save(calendar); |
1292 | #endif | 1296 | #endif |
1293 | if ( phoneFormat ) | 1297 | if ( phoneFormat ) |
1294 | phoneFormat->save(calendar); | 1298 | phoneFormat->save(calendar); |
1295 | iL = calendar->rawIncidences(); | 1299 | iL = calendar->rawIncidences(); |
1296 | inc = iL.first(); | 1300 | inc = iL.first(); |
1297 | Incidence* loc; | 1301 | Incidence* loc; |
1298 | while ( inc ) { | 1302 | while ( inc ) { |
1299 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { | 1303 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { |
1300 | loc = mCalendar->incidence(inc->uid() ); | 1304 | loc = mCalendar->incidence(inc->uid() ); |
1301 | if ( loc ) { | 1305 | if ( loc ) { |
1302 | loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); | 1306 | loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); |
1303 | loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); | 1307 | loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); |
1304 | } | 1308 | } |
1305 | } | 1309 | } |
1306 | inc = iL.next(); | 1310 | inc = iL.next(); |
1307 | } | 1311 | } |
1308 | Incidence* lse = getLastSyncEvent(); | 1312 | Incidence* lse = getLastSyncEvent(); |
1309 | if ( lse ) { | 1313 | if ( lse ) { |
1310 | lse->setReadOnly( false ); | 1314 | lse->setReadOnly( false ); |
1311 | lse->setDescription( "" ); | 1315 | lse->setDescription( "" ); |
1312 | lse->setReadOnly( true ); | 1316 | lse->setReadOnly( true ); |
1313 | } | 1317 | } |
1314 | } | 1318 | } |
1319 | } else { | ||
1320 | topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); | ||
1315 | } | 1321 | } |
1316 | setModified( true ); | 1322 | setModified( true ); |
1317 | } else { | 1323 | } else { |
1318 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; | 1324 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; |
1319 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), | 1325 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), |
1320 | question, i18n("Ok")) ; | 1326 | question, i18n("Ok")) ; |
1321 | 1327 | ||
1322 | } | 1328 | } |
1323 | delete calendar; | 1329 | delete calendar; |
1324 | updateView(); | 1330 | updateView(); |
1325 | emit tempDisableBR(false); | 1331 | emit tempDisableBR(false); |
1326 | return ;//syncOK; | 1332 | return ;//syncOK; |
1327 | 1333 | ||
1328 | } | 1334 | } |
1329 | 1335 | ||
1330 | bool CalendarView::importBday() | 1336 | bool CalendarView::importBday() |
1331 | { | 1337 | { |
1332 | #ifndef KORG_NOKABC | 1338 | #ifndef KORG_NOKABC |
1333 | 1339 | ||
1334 | #ifdef DESKTOP_VERSION | 1340 | #ifdef DESKTOP_VERSION |
1335 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 1341 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
1336 | KABC::AddressBook::Iterator it; | 1342 | KABC::AddressBook::Iterator it; |
1337 | int count = 0; | 1343 | int count = 0; |
1338 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 1344 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
1339 | ++count; | 1345 | ++count; |
1340 | } | 1346 | } |
1341 | QProgressBar bar(count,0 ); | 1347 | QProgressBar bar(count,0 ); |
1342 | int w = 300; | 1348 | int w = 300; |
1343 | if ( QApplication::desktop()->width() < 320 ) | 1349 | if ( QApplication::desktop()->width() < 320 ) |
1344 | w = 220; | 1350 | w = 220; |
1345 | int h = bar.sizeHint().height() ; | 1351 | int h = bar.sizeHint().height() ; |
1346 | int dw = QApplication::desktop()->width(); | 1352 | int dw = QApplication::desktop()->width(); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index fc2d59b..65566b5 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -820,106 +820,113 @@ void MainWindow::initActions() | |||
820 | 820 | ||
821 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 821 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
822 | this ); | 822 | this ); |
823 | action->addTo( importMenu ); | 823 | action->addTo( importMenu ); |
824 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 824 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
825 | #else | 825 | #else |
826 | importMenu->insertSeparator(); | 826 | importMenu->insertSeparator(); |
827 | icon = loadPixmap( pathString + "print" ); | 827 | icon = loadPixmap( pathString + "print" ); |
828 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 828 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
829 | action->addTo( importMenu ); | 829 | action->addTo( importMenu ); |
830 | connect( action, SIGNAL( activated() ), | 830 | connect( action, SIGNAL( activated() ), |
831 | this, SLOT( printCal() ) ); | 831 | this, SLOT( printCal() ) ); |
832 | 832 | ||
833 | icon = loadPixmap( pathString + "print" ); | 833 | icon = loadPixmap( pathString + "print" ); |
834 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 834 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
835 | action->addTo( importMenu ); | 835 | action->addTo( importMenu ); |
836 | connect( action, SIGNAL( activated() ), | 836 | connect( action, SIGNAL( activated() ), |
837 | this, SLOT( printSel() ) ); | 837 | this, SLOT( printSel() ) ); |
838 | #endif | 838 | #endif |
839 | importMenu->insertSeparator(); | 839 | importMenu->insertSeparator(); |
840 | action = new QAction( "beam all", i18n("Save"), 0, | 840 | action = new QAction( "beam all", i18n("Save"), 0, |
841 | this ); | 841 | this ); |
842 | action->addTo( importMenu ); | 842 | action->addTo( importMenu ); |
843 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 843 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
844 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 844 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
845 | this ); | 845 | this ); |
846 | action->addTo( importMenu ); | 846 | action->addTo( importMenu ); |
847 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 847 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
848 | 848 | ||
849 | //menuBar->insertItem( "Configure",configureMenu ); | 849 | //menuBar->insertItem( "Configure",configureMenu ); |
850 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 850 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
851 | icon = loadPixmap( "korganizer/korganizer" ); | 851 | icon = loadPixmap( "korganizer/korganizer" ); |
852 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 852 | |
853 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | ||
853 | action->addTo( helpMenu ); | 854 | action->addTo( helpMenu ); |
854 | connect( action, SIGNAL( activated() ), | 855 | connect( action, SIGNAL( activated() ), |
855 | SLOT( keyBindings() ) ); | 856 | SLOT( whatsNew() ) ); |
856 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 857 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
857 | action->addTo( helpMenu ); | 858 | action->addTo( helpMenu ); |
858 | connect( action, SIGNAL( activated() ), | 859 | connect( action, SIGNAL( activated() ), |
859 | SLOT( features() ) ); | 860 | SLOT( features() ) ); |
861 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | ||
862 | action->addTo( helpMenu ); | ||
863 | connect( action, SIGNAL( activated() ), | ||
864 | SLOT( keyBindings() ) ); | ||
865 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | ||
866 | action->addTo( helpMenu ); | ||
867 | connect( action, SIGNAL( activated() ), | ||
868 | SLOT( synchowto() ) ); | ||
869 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | ||
870 | action->addTo( helpMenu ); | ||
871 | connect( action, SIGNAL( activated() ), | ||
872 | SLOT( kdesynchowto() ) ); | ||
873 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | ||
874 | action->addTo( helpMenu ); | ||
875 | connect( action, SIGNAL( activated() ), | ||
876 | SLOT( multisynchowto() ) ); | ||
860 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 877 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
861 | action->addTo( helpMenu ); | 878 | action->addTo( helpMenu ); |
862 | connect( action, SIGNAL( activated() ), | 879 | connect( action, SIGNAL( activated() ), |
863 | SLOT( aboutAutoSaving() ) ); | 880 | SLOT( aboutAutoSaving() ) ); |
864 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 881 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
865 | action->addTo( helpMenu ); | 882 | action->addTo( helpMenu ); |
866 | connect( action, SIGNAL( activated() ), | 883 | connect( action, SIGNAL( activated() ), |
867 | SLOT( aboutKnownBugs() ) ); | 884 | SLOT( aboutKnownBugs() ) ); |
868 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 885 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
869 | action->addTo( helpMenu ); | 886 | action->addTo( helpMenu ); |
870 | connect( action, SIGNAL( activated() ), | 887 | connect( action, SIGNAL( activated() ), |
871 | SLOT( usertrans() ) ); | 888 | SLOT( usertrans() ) ); |
872 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | ||
873 | action->addTo( helpMenu ); | ||
874 | connect( action, SIGNAL( activated() ), | ||
875 | SLOT( synchowto() ) ); | ||
876 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | ||
877 | action->addTo( helpMenu ); | ||
878 | connect( action, SIGNAL( activated() ), | ||
879 | SLOT( whatsNew() ) ); | ||
880 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 889 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
881 | action->addTo( helpMenu ); | 890 | action->addTo( helpMenu ); |
882 | connect( action, SIGNAL( activated() ), | 891 | connect( action, SIGNAL( activated() ), |
883 | SLOT( faq() ) ); | 892 | SLOT( faq() ) ); |
884 | |||
885 | |||
886 | action = new QAction( "about", i18n("About..."), 0, this ); | ||
887 | action->addTo( helpMenu ); | ||
888 | connect( action, SIGNAL( activated() ), | ||
889 | SLOT( about() ) ); | ||
890 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 893 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
891 | action->addTo( helpMenu ); | 894 | action->addTo( helpMenu ); |
892 | connect( action, SIGNAL( activated() ), | 895 | connect( action, SIGNAL( activated() ), |
893 | SLOT( licence() ) ); | 896 | SLOT( licence() ) ); |
897 | action = new QAction( "about", i18n("About..."), 0, this ); | ||
898 | action->addTo( helpMenu ); | ||
899 | connect( action, SIGNAL( activated() ), | ||
900 | SLOT( about() ) ); | ||
894 | //menuBar->insertSeparator(); | 901 | //menuBar->insertSeparator(); |
895 | 902 | ||
896 | // ****************************************************** | 903 | // ****************************************************** |
897 | // menubar icons | 904 | // menubar icons |
898 | 905 | ||
899 | 906 | ||
900 | iconToolBar->setHorizontalStretchable (true ); | 907 | iconToolBar->setHorizontalStretchable (true ); |
901 | //menuBar->insertItem( iconToolBar ); | 908 | //menuBar->insertItem( iconToolBar ); |
902 | //xdays_action | 909 | //xdays_action |
903 | if (p-> mShowIconNewEvent) | 910 | if (p-> mShowIconNewEvent) |
904 | ne_action->addTo( iconToolBar ); | 911 | ne_action->addTo( iconToolBar ); |
905 | if (p->mShowIconNewTodo ) | 912 | if (p->mShowIconNewTodo ) |
906 | nt_action->addTo( iconToolBar ); | 913 | nt_action->addTo( iconToolBar ); |
907 | if (p-> mShowIconSearch) | 914 | if (p-> mShowIconSearch) |
908 | search_action->addTo( iconToolBar ); | 915 | search_action->addTo( iconToolBar ); |
909 | if (p-> mShowIconNext) | 916 | if (p-> mShowIconNext) |
910 | whatsnext_action->addTo( iconToolBar ); | 917 | whatsnext_action->addTo( iconToolBar ); |
911 | if (p-> mShowIconNextDays) | 918 | if (p-> mShowIconNextDays) |
912 | xdays_action->addTo( iconToolBar ); | 919 | xdays_action->addTo( iconToolBar ); |
913 | if (p-> mShowIconList) | 920 | if (p-> mShowIconList) |
914 | showlist_action->addTo( iconToolBar ); | 921 | showlist_action->addTo( iconToolBar ); |
915 | if (p-> mShowIconDay1) | 922 | if (p-> mShowIconDay1) |
916 | day1_action->addTo( iconToolBar ); | 923 | day1_action->addTo( iconToolBar ); |
917 | if (p-> mShowIconDay5) | 924 | if (p-> mShowIconDay5) |
918 | day5_action->addTo( iconToolBar ); | 925 | day5_action->addTo( iconToolBar ); |
919 | if (p-> mShowIconDay7) | 926 | if (p-> mShowIconDay7) |
920 | day7_action->addTo( iconToolBar ); | 927 | day7_action->addTo( iconToolBar ); |
921 | if (p-> mShowIconMonth) | 928 | if (p-> mShowIconMonth) |
922 | month_action->addTo( iconToolBar ); | 929 | month_action->addTo( iconToolBar ); |
923 | if (p-> mShowIconTodoview) | 930 | if (p-> mShowIconTodoview) |
924 | todoview_action->addTo( iconToolBar ); | 931 | todoview_action->addTo( iconToolBar ); |
925 | if (p-> mShowIconJournal) | 932 | if (p-> mShowIconJournal) |
@@ -1118,67 +1125,74 @@ void MainWindow::displayText( QString text ,QString cap ) | |||
1118 | dia.resize( 640, 480); | 1125 | dia.resize( 640, 480); |
1119 | #else | 1126 | #else |
1120 | dia.showMaximized(); | 1127 | dia.showMaximized(); |
1121 | #endif | 1128 | #endif |
1122 | dia.exec(); | 1129 | dia.exec(); |
1123 | } | 1130 | } |
1124 | void MainWindow::displayFile( QString fn, QString cap ) | 1131 | void MainWindow::displayFile( QString fn, QString cap ) |
1125 | { | 1132 | { |
1126 | QString fileName = resourcePath() + fn; | 1133 | QString fileName = resourcePath() + fn; |
1127 | QString text; | 1134 | QString text; |
1128 | QFile file( fileName ); | 1135 | QFile file( fileName ); |
1129 | if (!file.open( IO_ReadOnly ) ) { | 1136 | if (!file.open( IO_ReadOnly ) ) { |
1130 | return ; | 1137 | return ; |
1131 | 1138 | ||
1132 | } | 1139 | } |
1133 | QTextStream ts( &file ); | 1140 | QTextStream ts( &file ); |
1134 | text = ts.read(); | 1141 | text = ts.read(); |
1135 | file.close(); | 1142 | file.close(); |
1136 | displayText( text, cap); | 1143 | displayText( text, cap); |
1137 | } | 1144 | } |
1138 | void MainWindow::features() | 1145 | void MainWindow::features() |
1139 | { | 1146 | { |
1140 | 1147 | ||
1141 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); | 1148 | displayFile( "featuresKOPI.txt",i18n("KO/Pi Features and hints") ); |
1142 | } | 1149 | } |
1143 | 1150 | ||
1144 | void MainWindow::usertrans() | 1151 | void MainWindow::usertrans() |
1145 | { | 1152 | { |
1146 | 1153 | ||
1147 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); | 1154 | displayFile( "usertranslationHOWTO.txt",i18n("KO/Pi User translation HowTo") ); |
1148 | } | 1155 | } |
1149 | 1156 | ||
1157 | void MainWindow::kdesynchowto() | ||
1158 | { | ||
1159 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | ||
1160 | } | ||
1161 | void MainWindow::multisynchowto() | ||
1162 | { | ||
1163 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | ||
1164 | } | ||
1150 | void MainWindow::synchowto() | 1165 | void MainWindow::synchowto() |
1151 | { | 1166 | { |
1152 | |||
1153 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1167 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1154 | } | 1168 | } |
1155 | void MainWindow::faq() | 1169 | void MainWindow::faq() |
1156 | { | 1170 | { |
1157 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); | 1171 | displayFile( "kopiFAQ.txt",i18n("KO/Pi FAQ") ); |
1158 | 1172 | ||
1159 | } | 1173 | } |
1160 | void MainWindow::whatsNew() | 1174 | void MainWindow::whatsNew() |
1161 | { | 1175 | { |
1162 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1176 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1163 | 1177 | ||
1164 | } | 1178 | } |
1165 | void MainWindow::licence() | 1179 | void MainWindow::licence() |
1166 | { | 1180 | { |
1167 | KApplication::showLicence(); | 1181 | KApplication::showLicence(); |
1168 | 1182 | ||
1169 | } | 1183 | } |
1170 | void MainWindow::about() | 1184 | void MainWindow::about() |
1171 | { | 1185 | { |
1172 | QString version; | 1186 | QString version; |
1173 | #include <../version> | 1187 | #include <../version> |
1174 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1188 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1175 | i18n("KOrganizer/Platform-independent\n") + | 1189 | i18n("KOrganizer/Platform-independent\n") + |
1176 | "(KO/Pi) " + version + " - " + | 1190 | "(KO/Pi) " + version + " - " + |
1177 | 1191 | ||
1178 | #ifdef DESKTOP_VERSION | 1192 | #ifdef DESKTOP_VERSION |
1179 | i18n("Desktop Edition\n") + | 1193 | i18n("Desktop Edition\n") + |
1180 | #else | 1194 | #else |
1181 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + | 1195 | i18n("PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n") + |
1182 | #endif | 1196 | #endif |
1183 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); | 1197 | i18n("(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n") ); |
1184 | } | 1198 | } |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 0926313..ed65d36 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -24,64 +24,66 @@ class KSyncProfile; | |||
24 | #endif | 24 | #endif |
25 | class QPEToolBar; | 25 | class QPEToolBar; |
26 | 26 | ||
27 | 27 | ||
28 | namespace KCal { | 28 | namespace KCal { |
29 | class CalendarLocal; | 29 | class CalendarLocal; |
30 | } | 30 | } |
31 | 31 | ||
32 | using namespace KCal; | 32 | using namespace KCal; |
33 | 33 | ||
34 | class MainWindow : public QMainWindow | 34 | class MainWindow : public QMainWindow |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | public: | 37 | public: |
38 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); | 38 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); |
39 | ~MainWindow(); | 39 | ~MainWindow(); |
40 | bool beamReceiveEnabled(); | 40 | bool beamReceiveEnabled(); |
41 | public slots: | 41 | public slots: |
42 | virtual void showMaximized (); | 42 | virtual void showMaximized (); |
43 | void configureAgenda( int ); | 43 | void configureAgenda( int ); |
44 | void recieve( const QCString& msg, const QByteArray& data ); | 44 | void recieve( const QCString& msg, const QByteArray& data ); |
45 | static QString defaultFileName(); | 45 | static QString defaultFileName(); |
46 | static QString syncFileName(); | 46 | static QString syncFileName(); |
47 | static QString resourcePath(); | 47 | static QString resourcePath(); |
48 | protected slots: | 48 | protected slots: |
49 | void setCaptionToDates(); | 49 | void setCaptionToDates(); |
50 | void about(); | 50 | void about(); |
51 | void licence(); | 51 | void licence(); |
52 | void faq(); | 52 | void faq(); |
53 | void usertrans(); | 53 | void usertrans(); |
54 | void features(); | 54 | void features(); |
55 | void synchowto(); | 55 | void synchowto(); |
56 | void kdesynchowto(); | ||
57 | void multisynchowto(); | ||
56 | void whatsNew(); | 58 | void whatsNew(); |
57 | void keyBindings(); | 59 | void keyBindings(); |
58 | void aboutAutoSaving();; | 60 | void aboutAutoSaving();; |
59 | void aboutKnownBugs(); | 61 | void aboutKnownBugs(); |
60 | 62 | ||
61 | void processIncidenceSelection( Incidence * ); | 63 | void processIncidenceSelection( Incidence * ); |
62 | 64 | ||
63 | void importQtopia(); | 65 | void importQtopia(); |
64 | void importBday(); | 66 | void importBday(); |
65 | void importOL(); | 67 | void importOL(); |
66 | void importIcal(); | 68 | void importIcal(); |
67 | void importFile( QString, bool ); | 69 | void importFile( QString, bool ); |
68 | void quickImportIcal(); | 70 | void quickImportIcal(); |
69 | 71 | ||
70 | void slotModifiedChanged( bool ); | 72 | void slotModifiedChanged( bool ); |
71 | 73 | ||
72 | void save(); | 74 | void save(); |
73 | void configureToolBar( int ); | 75 | void configureToolBar( int ); |
74 | void printSel(); | 76 | void printSel(); |
75 | void printCal(); | 77 | void printCal(); |
76 | void saveCalendar(); | 78 | void saveCalendar(); |
77 | void loadCalendar(); | 79 | void loadCalendar(); |
78 | void exportVCalendar(); | 80 | void exportVCalendar(); |
79 | void fillFilterMenu(); | 81 | void fillFilterMenu(); |
80 | void selectFilter( int ); | 82 | void selectFilter( int ); |
81 | void exportToPhone( int ); | 83 | void exportToPhone( int ); |
82 | void toggleBeamReceive(); | 84 | void toggleBeamReceive(); |
83 | void disableBR(bool); | 85 | void disableBR(bool); |
84 | 86 | ||
85 | 87 | ||
86 | protected: | 88 | protected: |
87 | void displayText( QString, QString); | 89 | void displayText( QString, QString); |
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 17e6c75..9857e3e 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -451,99 +451,99 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) | |||
451 | { | 451 | { |
452 | bool ret = false; | 452 | bool ret = false; |
453 | QFileInfo info; | 453 | QFileInfo info; |
454 | info.setFile( fn ); | 454 | info.setFile( fn ); |
455 | QString mess; | 455 | QString mess; |
456 | bool loadbup = true; | 456 | bool loadbup = true; |
457 | if ( !info. exists() ) { | 457 | if ( !info. exists() ) { |
458 | mess = i18n( "Sync file \n...%1\ndoes not exist!\nNothing synced!\n").arg(fn.right( 30) ); | 458 | mess = i18n( "Sync file \n...%1\ndoes not exist!\nNothing synced!\n").arg(fn.right( 30) ); |
459 | int result = QMessageBox::warning( mParent, i18n("Warning!"), | 459 | int result = QMessageBox::warning( mParent, i18n("Warning!"), |
460 | mess ); | 460 | mess ); |
461 | return ret; | 461 | return ret; |
462 | } | 462 | } |
463 | int result = 0; | 463 | int result = 0; |
464 | if ( !quick ) { | 464 | if ( !quick ) { |
465 | mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 465 | mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
466 | result = QMessageBox::warning( mParent, i18n("Warning!"), | 466 | result = QMessageBox::warning( mParent, i18n("Warning!"), |
467 | mess, | 467 | mess, |
468 | i18n("Sync"), i18n("Cancel"), 0, | 468 | i18n("Sync"), i18n("Cancel"), 0, |
469 | 0, 1 ); | 469 | 0, 1 ); |
470 | if ( result ) | 470 | if ( result ) |
471 | return false; | 471 | return false; |
472 | } | 472 | } |
473 | if ( mAskForPreferences ) | 473 | if ( mAskForPreferences ) |
474 | if ( !edit_sync_options()) { | 474 | if ( !edit_sync_options()) { |
475 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); | 475 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); |
476 | return false; | 476 | return false; |
477 | } | 477 | } |
478 | if ( result == 0 ) { | 478 | if ( result == 0 ) { |
479 | //qDebug("Now sycing ... "); | 479 | //qDebug("Now sycing ... "); |
480 | if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) ) | 480 | if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) ) |
481 | mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") ); | 481 | mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") ); |
482 | else | 482 | else |
483 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed. Nothing synced.") ); | 483 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); |
484 | if ( ! quick ) | 484 | if ( ! quick ) |
485 | mPrefs->mLastSyncedLocalFile = fn; | 485 | mPrefs->mLastSyncedLocalFile = fn; |
486 | } | 486 | } |
487 | return ret; | 487 | return ret; |
488 | } | 488 | } |
489 | 489 | ||
490 | void KSyncManager::quickSyncLocalFile() | 490 | void KSyncManager::quickSyncLocalFile() |
491 | { | 491 | { |
492 | 492 | ||
493 | if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) { | 493 | if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) { |
494 | qDebug("quick syncLocalFile() successful "); | 494 | qDebug("quick syncLocalFile() successful "); |
495 | 495 | ||
496 | } | 496 | } |
497 | } | 497 | } |
498 | 498 | ||
499 | void KSyncManager::multiSync( bool askforPrefs ) | 499 | void KSyncManager::multiSync( bool askforPrefs ) |
500 | { | 500 | { |
501 | if (blockSave()) | 501 | if (blockSave()) |
502 | return; | 502 | return; |
503 | setBlockSave(true); | 503 | setBlockSave(true); |
504 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 504 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
505 | if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"), | 505 | if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"), |
506 | question, | 506 | question, |
507 | i18n("Yes"), i18n("No"), | 507 | i18n("Yes"), i18n("No"), |
508 | 0, 0 ) != 0 ) { | 508 | 0, 0 ) != 0 ) { |
509 | setBlockSave(false); | 509 | setBlockSave(false); |
510 | mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!")); | 510 | mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!")); |
511 | return; | 511 | return; |
512 | } | 512 | } |
513 | mCurrentSyncDevice = i18n("Multiple profiles") ; | 513 | mCurrentSyncDevice = i18n("Multiple profiles") ; |
514 | mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs; | 514 | mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs; |
515 | if ( askforPrefs ) { | 515 | if ( askforPrefs ) { |
516 | if ( !edit_sync_options()) { | 516 | if ( !edit_sync_options()) { |
517 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); | 517 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") ); |
518 | return; | 518 | return; |
519 | } | 519 | } |
520 | mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; | 520 | mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; |
521 | } | 521 | } |
522 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); | 522 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); |
523 | qApp->processEvents(); | 523 | qApp->processEvents(); |
524 | int num = ringSync() ; | 524 | int num = ringSync() ; |
525 | if ( num > 1 ) | 525 | if ( num > 1 ) |
526 | ringSync(); | 526 | ringSync(); |
527 | setBlockSave(false); | 527 | setBlockSave(false); |
528 | if ( num ) | 528 | if ( num ) |
529 | emit save(); | 529 | emit save(); |
530 | if ( num ) | 530 | if ( num ) |
531 | mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) ); | 531 | mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) ); |
532 | else | 532 | else |
533 | mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!")); | 533 | mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!")); |
534 | return; | 534 | return; |
535 | } | 535 | } |
536 | 536 | ||
537 | int KSyncManager::ringSync() | 537 | int KSyncManager::ringSync() |
538 | { | 538 | { |
539 | int syncedProfiles = 0; | 539 | int syncedProfiles = 0; |
540 | unsigned int i; | 540 | unsigned int i; |
541 | QTime timer; | 541 | QTime timer; |
542 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 542 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
543 | QStringList syncProfileNames = mSyncProfileNames; | 543 | QStringList syncProfileNames = mSyncProfileNames; |
544 | KSyncProfile* temp = new KSyncProfile (); | 544 | KSyncProfile* temp = new KSyncProfile (); |
545 | mAskForPreferences = false; | 545 | mAskForPreferences = false; |
546 | for ( i = 0; i < syncProfileNames.count(); ++i ) { | 546 | for ( i = 0; i < syncProfileNames.count(); ++i ) { |
547 | mCurrentSyncProfile = i; | 547 | mCurrentSyncProfile = i; |
548 | temp->setName(syncProfileNames[mCurrentSyncProfile]); | 548 | temp->setName(syncProfileNames[mCurrentSyncProfile]); |
549 | temp->readConfig(&config); | 549 | temp->readConfig(&config); |