summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index c7ce8cb..2d17986 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1363,53 +1363,51 @@ void MainWindow::slotModifiedChanged( bool changed )
1363{ 1363{
1364 if ( mBlockAtStartup ) 1364 if ( mBlockAtStartup )
1365 return; 1365 return;
1366 int msec; 1366 int msec;
1367 // we store the changes after 1 minute, 1367 // we store the changes after 1 minute,
1368 // and for safety reasons after 10 minutes again 1368 // and for safety reasons after 10 minutes again
1369 if ( !mSyncManager->blockSave() ) 1369 if ( !mSyncManager->blockSave() )
1370 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1370 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1371 else 1371 else
1372 msec = 1000 * 600; 1372 msec = 1000 * 600;
1373 mSaveTimer.start( msec, true ); // 1 minute 1373 mSaveTimer.start( msec, true ); // 1 minute
1374 qDebug("KO: Saving File in %d secs!", msec/1000); 1374 qDebug("KO: Saving File in %d secs!", msec/1000);
1375 mCalendarModifiedFlag = true; 1375 mCalendarModifiedFlag = true;
1376} 1376}
1377void MainWindow::save() 1377void MainWindow::save()
1378{ 1378{
1379 if ( mSyncManager->blockSave() ) 1379 if ( mSyncManager->blockSave() )
1380 return; 1380 return;
1381 mSyncManager->setBlockSave(true); 1381 mSyncManager->setBlockSave(true);
1382 if ( mView->checkFileVersion( defaultFileName()) ) { 1382 if ( mView->checkFileVersion( defaultFileName()) ) {
1383 1383
1384 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1384 QTime neededSaveTime = QDateTime::currentDateTime().time();
1385 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1385 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1386 qDebug("KO: Start saving data to file!"); 1386 qDebug("KO: Start saving data to file!");
1387 mView->setLoadedFileVersion(QDateTime::currentDateTime().addSecs( -1));
1388 mView->saveCalendar( defaultFileName() ); 1387 mView->saveCalendar( defaultFileName() );
1389 1388
1390 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1389 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1391 mView->watchSavedFile();
1392 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1390 qDebug("KO: Needed %d ms for saving.",msNeeded );
1393 QString savemes; 1391 QString savemes;
1394 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1392 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1395 setCaption(savemes); 1393 setCaption(savemes);
1396 } else 1394 } else
1397 setCaption(i18n("Saving cancelled!")); 1395 setCaption(i18n("Saving cancelled!"));
1398 mCalendarModifiedFlag = false; 1396 mCalendarModifiedFlag = false;
1399 mSyncManager->setBlockSave( false ); 1397 mSyncManager->setBlockSave( false );
1400} 1398}
1401 1399
1402void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1400void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1403{ 1401{
1404 if ( !e->isAutoRepeat() ) { 1402 if ( !e->isAutoRepeat() ) {
1405 mFlagKeyPressed = false; 1403 mFlagKeyPressed = false;
1406 } 1404 }
1407} 1405}
1408void MainWindow::keyPressEvent ( QKeyEvent * e ) 1406void MainWindow::keyPressEvent ( QKeyEvent * e )
1409{ 1407{
1410 qApp->processEvents(); 1408 qApp->processEvents();
1411 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1409 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1412 e->ignore(); 1410 e->ignore();
1413 // qDebug(" ignore %d",e->isAutoRepeat() ); 1411 // qDebug(" ignore %d",e->isAutoRepeat() );
1414 return; 1412 return;
1415 } 1413 }
@@ -1800,40 +1798,38 @@ void MainWindow::exportVCalendar()
1800 } 1798 }
1801 if ( createbup ) { 1799 if ( createbup ) {
1802 if ( mView->exportVCalendar( fn ) ) { 1800 if ( mView->exportVCalendar( fn ) ) {
1803 KOPrefs::instance()->mLastVcalFile = fn; 1801 KOPrefs::instance()->mLastVcalFile = fn;
1804 if ( fn.length() > 20 ) 1802 if ( fn.length() > 20 )
1805 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; 1803 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ;
1806 else 1804 else
1807 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 1805 mes = i18n("KO/Pi:Exported to %1").arg(fn );
1808 setCaption(mes); 1806 setCaption(mes);
1809 } 1807 }
1810 } 1808 }
1811 1809
1812} 1810}
1813 1811
1814void MainWindow::syncFileRequest() 1812void MainWindow::syncFileRequest()
1815{ 1813{
1816 save(); 1814 save();
1817} 1815}
1818void MainWindow::getFile( bool success ) 1816void MainWindow::getFile( bool success )
1819{ 1817{
1820 if ( ! success ) { 1818 if ( ! success ) {
1821 setCaption( i18n("Error receiving file. Nothing changed!") ); 1819 setCaption( i18n("Error receiving file. Nothing changed!") );
1822 return; 1820 return;
1823 } 1821 }
1824 mView->watchSavedFile();
1825 mView->openCalendar( defaultFileName() ); 1822 mView->openCalendar( defaultFileName() );
1826 setCaption( i18n("Pi-Sync successful!") ); 1823 setCaption( i18n("Pi-Sync successful!") );
1827
1828} 1824}
1829 1825
1830void MainWindow::printSel( ) 1826void MainWindow::printSel( )
1831{ 1827{
1832 mView->viewManager()->agendaView()->agenda()->printSelection(); 1828 mView->viewManager()->agendaView()->agenda()->printSelection();
1833} 1829}
1834 1830
1835void MainWindow::printCal() 1831void MainWindow::printCal()
1836{ 1832{
1837 mView->print();//mCp->showDialog(); 1833 mView->print();//mCp->showDialog();
1838} 1834}
1839 1835