And burn_image too...

This commit is contained in:
Jaime Thomas 2009-01-25 01:17:06 +00:00
parent a16e03399f
commit 351d3126ff
3 changed files with 71 additions and 92 deletions

View File

@ -148,17 +148,18 @@ group {
description { description {
state: "default" 0.0; state: "default" 0.0;
max: 99999 20; max: 99999 20;
min: 50 20;
align: 0.0 1.0;
rel1 { rel1 {
to: "bg";
relative: 0.0 1.0; relative: 0.0 1.0;
offset: 10 -23; offset: 10 5;
} }
rel2 { rel2 {
to: "bg"; to: "bg";
relative: 1.0 1.0; relative: 1.0 1.0;
offset: -11 -10; offset: -11 -5;
} }
} }
} }

View File

@ -75,51 +75,9 @@ group {
} }
} }
part { BUTTON("ecdb/burn_image/return", "ecdb/burn_image/return/text", 100, 26, 150, 26, "bg", "bg", 0, 0, "bg", "bg", 1, 1, 0, 5, -5, 1, 1, 0)
name: "ecdb/burn_image/return";
type: SWALLOW;
repeat_events: 1;
scale: 1;
description { BUTTON("ecdb/burn_image/begin", "ecdb/burn_image/begin/text", 100, 26, 150, 26, "bg", "ecdb/burn_image/return", 0, 1, "bg", "ecdb/burn_image/return", 1, 1, 0, 5, -5, -1, 1, 0)
state: "default" 0.0;
rel1 {
to: "bg";
relative: 1.0 0.0;
offset: -200 5;
}
rel2 {
to: "bg";
relative: 1.0 0.0;
offset: -11 30;
}
}
}
part {
name: "ecdb/burn_image/begin";
type: SWALLOW;
repeat_events: 1;
scale: 1;
description {
state: "default" 0.0;
rel1 {
to: "ecdb/burn_image/return";
relative: 0.0 1.0;
offset: 0 5;
}
rel2 {
to: "ecdb/burn_image/return";
relative: 1.0 1.0;
offset: 0 30;
}
}
}
part { part {
name: "ecdb/burn_image/file"; name: "ecdb/burn_image/file";
@ -129,17 +87,21 @@ group {
description { description {
state: "default" 0.0; state: "default" 0.0;
align: 1.0 0.0;
max: 150 26;
min: 100 26;
rel1 { rel1 {
to: "ecdb/burn_image/begin"; to_y: "ecdb/burn_image/begin";
to_x: "bg";
relative: 0.0 1.0; relative: 0.0 1.0;
offset: 0 5; offset: 0 5;
} }
rel2 { rel2 {
to: "ecdb/burn_image/begin"; to: "bg";
relative: 1.0 1.0; relative: 1.0 1.0;
offset: 0 30; offset: -5 -1;
} }
} }
} }
@ -152,17 +114,21 @@ group {
description { description {
state: "default" 0.0; state: "default" 0.0;
align: 1.0 0.0;
max: 150 26;
min: 100 26;
rel1 { rel1 {
to: "ecdb/burn_image/file"; to_y: "ecdb/burn_image/file";
to_x: "bg";
relative: 0.0 1.0; relative: 0.0 1.0;
offset: 0 5; offset: 0 5;
} }
rel2 { rel2 {
to: "ecdb/burn_image/file"; to: "bg";
relative: 1.0 1.0; relative: 1.0 1.0;
offset: 0 30; offset: -5 -1;
} }
} }
} }
@ -175,17 +141,21 @@ group {
description { description {
state: "default" 0.0; state: "default" 0.0;
max: 150 26;
min: 100 26;
align: 1.0 0.0;
rel1 { rel1 {
to: "ecdb/burn_image/drive"; to_y: "ecdb/burn_image/drive";
to_x: "bg";
relative: 0.0 1.0; relative: 0.0 1.0;
offset: 0 5; offset: 0 5;
} }
rel2 { rel2 {
to: "ecdb/burn_image/drive"; to: "bg";
relative: 1.0 1.0; relative: 1.0 1.0;
offset: 0 30; offset: -5 -1;
} }
} }
} }
@ -206,9 +176,10 @@ group {
} }
rel2 { rel2 {
to: "bg"; to_x: "ecdb/burn_image/speed";
relative: 1.0 1.0; to_y: "bg";
offset: -205 -10; relative: 0.0 1.0;
offset: -5 -10;
} }
image { image {
@ -325,6 +296,8 @@ group {
} }
programs { programs {
BUTTON_PROGS("ecdb/burn_image/return")
BUTTON_PROGS("ecdb/burn_image/begin")
program { program {
name: "burn_image_page,visible1"; name: "burn_image_page,visible1";
signal: "ecdb,burn_image_page,visible"; signal: "ecdb,burn_image_page,visible";

View File

@ -1,24 +1,28 @@
/* 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, void *event_info); static void _button_cb_return(void *data, Evas_Object *obj,
static void _button_cb_begin(void *data, Evas_Object *obj, void *event_info); const char *emission,
const char *source);
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 static void
_button_cb_return(void *data, Evas_Object *obj, void *event_info) _button_cb_return(void *data __UNUSED__, Evas_Object *obj,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{ {
Evas_Object *swallow, *gui; Evas_Object *gui;
char *signal; char *signal;
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui"); gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"burn_image_page");
edje_object_part_text_set(swallow, "progress_text", "Begin Burn"); edje_object_part_text_set(obj, "progress_text", "Begin Burn");
edje_object_part_text_set(swallow, "progress_percent", "0%"); edje_object_part_text_set(obj, "progress_percent", "0%");
signal = evas_object_data_get(swallow, "hide_signal"); signal = evas_object_data_get(obj, "hide_signal");
edje_object_signal_emit(swallow, signal, "ecdb"); edje_object_signal_emit(obj, signal, "ecdb");
ecdb_welcome_page_show(); ecdb_welcome_page_show();
/* Hide the filelist to be nice */ /* Hide the filelist to be nice */
@ -26,9 +30,11 @@ _button_cb_return(void *data, Evas_Object *obj, void *event_info)
} }
static void static void
_button_cb_begin(void *data, Evas_Object *obj, void *event_info) _button_cb_begin(void *data __UNUSED__, Evas_Object *obj,
const char *emission __UNUSED__,
const char *source __UNUSED__)
{ {
Evas_Object *swallow, *gui, *o; Evas_Object *gui, *o;
Ecdb_Burn_Project *proj; Ecdb_Burn_Project *proj;
Ecdb_Source *iso_file; Ecdb_Source *iso_file;
char *file, buf[1024]; char *file, buf[1024];
@ -36,8 +42,6 @@ _button_cb_begin(void *data, Evas_Object *obj, void *event_info)
int drive, speed; int drive, speed;
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui"); gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"burn_image_page");
o = evas_object_name_find(ecore_evas_get(em->main_win_ee), o = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"ecdb/burn_image/file"); "ecdb/burn_image/file");
file = ecdb_entry_text_get(o); file = ecdb_entry_text_get(o);
@ -45,7 +49,7 @@ _button_cb_begin(void *data, Evas_Object *obj, void *event_info)
// Make sure that file actually exists // Make sure that file actually exists
if (!ecore_file_exists(file)) if (!ecore_file_exists(file))
{ {
edje_object_part_text_set(swallow, "progress_text", "File doesn't " edje_object_part_text_set(obj, "progress_text", "File doesn't "
"exists!"); "exists!");
FREE(file); FREE(file);
return; return;
@ -66,7 +70,7 @@ _button_cb_begin(void *data, Evas_Object *obj, void *event_info)
{ {
printf("Choose a drive!\n"); printf("Choose a drive!\n");
ecdb_burn_project_destroy(proj); ecdb_burn_project_destroy(proj);
edje_object_part_text_set(swallow, "progress_text", "Choose a Drive!"); edje_object_part_text_set(obj, "progress_text", "Choose a Drive!");
return; return;
} }
@ -80,12 +84,12 @@ _button_cb_begin(void *data, Evas_Object *obj, void *event_info)
proj->speed = speed; proj->speed = speed;
snprintf(buf, sizeof(buf), "Commencing..."); snprintf(buf, sizeof(buf), "Commencing...");
edje_object_part_text_set(swallow, "progress_text", buf); edje_object_part_text_set(obj, "progress_text", buf);
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive)) if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive))
{ {
printf("Couldn't grab drive!\n"); printf("Couldn't grab drive!\n");
ecdb_burn_project_destroy(proj); ecdb_burn_project_destroy(proj);
edje_object_part_text_set(swallow, "progress_text", edje_object_part_text_set(obj, "progress_text",
"Couldn't grab the drive!"); "Couldn't grab the drive!");
return; return;
} }
@ -95,11 +99,14 @@ _button_cb_begin(void *data, Evas_Object *obj, void *event_info)
{ {
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(swallow, "ecdb,burn_image,start", "ecdb"); edje_object_signal_emit(obj, "ecdb,burn_image,start", "ecdb");
const char *ids[] = {"ecdb/burn_image/return", "ecdb/burn_image/begin", const char *ids[] = {"ecdb/burn_image/file", "ecdb/burn_image/drive",
"ecdb/burn_image/file", "ecdb/burn_image/drive",
"ecdb/burn_image/speed"}; "ecdb/burn_image/speed"};
ecdb_gui_controls_disable(ids, 5); ecdb_gui_controls_disable(ids, 3);
edje_object_signal_emit(obj, "ecdb,disable,ecdb/burn_image/begin",
"ecdb");
edje_object_signal_emit(obj, "ecdb,disable,ecdb/burn_image/return",
"ecdb");
return; return;
case ECDB_ERROR_IMAGE_CREATE: case ECDB_ERROR_IMAGE_CREATE:
@ -118,7 +125,7 @@ _button_cb_begin(void *data, Evas_Object *obj, void *event_info)
snprintf(buf, sizeof(buf), "Unknown error :-("); snprintf(buf, sizeof(buf), "Unknown error :-(");
} }
edje_object_part_text_set(swallow, "progress_text", buf); edje_object_part_text_set(obj, "progress_text", buf);
Ecdb_Project *p = ECDB_PROJECT(proj); Ecdb_Project *p = ECDB_PROJECT(proj);
burn_drive_release(p->drive->tangible[0].drive, 1); burn_drive_release(p->drive->tangible[0].drive, 1);
burn_drive_info_free(p->drive->tangible); burn_drive_info_free(p->drive->tangible);
@ -202,17 +209,15 @@ ecdb_burn_image_page_show(void)
ecdb_page_hide_finished, NULL); ecdb_page_hide_finished, NULL);
evas_object_show(swallow); evas_object_show(swallow);
b = ecdb_button_add(swallow, "ecdb/burn_image/return"); edje_object_part_text_set(swallow, "ecdb/burn_image/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/burn_image/return,clicked",
evas_object_show(b); "*", _button_cb_return, NULL);
ecdb_button_icon_set(b, "ecdb/burn_image/return");
b = ecdb_button_add(swallow, "ecdb/burn_image/begin"); edje_object_part_text_set(swallow, "ecdb/burn_image/begin/text",
ecdb_button_label_set(b, "Start Burn"); "Start Burn");
evas_object_smart_callback_add(b, "clicked", _button_cb_begin, NULL); edje_object_signal_callback_add(swallow, "ecdb/burn_image/begin,clicked",
evas_object_show(b); "*", _button_cb_begin, NULL);
ecdb_button_icon_set(b, "ecdb/burn_image/begin");
b = ecdb_entry_add(swallow, "ecdb/burn_image/file"); b = ecdb_entry_add(swallow, "ecdb/burn_image/file");
ecdb_entry_text_set(b, "Burn File"); ecdb_entry_text_set(b, "Burn File");