void KOEditorGeneralTodo::readTodo(Todo *todo, Calendar *calendar) { KOEditorGeneral::readIncidence(todo, calendar); QDateTime dueDT; if(todo->hasDueDate()) { enableAlarm(true); dueDT = todo->dtDue(); mDueDateEdit->setDate(todo->dtDue().date()); mDueTimeEdit->setTime(todo->dtDue().time()); mDueCheck->setChecked(true); } else { enableAlarm(false); mDueDateEdit->setEnabled(false); mDueTimeEdit->setEnabled(false); mDueDateEdit->setDate(QDate::currentDate()); mDueTimeEdit->setTime(QTime::currentTime()); mDueCheck->setChecked(false); } if(todo->hasStartDate()) { mStartDateEdit->setDate(todo->dtStart().date()); mStartTimeEdit->setTime(todo->dtStart().time()); mStartCheck->setChecked(true); } else { mStartDateEdit->setEnabled(false); mStartTimeEdit->setEnabled(false); mStartDateEdit->setDate(QDate::currentDate()); mStartTimeEdit->setTime(QTime::currentTime()); mStartCheck->setChecked(false); } mTimeButton->setChecked(!todo->doesFloat()); mAlreadyComplete = false; mCompletedCombo->setCurrentItem(todo->percentComplete() / 10); if(todo->isCompleted() && todo->hasCompletedDate()) { mCompleted = todo->completed(); mAlreadyComplete = true; } setCompletedDate(); mPriorityCombo->setCurrentItem(todo->priority()); mStartDateModified = false; }
void displayClock(){ PAR = not PAR; char* clock = rtc.formatTime(); int p=-14/*+7*/; LcdCharacterBig(p+=14,0,clock[0],false); LcdCharacterBig(p+=14,0,clock[1],false); LcdCharacterBig(p+=14,0,'-',false); LcdCharacterBig(p+=14,0,clock[3],false); LcdCharacterBig(p+=14,0,clock[4],false); gotoXY(70,2); sprintf (cha, "%02i", rtc.getSecond());LcdString(cha,true); gotoXY(0,4); sprintf (cha, "%02i/%02i/2016", rtc.getDay(), rtc.getMonth());LcdString(cha); gotoXY(0,5); sprintf (cha, "%02i'C | %02i%%", (int)(dht.readTemperature()), (int)(dht.readHumidity()));LcdString(cha); if (alarmENABLED){ sprintf(cha, "#"); gotoXY(77,4); LcdString(cha,true); gotoXY(77,5); LcdString(cha,true); } else{ sprintf(cha, " "); gotoXY(77,4); LcdString(cha,false); gotoXY(77,5); LcdString(cha,false); } if (alarmACTIVE){ sprintf(cha, " budzik "); gotoXY(0,3);LcdString(cha, PAR); } else if (alarmSNOOZE){ sprintf(cha, " drzemka "); gotoXY(0,3);LcdString(cha, PAR); } else{ sprintf(cha, EMPTY_LINE); gotoXY(0,3);LcdString(cha); } if (alarmINT){ if(b){ alarmCOMPLETED=true; alarmACTIVE=false; alarmINT=false; alarmSNOOZE=true; alarmTmp.addMinutes(SNOOZE_TIME); } } else{ if (b){mode=1;modechanged=true;LcdClear();return;} if (isRight()&&isUp()){ enableAlarm(); } } if (isLeft()&&isDown()){ if (alarmACTIVE) alarmCOMPLETED=true; else disableAlarm(); alarmSNOOZE=false; alarmTmp=alarm; alarmINT=false; alarmACTIVE=false; alarmENABLED=false; } }
void KOEditorGeneralTodo::showAlarm() { enableAlarm(mDueCheck->isChecked()); }