Enable buttons and the display.
Kind-of-sort-of usable-ish.
This commit is contained in:
38
Task.h
38
Task.h
@@ -29,8 +29,8 @@ namespace Common {
|
||||
namespace Schedule {
|
||||
|
||||
enum class ScheduleType {
|
||||
AT_TIME,
|
||||
NEVER,
|
||||
AT_TIME = 0,
|
||||
NEVER = 1,
|
||||
};
|
||||
|
||||
class NextTime {
|
||||
@@ -63,8 +63,38 @@ public:
|
||||
return { ScheduleType::AT_TIME, time };
|
||||
}
|
||||
|
||||
inline ScheduleType get_type() { return m_type; }
|
||||
inline time_t get_time() { return m_time; }
|
||||
inline ScheduleType get_type() const { return m_type; }
|
||||
inline time_t get_time() const { return m_time; }
|
||||
|
||||
inline bool operator<(const NextTime other) const {
|
||||
if (m_type < other.m_type) {
|
||||
return true;
|
||||
} else if (m_type == other.m_type) {
|
||||
switch(m_type){
|
||||
case ScheduleType::AT_TIME:
|
||||
return m_time < other.m_time;
|
||||
case ScheduleType::NEVER:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool operator==(const NextTime other) const {
|
||||
if (m_type != other.m_type) {
|
||||
return false;
|
||||
} else {
|
||||
switch(m_type){
|
||||
case ScheduleType::AT_TIME:
|
||||
return m_time == other.m_time;
|
||||
case ScheduleType::NEVER:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
NextTime(ScheduleType type, time_t time) :
|
||||
|
||||
Reference in New Issue
Block a user