From: Piotr Pruski Date: Fri, 26 Feb 2016 12:35:59 +0000 (+0100) Subject: System Wake up timer X-Git-Tag: accepted/tizen/tv/20160308.101500~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09c799b64c009be753322e51832e16598e954dfd;p=profile%2Ftv%2Fapps%2Fnative%2Fair_settings.git System Wake up timer Change-Id: I2a41ab6a1d17d31227f057ebd7b40461a4155bc4 Signed-off-by: Piotr Pruski --- diff --git a/include/data/system/settings_language.h b/include/data/system/settings_language.h index c829778..02811e8 100644 --- a/include/data/system/settings_language.h +++ b/include/data/system/settings_language.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __AIR_SETTINGS_WAKEUP_TIMER_H__ -#define __AIR_SETTINGS_WAKEUP_TIMER_H__ +#ifndef __AIR_SETTINGS_LANGUAGE_H__ +#define __AIR_SETTINGS_LANGUAGE_H__ #include #include @@ -43,4 +43,4 @@ settings_language_type settings_language_get_subtitle_language_id(void); /* Gets current display subtitlelanguage string. */ char *settings_language_get_subtitle_language_display_str(void); -#endif /* __AIR_SETTINGS_WAKEUP_TIMER_H__ */ +#endif /* __AIR_SETTINGS_LANGUAGE_H__ */ diff --git a/include/data/system/settings_wakeup_timer.h b/include/data/system/settings_wakeup_timer.h index 422275c..95bfb17 100644 --- a/include/data/system/settings_wakeup_timer.h +++ b/include/data/system/settings_wakeup_timer.h @@ -49,6 +49,7 @@ enum tmp_channel { }; int settings_wakeup_timer_get_setup(void); +char *settings_wakeup_timer_display_str(void); bool settings_wakeup_timer_get_time(struct tm *def_time); int settings_wakeup_timer_get_volume(void); int settings_wakeup_timer_get_source(void); diff --git a/include/define.h b/include/define.h index 651c1ac..9c6297d 100644 --- a/include/define.h +++ b/include/define.h @@ -132,6 +132,7 @@ #define STYLE_BASE_BTN "style.base.button" #define STYLE_NORMAL_BTN "style.normal.button" #define STYLE_STATUS_BTN "style.status.button" +#define STYLE_TEXTBLOCK_BTN "style.textblock.button" #define STYLE_PROGRESS_BTN "style.progress.button" #define STYLE_OPTION_BTN "style.option.button" #define STYLE_OPTION_LIST_BTN "style.option.list.button" diff --git a/res/widget/button.edc b/res/widget/button.edc index 8db60ee..8c20b0d 100644 --- a/res/widget/button.edc +++ b/res/widget/button.edc @@ -596,6 +596,94 @@ group { } group { + name, "elm/button/base/style.textblock.button"; + inherit, "elm/button/base/style.normal.button"; + styles { + style { + name, "style.subtext1"; + base, "font=BreezeSans:style=Light color=#747474 font_size=40 align=center"; + tag, "br" "\n"; + } + } + parts { + part { + name, "elm.text"; + description { + state, "default" 0.0; + rel2.relative, 1.0 0.5; + text.align, 0.5 0.5; + // the rest is inherited + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + color, COLOR_TEXT_FOCUS; + } + description { + state, "disabled" 0.0; + inherit, "default" 0.0; + color, COLOR_TEXT_DISABLE; + } + } + part { + name, PART_MENU_VALUE; + type, TEXTBLOCK; + repeat_events, 1; + scale, 1; + description { + state, "default" 0.0; + rel1 { + to, "bg.content"; + relative, 0.0 0.4; + } + rel2.to, "bg.content"; + + text { + align, 0.5 0.0; + style, "style.subtext1"; + } + } + description { + state, "focused" 0.0; + inherit, "default" 0.0; + color, COLOR_TEXT_VALUE_FOCUS; + } + description { + state, "disabled" 0.0; + inherit, "default" 0.0; + color, COLOR_TEXT_VALUE_DISABLE; + } + description { + state, "notavailable" 0.0; + inherit, "default" 0.0; + color, COLOR_TEXT_DISABLE; + } + } + } + programs { + program { + name, "focused"; + target, PART_MENU_VALUE; + } + program { + name, "unfocused"; + target, PART_MENU_VALUE; + } + program { + name, "disabled"; + target, PART_MENU_VALUE; + } + program { + name, SIG_NOTAVAILABLE; + signal, SIG_NOTAVAILABLE; + source, ""; + action, STATE_SET "notavailable" 0.0; + target, PART_MENU_VALUE; + } + } +} + +group { name, "elm/button/base/style.progress.button"; inherit, "elm/button/base/style.status.button"; parts { diff --git a/src/common/menumgr.c b/src/common/menumgr.c index b3e2a9d..357cb3a 100644 --- a/src/common/menumgr.c +++ b/src/common/menumgr.c @@ -128,6 +128,7 @@ void menumgr_update(struct menumgr *m) free(str); } } + if (m->info[i]->progress_evas) { elm_progressbar_value_set(m->info[i]->progress_evas, m->info[i]->progress_value()); } diff --git a/src/data/system/settings_wakeup_timer.c b/src/data/system/settings_wakeup_timer.c index 239ee05..8946a49 100644 --- a/src/data/system/settings_wakeup_timer.c +++ b/src/data/system/settings_wakeup_timer.c @@ -22,7 +22,17 @@ int settings_wakeup_timer_get_setup(void) { //@TODO: get from stored settings - return SETUP_TYPE_OFF; +// return SETUP_TYPE_OFF; + return SETUP_TYPE_ONCE; +} + +char *settings_wakeup_timer_display_str(void) +{ + //@TODO: get from stored settings + if(settings_wakeup_timer_get_setup() != SETUP_TYPE_OFF) + return strdup("10:45 AM
TV | 53 BBC"); + + return strdup("Off"); } bool settings_wakeup_timer_get_time(struct tm *def_time) diff --git a/src/layout/layout_system.c b/src/layout/layout_system.c index 70ed1f5..cad6517 100644 --- a/src/layout/layout_system.c +++ b/src/layout/layout_system.c @@ -63,9 +63,9 @@ enum { MENU_RESET }; -static char *_get_status(void *data, int id); static char *_get_clock_mode(void *data, int id); static char *_get_sleep_timer(void *data, int id); +static char *_get_wakeup_timer(void *data, int id); static char *_get_language(void *data, int id); static char *_get_subtitle(void *data, int id); static char *_get_location(void *data, int id); @@ -96,9 +96,9 @@ static struct menumgr_info menu_info[] = { { .id = MENU_WAKEUP_TIMER, .title = STR_WAKEUP_TIMER, - .style = STYLE_STATUS_BTN, + .style = STYLE_TEXTBLOCK_BTN, .disabled = EINA_FALSE, - .status = _get_status, + .status = _get_wakeup_timer, .selected = _selected, .selected_menu = _selected_menu }, @@ -147,11 +147,6 @@ static struct menumgr_info menu_info[] = { }, }; -static char *_get_status(void *data, int id) -{ - return NULL; -} - static char *_get_clock_mode(void *data, int id) { bool automatic = false; @@ -171,6 +166,11 @@ static char *_get_sleep_timer(void *data, int id) return strdup(TIMER_OFF); } +static char *_get_wakeup_timer(void *data, int id) +{ + return settings_wakeup_timer_display_str(); +} + static char *_get_language(void *data, int id) { return settings_language_get_language_display_str();