Ok, some stuff I missed when updating.

This commit is contained in:
Jaime Thomas 2009-01-27 04:00:34 +00:00
parent 3273177453
commit bfedcfcd28
7 changed files with 293 additions and 97 deletions

View File

@ -4,8 +4,6 @@
#include "images/images.edc" #include "images/images.edc"
#include "fonts/fonts.edc" #include "fonts/fonts.edc"
#include "macros/button.edc"
#include "macros/check.edc"
collections { collections {
#include "groups/window.edc" #include "groups/window.edc"
@ -20,4 +18,5 @@ collections {
#include "groups/burn_data.edc" #include "groups/burn_data.edc"
#include "groups/capacity.edc" #include "groups/capacity.edc"
#include "groups/config_inwin.edc" #include "groups/config_inwin.edc"
#include "groups/icons.edc"
} }

View File

@ -5,7 +5,7 @@ group {
data { data {
item: "ecdb/combo_item/minw" 50; item: "ecdb/combo_item/minw" 50;
item: "ecdb/combo_item/minh" 30; item: "ecdb/combo_item/minh" 26;
} }
parts { parts {

View File

@ -0,0 +1,132 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
group {
name: "ecdb/burn_data";
min: 32 32;
parts {
part {
name: "image";
type: IMAGE;
scale: 1;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "drive_optical.png";
}
}
}
}
}
group {
name: "ecdb/burn_audio";
min: 32 32;
parts {
part {
name: "image";
type: IMAGE;
scale: 1;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "audio.png";
}
}
}
}
}
group {
name: "ecdb/erase";
min: 32 32;
parts {
part {
name: "image";
type: IMAGE;
scale: 1;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "clear.png";
}
}
}
}
}
group {
name: "ecdb/burn_image";
min: 32 32;
parts {
part {
name: "image";
type: IMAGE;
scale: 1;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
image {
normal: "iso.png";
}
}
}
}
}

View File

