Renamed fasting window to eating window as to make more sense
This commit is contained in:
parent
60289b6175
commit
296bda9061
4 changed files with 17 additions and 17 deletions
|
|
@ -29,8 +29,8 @@
|
|||
"messageKeys": [
|
||||
"BackgroundColor",
|
||||
"ForegroundColor",
|
||||
"FastBegin",
|
||||
"FastEnd"
|
||||
"EatingWindowBegin",
|
||||
"EatingWindowEnd"
|
||||
],
|
||||
"resources": {
|
||||
"media": []
|
||||
|
|
|
|||
16
src/c/main.c
16
src/c/main.c
|
|
@ -13,8 +13,8 @@ static ClaySettings settings;
|
|||
static void default_settings() {
|
||||
settings.BackgroundColor = GColorBlack;
|
||||
settings.ForegroundColor = GColorWhite;
|
||||
settings.FastBegin = "12:00";
|
||||
settings.FastEnd = "20:00";
|
||||
settings.EatingWindowBegin = "12:00";
|
||||
settings.EatingWindowEnd = "20:00";
|
||||
}
|
||||
|
||||
// Read settings from persistent storage
|
||||
|
|
@ -47,15 +47,15 @@ static void inbox_recieved_callback(DictionaryIterator *iter, void *context) {
|
|||
}
|
||||
|
||||
// Second Tick
|
||||
Tuple *fast_begin_t = dict_find(iter, MESSAGE_KEY_FastBegin);
|
||||
Tuple *fast_begin_t = dict_find(iter, MESSAGE_KEY_EatingWindowBegin);
|
||||
if (fast_begin_t) {
|
||||
settings.FastBegin = fast_begin_t->value->cstring;
|
||||
settings.EatingWindowBegin = fast_begin_t->value->cstring;
|
||||
}
|
||||
|
||||
// Animations
|
||||
Tuple *fast_end_t = dict_find(iter, MESSAGE_KEY_FastEnd);
|
||||
Tuple *fast_end_t = dict_find(iter, MESSAGE_KEY_EatingWindowEnd);
|
||||
if (fast_end_t) {
|
||||
settings.FastEnd = fast_end_t->value->cstring;
|
||||
settings.EatingWindowEnd = fast_end_t->value->cstring;
|
||||
}
|
||||
|
||||
// Save the new settings to persistent storage
|
||||
|
|
@ -85,8 +85,8 @@ static void update_time() {
|
|||
static const char eatmsg[] = "Eat";
|
||||
static const char donteatmsg[] = "Don't Eat";
|
||||
|
||||
time_t fast_start = parse_time_str(settings.FastBegin);
|
||||
time_t fast_end = parse_time_str(settings.FastEnd);
|
||||
time_t fast_start = parse_time_str(settings.EatingWindowBegin);
|
||||
time_t fast_end = parse_time_str(settings.EatingWindowEnd);
|
||||
|
||||
if (now >= fast_start && now < fast_end) {
|
||||
text_layer_set_text(s_eat_layer, eatmsg);
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
typedef struct ClaySettings {
|
||||
GColor BackgroundColor;
|
||||
GColor ForegroundColor;
|
||||
char *FastBegin;
|
||||
char *FastEnd;
|
||||
char *EatingWindowBegin;
|
||||
char *EatingWindowEnd;
|
||||
} __attribute__((__packed__)) ClaySettings;
|
||||
|
||||
static void default_settings();
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@ module.exports = [
|
|||
"items": [
|
||||
{
|
||||
"type": "heading",
|
||||
"defaultValue": "Fasting Period (24hr format)"
|
||||
"defaultValue": "Eating Window (24hr format)"
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"messageKey": "FastBegin",
|
||||
"label": "Time your fast begins",
|
||||
"messageKey": "EatingWindowBegin",
|
||||
"label": "Time your eating window begins",
|
||||
"attributes": {
|
||||
"placeholder": "12:00",
|
||||
"limit": 5,
|
||||
|
|
@ -47,8 +47,8 @@ module.exports = [
|
|||
},
|
||||
{
|
||||
"type": "input",
|
||||
"messageKey": "FastEnd",
|
||||
"label": "Time your fast ends",
|
||||
"messageKey": "EatingWindowEnd",
|
||||
"label": "Time your eating window ends",
|
||||
"attributes": {
|
||||
"placeholder": "20:00",
|
||||
"limit": 5,
|
||||
|
|
|
|||
Loading…
Reference in a new issue