Ok, some stuff I missed when updating.

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

View File

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

View File

@ -5,7 +5,7 @@ group {
data {
item: "ecdb/combo_item/minw" 50;
item: "ecdb/combo_item/minh" 30;
item: "ecdb/combo_item/minh" 26;
}
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: */
group {
name: "ecdb/welcome_page";
min: 640 170;
parts {
part {
name: "bg";
type: RECT;
scale: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
min: 640 170;
rel1 {
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 {
BUTTON_PROGS("ecdb/burn_data")
BUTTON_PROGS("ecdb/burn_audio")
BUTTON_PROGS("ecdb/burn_image")
BUTTON_PROGS("ecdb/erase")
program {
name: "welcome_page,hide";
signal: "ecdb,welcome_page,hide";

View File

@ -1,13 +1,9 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h"
static void _button_cb_return(void *data, Evas_Object *obj,
const char *emission, const char *source);
static void _button_cb_begin(void *data, Evas_Object *obj,
const char *emission, const char *source);
static void _button_cb_return(void *data, Evas_Object *obj, void *event_info);
static void _button_cb_begin(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);
// 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 _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 _settings_clicked(void *data, Evas_Object *obj, void *event_into);
// Update on showing to proper values
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
_button_cb_return(void *data, Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
_button_cb_return(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *gui;
Ecdb_Burn_Project *proj;
@ -91,9 +86,7 @@ _button_cb_return(void *data, Evas_Object *obj __UNUSED__,
}
static void
_button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
_button_cb_begin(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *gui;
Ecdb_Burn_Project *proj;
@ -144,14 +137,10 @@ _button_cb_begin(void *data, Evas_Object *obj __UNUSED__,
case ECDB_ERROR_NONE:
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
edje_object_signal_emit(proj->parent, "ecdb,burn_data,start", "ecdb");
const char *ids[] = {"ecdb/burn_data/drives", "ecdb/burn_data/speed"};
ecdb_gui_controls_disable(ids, 2);
edje_object_signal_emit(proj->parent,
"ecdb,disable,ecdb/burn_data/return", "ecdb");
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");
const char *ids[] = {"ecdb/burn_data/return", "ecdb/burn_data/begin",
"ecdb/burn_data/file", "ecdb/burn_data/drive",
"ecdb/burn_data/speed"};
ecdb_gui_controls_disable(ids, 5);
return;
case ECDB_ERROR_IMAGE_CREATE:
@ -404,9 +393,7 @@ _proj_config(void *data, Evas_Object *obj, void *event_info)
}
static void
_settings_clicked(void *data, Evas_Object *obj __UNUSED__,
const char *emission __UNUSED__,
const char *source __UNUSED__)
_settings_clicked(void *data, Evas_Object *obj, void *event_into)
{
Eina_Iterator *it;
const Evas_Object *table;
@ -465,17 +452,17 @@ ecdb_burn_data_page_show(void)
evas_object_show(swallow);
proj->parent = swallow;
// The return button
edje_object_part_text_set(swallow, "ecdb/burn_data/return/text",
"Return to Main Page");
edje_object_signal_callback_add(swallow, "ecdb/burn_data/return,clicked",
"*", _button_cb_return, proj);
b = ecdb_button_add(swallow, "ecdb/burn_data/return");
ecdb_button_label_set(b, "Return to Main Page");
evas_object_smart_callback_add(b, "clicked", _button_cb_return, proj);
evas_object_show(b);
ecdb_button_icon_set(b, "ecdb/burn_data/return");
// The start button
edje_object_part_text_set(swallow, "ecdb/burn_data/begin/text",
"Start Burn");
edje_object_signal_callback_add(swallow, "ecdb/burn_data/begin,clicked",
"*", _button_cb_begin, proj);
b = ecdb_button_add(swallow, "ecdb/burn_data/begin");
ecdb_button_label_set(b, "Start Burn");
evas_object_smart_callback_add(b, "clicked", _button_cb_begin, proj);
evas_object_show(b);
ecdb_button_icon_set(b, "ecdb/burn_data/begin");
proj->drive_combo = ecdb_combo_add(swallow, "ecdb/burn_data/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");
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");
evas_object_data_set(proj->capacity, "source", src);
ecore_event_handler_add(ECDB_FILELIST_SIZE_CHANGED, _update_capacity,
@ -605,11 +593,10 @@ ecdb_burn_data_page_show(void)
evas_object_show(b);
// At the end so t is a valid pointer
edje_object_part_text_set(swallow, "ecdb/burn_data/settings/text",
"Settings");
edje_object_signal_callback_add(swallow,
"ecdb/burn_data/settings,clicked",
"*", _settings_clicked, t);
b = ecdb_button_add(swallow, "ecdb/burn_data/settings");
ecdb_button_label_set(b, "Settings");
evas_object_smart_callback_add(b, "clicked", _settings_clicked, t);
evas_object_show(b);
}
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: */
#include "ecdb.h"
static void _button_cb_return(void *data, Evas_Object *o, const char *emission,
const char *source);
static void _button_cb_begin(void *data, Evas_Object *o, const char *emission,
const char *source);
static void _button_cb_return(void *data, Evas_Object *obj, void *event_info);
static void _button_cb_begin(void *data, Evas_Object *obj, void *event_info);
static void
_button_cb_return(void *data __UNUSED__, Evas_Object *o,
const char *emission __UNUSED__,
const char *source __UNUSED__)
_button_cb_return(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *swallow;
char *signal;
edje_object_part_text_set(o, "progress_text", "Begin Erase");
edje_object_part_text_set(o, "progress_percent", "0%");
signal = evas_object_data_get(o, "hide_signal");
edje_object_signal_emit(o, signal, "ecdb");
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"erase_page");
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();
}
static void
_button_cb_begin(void *data __UNUSED__, Evas_Object *obj,
const char *emission __UNUSED__,
const char *source __UNUSED__)
_button_cb_begin(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *o;
Evas_Object *swallow, *o;
Ecdb_Erase_Project *proj;
char buf[1024];
const char *state, *ids[] = {"ecdb/erase/drive"};
int drive;
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"erase_page");
proj = ecdb_erase_project_new();
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");
drive = ecdb_combo_selected_get(o);
@ -41,7 +41,7 @@ _button_cb_begin(void *data __UNUSED__, Evas_Object *obj,
{
printf("Choose a drive!\n");
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;
}
@ -49,31 +49,30 @@ _button_cb_begin(void *data __UNUSED__, Evas_Object *obj,
{
printf("Couldn't grab drive!\n");
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!");
return;
}
state = edje_object_part_state_get(obj, "ecdb/erase/speed", NULL);
proj->quick = !strcmp(state, "on");
o = evas_object_name_find(evas_object_evas_get(obj), "ecdb/erase/speed");
proj->quick = ecdb_check_checked_get(o);
if (!ecdb_erase_disc(proj))
{
Ecdb_Project *p = ECDB_PROJECT(proj);
printf("Disc not erasable!\n");
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_info_free(p->drive->tangible);
ecdb_erase_project_destroy(proj);
return;
}
ecdb_gui_controls_enable(ids, 1);
edje_object_signal_emit(obj, "ecdb,erase,start", "ecdb");
edje_object_signal_emit(obj, "ecdb,disable,ecdb/erase/begin", "ecdb");
edje_object_signal_emit(obj, "ecdb,disable,ecdb/erase/return", "ecdb");
edje_object_signal_emit(obj, "ecdb,disable,ecdb/erase/speed", "ecdb");
edje_object_signal_emit(swallow, "ecdb,erase,start", "ecdb");
const char *ids[] = {"ecdb/erase/return", "ecdb/erase/begin",
"ecdb/erase/speed", "ecdb/erase/drive"};
ecdb_gui_controls_disable(ids, 4);
}
void
@ -108,20 +107,22 @@ ecdb_erase_page_show(void)
edje_object_signal_callback_add(swallow, "hide,finished", "erase_page",
ecdb_page_hide_finished, NULL);
/* Set text and ready callback for clicked */
edje_object_part_text_set(swallow, "ecdb/erase/return/text",
"Return to Main Page");
edje_object_signal_callback_add(swallow, "ecdb/erase/return,clicked",
"*", _button_cb_return, NULL);
b = ecdb_button_add(swallow, "ecdb/erase/return");
ecdb_button_label_set(b, "Return to Main Page");
evas_object_smart_callback_add(b, "clicked", _button_cb_return, NULL);
evas_object_show(b);
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",
"Start Erase");
edje_object_signal_callback_add(swallow, "ecdb/erase/begin,clicked",
"*", _button_cb_begin, NULL);
b = ecdb_check_add(swallow, "ecdb/erase/speed");
ecdb_check_label_set(b, "Quick Erase");
evas_object_show(b);
edje_object_part_text_set(swallow, "ecdb/erase/speed/text",
"Quick Erase");
b = ecdb_combo_add(swallow, "ecdb/erase/drive");
ecdb_combo_header_set(b, "Drive");
ecdb_combo_header_create_set(b, ecdb_gui_combo_header_from_drive);
@ -149,15 +150,17 @@ void
ecdb_erase_cleanup(void)
{
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),
"erase_page");
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,enable,ecdb/erase/begin", "ecdb");
edje_object_signal_emit(swallow, "ecdb,enable,ecdb/erase/return", "ecdb");
edje_object_signal_emit(swallow, "ecdb,enable,ecdb/erase/speed", "ecdb");
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"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");
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);
}
@ -889,8 +890,7 @@ ecdb_combo_expand(Evas_Object *c)
min_size = edje_object_data_get(o, "ecdb/combo_item/minh");
if (min_size)
{
// FIXME Change this to config val
h2 += (int)(atof(min_size) * edje_scale_get());
h2 += (int)((float)atoi(min_size) * em->scalef);
}
else
{