-rw-r--r-- | korganizer/mainwindow.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 63484d6..e3dad94 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1835,54 +1835,60 @@ void MainWindow::exportVCalendar() | |||
1835 | QString fn = KOPrefs::instance()->mLastVcalFile; | 1835 | QString fn = KOPrefs::instance()->mLastVcalFile; |
1836 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 1836 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
1837 | if ( fn == "" ) | 1837 | if ( fn == "" ) |
1838 | return; | 1838 | return; |
1839 | QFileInfo info; | 1839 | QFileInfo info; |
1840 | info.setFile( fn ); | 1840 | info.setFile( fn ); |
1841 | QString mes; | 1841 | QString mes; |
1842 | bool createbup = true; | 1842 | bool createbup = true; |
1843 | if ( info. exists() ) { | 1843 | if ( info. exists() ) { |
1844 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 1844 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
1845 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1845 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1846 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1846 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1847 | 0, 1 ); | 1847 | 0, 1 ); |
1848 | if ( result != 0 ) { | 1848 | if ( result != 0 ) { |
1849 | createbup = false; | 1849 | createbup = false; |
1850 | } | 1850 | } |
1851 | } | 1851 | } |
1852 | if ( createbup ) { | 1852 | if ( createbup ) { |
1853 | if ( mView->exportVCalendar( fn ) ) { | 1853 | if ( mView->exportVCalendar( fn ) ) { |
1854 | KOPrefs::instance()->mLastVcalFile = fn; | 1854 | KOPrefs::instance()->mLastVcalFile = fn; |
1855 | if ( fn.length() > 20 ) | 1855 | if ( fn.length() > 20 ) |
1856 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 1856 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
1857 | else | 1857 | else |
1858 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 1858 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
1859 | setCaption(mes); | 1859 | setCaption(mes); |
1860 | } | 1860 | } |
1861 | } | 1861 | } |
1862 | 1862 | ||
1863 | } | 1863 | } |
1864 | 1864 | ||
1865 | void MainWindow::syncFileRequest() | 1865 | void MainWindow::syncFileRequest() |
1866 | { | 1866 | { |
1867 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | ||
1868 | mSyncManager->slotSyncMenu( 999 ); | ||
1869 | } | ||
1867 | save(); | 1870 | save(); |
1868 | } | 1871 | } |
1869 | void MainWindow::getFile( bool success ) | 1872 | void MainWindow::getFile( bool success ) |
1870 | { | 1873 | { |
1871 | if ( ! success ) { | 1874 | if ( ! success ) { |
1872 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 1875 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
1873 | return; | 1876 | return; |
1874 | } | 1877 | } |
1875 | mView->openCalendar( defaultFileName() ); | 1878 | mView->openCalendar( defaultFileName() ); |
1879 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | ||
1880 | mSyncManager->slotSyncMenu( 999 ); | ||
1881 | } | ||
1876 | setCaption( i18n("Pi-Sync successful!") ); | 1882 | setCaption( i18n("Pi-Sync successful!") ); |
1877 | } | 1883 | } |
1878 | 1884 | ||
1879 | void MainWindow::printSel( ) | 1885 | void MainWindow::printSel( ) |
1880 | { | 1886 | { |
1881 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 1887 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
1882 | } | 1888 | } |
1883 | 1889 | ||
1884 | void MainWindow::printCal() | 1890 | void MainWindow::printCal() |
1885 | { | 1891 | { |
1886 | mView->print();//mCp->showDialog(); | 1892 | mView->print();//mCp->showDialog(); |
1887 | } | 1893 | } |
1888 | 1894 | ||