summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-08-24 18:38:31 (UTC)
committer zautrix <zautrix>2005-08-24 18:38:31 (UTC)
commit2cde25d8061acd536bccd698722952ce8555f5db (patch) (side-by-side diff)
tree70f905e5de57b44c3503883b2f98925d9c92ef8b /korganizer
parent645ceb7a95dce4716eb87a1b9191d3f3c1657be3 (diff)
downloadkdepimpi-2cde25d8061acd536bccd698722952ce8555f5db.zip
kdepimpi-2cde25d8061acd536bccd698722952ce8555f5db.tar.gz
kdepimpi-2cde25d8061acd536bccd698722952ce8555f5db.tar.bz2
conflict res fix
Diffstat (limited to 'korganizer') (more/less context) (ignore 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.cpp15
5 files changed, 29 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 9928b48..14094bb 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3035,24 +3035,26 @@ void CalendarView::changeEventDisplay(Event *which, int action)
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)
@@ -3086,24 +3088,29 @@ void CalendarView::checkConflictForEvent()
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 ) {
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 057df0d..7076e05 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -449,24 +449,27 @@ void KODayMatrix::updateViewTimed()
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() );
@@ -675,24 +678,27 @@ void KODayMatrix::updateEvents()
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);
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 571ca11..1b0e5f4 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -223,36 +223,38 @@ KOPrefs::KOPrefs() :
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);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 576edf9..bac8010 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -185,24 +185,25 @@ class KOPrefs : public KPimPrefs
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;
@@ -342,24 +343,25 @@ class KOPrefs : public KPimPrefs
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;
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index bbdf508..f1a6c3d 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -569,24 +569,29 @@ void KOPrefsDialog::setupViewsTab()
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);
@@ -924,31 +929,35 @@ dummy =
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);
+ 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"),