summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp7
-rw-r--r--korganizer/kodaymatrix.cpp6
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/koprefs.h2
-rw-r--r--korganizer/koprefsdialog.cpp13
5 files changed, 28 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 9928b48..14094bb 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3023,48 +3023,50 @@ void CalendarView::changeEventDisplay(Event *which, int action)
}
clearallviews = true;
mDateNavigator->updateView();
//mDialogManager->updateSearchDialog();
if (which) {
// If there is an event view visible update the display
mViewManager->currentView()->changeEventDisplay(which,action);
// TODO: check, if update needed
// if (which->getTodoStatus()) {
mTodoList->updateView();
if ( action != KOGlobals::EVENTDELETED && KOPrefs::instance()->mDetectConflicts ) {
mConflictingEvent = which ;
int time = 1000;
#ifdef DESKTOP_VERSION
time = 500;
#endif
bool checkC = false;
if ( mConflictingEvent->doesFloat() ) {
checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay
|| KOPrefs::instance()->mCheckConflictsAllDayNonAD;
} else {
checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay
|| KOPrefs::instance()->mCheckConflictsNonADNonAD;
}
+ if ( !KOPrefs::instance()->mIncludeFree && mConflictingEvent->transparency() == KCal::Event::Transparent )
+ checkC = false;
if ( checkC )
QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) );
}
// }
} else {
mViewManager->currentView()->updateView();
}
}
void CalendarView::checkConflictForEvent()
{
if (!KOPrefs::instance()->mConfirm)
return;
if ( ! mConflictingEvent ) return;
Event * conflictingEvent = mConflictingEvent;
mConflictingEvent = 0;
QDateTime current = QDateTime::currentDateTime();
if ( ! conflictingEvent->matchTime( &current, 0 ) ) {
return;
}
CalFilter *filterIN = 0;
CalFilter *filterALL = 0;
CalFilter *filter = mFilters.first();
while(filter) {
@@ -3074,48 +3076,53 @@ void CalendarView::checkConflictForEvent()
filterALL = filter;
filter = mFilters.next();
}
if ( filterIN ) {
if ( !filterIN->filterCalendarItem( conflictingEvent ) ) {
return;
}
}
QPtrList<Event> testlist = mCalendar->events();
Event * test = testlist.first();
QDateTime conflict;
QDateTime retVal;
bool found = false;
Event * cE = 0;
bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay;
bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD;
if ( !conflictingEvent->doesFloat() ) {
chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay;
chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD;
}
topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
while ( test ) {
qApp->processEvents();
bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad );
+
+ if ( !skip ) {
+ if ( !KOPrefs::instance()->mIncludeFree && test->transparency() == KCal::Event::Transparent )
+ skip = true;
+ }
if ( !skip ) {
if ( filterALL ) {
if ( !filterALL->filterCalendarItem( test ) ) {
skip = true;
}
}
if ( !skip ) {
if ( found )
skip = !test->matchTime( &current, &conflict );
else
skip = !test->matchTime( &current, 0 );
if ( !skip ) {
if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
if ( ! found ) {
conflict = retVal;
cE = test;
} else {
if ( retVal < conflict ) {
conflict = retVal;
cE = test;
}
}
found = true;
}
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 057df0d..7076e05 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -437,48 +437,51 @@ void KODayMatrix::updateViewTimed()
return;
}
#if 1
int i;
int timeSpan = NUMDAYS-1;
QPtrList<Event> events = mCalendar->events();
Event *event;
QDateTime dt;
bool ok;
bDays.fill( false);
pDays.fill( false);
hDays.fill( false);
eDays.fill( false);
mHolidays.clear();
QDate mStartDate = days[0];
QDate endDate = mStartDate.addDays( timeSpan );
for( event = events.first(); event; event = events.next() ) { // for event
ushort recurType = event->doesRecur();
if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) ||
(recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) {
continue;
}
+ if ( !KOPrefs::instance()->mLongAllday && event->doesFloat()&& event->isMultiDay() ) {
+ continue;
+ }
if ( event->doesRecur() ) {
bool last;
QDateTime incidenceStart = event->recurrence()->getPreviousDateTime( QDateTime( mStartDate ) , &last );
QDateTime incidenceEnd;
int eventlen = event->dtStart().date().daysTo ( event->dtEnd().date() );
bool invalid = false;
while( true ) {
if ( incidenceStart.isValid() ) {
incidenceEnd = incidenceStart.addDays( eventlen );
int st = incidenceStart.date().daysTo( endDate );
if ( st >= 0 ) { // start before timeend
int end = mStartDate.daysTo( incidenceEnd.date() );
if ( end >= 0 ) { // end after timestart --- got one!
//normalize
st = timeSpan - st;
if ( st < 0 ) st = 0;
if ( end > timeSpan ) end = timeSpan;
int iii;
//qDebug("found %s %d %d ",event->summary().latin1(), st, end );
for ( iii = st;iii<= end;++iii) {
computeEvent( event, iii );
}
}
}
@@ -663,48 +666,51 @@ void KODayMatrix::updateView(QDate actdate)
#else
mRepaintTimer->start( 350 );
mUpdateTimer->start( 800 );
#endif
}
}
void KODayMatrix::updateEvents()
{
if ( !mCalendar ) return;
for( int i = 0; i < NUMDAYS; i++ ) {
// if events are set for the day then remember to draw it bold
QPtrList<Event> eventlist = mCalendar->events( days[ i ] );
int numEvents = eventlist.count();
Event *event;
for( event = eventlist.first(); event != 0;event=eventlist.next()) {
ushort recurType = event->doesRecur();
if ( ( recurType == Recurrence::rDaily &&
!KOPrefs::instance()->mDailyRecur ) ||
( recurType == Recurrence::rWeekly &&
!KOPrefs::instance()->mWeeklyRecur ) ) {
numEvents--;
}
+ if ( !KOPrefs::instance()->mLongAllday && event->doesFloat()&& event->isMultiDay() ) {
+ numEvents--;
+ }
}
if ( numEvents )
eDays.setBit(i);
else
eDays.clearBit(i);
}
}
const QDate& KODayMatrix::getDate(int offset)
{
if (offset < 0 || offset > NUMDAYS-1) {
qDebug("Wrong offset2 %d", offset);
return days[0];
}
return days[offset];
}
QString KODayMatrix::getHolidayLabel(int offset)
{
if (offset < 0 || offset > NUMDAYS-1) {
qDebug("Wrong offset1 %d", offset);
return QString();
}
return mHolidays[offset];
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 571ca11..1b0e5f4 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -211,60 +211,62 @@ KOPrefs::KOPrefs() :
KPrefs::setCurrentGroup("Colors");
addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor);
addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
addItemBool("MonthViewWeek",&mMonthViewWeek,false);
addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
addItemBool("UseAppColors",&mUseAppColors,false);
KPrefs::setCurrentGroup("Conflicts");
addItemBool("EnableAutoDetect",&mDetectConflicts,true);
+ addItemBool("CheckConflictsFree",&mIncludeFree,true);
addItemBool("CheckConflictsAllDayAllDay",&mCheckConflictsAllDayAllDay,false);
addItemBool("CheckConflictsAllDayNonAD",&mCheckConflictsAllDayNonAD,false);
addItemBool("CheckConflictsNonADAllDay",&mCheckConflictsNonADAllDay,false);
addItemBool("CheckConflictsNonADNonAD",&mCheckConflictsNonADNonAD,true);
addItemString("FilterConflictEditItem", &mFilterConflictEditItem ,"nofilter" );
addItemString("FilterConflictAllItem", &mFilterConflictAllItem ,"nofilter" );
KPrefs::setCurrentGroup("Views");
addItemBool("Block Popup Menu",&mBlockPopupMenu,false);
addItemBool("Show Date Navigator",&mShowDateNavigator,true);
addItemInt("Hour Size",&mHourSize,8);
addItemBool("Show Daily Recurrences",&mDailyRecur,true);
+ addItemBool("ShowLongAllday",&mLongAllday,true);
addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
addItemBool("ShowShortMonthName",&mMonthShowShort,false);
addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
#ifdef DESKTOP_VERION
addItemBool("Enable ToolTips",&mEnableToolTips,true);
#else
addItemBool("Enable ToolTips",&mEnableToolTips,false);
#endif
addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 576edf9..bac8010 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -173,48 +173,49 @@ class KOPrefs : public KPimPrefs
QColor mEventColor;
QColor mTodoDoneColor;
QColor mAgendaBgColor;
QColor mWorkingHoursColor;
QColor mTodoDueTodayColor;
QColor mTodoOverdueColor;
QColor mTodoRunColor;
QColor mMonthViewEvenColor;
QColor mMonthViewOddColor;
QColor mMonthViewHolidayColor;
bool mMonthViewUsesDayColors;
bool mMonthViewSatSunTog;
bool mMonthViewWeek;
bool mMonthViewWeekRowlayout;
QColor mAppColor1;
QColor mAppColor2;
bool mUseAppColors;
int mDayBegins;
int mHourSize;
int mAllDaySize;
bool mShowFullMenu;
bool mDailyRecur;
bool mWeeklyRecur;
+ bool mLongAllday;
bool mMonthDailyRecur;
bool mMonthWeeklyRecur;
bool mMonthShowIcons;
bool mMonthShowTimes;
bool mMonthShowShort;
bool mEnableToolTips;
bool mEnableMonthScroll;
bool mFullViewMonth;
bool mMonthViewUsesCategoryColor;
bool mFullViewTodo;
bool mShowCompletedTodo;
bool mMarcusBainsEnabled;
int mNextXDays;
int mWhatsNextDays;
bool mWhatsNextTime2Lines;
int mWhatsNextPrios;
bool mEnableQuickTodo;
bool mCompactDialogs;
bool mVerticalScreen;
bool mShowIconNewTodo;
bool mShowIconNewEvent;
bool mShowIconSearch;
@@ -330,45 +331,46 @@ class KOPrefs : public KPimPrefs
int mAlarmSuspendCount;
int mAlarmBeepInterval;
int mOldLanguage;
int mOldLoadedLanguage;
QString mActiveSyncPort;
QString mActiveSyncIP;
// settings for eventviewer
bool mEVshowDetails;
bool mEVshowCreated;
bool mEVshowChanged;
bool mWTshowDetails;
bool mWTshowCreated;
bool mWTshowChanged;
int mCurrentDisplayedView;
QPtrList<KopiCalendarFile> mCalendars;
int mNextAvailableCalendar;
bool mGlobalUpdateDisabled;
bool mDetectConflicts;
+ bool mIncludeFree;
bool mCheckConflictsAllDayAllDay;
bool mCheckConflictsAllDayNonAD;
bool mCheckConflictsNonADAllDay;
bool mCheckConflictsNonADNonAD;
QString mFilterConflictEditItem;
QString mFilterConflictAllItem;
private:
QDict<QColor> mCategoryColors;
QArray<KopiCalendarFile*> mDefCalColors;
QColor mDefaultCategoryColor;
QFont mDefaultTimeBarFont;
QFont mDefaultViewFont;
QFont mDefaultMonthViewFont;
QString mName;
QString mEmail;
};
#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index bbdf508..f1a6c3d 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -557,48 +557,53 @@ void KOPrefsDialog::setupViewsTab()
KPrefsDialogWidBool *fullViewTodo =
addWidBool(i18n("Event list view uses full window"),
&(KOPrefs::instance()->mFullViewTodo),topFrame);
topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Listview uses monthly timespan"),
&(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Highlight selection in Time Edit"),
&(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
topLayout->addWidget( dummy->checkBox(), ii++,0);
KPrefsDialogWidBool *dailyRecur =
addWidBool(i18n("Show events that recur daily in date nav."),
&(KOPrefs::instance()->mDailyRecur),topFrame);
topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
KPrefsDialogWidBool *weeklyRecur =
addWidBool(i18n("Show ev. that recur weekly in date nav."),
&(KOPrefs::instance()->mWeeklyRecur),topFrame);
topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
+ weeklyRecur =
+ addWidBool(i18n("Show multiday allday ev. in date nav."),
+ &(KOPrefs::instance()->mLongAllday),topFrame);
+ topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
+
#ifdef DESKTOP_VERSION
KPrefsDialogWidBool *enableToolTips =
addWidBool(i18n("Enable tooltips displaying summary of ev."),
&(KOPrefs::instance()->mEnableToolTips),topFrame);
topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
#endif
// *********************************************************
topFrame = addPage(i18n("Agenda View"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
topLayout = new QGridLayout(topFrame,5,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
ii = 0;
dummy =
addWidBool(i18n("Show time in agenda items"),
&(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Highlight current day in agenda"),
@@ -914,53 +919,57 @@ dummy =
dummy = addWidBool(i18n("Details"),
&(KOPrefs::instance()->mWTshowDetails),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy = addWidBool(i18n("Created time"),
&(KOPrefs::instance()->mWTshowCreated),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy = addWidBool(i18n("Last modified time"),
&(KOPrefs::instance()->mWTshowChanged),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
topFrame = addPage(i18n("Conflict detection"),0,0);
topLayout = new QGridLayout(topFrame,2,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);
ii = 0;
dummy = addWidBool(i18n("Enable conflict detection"),
&(KOPrefs::instance()->mDetectConflicts),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
topFrame = new QFrame( topFrame );
topLayout->addWidget(topFrame ,ii++,0);
topLayout = new QGridLayout(topFrame,4,1);
connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) );
- topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:"), topFrame ) , ii++,0);
+ dummy = addWidBool(i18n("Include events which \"show as free\""),
+ &(KOPrefs::instance()->mIncludeFree),topFrame);
+ topLayout->addWidget(dummy->checkBox(), ii++,0);
+ topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with <b>other events</b> for overlapping."), topFrame ) , ii++,0);
+
topLayout->addWidget( new QLabel ( i18n("Filter for the edited event"), topFrame ) , ii++,0);
mFilterEditItem = new QComboBox( topFrame );
topLayout->addWidget(mFilterEditItem,ii++,0);
- topLayout->addWidget( new QLabel ( i18n("Filter for other existing events"), topFrame ) , ii++,0);
+ topLayout->addWidget( new QLabel ( i18n("Filter for other events"), topFrame ) , ii++,0);
mFilterAllItem = new QComboBox( topFrame );
topLayout->addWidget(mFilterAllItem,ii++,0);
dummy = addWidBool(i18n("Check Allday with Allday"),
&(KOPrefs::instance()->mCheckConflictsAllDayAllDay),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
dummy = addWidBool(i18n("Check Allday with NonAllday"),
&(KOPrefs::instance()->mCheckConflictsAllDayNonAD),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
dummy = addWidBool(i18n("Check NonAllday with Allday"),
&(KOPrefs::instance()->mCheckConflictsNonADAllDay),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
dummy = addWidBool(i18n("Check NonAllday with NonAllday"),
&(KOPrefs::instance()->mCheckConflictsNonADNonAD),topFrame);
topLayout->addWidget(dummy->checkBox(), ii++,0);
topFrame = addPage(i18n("Alarm"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
topLayout = new QGridLayout(topFrame,2,1);
topLayout->setSpacing(mSpacingHint);
topLayout->setMargin(mMarginHint);