Make the identifiers something meaningful

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

View File

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

View File

@ -227,35 +227,35 @@ ecdb_create_main_gui(void)
evas_object_move(welcome_page, x, y);
evas_object_resize(welcome_page, w, h);
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);
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);
evas_object_show(welcome_page);
/* Buttons next, do properly next */
Evas_Object *b;
int i;
char *names[] = {"b1","b2","b3","b4"};
char *labels[] = {"Burn Data CD", "Burn Audio CD", "Copy Disc",
char *labels[] = {"Burn Data CD", "Burn Audio CD", "Burn Image",
"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"};
for (i = 0; i < 4; i++)
{
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_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]);
evas_object_move(b, x, y);
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);
/* Place this after */
ecdb_button_icon_swallow(ecore_evas_get(em->main_win_ee), b,
icons[i]);
ids[i]);
}
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
* now
*/
if (!strcmp(source, "b1"))
if (!strcmp(source, "ecdb/burn_data"))
edje_object_signal_emit(gui, "ecdb,filelist,visible", "ecdb");
else if (swallow)
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
printf("Action: %s\n", source);
}