/* Style */
#define STYLE_MENU_BTN "style.menu.button"
#define STYLE_BASE_BTN "style.base.button"
+#define STYLE_SEARCH_PB "style.search.progressbar"
/* Signal */
#define SIG_FOCUSED "elm,action,focus"
#define SIG_UNFOCUSED "elm,action,unfocus"
#define SIG_SELECTED "selected"
-#define SIG_GUIDE "signal.guide"
+#define SIG_SEARCH_INIT "signal.search.init"
#define SIG_SEARCHING "signal.searching"
#define SIG_SEARCH_COMPLETE "signal.search.complete"
/* String for channel layout */
#define STR_CHANNEL_TITLE "Auto Program"
-#define STR_SEARCH_GUIDE1 "Connect TV cable to antenna / cable input socket<br>"\
+#define STR_SEARCH_INIT1 "Connect TV cable to antenna / cable input socket<br>"\
"behind the TV to start tuning.<br>You can search all available channels."
-#define STR_SEARCH_GUIDE2 "Press start to search and store channels."
+#define STR_SEARCH_INIT2 "Press start to search and store channels."
#define STR_SEARCHING1 "Auto Program is finding channels for you.<br>"\
"To skip current step, Press stop."
#define STR_SEARCHING2 "%d Ch found"
Eina_Bool horizontal, int pad_h, int pad_v);
Evas_Object *utils_add_button(Evas_Object *parent, const char *part,
const char *style, const char *text);
+Evas_Object *utils_add_progressbar(Evas_Object *parent, const char *part,
+ const char *style);
#endif /* __AIR_SETTINGS_UTILS_H__ */
scale, 1;
description {
state, "default" 0.0;
- min, 0 4;
- rel1.to, "padding.progressbar";
+ min, 568 4;
+ rel1 {
+ to, "padding.progressbar";
+ relative, 0.5 0.0;
+ }
rel2 {
to, "padding.progressbar";
- relative, 1.0 0.0;
+ relative, 0.5 0.0;
}
align, 0.5 1.0;
- fixed, 0 1;
+ fixed, 1 1;
visible, 0;
}
description {
programs {
program {
- name, SIG_GUIDE;
- signal, SIG_GUIDE;
+ name, SIG_SEARCH_INIT;
+ signal, SIG_SEARCH_INIT;
source, SRC_ELM;
action, STATE_SET "default" 0.0;
target, PART_SUBTEXT1;
collections {
#include "widget/button.edc"
+ #include "widget/progressbar.edc"
}
--- /dev/null
+group {
+ name, "elm/progressbar/horizontal/style.search.progressbar";
+ parts {
+ part {
+ name, "bg";
+ type, RECT;
+ mouse_events, 0;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ color, 206 206 206 255;
+ }
+ }
+
+ part {
+ name, "elm.cur.progressbar";
+ mouse_events, 0;
+ scale, 1;
+ dragable {
+ confine, "bg";
+ x, 1 1 1;
+ y, 0 0 0;
+ }
+ description {
+ state, "default" 0.0;
+ min, 0 4;
+ fixed, 0 1;
+ visible, 0;
+ rel1 {
+ to, "bg";
+ relative, 0.0 0.0;
+ }
+ rel2.to, "bg";
+ }
+ }
+
+ part {
+ name, "elm.progress.progressbar";
+ type, RECT;
+ mouse_events, 0;
+ scale, 1;
+ description {
+ state, "default" 0.0;
+ min, 0 0;
+ fixed, 1 0;
+ rel1.to, "bg";
+ rel2 {
+ to_y, "bg";
+ to_x, "elm.cur.progressbar";
+ }
+ color, 64 136 211 255;
+ }
+ }
+ }
+}
return btn;
}
+
+Evas_Object *utils_add_progressbar(Evas_Object *parent, const char *part,
+ const char *style)
+{
+ Evas_Object *pb;
+
+ if (!parent) {
+ _ERR("Invalid argument.");
+ return NULL;
+ }
+
+ pb = elm_progressbar_add(parent);
+ if (!pb) {
+ _ERR("elm_progressbar_add failed.");
+ return NULL;
+ }
+
+ if (part)
+ elm_object_part_content_set(parent, part, pb);
+
+ if (style)
+ elm_object_style_set(pb, style);
+
+ return pb;
+}
Evas_Object *base;
Evas_Object *ly;
Evas_Object *btn;
+ Evas_Object *pb;
enum search_state cur_state;
layoutmgr *lmgr;
};
static void _channel_search_init(struct _priv *priv)
{
- _update_layout_text(priv, SIG_GUIDE, STR_SEARCH_GUIDE1,
- STR_SEARCH_GUIDE2, STR_START);
+ _update_layout_text(priv, SIG_SEARCH_INIT, STR_SEARCH_INIT1,
+ STR_SEARCH_INIT2, STR_START);
priv->cur_state = STATE_INIT;
}
static bool _create(layoutmgr *lmgr, void *data)
{
struct _priv *priv;
- Evas_Object *base, *ly, *btn;
+ Evas_Object *base, *ly, *btn, *pb;
if (!lmgr) {
_ERR("Invalid argument.");
return false;
}
+ pb = utils_add_progressbar(ly, PART_PROGRESSBAR, STYLE_SEARCH_PB);
+ if (!pb) {
+ _ERR("Addprogress bar failed.");
+ evas_object_del(ly);
+ return false;
+ }
+
priv = calloc(1, sizeof(*priv));
if (!priv) {
_ERR("Calloc failed.");
priv->base = base;
priv->ly = ly;
priv->btn = btn;
+ priv->pb = pb;
inputmgr_add_callback(btn, 0, &_input_handler, priv);
layoutmgr_set_layout_data(lmgr, LAYOUT_ID_CHANNEL, priv);