By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 304
Collapse All | Expand All

(-)a/kalarm/editdlg.cpp (-6 / +12 lines)
Lines 1374-1386 void EditAlarmDlg::slotOk() Link Here
1374
			return;
1374
			return;
1375
		}
1375
		}
1376
	}
1376
	}
1377
	if (!checkCommandData()
1377
	if (!checkCommandData()	|| !checkEmailData())
1378
	||  !checkEmailData())
1379
		return;
1378
		return;
1380
	if (!mTemplate)
1379
	if (!mTemplate)
1381
	{
1380
	{
1382
		if (timedRecurrence)
1381
		if (timedRecurrence)
1383
		{
1382
		{	  
1383
		  // For daily, weekly, monthly and yearly recurrences, check that the
1384
		  // specified date matches the allowed days of the week
1385
		  if (!mRecurrenceEdit->validateDate(mAlarmDateTime))
1386
		  {
1387
		    KMessageBox::sorry(this, i18n("The date/time in the Alarm tab does not "
1388
		            "match the recurrence settings specified in the Recurrence tab."));
1389
		    return;
1390
      }
1384
			TQDateTime now = TQDateTime::currentDateTime();
1391
			TQDateTime now = TQDateTime::currentDateTime();
1385
			if (mAlarmDateTime.date() < now.date()
1392
			if (mAlarmDateTime.date() < now.date()
1386
			||  mAlarmDateTime.date() == now.date()
1393
			||  mAlarmDateTime.date() == now.date()
Lines 1415-1421 void EditAlarmDlg::slotOk() Link Here
1415
		KAEvent recurEvent;
1422
		KAEvent recurEvent;
1416
		int longestRecurInterval = -1;
1423
		int longestRecurInterval = -1;
1417
		int reminder = mReminder->minutes();
1424
		int reminder = mReminder->minutes();
1418
		if (reminder  &&  !mReminder->isOnceOnly())
1425
		if (reminder && !mReminder->isOnceOnly())
1419
		{
1426
		{
1420
			mRecurrenceEdit->updateEvent(recurEvent, false);
1427
			mRecurrenceEdit->updateEvent(recurEvent, false);
1421
			longestRecurInterval = recurEvent.longestRecurrenceInterval();
1428
			longestRecurInterval = recurEvent.longestRecurrenceInterval();
Lines 1423-1430 void EditAlarmDlg::slotOk() Link Here
1423
			{
1430
			{
1424
				mTabs->setCurrentPage(mMainPageIndex);
1431
				mTabs->setCurrentPage(mMainPageIndex);
1425
				mReminder->setFocusOnCount();
1432
				mReminder->setFocusOnCount();
1426
				KMessageBox::sorry(this, i18n("Reminder period must be less than the recurrence interval, unless '%1' is checked."
1433
				KMessageBox::sorry(this, i18n("Reminder period must be less than the recurrence interval, unless '%1' is checked.").arg(Reminder::i18n_first_recurrence_only()));
1427
				                             ).arg(Reminder::i18n_first_recurrence_only()));
1428
				return;
1434
				return;
1429
			}
1435
			}
1430
		}
1436
		}
(-)a/kalarm/recurrenceedit.cpp (+93 lines)
Lines 531-536 void RecurrenceEdit::activateSubRepetition() Link Here
531
}
531
}
532
532
533
/******************************************************************************
533
/******************************************************************************
534
* For weekly, monthly and yearly recurrence, checks that the specified date 
535
* matches the days allowed. For the other recurrence simply return true.
536
*/
537
bool RecurrenceEdit::validateDate(const DateTime &date) const
538
{
539
  if (mRuleButtonType == RecurrenceEdit::DAILY)
540
  {
541
    TQBitArray selectedDays = mDailyRule->days();
542
    if (!selectedDays[date.date().dayOfWeek()-1])
543
      return false;
544
  }
545
  else if (mRuleButtonType == RecurrenceEdit::WEEKLY)
546
  {
547
    TQBitArray selectedDays = mWeeklyRule->days();
548
    if (!selectedDays[date.date().dayOfWeek()-1])
549
      return false;
550
  }
551
  else if (mRuleButtonType == RecurrenceEdit::MONTHLY)
552
  { 
553
    if (mMonthlyRule->type() == MonthYearRule::DATE)
554
    { 
555
      // on the nth day of the month
556
      int comboDate = mMonthlyRule->date();
557
      if ((comboDate > 0 && date.date().day() != comboDate) ||
558
          (comboDate <=0 && date.date().day() != date.date().daysInMonth()))
559
        return false;
560
    } 
561
    else
562
    {
563
      // on the nth weekday (i.e. Monday) of the month
564
      if (date.date().dayOfWeek() != mMonthlyRule->dayOfWeek())
565
        return false;
566
      
567
      int monthDay = date.date().day();
568
      int weekNum = mMonthlyRule->week();
569
      int minDay = 0, maxDay = 0;
570
      if (weekNum > 0 )
571
      {
572
        minDay = (weekNum-1) * 7;
573
        maxDay = weekNum * 7;
574
      }
575
      else if (weekNum < 0)
576
      {
577
        int dim = date.date().daysInMonth();
578
        minDay = dim + weekNum * 7;
579
        maxDay = dim + (weekNum+1) * 7;
580
      }
581
      if (monthDay <= minDay || monthDay > maxDay)
582
        return false;
583
    }
584
  }
585
  else if (mRuleButtonType == RecurrenceEdit::ANNUAL)
586
  { 
587
		TQValueList<int> months = mYearlyRule->months();
588
    if (!months.contains(date.date().month()))
589
      return false;
590
    
591
    if (mYearlyRule->type() == MonthYearRule::DATE)
592
    { 
593
      // on the nth day of the month
594
      int comboDate = mYearlyRule->date();
595
      if ((comboDate > 0 && date.date().day() != comboDate) ||
596
          (comboDate <=0 && date.date().day() != date.date().daysInMonth()))
597
        return false;
598
    } 
599
    else
600
    {
601
      // on the nth weekday (i.e. Monday) of the month
602
      if (date.date().dayOfWeek() != mYearlyRule->dayOfWeek())
603
        return false;
604
      
605
      int monthDay = date.date().day();
606
      int weekNum = mYearlyRule->week();
607
      int minDay = 0, maxDay = 0;
608
      if (weekNum > 0 )
609
      {
610
        minDay = (weekNum-1) * 7;
611
        maxDay = weekNum * 7;
612
      }
613
      else if (weekNum < 0)
614
      {
615
        int dim = date.date().daysInMonth();
616
        minDay = dim + weekNum * 7;
617
        maxDay = dim + (weekNum+1) * 7;
618
      }
619
      if (monthDay <= minDay || monthDay > maxDay)
620
        return false;
621
    }
622
  }  
623
  return true;
624
}
625
626
/******************************************************************************
534
 * Called when the value of the repeat count field changes, to reset the
627
 * Called when the value of the repeat count field changes, to reset the
535
 * minimum value to 1 if the value was 0.
628
 * minimum value to 1 if the value was 0.
536
 */
629
 */
(-)a/kalarm/recurrenceedit.h (+1 lines)
Lines 81-86 class RecurrenceEdit : public TQFrame Link Here
81
		DateTime      endDateTime() const;
81
		DateTime      endDateTime() const;
82
		bool          stateChanged() const;
82
		bool          stateChanged() const;
83
		void          activateSubRepetition();
83
		void          activateSubRepetition();
84
		bool          validateDate(const DateTime &date) const;
84
85
85
		static TQString i18n_Norecur();           // text of 'No recurrence' selection, lower case
86
		static TQString i18n_Norecur();           // text of 'No recurrence' selection, lower case
86
		static TQString i18n_NoRecur();           // text of 'No Recurrence' selection, initial capitals
87
		static TQString i18n_NoRecur();           // text of 'No Recurrence' selection, initial capitals

Return to bug 304