-rw-r--r-- | korganizer/mainwindow.cpp | 18 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
2 files changed, 16 insertions, 3 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 468fd5b..18a4b12 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -260,17 +260,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
260 | //fillSyncMenu(); | 260 | //fillSyncMenu(); |
261 | 261 | ||
262 | 262 | ||
263 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 263 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
264 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 264 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
265 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 265 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
266 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 266 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
267 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 267 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
268 | mSyncManager->setDefaultFileName( defaultFileName()); | 268 | mSyncManager->setDefaultFileName( sentSyncFile()); |
269 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 269 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
270 | mSyncManager->fillSyncMenu(); | 270 | mSyncManager->fillSyncMenu(); |
271 | 271 | ||
272 | 272 | ||
273 | 273 | ||
274 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 274 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
275 | if ( showWarning ) { | 275 | if ( showWarning ) { |
276 | KMessageBox::information( this, | 276 | KMessageBox::information( this, |
@@ -1987,31 +1987,43 @@ void MainWindow::exportVCalendar() | |||
1987 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 1987 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
1988 | else | 1988 | else |
1989 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 1989 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
1990 | setCaption(mes); | 1990 | setCaption(mes); |
1991 | } | 1991 | } |
1992 | } | 1992 | } |
1993 | 1993 | ||
1994 | } | 1994 | } |
1995 | QString MainWindow::sentSyncFile() | ||
1996 | { | ||
1997 | #ifdef DESKTOP_VERSION | ||
1998 | return locateLocal( "tmp", "copysynccal.ics" ); | ||
1999 | #else | ||
2000 | return QString( "/tmp/copysynccal.ics" ); | ||
2001 | #endif | ||
2002 | } | ||
1995 | 2003 | ||
1996 | void MainWindow::syncFileRequest() | 2004 | void MainWindow::syncFileRequest() |
1997 | { | 2005 | { |
1998 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2006 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
1999 | mSyncManager->slotSyncMenu( 999 ); | 2007 | mSyncManager->slotSyncMenu( 999 ); |
2000 | } | 2008 | } |
2001 | save(); | 2009 | |
2010 | setCaption(i18n("Saving Data to temp file ..." )); | ||
2011 | mView->saveCalendar( sentSyncFile() ); | ||
2012 | setCaption(i18n("Data saved to temp file!" )); | ||
2013 | |||
2002 | } | 2014 | } |
2003 | void MainWindow::getFile( bool success ) | 2015 | void MainWindow::getFile( bool success ) |
2004 | { | 2016 | { |
2005 | if ( ! success ) { | 2017 | if ( ! success ) { |
2006 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2018 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2007 | return; | 2019 | return; |
2008 | } | 2020 | } |
2009 | mView->openCalendar( defaultFileName() ); | 2021 | mView->openCalendar( sentSyncFile() ); |
2010 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2022 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2011 | mSyncManager->slotSyncMenu( 999 ); | 2023 | mSyncManager->slotSyncMenu( 999 ); |
2012 | } | 2024 | } |
2013 | setCaption( i18n("Pi-Sync successful!") ); | 2025 | setCaption( i18n("Pi-Sync successful!") ); |
2014 | } | 2026 | } |
2015 | 2027 | ||
2016 | void MainWindow::printSel( ) | 2028 | void MainWindow::printSel( ) |
2017 | { | 2029 | { |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 5b9f903..5808700 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -98,16 +98,17 @@ class MainWindow : public QMainWindow | |||
98 | signals: | 98 | signals: |
99 | void selectWeek ( int ); | 99 | void selectWeek ( int ); |
100 | private slots: | 100 | private slots: |
101 | void showConfigureAgenda(); | 101 | void showConfigureAgenda(); |
102 | void getFile( bool ); | 102 | void getFile( bool ); |
103 | void syncFileRequest(); | 103 | void syncFileRequest(); |
104 | 104 | ||
105 | protected: | 105 | protected: |
106 | QString sentSyncFile(); | ||
106 | void displayText( QString, QString); | 107 | void displayText( QString, QString); |
107 | void enableIncidenceActions( bool ); | 108 | void enableIncidenceActions( bool ); |
108 | 109 | ||
109 | private: | 110 | private: |
110 | bool mBRdisabled; | 111 | bool mBRdisabled; |
111 | #ifndef DESKTOP_VERSION | 112 | #ifndef DESKTOP_VERSION |
112 | QCopChannel* infrared; | 113 | QCopChannel* infrared; |
113 | #endif | 114 | #endif |