-rw-r--r-- | korganizer/calendarview.cpp | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 04051a2..0c35bb3 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -677,53 +677,48 @@ QDate CalendarView::startDate() | |||
677 | { | 677 | { |
678 | DateList dates = mNavigator->selectedDates(); | 678 | DateList dates = mNavigator->selectedDates(); |
679 | 679 | ||
680 | return dates.first(); | 680 | return dates.first(); |
681 | } | 681 | } |
682 | 682 | ||
683 | QDate CalendarView::endDate() | 683 | QDate CalendarView::endDate() |
684 | { | 684 | { |
685 | DateList dates = mNavigator->selectedDates(); | 685 | DateList dates = mNavigator->selectedDates(); |
686 | 686 | ||
687 | return dates.last(); | 687 | return dates.last(); |
688 | } | 688 | } |
689 | 689 | ||
690 | 690 | ||
691 | void CalendarView::createPrinter() | 691 | void CalendarView::createPrinter() |
692 | { | 692 | { |
693 | #ifndef KORG_NOPRINTER | 693 | #ifndef KORG_NOPRINTER |
694 | if (!mCalPrinter) { | 694 | if (!mCalPrinter) { |
695 | mCalPrinter = new CalPrinter(this, mCalendar); | 695 | mCalPrinter = new CalPrinter(this, mCalendar); |
696 | connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); | 696 | connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); |
697 | } | 697 | } |
698 | #endif | 698 | #endif |
699 | } | 699 | } |
700 | 700 | ||
701 | void CalendarView::confSync() | ||
702 | { | ||
703 | //DELETE | ||
704 | } | ||
705 | |||
706 | 701 | ||
707 | //KOPrefs::instance()->mWriteBackFile | 702 | //KOPrefs::instance()->mWriteBackFile |
708 | //KOPrefs::instance()->mWriteBackExistingOnly | 703 | //KOPrefs::instance()->mWriteBackExistingOnly |
709 | 704 | ||
710 | // 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 705 | // 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
711 | // 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 706 | // 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
712 | // 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | 707 | // 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); |
713 | // 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | 708 | // 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); |
714 | // 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); | 709 | // 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); |
715 | // 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | 710 | // 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); |
716 | 711 | ||
717 | int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) | 712 | int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) |
718 | { | 713 | { |
719 | 714 | ||
720 | //void setZaurusId(int id); | 715 | //void setZaurusId(int id); |
721 | // int zaurusId() const; | 716 | // int zaurusId() const; |
722 | // void setZaurusUid(int id); | 717 | // void setZaurusUid(int id); |
723 | // int zaurusUid() const; | 718 | // int zaurusUid() const; |
724 | // void setZaurusStat(int id); | 719 | // void setZaurusStat(int id); |
725 | // int zaurusStat() const; | 720 | // int zaurusStat() const; |
726 | // 0 equal | 721 | // 0 equal |
727 | // 1 take local | 722 | // 1 take local |
728 | // 2 take remote | 723 | // 2 take remote |
729 | // 3 cancel | 724 | // 3 cancel |
@@ -1180,78 +1175,76 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1180 | 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 ); | 1175 | 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 ); |
1181 | QString delmess; | 1176 | QString delmess; |
1182 | if ( delFut ) { | 1177 | if ( delFut ) { |
1183 | delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\n"),delFut, mSyncManager->mWriteBackInFuture ); | 1178 | delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are in the past or\nmore than %d weeks in the future.\n"),delFut, mSyncManager->mWriteBackInFuture ); |
1184 | mes += delmess; | 1179 | mes += delmess; |
1185 | } | 1180 | } |
1186 | if ( mSyncManager->mShowSyncSummary ) { | 1181 | if ( mSyncManager->mShowSyncSummary ) { |
1187 | KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") ); | 1182 | KMessageBox::information(this, mes, i18n("KO/Pi Synchronization") ); |
1188 | } | 1183 | } |
1189 | qDebug( mes ); | 1184 | qDebug( mes ); |
1190 | mCalendar->checkAlarmForIncidence( 0, true ); | 1185 | mCalendar->checkAlarmForIncidence( 0, true ); |
1191 | return syncOK; | 1186 | return syncOK; |
1192 | } | 1187 | } |
1193 | 1188 | ||
1194 | void CalendarView::setSyncDevice( QString s ) | 1189 | void CalendarView::setSyncDevice( QString s ) |
1195 | { | 1190 | { |
1196 | mCurrentSyncDevice= s; | 1191 | mCurrentSyncDevice= s; |
1197 | } | 1192 | } |
1198 | void CalendarView::setSyncName( QString s ) | 1193 | void CalendarView::setSyncName( QString s ) |
1199 | { | 1194 | { |
1200 | mCurrentSyncName= s; | 1195 | mCurrentSyncName= s; |
1201 | } | 1196 | } |
1202 | bool CalendarView::syncCalendar(QString filename, int mode) | 1197 | bool CalendarView::syncCalendar(QString filename, int mode) |
1203 | { | 1198 | { |
1199 | //qDebug("syncCalendar %s ", filename.latin1()); | ||
1204 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 1200 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
1205 | CalendarLocal* calendar = new CalendarLocal(); | 1201 | CalendarLocal* calendar = new CalendarLocal(); |
1206 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); | 1202 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); |
1207 | FileStorage* storage = new FileStorage( calendar ); | 1203 | FileStorage* storage = new FileStorage( calendar ); |
1208 | bool syncOK = false; | 1204 | bool syncOK = false; |
1209 | storage->setFileName( filename ); | 1205 | storage->setFileName( filename ); |
1210 | // qDebug("loading ... "); | 1206 | // qDebug("loading ... "); |
1211 | if ( storage->load() ) { | 1207 | if ( storage->load() ) { |
1212 | getEventViewerDialog()->setSyncMode( true ); | 1208 | getEventViewerDialog()->setSyncMode( true ); |
1213 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); | 1209 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); |
1214 | getEventViewerDialog()->setSyncMode( false ); | 1210 | getEventViewerDialog()->setSyncMode( false ); |
1215 | if ( syncOK ) { | 1211 | if ( syncOK ) { |
1216 | if ( mSyncManager->mWriteBackFile ) | 1212 | if ( mSyncManager->mWriteBackFile ) |
1217 | { | 1213 | { |
1218 | storage->setSaveFormat( new ICalFormat() ); | 1214 | storage->setSaveFormat( new ICalFormat() ); |
1219 | storage->save(); | 1215 | storage->save(); |
1220 | } | 1216 | } |
1221 | } | 1217 | } |
1222 | setModified( true ); | 1218 | setModified( true ); |
1223 | } | 1219 | } |
1224 | delete storage; | 1220 | delete storage; |
1225 | delete calendar; | 1221 | delete calendar; |
1226 | if ( syncOK ) | 1222 | if ( syncOK ) |
1227 | updateView(); | 1223 | updateView(); |
1228 | return syncOK; | 1224 | return syncOK; |
1229 | } | 1225 | } |
1230 | void CalendarView::syncPhone() | 1226 | |
1231 | { | ||
1232 | //DELETE | ||
1233 | } | ||
1234 | void CalendarView::syncExternal( int mode ) | 1227 | void CalendarView::syncExternal( int mode ) |
1235 | { | 1228 | { |
1236 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 1229 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
1237 | 1230 | ||
1238 | qApp->processEvents(); | 1231 | qApp->processEvents(); |
1239 | CalendarLocal* calendar = new CalendarLocal(); | 1232 | CalendarLocal* calendar = new CalendarLocal(); |
1240 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); | 1233 | calendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); |
1241 | bool syncOK = false; | 1234 | bool syncOK = false; |
1242 | bool loadSuccess = false; | 1235 | bool loadSuccess = false; |
1243 | PhoneFormat* phoneFormat = 0; | 1236 | PhoneFormat* phoneFormat = 0; |
1244 | #ifndef DESKTOP_VERSION | 1237 | #ifndef DESKTOP_VERSION |
1245 | SharpFormat* sharpFormat = 0; | 1238 | SharpFormat* sharpFormat = 0; |
1246 | if ( mode == 0 ) { // sharp | 1239 | if ( mode == 0 ) { // sharp |
1247 | sharpFormat = new SharpFormat () ; | 1240 | sharpFormat = new SharpFormat () ; |
1248 | loadSuccess = sharpFormat->load( calendar, mCalendar ); | 1241 | loadSuccess = sharpFormat->load( calendar, mCalendar ); |
1249 | 1242 | ||
1250 | } else | 1243 | } else |
1251 | #endif | 1244 | #endif |
1252 | if ( mode == 1 ) { // phone | 1245 | if ( mode == 1 ) { // phone |
1253 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, | 1246 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, |
1254 | mSyncManager->mPhoneDevice, | 1247 | mSyncManager->mPhoneDevice, |
1255 | mSyncManager->mPhoneConnection, | 1248 | mSyncManager->mPhoneConnection, |
1256 | mSyncManager->mPhoneModel); | 1249 | mSyncManager->mPhoneModel); |
1257 | loadSuccess = phoneFormat->load( calendar,mCalendar); | 1250 | loadSuccess = phoneFormat->load( calendar,mCalendar); |
@@ -1292,54 +1285,48 @@ void CalendarView::syncExternal( int mode ) | |||
1292 | } | 1285 | } |
1293 | } | 1286 | } |
1294 | inc = iL.next(); | 1287 | inc = iL.next(); |
1295 | } | 1288 | } |
1296 | Incidence* lse = getLastSyncEvent(); | 1289 | Incidence* lse = getLastSyncEvent(); |
1297 | if ( lse ) { | 1290 | if ( lse ) { |
1298 | lse->setReadOnly( false ); | 1291 | lse->setReadOnly( false ); |
1299 | lse->setDescription( "" ); | 1292 | lse->setDescription( "" ); |
1300 | lse->setReadOnly( true ); | 1293 | lse->setReadOnly( true ); |
1301 | } | 1294 | } |
1302 | } | 1295 | } |
1303 | } | 1296 | } |
1304 | setModified( true ); | 1297 | setModified( true ); |
1305 | } else { | 1298 | } else { |
1306 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; | 1299 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; |
1307 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), | 1300 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), |
1308 | question, i18n("Ok")) ; | 1301 | question, i18n("Ok")) ; |
1309 | 1302 | ||
1310 | } | 1303 | } |
1311 | delete calendar; | 1304 | delete calendar; |
1312 | updateView(); | 1305 | updateView(); |
1313 | return ;//syncOK; | 1306 | return ;//syncOK; |
1314 | 1307 | ||
1315 | } | 1308 | } |
1316 | void CalendarView::syncSharp() | ||
1317 | { | ||
1318 | //DELETE | ||
1319 | |||
1320 | } | ||
1321 | |||
1322 | 1309 | ||
1323 | bool CalendarView::importBday() | 1310 | bool CalendarView::importBday() |
1324 | { | 1311 | { |
1325 | #ifndef KORG_NOKABC | 1312 | #ifndef KORG_NOKABC |
1326 | 1313 | ||
1327 | #ifdef DESKTOP_VERSION | 1314 | #ifdef DESKTOP_VERSION |
1328 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 1315 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
1329 | KABC::AddressBook::Iterator it; | 1316 | KABC::AddressBook::Iterator it; |
1330 | int count = 0; | 1317 | int count = 0; |
1331 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 1318 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
1332 | ++count; | 1319 | ++count; |
1333 | } | 1320 | } |
1334 | QProgressBar bar(count,0 ); | 1321 | QProgressBar bar(count,0 ); |
1335 | int w = 300; | 1322 | int w = 300; |
1336 | if ( QApplication::desktop()->width() < 320 ) | 1323 | if ( QApplication::desktop()->width() < 320 ) |
1337 | w = 220; | 1324 | w = 220; |
1338 | int h = bar.sizeHint().height() ; | 1325 | int h = bar.sizeHint().height() ; |
1339 | int dw = QApplication::desktop()->width(); | 1326 | int dw = QApplication::desktop()->width(); |
1340 | int dh = QApplication::desktop()->height(); | 1327 | int dh = QApplication::desktop()->height(); |
1341 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1328 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1342 | bar.show(); | 1329 | bar.show(); |
1343 | bar.setCaption (i18n("Reading addressbook - close to abort!") ); | 1330 | bar.setCaption (i18n("Reading addressbook - close to abort!") ); |
1344 | qApp->processEvents(); | 1331 | qApp->processEvents(); |
1345 | count = 0; | 1332 | count = 0; |
@@ -1568,52 +1555,55 @@ bool CalendarView::openCalendar(QString filename, bool merge) | |||
1568 | KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); | 1555 | KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); |
1569 | return false; | 1556 | return false; |
1570 | } | 1557 | } |
1571 | 1558 | ||
1572 | globalFlagBlockAgenda = 1; | 1559 | globalFlagBlockAgenda = 1; |
1573 | if (!merge) mCalendar->close(); | 1560 | if (!merge) mCalendar->close(); |
1574 | 1561 | ||
1575 | mStorage->setFileName( filename ); | 1562 | mStorage->setFileName( filename ); |
1576 | 1563 | ||
1577 | if ( mStorage->load() ) { | 1564 | if ( mStorage->load() ) { |
1578 | if ( merge ) ;//setModified( true ); | 1565 | if ( merge ) ;//setModified( true ); |
1579 | else { | 1566 | else { |
1580 | //setModified( true ); | 1567 | //setModified( true ); |
1581 | mViewManager->setDocumentId( filename ); | 1568 | mViewManager->setDocumentId( filename ); |
1582 | mDialogManager->setDocumentId( filename ); | 1569 | mDialogManager->setDocumentId( filename ); |
1583 | mTodoList->setDocumentId( filename ); | 1570 | mTodoList->setDocumentId( filename ); |
1584 | } | 1571 | } |
1585 | globalFlagBlockAgenda = 2; | 1572 | globalFlagBlockAgenda = 2; |
1586 | // if ( getLastSyncEvent() ) | 1573 | // if ( getLastSyncEvent() ) |
1587 | // getLastSyncEvent()->setReadOnly( true ); | 1574 | // getLastSyncEvent()->setReadOnly( true ); |
1588 | mCalendar->reInitAlarmSettings(); | 1575 | mCalendar->reInitAlarmSettings(); |
1589 | setSyncEventsReadOnly(); | 1576 | setSyncEventsReadOnly(); |
1590 | updateUnmanagedViews(); | 1577 | updateUnmanagedViews(); |
1591 | updateView(); | 1578 | updateView(); |
1592 | setLoadedFileVersion( QDateTime::currentDateTime().addSecs( -1 )); | ||
1593 | if ( filename != MainWindow::defaultFileName() ) { | 1579 | if ( filename != MainWindow::defaultFileName() ) { |
1594 | saveCalendar( MainWindow::defaultFileName() ); | 1580 | saveCalendar( MainWindow::defaultFileName() ); |
1595 | watchSavedFile(); | 1581 | } else { |
1582 | QFileInfo finf ( MainWindow::defaultFileName()); | ||
1583 | if ( finf.exists() ) { | ||
1584 | setLoadedFileVersion( finf.lastModified () ); | ||
1585 | } | ||
1596 | } | 1586 | } |
1597 | return true; | 1587 | return true; |
1598 | } else { | 1588 | } else { |
1599 | // while failing to load, the calendar object could | 1589 | // while failing to load, the calendar object could |
1600 | // have become partially populated. Clear it out. | 1590 | // have become partially populated. Clear it out. |
1601 | if ( !merge ) { | 1591 | if ( !merge ) { |
1602 | mCalendar->close(); | 1592 | mCalendar->close(); |
1603 | mViewManager->setDocumentId( filename ); | 1593 | mViewManager->setDocumentId( filename ); |
1604 | mDialogManager->setDocumentId( filename ); | 1594 | mDialogManager->setDocumentId( filename ); |
1605 | mTodoList->setDocumentId( filename ); | 1595 | mTodoList->setDocumentId( filename ); |
1606 | } | 1596 | } |
1607 | 1597 | ||
1608 | //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); | 1598 | //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); |
1609 | 1599 | ||
1610 | QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); | 1600 | QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); |
1611 | globalFlagBlockAgenda = 2; | 1601 | globalFlagBlockAgenda = 2; |
1612 | mCalendar->reInitAlarmSettings(); | 1602 | mCalendar->reInitAlarmSettings(); |
1613 | setSyncEventsReadOnly(); | 1603 | setSyncEventsReadOnly(); |
1614 | updateUnmanagedViews(); | 1604 | updateUnmanagedViews(); |
1615 | updateView(); | 1605 | updateView(); |
1616 | } | 1606 | } |
1617 | return false; | 1607 | return false; |
1618 | } | 1608 | } |
1619 | void CalendarView::showOpenError() | 1609 | void CalendarView::showOpenError() |
@@ -1668,58 +1658,61 @@ bool CalendarView::checkFileVersion(QString fn) | |||
1668 | if ( km == KMessageBox::Yes ) | 1658 | if ( km == KMessageBox::Yes ) |
1669 | return true; | 1659 | return true; |
1670 | 1660 | ||
1671 | setSyncDevice("deleteaftersync" ); | 1661 | setSyncDevice("deleteaftersync" ); |
1672 | mSyncManager->mAskForPreferences = true; | 1662 | mSyncManager->mAskForPreferences = true; |
1673 | mSyncManager->mSyncAlgoPrefs = 3; | 1663 | mSyncManager->mSyncAlgoPrefs = 3; |
1674 | mSyncManager->mWriteBackFile = false; | 1664 | mSyncManager->mWriteBackFile = false; |
1675 | mSyncManager->mWriteBackExistingOnly = false; | 1665 | mSyncManager->mWriteBackExistingOnly = false; |
1676 | mSyncManager->mShowSyncSummary = false; | 1666 | mSyncManager->mShowSyncSummary = false; |
1677 | syncCalendar( fn, 3 ); | 1667 | syncCalendar( fn, 3 ); |
1678 | Event * e = getLastSyncEvent(); | 1668 | Event * e = getLastSyncEvent(); |
1679 | mCalendar->deleteEvent ( e ); | 1669 | mCalendar->deleteEvent ( e ); |
1680 | updateView(); | 1670 | updateView(); |
1681 | return true; | 1671 | return true; |
1682 | } | 1672 | } |
1683 | 1673 | ||
1684 | bool CalendarView::saveCalendar( QString filename ) | 1674 | bool CalendarView::saveCalendar( QString filename ) |
1685 | { | 1675 | { |
1686 | 1676 | ||
1687 | // Store back all unsaved data into calendar object | 1677 | // Store back all unsaved data into calendar object |
1688 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); | 1678 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); |
1689 | if ( mViewManager->currentView() ) | 1679 | if ( mViewManager->currentView() ) |
1690 | mViewManager->currentView()->flushView(); | 1680 | mViewManager->currentView()->flushView(); |
1691 | 1681 | ||
1692 | //mStorage->setFileName( filename ); | 1682 | |
1693 | 1683 | QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); | |
1694 | mStorage->setSaveFormat( new ICalFormat() ); | 1684 | mStorage->setSaveFormat( new ICalFormat() ); |
1695 | mStorage->setFileName( filename ); | 1685 | mStorage->setFileName( filename ); |
1696 | bool success; | 1686 | bool success; |
1697 | success = mStorage->save(); | 1687 | success = mStorage->save(); |
1698 | if ( !success ) { | 1688 | if ( !success ) { |
1699 | return false; | 1689 | return false; |
1700 | } | 1690 | } |
1701 | 1691 | if ( filename == MainWindow::defaultFileName() ) { | |
1692 | setLoadedFileVersion( lfv ); | ||
1693 | watchSavedFile(); | ||
1694 | } | ||
1702 | return true; | 1695 | return true; |
1703 | } | 1696 | } |
1704 | 1697 | ||
1705 | void CalendarView::closeCalendar() | 1698 | void CalendarView::closeCalendar() |
1706 | { | 1699 | { |
1707 | 1700 | ||
1708 | // child windows no longer valid | 1701 | // child windows no longer valid |
1709 | emit closingDown(); | 1702 | emit closingDown(); |
1710 | 1703 | ||
1711 | mCalendar->close(); | 1704 | mCalendar->close(); |
1712 | setModified(false); | 1705 | setModified(false); |
1713 | updateView(); | 1706 | updateView(); |
1714 | } | 1707 | } |
1715 | 1708 | ||
1716 | void CalendarView::archiveCalendar() | 1709 | void CalendarView::archiveCalendar() |
1717 | { | 1710 | { |
1718 | mDialogManager->showArchiveDialog(); | 1711 | mDialogManager->showArchiveDialog(); |
1719 | } | 1712 | } |
1720 | 1713 | ||
1721 | 1714 | ||
1722 | void CalendarView::readSettings() | 1715 | void CalendarView::readSettings() |
1723 | { | 1716 | { |
1724 | 1717 | ||
1725 | 1718 | ||
@@ -2161,53 +2154,48 @@ void CalendarView::edit_copy() | |||
2161 | 2154 | ||
2162 | if (!anEvent) { | 2155 | if (!anEvent) { |
2163 | KNotifyClient::beep(); | 2156 | KNotifyClient::beep(); |
2164 | return; | 2157 | return; |
2165 | } | 2158 | } |
2166 | DndFactory factory( mCalendar ); | 2159 | DndFactory factory( mCalendar ); |
2167 | factory.copyEvent(anEvent); | 2160 | factory.copyEvent(anEvent); |
2168 | } | 2161 | } |
2169 | 2162 | ||
2170 | void CalendarView::edit_paste() | 2163 | void CalendarView::edit_paste() |
2171 | { | 2164 | { |
2172 | QDate date = mNavigator->selectedDates().first(); | 2165 | QDate date = mNavigator->selectedDates().first(); |
2173 | 2166 | ||
2174 | DndFactory factory( mCalendar ); | 2167 | DndFactory factory( mCalendar ); |
2175 | Event *pastedEvent = factory.pasteEvent( date ); | 2168 | Event *pastedEvent = factory.pasteEvent( date ); |
2176 | 2169 | ||
2177 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); | 2170 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); |
2178 | } | 2171 | } |
2179 | 2172 | ||
2180 | void CalendarView::edit_options() | 2173 | void CalendarView::edit_options() |
2181 | { | 2174 | { |
2182 | mDialogManager->showOptionsDialog(); | 2175 | mDialogManager->showOptionsDialog(); |
2183 | //writeSettings(); | 2176 | //writeSettings(); |
2184 | } | 2177 | } |
2185 | void CalendarView::edit_sync_options() | ||
2186 | { | ||
2187 | // DELETE | ||
2188 | |||
2189 | } | ||
2190 | 2178 | ||
2191 | void CalendarView::slotSelectPickerDate( QDate d) | 2179 | void CalendarView::slotSelectPickerDate( QDate d) |
2192 | { | 2180 | { |
2193 | mDateFrame->hide(); | 2181 | mDateFrame->hide(); |
2194 | if ( mDatePickerMode == 1 ) { | 2182 | if ( mDatePickerMode == 1 ) { |
2195 | mNavigator->slotDaySelect( d ); | 2183 | mNavigator->slotDaySelect( d ); |
2196 | } else if ( mDatePickerMode == 2 ) { | 2184 | } else if ( mDatePickerMode == 2 ) { |
2197 | if ( mMoveIncidence->type() == "Todo" ) { | 2185 | if ( mMoveIncidence->type() == "Todo" ) { |
2198 | Todo * to = (Todo *) mMoveIncidence; | 2186 | Todo * to = (Todo *) mMoveIncidence; |
2199 | QTime tim; | 2187 | QTime tim; |
2200 | if ( to->hasDueDate() ) | 2188 | if ( to->hasDueDate() ) |
2201 | tim = to->dtDue().time(); | 2189 | tim = to->dtDue().time(); |
2202 | else { | 2190 | else { |
2203 | tim = QTime ( 0,0,0 ); | 2191 | tim = QTime ( 0,0,0 ); |
2204 | to->setFloats( true ); | 2192 | to->setFloats( true ); |
2205 | to->setHasDueDate( true ); | 2193 | to->setHasDueDate( true ); |
2206 | } | 2194 | } |
2207 | QDateTime dt ( d,tim ); | 2195 | QDateTime dt ( d,tim ); |
2208 | to->setDtDue( dt ); | 2196 | to->setDtDue( dt ); |
2209 | todoChanged( to ); | 2197 | todoChanged( to ); |
2210 | } else { | 2198 | } else { |
2211 | QTime tim = mMoveIncidence->dtStart().time(); | 2199 | QTime tim = mMoveIncidence->dtStart().time(); |
2212 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); | 2200 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); |
2213 | QDateTime dt ( d,tim ); | 2201 | QDateTime dt ( d,tim ); |