Knock another item off the TODO. Theme now emits ecdb,clicked for taking action, and ecdb,activate for focusing.
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
/* vim: set sw=3 ts=3 sts=3 expandtab: */
|
||||
#include "ecdb.h"
|
||||
|
||||
static void ecdb_handle_typebuf(Evas_Object *gui, Ewl_Widget *fl);
|
||||
static void ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
typedef void (*edje_cb_type)(void *, Evas_Object *, const char *, const char *);
|
||||
|
||||
static void ecdb_cb_burn_data_clicked(void *data, Evas_Object *o,
|
||||
const char *emission, const char *source);
|
||||
static void ecdb_cb_burn_audio_clicked(void *data, Evas_Object *o,
|
||||
const char *emission, const char *source);
|
||||
static void ecdb_cb_burn_image_clicked(void *data, Evas_Object *o,
|
||||
const char *emission, const char *source);
|
||||
static void ecdb_cb_erase_disc_clicked(void *data, Evas_Object *o,
|
||||
const char *emission, const char *source);
|
||||
|
||||
static void ecdb_handle_typebuf(Evas_Object *gui, Ewl_Widget *fl);
|
||||
static void ecdb_filelist_show(Ecdb_Page *page);
|
||||
static void ecdb_welcome_page_hide_finished(void *data, Evas_Object *o,
|
||||
const char *emission,
|
||||
const char *source);
|
||||
const char *emission, const char *source);
|
||||
static void _page_del(void *data, Evas *e, Evas_Object *obj, void *ev);
|
||||
static void _filelist_del(Ewl_Widget *w, void *ev_data, void *data);
|
||||
|
||||
@@ -357,39 +365,6 @@ ecdb_handle_typebuf(Evas_Object *gui, Ewl_Widget *fl)
|
||||
edje_object_part_text_set(gui, "filelist_overlay_text", NULL);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
const char *emission __UNUSED__,
|
||||
const char *source)
|
||||
{
|
||||
Ecdb_Page *page = data;
|
||||
|
||||
if (!strcmp(source, "ecdb/burn_data"))
|
||||
{
|
||||
edje_object_signal_emit(o, "ecdb,welcome_page,hide", "ecdb");
|
||||
ecdb_burn_data_page_show(page);
|
||||
ecdb_filelist_show(page);
|
||||
}
|
||||
else if (!strcmp(source, "ecdb/erase"))
|
||||
{
|
||||
edje_object_signal_emit(o, "ecdb,welcome_page,hide", "ecdb");
|
||||
ecdb_erase_page_show(page);
|
||||
}
|
||||
else if (!strcmp(source, "ecdb/burn_image"))
|
||||
{
|
||||
ecdb_filelist_show(page);
|
||||
edje_object_signal_emit(o, "ecdb,welcome_page,hide", "ecdb");
|
||||
ecdb_burn_image_page_show(page);
|
||||
}
|
||||
else if (o)
|
||||
{
|
||||
edje_object_signal_emit(page->gui, "ecdb,filelist,hide", "ecdb");
|
||||
}
|
||||
|
||||
EINA_ERROR_PDBG("Action: %s\n", source);
|
||||
}
|
||||
|
||||
void
|
||||
ecdb_welcome_page_show(Ecdb_Page *page)
|
||||
{
|
||||
@@ -404,23 +379,40 @@ ecdb_welcome_page_show(Ecdb_Page *page)
|
||||
evas_object_move(page->welcome, x, y);
|
||||
evas_object_resize(page->welcome, w, h);
|
||||
edje_object_part_swallow(page->gui, "action_area", page->welcome);
|
||||
edje_object_signal_callback_add(page->welcome, "mouse,clicked,1",
|
||||
"ecdb/*", ecdb_cb_welcome_page_buttons_clicked, page);
|
||||
edje_object_signal_callback_add(page->welcome, "hide,finished",
|
||||
"welcome_page", ecdb_welcome_page_hide_finished,
|
||||
page->gui);
|
||||
evas_object_show(page->welcome);
|
||||
|
||||
int i;
|
||||
char *labels[] = {"Burn Data CD", "Burn Audio CD", "Burn Image",
|
||||
"Erase Re-writable Disc"};
|
||||
char *ids[] = {"ecdb/burn_data", "ecdb/burn_audio", "ecdb/burn_image",
|
||||
"ecdb/erase"};
|
||||
edje_cb_type cbs[] =
|
||||
{
|
||||
ecdb_cb_burn_data_clicked,
|
||||
ecdb_cb_burn_audio_clicked,
|
||||
ecdb_cb_burn_image_clicked,
|
||||
ecdb_cb_erase_disc_clicked
|
||||
};
|
||||
char *labels[] =
|
||||
{
|
||||
"Burn Data CD",
|
||||
"Burn Audio CD",
|
||||
"Burn Image",
|
||||
"Erase Re-writable Disc"
|
||||
};
|
||||
char *ids[] =
|
||||
{
|
||||
"ecdb/burn_data",
|
||||
"ecdb/burn_audio",
|
||||
"ecdb/burn_image",
|
||||
"ecdb/erase"
|
||||
};
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
b = ecdb_button_add(page->welcome, ids[i]);
|
||||
ecdb_button_label_set(b, labels[i]);
|
||||
evas_object_show(b);
|
||||
edje_object_signal_callback_add(b, "ecdb,clicked", "ecdb",
|
||||
cbs[i], page);
|
||||
ecdb_button_icon_set(b, ids[i]);
|
||||
}
|
||||
}
|
||||
@@ -533,3 +525,47 @@ ecdb_gui_combo_header_from_speeds(Evas_Object *c, const char *name, void *data,
|
||||
evas_object_show(ret);
|
||||
}
|
||||
|
||||
static void
|
||||
ecdb_cb_burn_data_clicked(void *data, Evas_Object *o,
|
||||
const char *emission __UNUSED__,
|
||||
const char *source __UNUSED__)
|
||||
{
|
||||
Ecdb_Page *page = data;
|
||||
|
||||
edje_object_signal_emit(page->welcome, "ecdb,welcome_page,hide", "ecdb");
|
||||
ecdb_burn_data_page_show(page);
|
||||
ecdb_filelist_show(page);
|
||||
}
|
||||
|
||||
static void
|
||||
ecdb_cb_burn_audio_clicked(void *data, Evas_Object *o,
|
||||
const char *emission __UNUSED__,
|
||||
const char *source __UNUSED__)
|
||||
{
|
||||
Ecdb_Page *page = data;
|
||||
|
||||
edje_object_signal_emit(page->welcome, "ecdb,filelist,hide", "ecdb");
|
||||
EINA_ERROR_PDBG("Burn Audio Disc\n");
|
||||
}
|
||||
|
||||
static void
|
||||
ecdb_cb_burn_image_clicked(void *data, Evas_Object *o,
|
||||
const char *emission __UNUSED__,
|
||||
const char *source __UNUSED__)
|
||||
{
|
||||
Ecdb_Page *page = data;
|
||||
|
||||
ecdb_filelist_show(page);
|
||||
edje_object_signal_emit(page->welcome, "ecdb,welcome_page,hide", "ecdb");
|
||||
ecdb_burn_image_page_show(page);
|
||||
}
|
||||
static void
|
||||
ecdb_cb_erase_disc_clicked(void *data, Evas_Object *o,
|
||||
const char *emission __UNUSED__,
|
||||
const char *source __UNUSED__)
|
||||
{
|
||||
Ecdb_Page *page = data;
|
||||
|
||||
edje_object_signal_emit(page->welcome, "ecdb,welcome_page,hide", "ecdb");
|
||||
ecdb_erase_page_show(page);
|
||||
}
|
||||
|
Reference in New Issue
Block a user