Make the identifiers something meaningful

This commit is contained in:
Jaime Thomas 2008-09-23 03:31:15 +00:00
parent 8ea54c6416
commit 3db24761ca
2 changed files with 32 additions and 30 deletions

View File

@ -4,7 +4,7 @@ group {
parts { parts {
part { part {
name: "b1"; name: "ecdb/burn_data";
type: SWALLOW; type: SWALLOW;
repeat_events: 1; repeat_events: 1;
@ -25,7 +25,7 @@ group {
} }
part { part {
name: "b2"; name: "ecdb/burn_audio";
type: SWALLOW; type: SWALLOW;
repeat_events: 1; repeat_events: 1;
@ -46,7 +46,7 @@ group {
} }
part { part {
name: "b3"; name: "ecdb/burn_image";
type: SWALLOW; type: SWALLOW;
repeat_events: 1; repeat_events: 1;
@ -67,7 +67,7 @@ group {
} }
part { part {
name: "b4"; name: "ecdb/erase";
type: SWALLOW; type: SWALLOW;
repeat_events: 1; repeat_events: 1;
@ -92,58 +92,58 @@ group {
program { program {
name: "b1_selected"; name: "b1_selected";
signal: "mouse,down,1"; signal: "mouse,down,1";
action: SIGNAL_EMIT "selected" "b1"; action: SIGNAL_EMIT "selected" "ecdb/burn_data";
source: "b1"; source: "ecdb/burn_data";
} }
program { program {
name: "b1_clicked"; name: "b1_clicked";
signal: "mouse,clicked,1"; signal: "mouse,clicked,1";
action: SIGNAL_EMIT "clicked" "b1"; action: SIGNAL_EMIT "clicked" "ecdb/burn_data";
source: "b1"; source: "ecdb/burn_data";
} }
program { program {
name: "b2_selected"; name: "b2_selected";
signal: "mouse,down,1"; signal: "mouse,down,1";
action: SIGNAL_EMIT "selected" "b2"; action: SIGNAL_EMIT "selected" "ecdb/burn_audio";
source: "b2"; source: "ecdb/burn_audio";
} }
program { program {
name: "b2_clicked"; name: "b2_clicked";
signal: "mouse,clicked,1"; signal: "mouse,clicked,1";
action: SIGNAL_EMIT "clicked" "b2"; action: SIGNAL_EMIT "clicked" "ecdb/burn_audio";
source: "b2"; source: "ecdb/burn_audio";
} }
program { program {
name: "b3_selected"; name: "b3_selected";
signal: "mouse,down,1"; signal: "mouse,down,1";
action: SIGNAL_EMIT "selected" "b3"; action: SIGNAL_EMIT "selected" "ecdb/burn_image";
source: "b3"; source: "ecdb/burn_image";
} }
program { program {
name: "b3_clicked"; name: "b3_clicked";
signal: "mouse,clicked,1"; signal: "mouse,clicked,1";
action: SIGNAL_EMIT "clicked" "b3"; action: SIGNAL_EMIT "clicked" "ecdb/burn_image";
source: "b3"; source: "ecdb/burn_image";
} }
program { program {
name: "b4_selected"; name: "b4_selected";
signal: "mouse,down,1"; signal: "mouse,down,1";
action: SIGNAL_EMIT "selected" "b4"; action: SIGNAL_EMIT "selected" "ecdb/erase";
source: "b4"; source: "ecdb/erase";
} }
program { program {
name: "b4_clicked"; name: "b4_clicked";
signal: "mouse,clicked,1"; signal: "mouse,clicked,1";
action: SIGNAL_EMIT "clicked" "b4"; action: SIGNAL_EMIT "clicked" "ecdb/erase";
source: "b4"; source: "ecdb/erase";
} }
} }
} }

View File

@ -227,35 +227,35 @@ ecdb_create_main_gui(void)
evas_object_move(welcome_page, x, y); evas_object_move(welcome_page, x, y);
evas_object_resize(welcome_page, w, h); evas_object_resize(welcome_page, w, h);
edje_object_part_swallow(gui, "action_area", welcome_page); edje_object_part_swallow(gui, "action_area", welcome_page);
edje_object_signal_callback_add(welcome_page, "selected", "b*", edje_object_signal_callback_add(welcome_page, "selected", "ecdb/*",
ecdb_cb_welcome_page_buttons_focused, NULL); ecdb_cb_welcome_page_buttons_focused, NULL);
edje_object_signal_callback_add(welcome_page, "clicked", "b*", edje_object_signal_callback_add(welcome_page, "clicked", "ecdb/*",
ecdb_cb_welcome_page_buttons_clicked, NULL); ecdb_cb_welcome_page_buttons_clicked, NULL);
evas_object_show(welcome_page); evas_object_show(welcome_page);
/* Buttons next, do properly next */ /* Buttons next, do properly next */
Evas_Object *b; Evas_Object *b;
int i; int i;
char *names[] = {"b1","b2","b3","b4"}; char *labels[] = {"Burn Data CD", "Burn Audio CD", "Burn Image",
char *labels[] = {"Burn Data CD", "Burn Audio CD", "Copy Disc",
"Erase Re-writable Disc"}; "Erase Re-writable Disc"};
char *icons[] = {"ecdb/burn_data", "ecdb/burn_audio", "ecdb/burn_image", char *ids[] = {"ecdb/burn_data", "ecdb/burn_audio", "ecdb/burn_image",
"ecdb/erase"}; "ecdb/erase"};
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
b = edje_object_add(ecore_evas_get(em->main_win_ee)); b = edje_object_add(ecore_evas_get(em->main_win_ee));
evas_object_name_set(b, names[i]); evas_object_name_set(b, ids[i]);
edje_object_file_set(b, em->theme_path, "ecdb/button"); edje_object_file_set(b, em->theme_path, "ecdb/button");
edje_object_part_geometry_get(welcome_page, names[i], &x, &y, &w, &h); edje_object_part_geometry_get(welcome_page, ids[i], &x,
&y, &w, &h);
edje_object_part_text_set(b, "label", labels[i]); edje_object_part_text_set(b, "label", labels[i]);
evas_object_move(b, x, y); evas_object_move(b, x, y);
evas_object_resize(b, w, h); evas_object_resize(b, w, h);
edje_object_part_swallow(welcome_page, names[i], b); edje_object_part_swallow(welcome_page, ids[i], b);
evas_object_show(b); evas_object_show(b);
/* Place this after */ /* Place this after */
ecdb_button_icon_swallow(ecore_evas_get(em->main_win_ee), b, ecdb_button_icon_swallow(ecore_evas_get(em->main_win_ee), b,
icons[i]); ids[i]);
} }
return TRUE; return TRUE;
@ -438,9 +438,11 @@ ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
/* Actually get this to do some stuff, instead of just for show like /* Actually get this to do some stuff, instead of just for show like
* now * now
*/ */
if (!strcmp(source, "b1")) if (!strcmp(source, "ecdb/burn_data"))
edje_object_signal_emit(gui, "ecdb,filelist,visible", "ecdb"); edje_object_signal_emit(gui, "ecdb,filelist,visible", "ecdb");
else if (swallow) else if (swallow)
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb"); edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
printf("Action: %s\n", source);
} }