-rw-r--r-- | korganizer/calendarview.cpp | 45 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 4 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 3 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 17 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 2 |
6 files changed, 35 insertions, 38 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index fd026fa..70a1d2d 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -774,25 +774,25 @@ void CalendarView::suspendAlarm() | |||
774 | computeAlarm(mSuspendAlarmNotification ); | 774 | computeAlarm(mSuspendAlarmNotification ); |
775 | 775 | ||
776 | } | 776 | } |
777 | 777 | ||
778 | void CalendarView::startAlarm( QString mess , QString filename) | 778 | void CalendarView::startAlarm( QString mess , QString filename) |
779 | { | 779 | { |
780 | 780 | ||
781 | topLevelWidget()->showNormal(); | 781 | topLevelWidget()->showNormal(); |
782 | topLevelWidget()->setActiveWindow(); | 782 | topLevelWidget()->setActiveWindow(); |
783 | topLevelWidget()->raise(); | 783 | topLevelWidget()->raise(); |
784 | 784 | ||
785 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); | 785 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); |
786 | QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); | 786 | QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); |
787 | 787 | ||
788 | } | 788 | } |
789 | 789 | ||
790 | void CalendarView::checkNextTimerAlarm() | 790 | void CalendarView::checkNextTimerAlarm() |
791 | { | 791 | { |
792 | mCalendar->checkAlarmForIncidence( 0, true ); | 792 | mCalendar->checkAlarmForIncidence( 0, true ); |
793 | } | 793 | } |
794 | 794 | ||
795 | void CalendarView::computeAlarm( QString msg ) | 795 | void CalendarView::computeAlarm( QString msg ) |
796 | { | 796 | { |
797 | 797 | ||
798 | QString mess = msg; | 798 | QString mess = msg; |
@@ -917,30 +917,34 @@ void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) | |||
917 | //qDebug("Alarm timer started with secs: %d ", sec); | 917 | //qDebug("Alarm timer started with secs: %d ", sec); |
918 | mAlarmTimer->start( sec *1000 , true ); | 918 | mAlarmTimer->start( sec *1000 , true ); |
919 | 919 | ||
920 | } | 920 | } |
921 | // called by mRecheckAlarmTimer to get next alarm | 921 | // called by mRecheckAlarmTimer to get next alarm |
922 | // we need this, because a QTimer has only a max range of 25 days | 922 | // we need this, because a QTimer has only a max range of 25 days |
923 | void CalendarView::recheckTimerAlarm() | 923 | void CalendarView::recheckTimerAlarm() |
924 | { | 924 | { |
925 | mAlarmTimer->stop(); | 925 | mAlarmTimer->stop(); |
926 | mRecheckAlarmTimer->stop(); | 926 | mRecheckAlarmTimer->stop(); |
927 | mCalendar->checkAlarmForIncidence( 0, true ); | 927 | mCalendar->checkAlarmForIncidence( 0, true ); |
928 | } | 928 | } |
929 | #ifndef DESKTOP_VERSION | ||
929 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) | 930 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) |
931 | #else | ||
932 | void CalendarView::removeAlarm(const QDateTime &, const QString & ) | ||
933 | #endif | ||
930 | { | 934 | { |
931 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 935 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
932 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 936 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
933 | #ifndef DESKTOP_VERSION | 937 | #ifndef DESKTOP_VERSION |
934 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); | 938 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.utf8() ); |
935 | #endif | 939 | #endif |
936 | return; | 940 | return; |
937 | } | 941 | } |
938 | mAlarmTimer->stop(); | 942 | mAlarmTimer->stop(); |
939 | } | 943 | } |
940 | void CalendarView::selectWeekNum ( int num ) | 944 | void CalendarView::selectWeekNum ( int num ) |
941 | { | 945 | { |
942 | dateNavigator()->blockSignals( true ); | 946 | dateNavigator()->blockSignals( true ); |
943 | dateNavigator()->selectWeek( num ); | 947 | dateNavigator()->selectWeek( num ); |
944 | dateNavigator()->blockSignals( false ); | 948 | dateNavigator()->blockSignals( false ); |
945 | mViewManager->showWeekView(); | 949 | mViewManager->showWeekView(); |
946 | } | 950 | } |
@@ -1201,25 +1205,24 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1201 | int addedEvent = 0; | 1205 | int addedEvent = 0; |
1202 | int addedEventR = 0; | 1206 | int addedEventR = 0; |
1203 | int deletedEventR = 0; | 1207 | int deletedEventR = 0; |
1204 | int deletedEventL = 0; | 1208 | int deletedEventL = 0; |
1205 | int changedLocal = 0; | 1209 | int changedLocal = 0; |
1206 | int changedRemote = 0; | 1210 | int changedRemote = 0; |
1207 | int filteredIN = 0; | 1211 | int filteredIN = 0; |
1208 | int filteredOUT = 0; | 1212 | int filteredOUT = 0; |
1209 | //QPtrList<Event> el = local->rawEvents(); | 1213 | //QPtrList<Event> el = local->rawEvents(); |
1210 | Event* eventR; | 1214 | Event* eventR; |
1211 | QString uid; | 1215 | QString uid; |
1212 | int take; | 1216 | int take; |
1213 | Event* eventL; | ||
1214 | Event* eventRSync; | 1217 | Event* eventRSync; |
1215 | Event* eventLSync; | 1218 | Event* eventLSync; |
1216 | clearAllViews(); | 1219 | clearAllViews(); |
1217 | QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); | 1220 | QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); |
1218 | QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); | 1221 | QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); |
1219 | bool fullDateRange = false; | 1222 | bool fullDateRange = false; |
1220 | local->resetTempSyncStat(); | 1223 | local->resetTempSyncStat(); |
1221 | mLastCalendarSync = QDateTime::currentDateTime(); | 1224 | mLastCalendarSync = QDateTime::currentDateTime(); |
1222 | if ( mSyncManager->syncWithDesktop() ) { | 1225 | if ( mSyncManager->syncWithDesktop() ) { |
1223 | remote->resetPilotStat(1); | 1226 | remote->resetPilotStat(1); |
1224 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { | 1227 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { |
1225 | mLastCalendarSync = KSyncManager::mRequestedSyncEvent; | 1228 | mLastCalendarSync = KSyncManager::mRequestedSyncEvent; |
@@ -2301,25 +2304,30 @@ void CalendarView::readSettings() | |||
2301 | } | 2304 | } |
2302 | mMainFrame->setSizes(sizes); | 2305 | mMainFrame->setSizes(sizes); |
2303 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 2306 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
2304 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 2307 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
2305 | else mNavigator->selectDates( dateCount ); | 2308 | else mNavigator->selectDates( dateCount ); |
2306 | // mViewManager->readSettings( config ); | 2309 | // mViewManager->readSettings( config ); |
2307 | updateConfig(); | 2310 | updateConfig(); |
2308 | globalFlagBlockAgenda = 2; | 2311 | globalFlagBlockAgenda = 2; |
2309 | mViewManager->readSettings( config ); | 2312 | mViewManager->readSettings( config ); |
2310 | QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); | 2313 | QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); |
2311 | } | 2314 | } |
2312 | 2315 | ||
2313 | 2316 | void CalendarView::checkSuspendAlarm() | |
2317 | { | ||
2318 | if ( mSuspendTimer->isActive() ) { | ||
2319 | KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm")); | ||
2320 | } | ||
2321 | } | ||
2314 | void CalendarView::writeSettings() | 2322 | void CalendarView::writeSettings() |
2315 | { | 2323 | { |
2316 | // kdDebug() << "CalendarView::writeSettings" << endl; | 2324 | // kdDebug() << "CalendarView::writeSettings" << endl; |
2317 | 2325 | ||
2318 | KConfig *config = KOGlobals::config(); | 2326 | KConfig *config = KOGlobals::config(); |
2319 | 2327 | ||
2320 | mViewManager->writeSettings( config ); | 2328 | mViewManager->writeSettings( config ); |
2321 | mTodoList->saveLayout(config,QString("Todo Layout")); | 2329 | mTodoList->saveLayout(config,QString("Todo Layout")); |
2322 | mDialogManager->writeSettings( config ); | 2330 | mDialogManager->writeSettings( config ); |
2323 | //KOPrefs::instance()->usrWriteConfig(); | 2331 | //KOPrefs::instance()->usrWriteConfig(); |
2324 | KOPrefs::instance()->writeConfig(); | 2332 | KOPrefs::instance()->writeConfig(); |
2325 | 2333 | ||
@@ -2785,46 +2793,45 @@ void CalendarView::slotSelectPickerDate( QDate d) | |||
2785 | 2793 | ||
2786 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); | 2794 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); |
2787 | } | 2795 | } |
2788 | } | 2796 | } |
2789 | 2797 | ||
2790 | void CalendarView::removeCategories() | 2798 | void CalendarView::removeCategories() |
2791 | { | 2799 | { |
2792 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2800 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2793 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2801 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2794 | QStringList catIncList; | 2802 | QStringList catIncList; |
2795 | QStringList newCatList; | 2803 | QStringList newCatList; |
2796 | Incidence* inc = incList.first(); | 2804 | Incidence* inc = incList.first(); |
2797 | int i; | 2805 | uint i; |
2798 | int count = 0; | ||
2799 | while ( inc ) { | 2806 | while ( inc ) { |
2800 | newCatList.clear(); | 2807 | newCatList.clear(); |
2801 | catIncList = inc->categories() ; | 2808 | catIncList = inc->categories() ; |
2802 | for( i = 0; i< catIncList.count(); ++i ) { | 2809 | for( i = 0; i< catIncList.count(); ++i ) { |
2803 | if ( catList.contains (catIncList[i])) | 2810 | if ( catList.contains (catIncList[i])) |
2804 | newCatList.append( catIncList[i] ); | 2811 | newCatList.append( catIncList[i] ); |
2805 | } | 2812 | } |
2806 | newCatList.sort(); | 2813 | newCatList.sort(); |
2807 | inc->setCategories( newCatList.join(",") ); | 2814 | inc->setCategories( newCatList.join(",") ); |
2808 | inc = incList.next(); | 2815 | inc = incList.next(); |
2809 | } | 2816 | } |
2810 | } | 2817 | } |
2811 | 2818 | ||
2812 | int CalendarView::addCategories() | 2819 | int CalendarView::addCategories() |
2813 | { | 2820 | { |
2814 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2821 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2815 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2822 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2816 | QStringList catIncList; | 2823 | QStringList catIncList; |
2817 | Incidence* inc = incList.first(); | 2824 | Incidence* inc = incList.first(); |
2818 | int i; | 2825 | uint i; |
2819 | int count = 0; | 2826 | int count = 0; |
2820 | while ( inc ) { | 2827 | while ( inc ) { |
2821 | catIncList = inc->categories() ; | 2828 | catIncList = inc->categories() ; |
2822 | for( i = 0; i< catIncList.count(); ++i ) { | 2829 | for( i = 0; i< catIncList.count(); ++i ) { |
2823 | if ( !catList.contains (catIncList[i])) { | 2830 | if ( !catList.contains (catIncList[i])) { |
2824 | catList.append( catIncList[i] ); | 2831 | catList.append( catIncList[i] ); |
2825 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2832 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2826 | ++count; | 2833 | ++count; |
2827 | } | 2834 | } |
2828 | } | 2835 | } |
2829 | inc = incList.next(); | 2836 | inc = incList.next(); |
2830 | } | 2837 | } |
@@ -2936,33 +2943,35 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | |||
2936 | } | 2943 | } |
2937 | delete cal; | 2944 | delete cal; |
2938 | mes = i18n("KO/Pi: Ready for beaming"); | 2945 | mes = i18n("KO/Pi: Ready for beaming"); |
2939 | topLevelWidget()->setCaption(mes); | 2946 | topLevelWidget()->setCaption(mes); |
2940 | KApplication::convert2latin1( fn ); | 2947 | KApplication::convert2latin1( fn ); |
2941 | #ifndef DESKTOP_VERSION | 2948 | #ifndef DESKTOP_VERSION |
2942 | Ir *ir = new Ir( this ); | 2949 | Ir *ir = new Ir( this ); |
2943 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 2950 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
2944 | ir->send( fn, description, "text/x-vCalendar" ); | 2951 | ir->send( fn, description, "text/x-vCalendar" ); |
2945 | #endif | 2952 | #endif |
2946 | } | 2953 | } |
2947 | } | 2954 | } |
2955 | |||
2956 | #ifndef DESKTOP_VERSION | ||
2948 | void CalendarView::beamDone( Ir *ir ) | 2957 | void CalendarView::beamDone( Ir *ir ) |
2949 | { | 2958 | { |
2950 | #ifndef DESKTOP_VERSION | ||
2951 | delete ir; | 2959 | delete ir; |
2952 | #endif | ||
2953 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); | 2960 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); |
2954 | topLevelWidget()->raise(); | 2961 | topLevelWidget()->raise(); |
2955 | } | 2962 | } |
2956 | 2963 | #else | |
2964 | void CalendarView::beamDone( Ir *){;} | ||
2965 | #endif | ||
2957 | void CalendarView::moveIncidence(Incidence * inc ) | 2966 | void CalendarView::moveIncidence(Incidence * inc ) |
2958 | { | 2967 | { |
2959 | if ( !inc ) return; | 2968 | if ( !inc ) return; |
2960 | showDatePickerPopup(); | 2969 | showDatePickerPopup(); |
2961 | mDatePickerMode = 2; | 2970 | mDatePickerMode = 2; |
2962 | mMoveIncidence = inc ; | 2971 | mMoveIncidence = inc ; |
2963 | QDate da; | 2972 | QDate da; |
2964 | if ( mMoveIncidence->typeID() == todoID ) { | 2973 | if ( mMoveIncidence->typeID() == todoID ) { |
2965 | Todo * to = (Todo *) mMoveIncidence; | 2974 | Todo * to = (Todo *) mMoveIncidence; |
2966 | if ( to->hasDueDate() ) | 2975 | if ( to->hasDueDate() ) |
2967 | da = to->dtDue().date(); | 2976 | da = to->dtDue().date(); |
2968 | else | 2977 | else |
@@ -4298,29 +4307,24 @@ Todo *CalendarView::selectedTodo() | |||
4298 | if ( incidence && incidence->typeID() == todoID ) { | 4307 | if ( incidence && incidence->typeID() == todoID ) { |
4299 | return static_cast<Todo *>( incidence ); | 4308 | return static_cast<Todo *>( incidence ); |
4300 | } | 4309 | } |
4301 | 4310 | ||
4302 | incidence = mTodoList->selectedIncidences().first(); | 4311 | incidence = mTodoList->selectedIncidences().first(); |
4303 | if ( incidence && incidence->typeID() == todoID ) { | 4312 | if ( incidence && incidence->typeID() == todoID ) { |
4304 | return static_cast<Todo *>( incidence ); | 4313 | return static_cast<Todo *>( incidence ); |
4305 | } | 4314 | } |
4306 | 4315 | ||
4307 | return 0; | 4316 | return 0; |
4308 | } | 4317 | } |
4309 | 4318 | ||
4310 | void CalendarView::dialogClosing(Incidence *in) | ||
4311 | { | ||
4312 | // mDialogList.remove(in); | ||
4313 | } | ||
4314 | |||
4315 | void CalendarView::showIncidence() | 4319 | void CalendarView::showIncidence() |
4316 | { | 4320 | { |
4317 | mViewerCallerIsSearchDialog = false; | 4321 | mViewerCallerIsSearchDialog = false; |
4318 | Incidence *incidence = currentSelection(); | 4322 | Incidence *incidence = currentSelection(); |
4319 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 4323 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
4320 | if ( incidence ) { | 4324 | if ( incidence ) { |
4321 | ShowIncidenceVisitor v; | 4325 | ShowIncidenceVisitor v; |
4322 | v.act( incidence, this ); | 4326 | v.act( incidence, this ); |
4323 | } | 4327 | } |
4324 | } | 4328 | } |
4325 | void CalendarView::editIncidenceDescription() | 4329 | void CalendarView::editIncidenceDescription() |
4326 | { | 4330 | { |
@@ -4423,28 +4427,25 @@ bool CalendarView::removeCompletedSubTodos( Todo* t ) | |||
4423 | 4427 | ||
4424 | } | 4428 | } |
4425 | void CalendarView::purgeCompleted() | 4429 | void CalendarView::purgeCompleted() |
4426 | { | 4430 | { |
4427 | int result = KMessageBox::warningContinueCancel(this, | 4431 | int result = KMessageBox::warningContinueCancel(this, |
4428 | i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); | 4432 | i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); |
4429 | 4433 | ||
4430 | if (result == KMessageBox::Continue) { | 4434 | if (result == KMessageBox::Continue) { |
4431 | 4435 | ||
4432 | QPtrList<Todo> todoCal; | 4436 | QPtrList<Todo> todoCal; |
4433 | QPtrList<Todo> rootTodos; | 4437 | QPtrList<Todo> rootTodos; |
4434 | //QPtrList<Incidence> rel; | 4438 | //QPtrList<Incidence> rel; |
4435 | Todo *aTodo;//, *rTodo; | 4439 | Todo *aTodo; |
4436 | Incidence *rIncidence; | ||
4437 | bool childDelete = false; | ||
4438 | bool deletedOne = true; | ||
4439 | todoCal = calendar()->todos(); | 4440 | todoCal = calendar()->todos(); |
4440 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { | 4441 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { |
4441 | if ( !aTodo->relatedTo() ) | 4442 | if ( !aTodo->relatedTo() ) |
4442 | rootTodos.append( aTodo ); | 4443 | rootTodos.append( aTodo ); |
4443 | } | 4444 | } |
4444 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { | 4445 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { |
4445 | removeCompletedSubTodos( aTodo ); | 4446 | removeCompletedSubTodos( aTodo ); |
4446 | } | 4447 | } |
4447 | 4448 | ||
4448 | updateView(); | 4449 | updateView(); |
4449 | } | 4450 | } |
4450 | } | 4451 | } |
@@ -4454,35 +4455,39 @@ void CalendarView::slotCalendarChanged() | |||
4454 | ; | 4455 | ; |
4455 | } | 4456 | } |
4456 | 4457 | ||
4457 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 4458 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
4458 | { | 4459 | { |
4459 | //qDebug(" alendarView::keyPressEvent "); | 4460 | //qDebug(" alendarView::keyPressEvent "); |
4460 | e->ignore(); | 4461 | e->ignore(); |
4461 | } | 4462 | } |
4462 | 4463 | ||
4463 | 4464 | ||
4464 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 4465 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
4465 | { | 4466 | { |
4466 | // mSyncManager = manager; | 4467 | |
4468 | if ( manager != mSyncManager) | ||
4469 | qDebug("KO: Internal error-1. SyncManager mismatch "); | ||
4467 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 4470 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
4468 | qDebug("KO: SyncKDE request detected!"); | 4471 | qDebug("KO: SyncKDE request detected!"); |
4469 | } | 4472 | } |
4470 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4473 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4471 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4474 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4472 | return syncCalendar( filename, mode ); | 4475 | return syncCalendar( filename, mode ); |
4473 | } | 4476 | } |
4474 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 4477 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
4475 | { | 4478 | { |
4476 | //mSyncManager = manager; | 4479 | //mSyncManager = manager; |
4480 | if ( manager != mSyncManager) | ||
4481 | qDebug("KO: Internal error-2. SyncManager mismatch "); | ||
4477 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4482 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4478 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4483 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4479 | if ( resource == "sharp" ) | 4484 | if ( resource == "sharp" ) |
4480 | syncExternal( 0 ); | 4485 | syncExternal( 0 ); |
4481 | if ( resource == "phone" ) | 4486 | if ( resource == "phone" ) |
4482 | syncExternal( 1 ); | 4487 | syncExternal( 1 ); |
4483 | // pending setmodified | 4488 | // pending setmodified |
4484 | return true; | 4489 | return true; |
4485 | } | 4490 | } |
4486 | void CalendarView::setSyncManager(KSyncManager* manager) | 4491 | void CalendarView::setSyncManager(KSyncManager* manager) |
4487 | { | 4492 | { |
4488 | mSyncManager = manager; | 4493 | mSyncManager = manager; |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 3323a98..c9e9870 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -128,24 +128,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
128 | QDate endDate(); | 128 | QDate endDate(); |
129 | 129 | ||
130 | QWidgetStack *viewStack(); | 130 | QWidgetStack *viewStack(); |
131 | QWidget *leftFrame(); | 131 | QWidget *leftFrame(); |
132 | 132 | ||
133 | DateNavigator *dateNavigator(); | 133 | DateNavigator *dateNavigator(); |
134 | KDateNavigator *dateNavigatorWidget(); | 134 | KDateNavigator *dateNavigatorWidget(); |
135 | 135 | ||
136 | void addView(KOrg::BaseView *); | 136 | void addView(KOrg::BaseView *); |
137 | void showView(KOrg::BaseView *); | 137 | void showView(KOrg::BaseView *); |
138 | KOEventViewerDialog* getEventViewerDialog(); | 138 | KOEventViewerDialog* getEventViewerDialog(); |
139 | Incidence *currentSelection(); | 139 | Incidence *currentSelection(); |
140 | void checkSuspendAlarm(); | ||
140 | 141 | ||
141 | signals: | 142 | signals: |
142 | void save (); | 143 | void save (); |
143 | void saveStopTimer (); | 144 | void saveStopTimer (); |
144 | void tempDisableBR(bool); | 145 | void tempDisableBR(bool); |
145 | /** This todo has been modified */ | 146 | /** This todo has been modified */ |
146 | void todoModified(Todo *, int); | 147 | void todoModified(Todo *, int); |
147 | 148 | ||
148 | /** when change is made to options dialog, the topwidget will catch this | 149 | /** when change is made to options dialog, the topwidget will catch this |
149 | * and emit this signal which notifies all widgets which have registered | 150 | * and emit this signal which notifies all widgets which have registered |
150 | * for notification to update their settings. */ | 151 | * for notification to update their settings. */ |
151 | void configChanged(); | 152 | void configChanged(); |
@@ -446,25 +447,24 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
446 | 447 | ||
447 | /** Move to the previous date(s) in the current view */ | 448 | /** Move to the previous date(s) in the current view */ |
448 | void goPrevious(); | 449 | void goPrevious(); |
449 | /** Move to the next date(s) in the current view */ | 450 | /** Move to the next date(s) in the current view */ |
450 | void goNextMonth(); | 451 | void goNextMonth(); |
451 | 452 | ||
452 | /** Move to the previous date(s) in the current view */ | 453 | /** Move to the previous date(s) in the current view */ |
453 | void goPreviousMonth(); | 454 | void goPreviousMonth(); |
454 | 455 | ||
455 | void toggleExpand(); | 456 | void toggleExpand(); |
456 | void toggleDateNavigatorWidget(); | 457 | void toggleDateNavigatorWidget(); |
457 | void toggleAllDaySize(); | 458 | void toggleAllDaySize(); |
458 | void dialogClosing(Incidence *); | ||
459 | 459 | ||
460 | /** Look for new messages in the inbox */ | 460 | /** Look for new messages in the inbox */ |
461 | void lookForIncomingMessages(); | 461 | void lookForIncomingMessages(); |
462 | /** Look for new messages in the outbox */ | 462 | /** Look for new messages in the outbox */ |
463 | void lookForOutgoingMessages(); | 463 | void lookForOutgoingMessages(); |
464 | 464 | ||
465 | void processMainViewSelection( Incidence * ); | 465 | void processMainViewSelection( Incidence * ); |
466 | void processTodoListSelection( Incidence * ); | 466 | void processTodoListSelection( Incidence * ); |
467 | 467 | ||
468 | void processIncidenceSelection( Incidence * ); | 468 | void processIncidenceSelection( Incidence * ); |
469 | 469 | ||
470 | void purgeCompleted(); | 470 | void purgeCompleted(); |
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index 5455098..ea30fac 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp | |||
@@ -289,52 +289,48 @@ KOEventEditor *KODialogManager::getEventEditor() | |||
289 | mMainView,SLOT(eventDeleted())); | 289 | mMainView,SLOT(eventDeleted())); |
290 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), | 290 | connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), |
291 | mMainView,SLOT(schedule_cancel(Incidence *))); | 291 | mMainView,SLOT(schedule_cancel(Incidence *))); |
292 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), | 292 | connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), |
293 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 293 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
294 | connect( eventEditor, SIGNAL( showAgendaView( bool)), | 294 | connect( eventEditor, SIGNAL( showAgendaView( bool)), |
295 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 295 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
296 | 296 | ||
297 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 297 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
298 | // eventEditor,SLOT(updateCategoryConfig())); | 298 | // eventEditor,SLOT(updateCategoryConfig())); |
299 | // connect(eventEditor,SIGNAL(editCategories()), | 299 | // connect(eventEditor,SIGNAL(editCategories()), |
300 | // mCategoryEditDialog,SLOT(show())); | 300 | // mCategoryEditDialog,SLOT(show())); |
301 | connect(eventEditor,SIGNAL(dialogClose(Incidence*)), | ||
302 | mMainView,SLOT(dialogClosing(Incidence*))); | ||
303 | 301 | ||
304 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); | 302 | //connect(mMainView,SIGNAL(closingDown()),eventEditor,SLOT(reject())); |
305 | 303 | ||
306 | #ifndef DESKTOP_VERSION | 304 | #ifndef DESKTOP_VERSION |
307 | eventEditor->resize( QApplication::desktop()->width() -20, 100 ); | 305 | eventEditor->resize( QApplication::desktop()->width() -20, 100 ); |
308 | #endif | 306 | #endif |
309 | return eventEditor; | 307 | return eventEditor; |
310 | } | 308 | } |
311 | 309 | ||
312 | KOTodoEditor *KODialogManager::getTodoEditor() | 310 | KOTodoEditor *KODialogManager::getTodoEditor() |
313 | { | 311 | { |
314 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), | 312 | KOTodoEditor *todoEditor = new KOTodoEditor( mMainView->calendar(), |
315 | mMainView ); | 313 | mMainView ); |
316 | 314 | ||
317 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), | 315 | // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), |
318 | // todoEditor,SLOT(updateCategoryConfig())); | 316 | // todoEditor,SLOT(updateCategoryConfig())); |
319 | // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); | 317 | // connect(todoEditor,SIGNAL(editCategories()),mCategoryEditDialog,SLOT(show())); |
320 | 318 | ||
321 | connect(todoEditor,SIGNAL(todoAdded(Todo *)), | 319 | connect(todoEditor,SIGNAL(todoAdded(Todo *)), |
322 | mMainView,SLOT(todoAdded(Todo *))); | 320 | mMainView,SLOT(todoAdded(Todo *))); |
323 | connect(todoEditor,SIGNAL(todoChanged(Todo *)), | 321 | connect(todoEditor,SIGNAL(todoChanged(Todo *)), |
324 | mMainView,SLOT(todoChanged(Todo *))); | 322 | mMainView,SLOT(todoChanged(Todo *))); |
325 | connect(todoEditor,SIGNAL(todoDeleted()), | 323 | connect(todoEditor,SIGNAL(todoDeleted()), |
326 | mMainView,SLOT(todoDeleted())); | 324 | mMainView,SLOT(todoDeleted())); |
327 | connect(todoEditor,SIGNAL(dialogClose(Incidence*)), | ||
328 | mMainView,SLOT(dialogClosing(Incidence*))); | ||
329 | connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), | 325 | connect( todoEditor, SIGNAL(jumpToTime( const QDate &)), |
330 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 326 | mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
331 | connect( todoEditor, SIGNAL( showAgendaView( bool)), | 327 | connect( todoEditor, SIGNAL( showAgendaView( bool)), |
332 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); | 328 | mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); |
333 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), | 329 | // connect(todoEditor,SIGNAL(deleteAttendee(Incidence *)), |
334 | // mMainView,SLOT(schedule_cancel(Incidence *))); | 330 | // mMainView,SLOT(schedule_cancel(Incidence *))); |
335 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); | 331 | //connect(mMainView,SIGNAL(closingDown()),todoEditor,SLOT(reject())); |
336 | #ifndef DESKTOP_VERSION | 332 | #ifndef DESKTOP_VERSION |
337 | todoEditor->resize( QApplication::desktop()->width() -20, 100 ); | 333 | todoEditor->resize( QApplication::desktop()->width() -20, 100 ); |
338 | #endif | 334 | #endif |
339 | return todoEditor; | 335 | return todoEditor; |
340 | } | 336 | } |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 517677c..e5e3704 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -430,25 +430,26 @@ void KOListView::setCalendar( int c ) | |||
430 | cal = calendars.next(); | 430 | cal = calendars.next(); |
431 | } | 431 | } |
432 | mCalendar->setSyncEventsReadOnly(); | 432 | mCalendar->setSyncEventsReadOnly(); |
433 | mCalendar->reInitAlarmSettings(); | 433 | mCalendar->reInitAlarmSettings(); |
434 | 434 | ||
435 | } | 435 | } |
436 | void KOListView::populateCalPopup() | 436 | void KOListView::populateCalPopup() |
437 | { | 437 | { |
438 | mCalPopup->clear(); | 438 | mCalPopup->clear(); |
439 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 439 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
440 | while ( kkf ) { | 440 | while ( kkf ) { |
441 | int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber); | 441 | int index = mCalPopup->insertItem( kkf->mName, kkf->mCalNumber); |
442 | mCalPopup->setItemEnabled( index, !kkf->isReadOnly ); | 442 | if ( kkf->mErrorOnLoad || kkf->isReadOnly ) |
443 | mCalPopup->setItemEnabled( index, false ); | ||
443 | kkf = KOPrefs::instance()->mCalendars.next(); | 444 | kkf = KOPrefs::instance()->mCalendars.next(); |
444 | } | 445 | } |
445 | } | 446 | } |
446 | void KOListView::updateList() | 447 | void KOListView::updateList() |
447 | { | 448 | { |
448 | // qDebug(" KOListView::updateList() "); | 449 | // qDebug(" KOListView::updateList() "); |
449 | 450 | ||
450 | } | 451 | } |
451 | 452 | ||
452 | void KOListView::clearList() | 453 | void KOListView::clearList() |
453 | { | 454 | { |
454 | clear (); | 455 | clear (); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index b6ce7d5..b797d8c 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -125,42 +125,39 @@ class KOex2phonePrefs : public QDialog | |||
125 | } | 125 | } |
126 | 126 | ||
127 | public: | 127 | public: |
128 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 128 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
129 | QCheckBox* mWriteBackFuture; | 129 | QCheckBox* mWriteBackFuture; |
130 | QSpinBox* mWriteBackFutureWeeks; | 130 | QSpinBox* mWriteBackFutureWeeks; |
131 | }; | 131 | }; |
132 | 132 | ||
133 | QPixmap* sgListViewCompletedPix[6]; | 133 | QPixmap* sgListViewCompletedPix[6]; |
134 | 134 | ||
135 | 135 | ||
136 | int globalFlagBlockStartup; | 136 | int globalFlagBlockStartup; |
137 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 137 | MainWindow::MainWindow( QWidget *parent, const char *name ) : |
138 | QMainWindow( parent, name ) | 138 | QMainWindow( parent, name ) |
139 | { | 139 | { |
140 | sgListViewCompletedPix[5] = &listviewPix; | 140 | sgListViewCompletedPix[5] = &listviewPix; |
141 | sgListViewCompletedPix[0] = &listviewPix0; | 141 | sgListViewCompletedPix[0] = &listviewPix0; |
142 | sgListViewCompletedPix[1] = &listviewPix20; | 142 | sgListViewCompletedPix[1] = &listviewPix20; |
143 | sgListViewCompletedPix[2] = &listviewPix40; | 143 | sgListViewCompletedPix[2] = &listviewPix40; |
144 | sgListViewCompletedPix[3] = &listviewPix60; | 144 | sgListViewCompletedPix[3] = &listviewPix60; |
145 | sgListViewCompletedPix[4] = &listviewPix80; | 145 | sgListViewCompletedPix[4] = &listviewPix80; |
146 | if ( sgListViewCompletedPix[5]->height() < 5 ) { | 146 | if ( sgListViewCompletedPix[5]->height() < 5 ) { |
147 | int size = 12; | 147 | //int size = 12; |
148 | sgListViewCompletedPix[5]->resize( 11, 11 ); | 148 | sgListViewCompletedPix[5]->resize( 11, 11 ); |
149 | sgListViewCompletedPix[5]->fill( Qt::white ); | 149 | sgListViewCompletedPix[5]->fill( Qt::white ); |
150 | QPainter p ( sgListViewCompletedPix[5] ); | 150 | QPainter p ( sgListViewCompletedPix[5] ); |
151 | p.drawRect( 0,0,11,11); | 151 | p.drawRect( 0,0,11,11); |
152 | int half = size/2; | ||
153 | int heihei = size/2; | ||
154 | int x = 1; | ||
155 | p.drawLine ( 2, 5, 4 , 7 ) ; | 152 | p.drawLine ( 2, 5, 4 , 7 ) ; |
156 | p.drawLine ( 4 , 7 , 8, 3) ; | 153 | p.drawLine ( 4 , 7 , 8, 3) ; |
157 | int iii = 0; | 154 | int iii = 0; |
158 | for ( iii = 0; iii < 5; ++iii ) { | 155 | for ( iii = 0; iii < 5; ++iii ) { |
159 | sgListViewCompletedPix[iii]->resize( 11, 11 ); | 156 | sgListViewCompletedPix[iii]->resize( 11, 11 ); |
160 | sgListViewCompletedPix[iii]->fill( Qt::white ); | 157 | sgListViewCompletedPix[iii]->fill( Qt::white ); |
161 | QPainter p ( sgListViewCompletedPix[iii] ); | 158 | QPainter p ( sgListViewCompletedPix[iii] ); |
162 | p.drawRect( 0,0,11,11); | 159 | p.drawRect( 0,0,11,11); |
163 | if ( iii ) | 160 | if ( iii ) |
164 | p.fillRect( 1,1,iii*2,9,Qt::gray ); | 161 | p.fillRect( 1,1,iii*2,9,Qt::gray ); |
165 | } | 162 | } |
166 | } | 163 | } |
@@ -335,25 +332,24 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | |||
335 | } | 332 | } |
336 | mView->saveCalendar( defaultFileName() ); | 333 | mView->saveCalendar( defaultFileName() ); |
337 | newFile = true; | 334 | newFile = true; |
338 | } | 335 | } |
339 | 336 | ||
340 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 337 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
341 | mView->loadCalendars(); | 338 | mView->loadCalendars(); |
342 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 339 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
343 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 340 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
344 | 341 | ||
345 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 342 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
346 | KOPrefs::instance()->setAllDefaults(); | 343 | KOPrefs::instance()->setAllDefaults(); |
347 | int count = mView->addCategories(); | ||
348 | } | 344 | } |
349 | processIncidenceSelection( 0 ); | 345 | processIncidenceSelection( 0 ); |
350 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 346 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
351 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 347 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
352 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 348 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
353 | SLOT( slotModifiedChanged( bool ) ) ); | 349 | SLOT( slotModifiedChanged( bool ) ) ); |
354 | 350 | ||
355 | 351 | ||
356 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 352 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
357 | SLOT( disableBR(bool) ) ); | 353 | SLOT( disableBR(bool) ) ); |
358 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 354 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
359 | mView->setModified( false ); | 355 | mView->setModified( false ); |
@@ -1846,29 +1842,29 @@ void MainWindow::saveOnClose() | |||
1846 | 1842 | ||
1847 | if ( p->mToolBarHorN ) | 1843 | if ( p->mToolBarHorN ) |
1848 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; | 1844 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; |
1849 | else | 1845 | else |
1850 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; | 1846 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; |
1851 | if ( filterToolBar ) { | 1847 | if ( filterToolBar ) { |
1852 | if ( p->mToolBarHorF ) | 1848 | if ( p->mToolBarHorF ) |
1853 | p->mToolBarUpF = filterToolBar->y() > height()/2; | 1849 | p->mToolBarUpF = filterToolBar->y() > height()/2; |
1854 | else | 1850 | else |
1855 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; | 1851 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; |
1856 | } | 1852 | } |
1857 | #endif | 1853 | #endif |
1858 | |||
1859 | save(); | 1854 | save(); |
1860 | mView->writeSettings(); | 1855 | mView->writeSettings(); |
1856 | mView->checkSuspendAlarm(); | ||
1861 | } | 1857 | } |
1862 | void MainWindow::slotModifiedChanged( bool changed ) | 1858 | void MainWindow::slotModifiedChanged( bool ) |
1863 | { | 1859 | { |
1864 | if ( mBlockAtStartup ) | 1860 | if ( mBlockAtStartup ) |
1865 | return; | 1861 | return; |
1866 | 1862 | ||
1867 | int msec; | 1863 | int msec; |
1868 | // we store the changes after 1 minute, | 1864 | // we store the changes after 1 minute, |
1869 | // and for safety reasons after 10 minutes again | 1865 | // and for safety reasons after 10 minutes again |
1870 | if ( !mSyncManager->blockSave() ) | 1866 | if ( !mSyncManager->blockSave() ) |
1871 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1867 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1872 | else | 1868 | else |
1873 | msec = 1000 * 600; | 1869 | msec = 1000 * 600; |
1874 | mSaveTimer.start( msec, true ); // 1 minute | 1870 | mSaveTimer.start( msec, true ); // 1 minute |
@@ -1894,25 +1890,25 @@ void MainWindow::backupAllFiles() | |||
1894 | setCaption(i18n("Backup cancelled" )); | 1890 | setCaption(i18n("Backup cancelled" )); |
1895 | qDebug("KO: Backup cancelled. Will try again tomorrow "); | 1891 | qDebug("KO: Backup cancelled. Will try again tomorrow "); |
1896 | // retval == 0 : backup skipped for today, try again tomorrow | 1892 | // retval == 0 : backup skipped for today, try again tomorrow |
1897 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; | 1893 | KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; |
1898 | } else if ( retval == 1 ){ | 1894 | } else if ( retval == 1 ){ |
1899 | qDebug("KO: Backup created."); | 1895 | qDebug("KO: Backup created."); |
1900 | // backup ok | 1896 | // backup ok |
1901 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 1897 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
1902 | KopiCalendarFile * cal = calendars.first(); | 1898 | KopiCalendarFile * cal = calendars.first(); |
1903 | cal = calendars.next(); | 1899 | cal = calendars.next(); |
1904 | while ( cal ) { | 1900 | while ( cal ) { |
1905 | if ( !cal->mErrorOnLoad ) { | 1901 | if ( !cal->mErrorOnLoad ) { |
1906 | int retval = KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); | 1902 | KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); |
1907 | } | 1903 | } |
1908 | cal = calendars.next(); | 1904 | cal = calendars.next(); |
1909 | } | 1905 | } |
1910 | KOPrefs::instance()->mLastBackupDate = daysTo; | 1906 | KOPrefs::instance()->mLastBackupDate = daysTo; |
1911 | setCaption(i18n("Backup succesfully finished" )); | 1907 | setCaption(i18n("Backup succesfully finished" )); |
1912 | } else if ( retval == 2 ){ | 1908 | } else if ( retval == 2 ){ |
1913 | setCaption(i18n("Backup globally disabled" )); | 1909 | setCaption(i18n("Backup globally disabled" )); |
1914 | qDebug("KO: Backup globally cancelled."); | 1910 | qDebug("KO: Backup globally cancelled."); |
1915 | // backup globally cancelled | 1911 | // backup globally cancelled |
1916 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | 1912 | KPimGlobalPrefs::instance()->mBackupEnabled = false; |
1917 | } | 1913 | } |
1918 | // retval == 3: do nothing, try again later | 1914 | // retval == 3: do nothing, try again later |
@@ -2399,28 +2395,27 @@ void MainWindow::loadCalendar() | |||
2399 | #endif | 2395 | #endif |
2400 | 2396 | ||
2401 | } | 2397 | } |
2402 | void MainWindow::quickImportIcal() | 2398 | void MainWindow::quickImportIcal() |
2403 | { | 2399 | { |
2404 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 2400 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
2405 | } | 2401 | } |
2406 | void MainWindow::importFile( QString fn, bool quick ) | 2402 | void MainWindow::importFile( QString fn, bool quick ) |
2407 | { | 2403 | { |
2408 | QFileInfo info; | 2404 | QFileInfo info; |
2409 | info.setFile( fn ); | 2405 | info.setFile( fn ); |
2410 | QString mess; | 2406 | QString mess; |
2411 | bool loadbup = true; | ||
2412 | if ( !info. exists() ) { | 2407 | if ( !info. exists() ) { |
2413 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 2408 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
2414 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2409 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2415 | mess ); | 2410 | mess ); |
2416 | return; | 2411 | return; |
2417 | } | 2412 | } |
2418 | int result = 0; | 2413 | int result = 0; |
2419 | if ( !quick ) { | 2414 | if ( !quick ) { |
2420 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2415 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
2421 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2416 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2422 | mess, | 2417 | mess, |
2423 | "Import", "Cancel", 0, | 2418 | "Import", "Cancel", 0, |
2424 | 0, 1 ); | 2419 | 0, 1 ); |
2425 | } | 2420 | } |
2426 | if ( result == 0 ) { | 2421 | if ( result == 0 ) { |
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 953774f..a948a52 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -27,25 +27,25 @@ class QPEMenuBar; | |||
27 | 27 | ||
28 | 28 | ||
29 | namespace KCal { | 29 | namespace KCal { |
30 | class CalendarLocal; | 30 | class CalendarLocal; |
31 | } | 31 | } |
32 | 32 | ||
33 | using namespace KCal; | 33 | using namespace KCal; |
34 | 34 | ||
35 | class MainWindow : public QMainWindow | 35 | class MainWindow : public QMainWindow |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | public: | 38 | public: |
39 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); | 39 | MainWindow( QWidget *parent = 0, const char *name = 0 ); |
40 | ~MainWindow(); | 40 | ~MainWindow(); |
41 | bool beamReceiveEnabled(); | 41 | bool beamReceiveEnabled(); |
42 | static QString defaultFileName(); | 42 | static QString defaultFileName(); |
43 | static QString syncFileName(); | 43 | static QString syncFileName(); |
44 | static QString resourcePath(); | 44 | static QString resourcePath(); |
45 | public slots: | 45 | public slots: |
46 | void setUsesBigPixmaps ( bool ); | 46 | void setUsesBigPixmaps ( bool ); |
47 | void setCaption ( const QString & ); | 47 | void setCaption ( const QString & ); |
48 | void updateWeekNum(const KCal::DateList &); | 48 | void updateWeekNum(const KCal::DateList &); |
49 | void updateWeek(QDate); | 49 | void updateWeek(QDate); |
50 | void updateFilterToolbar(); | 50 | void updateFilterToolbar(); |
51 | virtual void showMaximized (); | 51 | virtual void showMaximized (); |