@ -1,17 +1,16 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */ /* vim: set sw=3 ts=3 sts=3 expandtab: */
group { group {
name: "ecdb/welcome_page"; name: "ecdb/welcome_page";
min: 640 170;
parts { parts {
part { part {
name: "bg"; name: "bg";
type: RECT; type: RECT;
scale: 1;
description { description {
state: "default" 0.0; state: "default" 0.0;
color: 0 0 0 0; color: 0 0 0 0;
min: 640 170;
rel1 { rel1 {
relative: 0.0 0.0; relative: 0.0 0.0;
@ -55,20 +54,96 @@ group {
} }
} }
BUTTON_ICON("ecdb/burn_data", "ecdb/burn_data/text", "drive_optical.png", 100, 26, 99999, 99999, "bg", "bg", 0, 0, "bg", "bg", 0.5, 0.5, 5, 5, -6, -6, 0, 0) part {
name: "ecdb/burn_data";
type: SWALLOW;
repeat_events: 1;
BUTTON_ICON("ecdb/burn_audio", "ecdb/burn_audio/text", "audio.png", 100, 26, 99999, 99999, "bg", "bg", 0.5, 0, "bg", "bg", 1, 0.5, 5, 5, -6, -6, 0, 0) description {
state: "default" 0.0;
BUTTON_ICON("ecdb/burn_image", "ecdb/burn_image/text", "iso.png", 100, 26, 99999, 99999, "bg", "bg", 0, 0.5, "bg", "bg", 0.5, 1, 5, 5, -6, -6, 0, 0) rel1 {
to: "bg";
relative: 0.0 0.0;
offset: 10 10;
}
BUTTON_ICON("ecdb/erase", "ecdb/erase/text", "clear.png", 100, 26, 99999, 99999, "bg", "bg", 0.5, 0.5, "bg", "bg", 1, 1, 5, 5, -6, -6, 0, 0) rel2 {
to: "bg";
relative: 0.5 0.5;
offset: -11 -11;
}
}
}
part {
name: "ecdb/burn_audio";
type: SWALLOW;
repeat_events: 1;
description {
state: "default" 0.0;
rel1 {
to: "bg";
relative: 0.5 0.0;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 1.0 0.5;
offset: -11 -11;
}
}
}
part {
name: "ecdb/burn_image";
type: SWALLOW;
repeat_events: 1;
description {
state: "default" 0.0;
rel1 {
to: "bg";
relative: 0.0 0.5;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 0.5 1.0;
offset: -11 -11;
}
}
}
part {
name: "ecdb/erase";
type: SWALLOW;
repeat_events: 1;
description {
state: "default" 0.0;
rel1 {
to: "bg";
relative: 0.5 0.5;
offset: 10 10;
}
rel2 {
to: "bg";
relative: 1.0 1.0;
offset: -11 -11;
}
}
}
} }
programs { programs {
BUTTON_PROGS("ecdb/burn_data")
BUTTON_PROGS("ecdb/burn_audio")
BUTTON_PROGS("ecdb/burn_image")
BUTTON_PROGS("ecdb/erase")
program { program {
name: "welcome_page,hide"; name: "welcome_page,hide";
signal: "ecdb,welcome_page,hide"; signal: "ecdb,welcome_page,hide";

View File

@ -1,13 +1,9 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */ /* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
static void _button_cb_return(void *data, Evas_Object *obj, static void _button_cb_return(void *data, Evas_Object *obj, void *event_info);
const char *emission, const char *source); static void _button_cb_begin(void *data, Evas_Object *obj, void *event_info);
static void _button_cb_begin(void *data, Evas_Object *obj,
const char *emission, const char *source);
static void _combo_cb_clicked(void *data, Evas_Object *obj, void *event_info); static void _combo_cb_clicked(void *data, Evas_Object *obj, void *event_info);
static void _settings_clicked(void *data, Evas_Object *obj,
const char *emission, const char *source);
static int _update_capacity(void *data, int type, void *ev_data); static int _update_capacity(void *data, int type, void *ev_data);
// Config inwin updates // Config inwin updates
@ -20,6 +16,7 @@ static void _sim_clicked(void *data, Evas_Object *obj, void *event_info);
static void _underrun_clicked(void *data, Evas_Object *obj, void *event_info); static void _underrun_clicked(void *data, Evas_Object *obj, void *event_info);
static void _apply_clicked(void *data, Evas_Object *obj, void *event_info); static void _apply_clicked(void *data, Evas_Object *obj, void *event_info);
static void _proj_name(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _proj_name(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _settings_clicked(void *data, Evas_Object *obj, void *event_into);
// Update on showing to proper values // Update on showing to proper values
static void _joliet_config(void *data, Evas_Object *obj, void *event_info); static void _joliet_config(void *data, Evas_Object *obj, void *event_info);
@ -68,9 +65,7 @@ _update_capacity(void *data, int type, void *ev_data)
} }
static void static void
_button_cb_return(void *data, Evas_Object *obj __UNUSED__, _button_cb_return(void *data, Evas_Object *obj, void *event_info)
const char *emission __UNUSED__,
const char *source __UNUSED__)
{ {
Evas_Object *gui; Evas_Object *gui;
Ecdb_Burn_Project *proj; Ecdb_Burn_Project *proj;
@ -91,9 +86,7 @@ _button_cb_return(void *data, Evas_Object *obj __UNUSED__,
} }
static void static void
_button_cb_begin(void *data, Evas_Object *obj __UNUSED__, _button_cb_begin(void *data, Evas_Object *obj, void *event_info)
const char *emission __UNUSED__,
const char *source __UNUSED__)
{ {
Evas_Object *gui; Evas_Object *gui;
Ecdb_Burn_Project *proj; Ecdb_Burn_Project *proj;
@ -144,14 +137,10 @@ _button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
case ECDB_ERROR_NONE: case ECDB_ERROR_NONE:
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb"); edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
edje_object_signal_emit(proj->parent, "ecdb,burn_data,start", "ecdb"); edje_object_signal_emit(proj->parent, "ecdb,burn_data,start", "ecdb");
const char *ids[] = {"ecdb/burn_data/drives", "ecdb/burn_data/speed"}; const char *ids[] = {"ecdb/burn_data/return", "ecdb/burn_data/begin",
ecdb_gui_controls_disable(ids, 2); "ecdb/burn_data/file", "ecdb/burn_data/drive",
edje_object_signal_emit(proj->parent, "ecdb/burn_data/speed"};
"ecdb,disable,ecdb/burn_data/return", "ecdb"); ecdb_gui_controls_disable(ids, 5);
edje_object_signal_emit(proj->parent,
"ecdb,disable,ecdb/burn_data/begin", "ecdb");
edje_object_signal_emit(proj->parent,
"ecdb,disable,ecdb/burn_data/settings", "ecdb");
return; return;
case ECDB_ERROR_IMAGE_CREATE: case ECDB_ERROR_IMAGE_CREATE:
@ -404,9 +393,7 @@ _proj_config(void *data, Evas_Object *obj, void *event_info)
} }
static void static void
_settings_clicked(void *data, Evas_Object *obj __UNUSED__, _settings_clicked(void *data, Evas_Object *obj, void *event_into)
const char *emission __UNUSED__,
const char *source __UNUSED__)
{ {
Eina_Iterator *it; Eina_Iterator *it;
const Evas_Object *table; const Evas_Object *table;
@ -465,17 +452,17 @@ ecdb_burn_data_page_show(void)
evas_object_show(swallow); evas_object_show(swallow);
proj->parent = swallow; proj->parent = swallow;
// The return button b = ecdb_button_add(swallow, "ecdb/burn_data/return");
edje_object_part_text_set(swallow, "ecdb/burn_data/return/text", ecdb_button_label_set(b, "Return to Main Page");
"Return to Main Page"); evas_object_smart_callback_add(b, "clicked", _button_cb_return, proj);
edje_object_signal_callback_add(swallow, "ecdb/burn_data/return,clicked", evas_object_show(b);
"*", _button_cb_return, proj); ecdb_button_icon_set(b, "ecdb/burn_data/return");
// The start button b = ecdb_button_add(swallow, "ecdb/burn_data/begin");
edje_object_part_text_set(swallow, "ecdb/burn_data/begin/text", ecdb_button_label_set(b, "Start Burn");
"Start Burn"); evas_object_smart_callback_add(b, "clicked", _button_cb_begin, proj);
edje_object_signal_callback_add(swallow, "ecdb/burn_data/begin,clicked", evas_object_show(b);
"*", _button_cb_begin, proj); ecdb_button_icon_set(b, "ecdb/burn_data/begin");
proj->drive_combo = ecdb_combo_add(swallow, "ecdb/burn_data/drive"); proj->drive_combo = ecdb_combo_add(swallow, "ecdb/burn_data/drive");
ecdb_combo_header_set(proj->drive_combo, "Drive"); ecdb_combo_header_set(proj->drive_combo, "Drive");
@ -524,6 +511,7 @@ ecdb_burn_data_page_show(void)
b = edje_object_part_swallow_get(swallow, "ecdb/burn_data/filelist"); b = edje_object_part_swallow_get(swallow, "ecdb/burn_data/filelist");
ecdb_widget_focus_callback_add(b, "ecdb/burn_data/filelist"); ecdb_widget_focus_callback_add(b, "ecdb/burn_data/filelist");
// FIXME Turn this into a normal widget
proj->capacity = ecdb_capacity_add(swallow, "ecdb/burn_data/capacity"); proj->capacity = ecdb_capacity_add(swallow, "ecdb/burn_data/capacity");
evas_object_data_set(proj->capacity, "source", src); evas_object_data_set(proj->capacity, "source", src);
ecore_event_handler_add(ECDB_FILELIST_SIZE_CHANGED, _update_capacity, ecore_event_handler_add(ECDB_FILELIST_SIZE_CHANGED, _update_capacity,
@ -605,11 +593,10 @@ ecdb_burn_data_page_show(void)
evas_object_show(b); evas_object_show(b);
// At the end so t is a valid pointer // At the end so t is a valid pointer
edje_object_part_text_set(swallow, "ecdb/burn_data/settings/text", b = ecdb_button_add(swallow, "ecdb/burn_data/settings");
"Settings"); ecdb_button_label_set(b, "Settings");
edje_object_signal_callback_add(swallow, evas_object_smart_callback_add(b, "clicked", _settings_clicked, t);
"ecdb/burn_data/settings,clicked", evas_object_show(b);
"*", _settings_clicked, t);
} }
else if (edje_object_part_swallow_get(gui, "action_area") != swallow) else if (edje_object_part_swallow_get(gui, "action_area") != swallow)
{ {

View File

@ -1,39 +1,39 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */ /* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
static void _button_cb_return(void *data, Evas_Object *o, const char *emission, static void _button_cb_return(void *data, Evas_Object *obj, void *event_info);
const char *source); static void _button_cb_begin(void *data, Evas_Object *obj, void *event_info);
static void _button_cb_begin(void *data, Evas_Object *o, const char *emission,
const char *source);
static void static void
_button_cb_return(void *data __UNUSED__, Evas_Object *o, _button_cb_return(void *data, Evas_Object *obj, void *event_info)
const char *emission __UNUSED__,
const char *source __UNUSED__)
{ {
Evas_Object *swallow;
char *signal; char *signal;
edje_object_part_text_set(o, "progress_text", "Begin Erase"); swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
edje_object_part_text_set(o, "progress_percent", "0%"); "erase_page");
signal = evas_object_data_get(o, "hide_signal");
edje_object_signal_emit(o, signal, "ecdb"); edje_object_part_text_set(swallow, "progress_text", "Begin Erase");
edje_object_part_text_set(swallow, "progress_percent", "0%");
signal = evas_object_data_get(swallow, "hide_signal");
edje_object_signal_emit(swallow, signal, "ecdb");
ecdb_welcome_page_show(); ecdb_welcome_page_show();
} }
static void static void
_button_cb_begin(void *data __UNUSED__, Evas_Object *obj, _button_cb_begin(void *data, Evas_Object *obj, void *event_info)
const char *emission __UNUSED__,
const char *source __UNUSED__)
{ {
Evas_Object *o; Evas_Object *swallow, *o;
Ecdb_Erase_Project *proj; Ecdb_Erase_Project *proj;
char buf[1024]; char buf[1024];
const char *state, *ids[] = {"ecdb/erase/drive"};
int drive; int drive;
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"erase_page");
proj = ecdb_erase_project_new(); proj = ecdb_erase_project_new();
snprintf(buf, sizeof(buf), "Commencing..."); snprintf(buf, sizeof(buf), "Commencing...");
edje_object_part_text_set(obj, "progress_text", buf); edje_object_part_text_set(swallow, "progress_text", buf);
o = evas_object_name_find(evas_object_evas_get(obj), "ecdb/erase/drive"); o = evas_object_name_find(evas_object_evas_get(obj), "ecdb/erase/drive");
drive = ecdb_combo_selected_get(o); drive = ecdb_combo_selected_get(o);
@ -41,7 +41,7 @@ _button_cb_begin(void *data __UNUSED__, Evas_Object *obj,
{ {
printf("Choose a drive!\n"); printf("Choose a drive!\n");
ecdb_erase_project_destroy(proj); ecdb_erase_project_destroy(proj);
edje_object_part_text_set(obj, "progress_text", "Choose a Drive!"); edje_object_part_text_set(swallow, "progress_text", "Choose a Drive!");
return; return;
} }
@ -49,31 +49,30 @@ _button_cb_begin(void *data __UNUSED__, Evas_Object *obj,
{ {
printf("Couldn't grab drive!\n"); printf("Couldn't grab drive!\n");
ecdb_erase_project_destroy(proj); ecdb_erase_project_destroy(proj);
edje_object_part_text_set(obj, "progress_text", edje_object_part_text_set(swallow, "progress_text",
"Couldn't grab the drive!"); "Couldn't grab the drive!");
return; return;
} }
state = edje_object_part_state_get(obj, "ecdb/erase/speed", NULL); o = evas_object_name_find(evas_object_evas_get(obj), "ecdb/erase/speed");
proj->quick = !strcmp(state, "on"); proj->quick = ecdb_check_checked_get(o);
if (!ecdb_erase_disc(proj)) if (!ecdb_erase_disc(proj))
{ {
Ecdb_Project *p = ECDB_PROJECT(proj); Ecdb_Project *p = ECDB_PROJECT(proj);
printf("Disc not erasable!\n"); printf("Disc not erasable!\n");
snprintf(buf, sizeof(buf), "Disc not erasable!"); snprintf(buf, sizeof(buf), "Disc not erasable!");
edje_object_part_text_set(obj, "progress_text", buf); edje_object_part_text_set(swallow, "progress_text", buf);
burn_drive_release(p->drive->tangible[0].drive, 0); burn_drive_release(p->drive->tangible[0].drive, 0);
burn_drive_info_free(p->drive->tangible); burn_drive_info_free(p->drive->tangible);
ecdb_erase_project_destroy(proj); ecdb_erase_project_destroy(proj);
return; return;
} }
ecdb_gui_controls_enable(ids, 1); edje_object_signal_emit(swallow, "ecdb,erase,start", "ecdb");
edje_object_signal_emit(obj, "ecdb,erase,start", "ecdb"); const char *ids[] = {"ecdb/erase/return", "ecdb/erase/begin",
edje_object_signal_emit(obj, "ecdb,disable,ecdb/erase/begin", "ecdb"); "ecdb/erase/speed", "ecdb/erase/drive"};
edje_object_signal_emit(obj, "ecdb,disable,ecdb/erase/return", "ecdb"); ecdb_gui_controls_disable(ids, 4);
edje_object_signal_emit(obj, "ecdb,disable,ecdb/erase/speed", "ecdb");
} }
void void
@ -108,20 +107,22 @@ ecdb_erase_page_show(void)
edje_object_signal_callback_add(swallow, "hide,finished", "erase_page", edje_object_signal_callback_add(swallow, "hide,finished", "erase_page",
ecdb_page_hide_finished, NULL); ecdb_page_hide_finished, NULL);
/* Set text and ready callback for clicked */ b = ecdb_button_add(swallow, "ecdb/erase/return");
edje_object_part_text_set(swallow, "ecdb/erase/return/text", ecdb_button_label_set(b, "Return to Main Page");
"Return to Main Page"); evas_object_smart_callback_add(b, "clicked", _button_cb_return, NULL);
edje_object_signal_callback_add(swallow, "ecdb/erase/return,clicked", evas_object_show(b);
"*", _button_cb_return, NULL); ecdb_button_icon_set(b, "ecdb/erase/return");
b = ecdb_button_add(swallow, "ecdb/erase/begin");
ecdb_button_label_set(b, "Start Erase");
evas_object_smart_callback_add(b, "clicked", _button_cb_begin, NULL);
evas_object_show(b);
ecdb_button_icon_set(b, "ecdb/erase/begin");
edje_object_part_text_set(swallow, "ecdb/erase/begin/text", b = ecdb_check_add(swallow, "ecdb/erase/speed");
"Start Erase"); ecdb_check_label_set(b, "Quick Erase");
edje_object_signal_callback_add(swallow, "ecdb/erase/begin,clicked", evas_object_show(b);
"*", _button_cb_begin, NULL);
edje_object_part_text_set(swallow, "ecdb/erase/speed/text",
"Quick Erase");
b = ecdb_combo_add(swallow, "ecdb/erase/drive"); b = ecdb_combo_add(swallow, "ecdb/erase/drive");
ecdb_combo_header_set(b, "Drive"); ecdb_combo_header_set(b, "Drive");
ecdb_combo_header_create_set(b, ecdb_gui_combo_header_from_drive); ecdb_combo_header_create_set(b, ecdb_gui_combo_header_from_drive);
@ -149,15 +150,17 @@ void
ecdb_erase_cleanup(void) ecdb_erase_cleanup(void)
{ {
Evas_Object *swallow; Evas_Object *swallow;
const char *ids[] = {"ecdb/erase/drive"}; const char *ids[] = {"ecdb/erase/return", "ecdb/erase/begin",
"ecdb/erase/speed", "ecdb/erase/drive"};
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee), swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"erase_page"); "erase_page");
edje_object_part_text_set(swallow, "progress_text", "Erase Complete!"); edje_object_part_text_set(swallow, "progress_text", "Erase Complete!");
ecdb_gui_controls_enable(ids, 1); ecdb_gui_controls_enable(ids, 4);
edje_object_signal_emit(swallow, "ecdb,erase,done", "ecdb"); edje_object_signal_emit(swallow, "ecdb,erase,done", "ecdb");
edje_object_signal_emit(swallow, "ecdb,enable,ecdb/erase/begin", "ecdb");
edje_object_signal_emit(swallow, "ecdb,enable,ecdb/erase/return", "ecdb"); swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
edje_object_signal_emit(swallow, "ecdb,enable,ecdb/erase/speed", "ecdb"); "ecdb/erase/drive");
ecdb_check_checked_set(swallow, 0);
} }

View File

@ -138,7 +138,8 @@ ecdb_button_icon_set(Evas_Object *b, const char *group)
printf("ecdb_button_icon_set: NULL icon!\n"); printf("ecdb_button_icon_set: NULL icon!\n");
return; return;
} }
edje_object_file_set(icon, em->theme_path, group); if (edje_object_file_set(icon, em->theme_path, group))
edje_object_signal_emit(b, "ecdb,button,icon,swallow", "ecdb");
evas_object_show(icon); evas_object_show(icon);
} }
@ -889,8 +890,7 @@ ecdb_combo_expand(Evas_Object *c)
min_size = edje_object_data_get(o, "ecdb/combo_item/minh"); min_size = edje_object_data_get(o, "ecdb/combo_item/minh");
if (min_size) if (min_size)
{ {
// FIXME Change this to config val h2 += (int)((float)atoi(min_size) * em->scalef);
h2 += (int)(atof(min_size) * edje_scale_get());
} }
else else
{ {