2008-12-22 01:12:16 +00:00
|
|
|
/* vim: set sw=3 ts=3 sts=3 expandtab: */
|
|
|
|
#include "ecdb.h"
|
|
|
|
|
2009-01-30 03:59:48 +00:00
|
|
|
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);
|
2008-12-22 01:12:16 +00:00
|
|
|
static void _combo_cb_clicked(void *data, Evas_Object *obj, void *event_info);
|
2008-12-24 22:59:59 +00:00
|
|
|
static int _update_capacity(void *data, int type, void *ev_data);
|
|
|
|
|
2009-01-11 02:14:02 +00:00
|
|
|
// Config inwin updates
|
|
|
|
static void _joliet_clicked(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _rockridge_clicked(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _symlinks_clicked(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _hidden_clicked(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _multi_clicked(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
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);
|
2009-01-30 03:59:48 +00:00
|
|
|
static void _settings_clicked(void *data, Evas_Object *obj,
|
|
|
|
const char *emission,
|
|
|
|
const char *source);
|
2009-01-11 02:14:02 +00:00
|
|
|
|
|
|
|
// Update on showing to proper values
|
|
|
|
static void _joliet_config(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _rockridge_config(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _symlinks_config(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _hidden_config(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _multi_config(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _sim_config(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _underrun_config(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
static void _proj_config(void *data, Evas_Object *obj, void *event_info);
|
|
|
|
|
2008-12-24 22:59:59 +00:00
|
|
|
static int
|
|
|
|
_update_capacity(void *data, int type, void *ev_data)
|
|
|
|
{
|
|
|
|
Ecdb_Source *src;
|
2009-01-11 22:13:44 +00:00
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
Ecdb_Project *base_proj;
|
|
|
|
float val;
|
2008-12-24 22:59:59 +00:00
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
proj = data;
|
|
|
|
if (!proj)
|
2008-12-26 19:03:11 +00:00
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
base_proj = ECDB_PROJECT(proj);
|
|
|
|
src = evas_object_data_get(proj->capacity, "source");
|
|
|
|
if ((base_proj->drive) && (base_proj->drive->capacity > 0))
|
2008-12-25 06:23:20 +00:00
|
|
|
{
|
2009-01-11 22:13:44 +00:00
|
|
|
printf("drive capacity: %lld, src->size: %lld\n",
|
|
|
|
base_proj->drive->capacity, src->size);
|
|
|
|
val = (float)src->size / (float)base_proj->drive->capacity;
|
2008-12-25 06:23:20 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-12-26 19:03:11 +00:00
|
|
|
// Default to a nice, small size
|
2009-01-11 22:13:44 +00:00
|
|
|
val = (float)src->size / 1048576.0 / 700.0;
|
2008-12-26 19:03:11 +00:00
|
|
|
}
|
2009-01-11 22:13:44 +00:00
|
|
|
if (val > 1.0)
|
2008-12-26 19:03:11 +00:00
|
|
|
{
|
|
|
|
printf("OVER SIZE LIMIT!\n");
|
2009-01-11 22:13:44 +00:00
|
|
|
edje_object_signal_emit(proj->capacity, "ecdb,capacity,exceeded", "ecdb");
|
|
|
|
edje_object_signal_emit(proj->parent, "ecdb,capacity, exceeded", "ecdb");
|
2008-12-25 06:23:20 +00:00
|
|
|
}
|
2009-01-11 22:13:44 +00:00
|
|
|
ecdb_capacity_float_set(proj->capacity, val);
|
2008-12-24 22:59:59 +00:00
|
|
|
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
2008-12-22 01:12:16 +00:00
|
|
|
|
|
|
|
static void
|
2009-01-30 03:59:48 +00:00
|
|
|
_button_cb_return(void *data, Evas_Object *obj,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2008-12-22 01:12:16 +00:00
|
|
|
{
|
2008-12-26 19:03:11 +00:00
|
|
|
Evas_Object *gui;
|
2008-12-22 01:12:16 +00:00
|
|
|
char *signal;
|
|
|
|
|
2009-01-30 03:59:48 +00:00
|
|
|
gui = data;
|
2008-12-26 19:03:11 +00:00
|
|
|
|
2009-01-30 03:59:48 +00:00
|
|
|
signal = evas_object_data_get(obj, "hide_signal");
|
|
|
|
edje_object_signal_emit(obj, signal, "ecdb");
|
2008-12-22 01:12:16 +00:00
|
|
|
ecdb_welcome_page_show();
|
|
|
|
|
|
|
|
/* Hide the filelist to be nice */
|
|
|
|
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-01-30 03:59:48 +00:00
|
|
|
_button_cb_begin(void *data, Evas_Object *obj,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2008-12-22 01:12:16 +00:00
|
|
|
{
|
2008-12-26 19:03:11 +00:00
|
|
|
Evas_Object *gui;
|
2009-01-11 22:13:44 +00:00
|
|
|
Ecdb_Burn_Project *proj;
|
2008-12-23 22:42:15 +00:00
|
|
|
Ewl_Widget *filelist;
|
|
|
|
char buf[1024];
|
2008-12-22 01:12:16 +00:00
|
|
|
Ecdb_Burn_Result burn_result;
|
|
|
|
int drive, speed;
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
proj = data;
|
|
|
|
if (!proj)
|
2008-12-26 19:03:11 +00:00
|
|
|
return;
|
|
|
|
|
2008-12-22 01:12:16 +00:00
|
|
|
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
|
2008-12-23 22:42:15 +00:00
|
|
|
filelist = ewl_widget_name_find("ecdb/burn_data/filelist");
|
2009-01-11 22:13:44 +00:00
|
|
|
if (!ECDB_PROJECT(proj)->drive)
|
2008-12-22 01:12:16 +00:00
|
|
|
{
|
|
|
|
printf("Choose a drive!\n");
|
2009-01-11 22:13:44 +00:00
|
|
|
edje_object_part_text_set(proj->parent, "progress_text",
|
2008-12-26 19:03:11 +00:00
|
|
|
"Choose a Drive!");
|
2008-12-22 01:12:16 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
drive = ecdb_combo_selected_get(proj->drive_combo);
|
2008-12-22 01:12:16 +00:00
|
|
|
speed = ecdb_speed_convert(eina_list_nth(em->drives, drive),
|
2009-01-11 22:13:44 +00:00
|
|
|
ecdb_combo_selected_get(proj->speed_combo));
|
2008-12-22 01:12:16 +00:00
|
|
|
if (speed < 0)
|
2009-01-11 22:13:44 +00:00
|
|
|
proj->speed = 0;
|
2008-12-22 01:12:16 +00:00
|
|
|
else
|
2009-01-11 22:13:44 +00:00
|
|
|
proj->speed = speed;
|
2008-12-22 01:12:16 +00:00
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
proj->files = ewl_widget_data_get(filelist, "source");
|
|
|
|
while (proj->files->parent)
|
|
|
|
proj->files = proj->files->parent;
|
2008-12-23 22:42:15 +00:00
|
|
|
|
2008-12-22 01:12:16 +00:00
|
|
|
snprintf(buf, sizeof(buf), "Commencing...");
|
2009-01-30 03:59:48 +00:00
|
|
|
edje_object_part_text_set(obj, "progress_text", buf);
|
2009-01-11 22:13:44 +00:00
|
|
|
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive))
|
2008-12-22 01:12:16 +00:00
|
|
|
{
|
|
|
|
printf("Couldn't grab drive!\n");
|
2009-01-30 03:59:48 +00:00
|
|
|
edje_object_part_text_set(obj, "progress_text",
|
2008-12-22 01:12:16 +00:00
|
|
|
"Couldn't grab the drive!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
burn_result = ecdb_burn_project(proj);
|
2008-12-22 01:12:16 +00:00
|
|
|
switch (burn_result)
|
|
|
|
{
|
|
|
|
case ECDB_ERROR_NONE:
|
|
|
|
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
|
2009-01-30 03:59:48 +00:00
|
|
|
edje_object_signal_emit(obj, "ecdb,burn_data,start", "ecdb");
|
2009-01-27 04:00:34 +00:00
|
|
|
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);
|
2008-12-22 01:12:16 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
case ECDB_ERROR_IMAGE_CREATE:
|
|
|
|
snprintf(buf, sizeof(buf), "Invalid file!");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ECDB_ERROR_SOURCE_ATTACH:
|
|
|
|
snprintf(buf, sizeof(buf), "Couldn't attach source data!");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ECDB_ERROR_WRITE_MODE:
|
|
|
|
snprintf(buf, sizeof(buf), "No suitable burn mode!");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
snprintf(buf, sizeof(buf), "Unknown error :-(");
|
|
|
|
}
|
|
|
|
|
2009-01-30 03:59:48 +00:00
|
|
|
edje_object_part_text_set(obj, "progress_text", buf);
|
2009-01-11 22:13:44 +00:00
|
|
|
burn_drive_release(ECDB_PROJECT(proj)->drive->tangible[0].drive, 1);
|
|
|
|
burn_drive_info_free(ECDB_PROJECT(proj)->drive->tangible);
|
|
|
|
ecdb_burn_project_destroy(proj);
|
2009-01-30 03:59:48 +00:00
|
|
|
evas_object_data_set(obj, "proj", NULL);
|
2008-12-22 01:12:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_combo_cb_clicked(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
2008-12-26 19:03:11 +00:00
|
|
|
Evas_Object *b;
|
2009-01-11 22:13:44 +00:00
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
Ecdb_Project *base_proj;
|
2008-12-23 02:26:24 +00:00
|
|
|
int sel, i, num_speeds, speed;
|
2008-12-22 01:12:16 +00:00
|
|
|
char buf[1024];
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
proj = data;
|
|
|
|
if (!proj)
|
2008-12-26 19:03:11 +00:00
|
|
|
return;
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
base_proj = ECDB_PROJECT(proj);
|
|
|
|
sel = ecdb_combo_selected_get(proj->drive_combo);
|
2008-12-22 01:12:16 +00:00
|
|
|
if (sel < 0)
|
|
|
|
return;
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
base_proj->drive = eina_list_nth(em->drives, sel);
|
2008-12-26 19:03:11 +00:00
|
|
|
// Update the capacity here, as our capacity could change with the drive
|
|
|
|
ecore_event_add(ECDB_FILELIST_SIZE_CHANGED, NULL, NULL, NULL);
|
2009-01-11 22:13:44 +00:00
|
|
|
num_speeds = base_proj->drive->write_speeds[0];
|
|
|
|
ecdb_combo_data_set(proj->speed_combo, base_proj->drive);
|
2008-12-22 01:12:16 +00:00
|
|
|
for (i = 1; i < num_speeds; i++)
|
|
|
|
{
|
2009-01-11 22:13:44 +00:00
|
|
|
if (base_proj->drive->write_speeds[i] <= 0)
|
2008-12-22 01:12:16 +00:00
|
|
|
continue;
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
b = ecdb_combo_item_add(proj->speed_combo, NULL);
|
2008-12-23 02:26:24 +00:00
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
if ((base_proj->drive->profile_name) &&
|
|
|
|
(base_proj->drive->profile_name[0] != '\0'))
|
2008-12-23 02:26:24 +00:00
|
|
|
{
|
2009-01-11 22:13:44 +00:00
|
|
|
if (base_proj->drive->profile_name[0] == 'C')
|
|
|
|
speed = base_proj->drive->write_speeds[i] / 150;
|
|
|
|
else if (base_proj->drive->profile_name[0] == 'D')
|
|
|
|
speed = base_proj->drive->write_speeds[i] / 1352;
|
2008-12-23 02:26:24 +00:00
|
|
|
else
|
2009-01-11 22:13:44 +00:00
|
|
|
speed = base_proj->drive->write_speeds[i] / 4500;
|
2008-12-23 02:26:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
speed = 0;
|
|
|
|
}
|
|
|
|
|
2008-12-26 19:03:11 +00:00
|
|
|
snprintf(buf, sizeof(buf), "%dX (%dkb/s)", speed,
|
2009-01-11 22:13:44 +00:00
|
|
|
base_proj->drive->write_speeds[i]);
|
2008-12-24 18:59:22 +00:00
|
|
|
ecdb_combo_item_label_set(b, buf);
|
2009-01-11 22:13:44 +00:00
|
|
|
ecdb_combo_append(proj->speed_combo, b);
|
2008-12-22 01:12:16 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-11 02:14:02 +00:00
|
|
|
static void
|
|
|
|
_joliet_clicked(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
int state;
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
state = ecdb_check_checked_get(obj);
|
|
|
|
proj->use_joliet = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_joliet_config(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
ecdb_check_checked_set(obj, proj->use_joliet);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_rockridge_clicked(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
int state;
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
state = ecdb_check_checked_get(obj);
|
|
|
|
proj->use_rockridge = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_rockridge_config(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
ecdb_check_checked_set(obj, proj->use_rockridge);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_symlinks_clicked(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
int state;
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
state = ecdb_check_checked_get(obj);
|
|
|
|
proj->follow_symlinks = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_symlinks_config(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
ecdb_check_checked_set(obj, proj->follow_symlinks);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_hidden_clicked(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
int state;
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
state = ecdb_check_checked_get(obj);
|
|
|
|
proj->ignore_hidden = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_hidden_config(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
ecdb_check_checked_set(obj, proj->ignore_hidden);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_multi_clicked(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
int state;
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
state = ecdb_check_checked_get(obj);
|
|
|
|
proj->multi = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_multi_config(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
ecdb_check_checked_set(obj, proj->multi);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_sim_clicked(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
int state;
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
state = ecdb_check_checked_get(obj);
|
|
|
|
proj->simulate = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_sim_config(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
ecdb_check_checked_set(obj, proj->simulate);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_underrun_clicked(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
int state;
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
state = ecdb_check_checked_get(obj);
|
|
|
|
proj->underrun_proof = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_underrun_config(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
ecdb_check_checked_set(obj, proj->underrun_proof);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_apply_clicked(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
ecdb_config_inwin_hide(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_proj_name(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
name = ecdb_entry_text_get(obj);
|
2009-01-11 02:43:33 +00:00
|
|
|
if (proj->volume_id)
|
|
|
|
free(proj->volume_id);
|
|
|
|
|
2009-01-11 02:14:02 +00:00
|
|
|
proj->volume_id = strdup(name);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_proj_config(void *data, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Ecdb_Burn_Project *proj;
|
|
|
|
|
|
|
|
proj = data;
|
|
|
|
|
|
|
|
if (proj->volume_id)
|
|
|
|
ecdb_entry_text_set(obj, proj->volume_id);
|
|
|
|
else
|
|
|
|
ecdb_entry_text_set(obj, "Project Name");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2009-01-30 03:59:48 +00:00
|
|
|
_settings_clicked(void *data, Evas_Object *obj __UNUSED__,
|
|
|
|
const char *emission __UNUSED__,
|
|
|
|
const char *source __UNUSED__)
|
2009-01-11 02:14:02 +00:00
|
|
|
{
|
|
|
|
Eina_Iterator *it;
|
|
|
|
const Evas_Object *table;
|
|
|
|
Evas_Object *o;
|
|
|
|
|
|
|
|
table = edje_object_part_object_get(data, "ecdb.table");
|
|
|
|
it = evas_object_table_iterator_new(table);
|
|
|
|
|
|
|
|
if (!it)
|
|
|
|
{
|
|
|
|
printf("_settings_clicked: NULL iterator!\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (eina_iterator_next(it, (void **)&o))
|
|
|
|
evas_object_smart_callback_call(o, "proj_config", NULL);
|
|
|
|
eina_iterator_free(it);
|
|
|
|
|
|
|
|
ecdb_config_inwin_show(data);
|
|
|
|
}
|
|
|
|
|
2008-12-22 01:12:16 +00:00
|
|
|
void
|
|
|
|
ecdb_burn_data_page_show(void)
|
|
|
|
{
|
|
|
|
Evas_Object *swallow, *gui;
|
2009-01-11 22:13:44 +00:00
|
|
|
Ecdb_Burn_Project *proj;
|
2008-12-22 01:12:16 +00:00
|
|
|
|
|
|
|
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_data_page");
|
|
|
|
|
|
|
|
if (!swallow)
|
|
|
|
{
|
2009-01-11 22:13:44 +00:00
|
|
|
Evas_Object *b, *t;
|
2008-12-22 01:12:16 +00:00
|
|
|
Eina_List *l;
|
|
|
|
Ecdb_Drive_Info *drive;
|
|
|
|
Evas_Coord x, y, w, h;
|
|
|
|
Ewl_Widget *embed, *filelist;
|
|
|
|
Ecdb_Source *src;
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
proj = ecdb_burn_project_new();
|
2008-12-26 19:03:11 +00:00
|
|
|
|
2008-12-22 01:12:16 +00:00
|
|
|
swallow = edje_object_add(ecore_evas_get(em->main_win_ee));
|
|
|
|
edje_object_file_set(swallow, em->theme_path, "ecdb/burn_data_page");
|
|
|
|
evas_object_name_set(swallow, "burn_data_page");
|
|
|
|
evas_object_data_set(swallow, "hide_signal", "ecdb,burn_data_page,hide");
|
|
|
|
edje_object_part_geometry_get(gui, "active_area", &x, &y, &w, &h);
|
|
|
|
evas_object_move(swallow, x, y);
|
|
|
|
evas_object_resize(swallow, w, h);
|
|
|
|
edje_object_part_swallow(gui, "action_area", swallow);
|
|
|
|
|
|
|
|
edje_object_signal_callback_add(swallow, "hide,finished",
|
|
|
|
"burn_data_page",
|
|
|
|
ecdb_page_hide_finished, NULL);
|
2009-01-11 22:13:44 +00:00
|
|
|
evas_object_data_set(swallow, "proj", proj);
|
2008-12-22 01:12:16 +00:00
|
|
|
evas_object_show(swallow);
|
2009-01-11 22:13:44 +00:00
|
|
|
proj->parent = swallow;
|
2008-12-22 01:12:16 +00:00
|
|
|
|
2009-01-27 04:00:34 +00:00
|
|
|
b = ecdb_button_add(swallow, "ecdb/burn_data/return");
|
|
|
|
ecdb_button_label_set(b, "Return to Main Page");
|
2009-01-30 03:59:48 +00:00
|
|
|
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
|
|
|
|
"ecdb/burn_data/return", _button_cb_return, gui);
|
2009-01-27 04:00:34 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
ecdb_button_icon_set(b, "ecdb/burn_data/return");
|
2008-12-22 01:12:16 +00:00
|
|
|
|
2009-01-27 04:00:34 +00:00
|
|
|
b = ecdb_button_add(swallow, "ecdb/burn_data/begin");
|
|
|
|
ecdb_button_label_set(b, "Start Burn");
|
2009-01-30 03:59:48 +00:00
|
|
|
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
|
|
|
|
"ecdb/burn_data/begin", _button_cb_begin, proj);
|
2009-01-27 04:00:34 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
ecdb_button_icon_set(b, "ecdb/burn_data/begin");
|
2008-12-22 01:12:16 +00:00
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
proj->drive_combo = ecdb_combo_add(swallow, "ecdb/burn_data/drive");
|
|
|
|
ecdb_combo_header_set(proj->drive_combo, "Drive");
|
|
|
|
ecdb_combo_header_create_set(proj->drive_combo,
|
|
|
|
ecdb_gui_combo_header_from_drive);
|
|
|
|
evas_object_show(proj->drive_combo);
|
2008-12-22 01:12:16 +00:00
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
proj->speed_combo = ecdb_combo_add(swallow, "ecdb/burn_data/speed");
|
|
|
|
ecdb_combo_header_create_set(proj->speed_combo,
|
|
|
|
ecdb_gui_combo_header_from_speeds);
|
|
|
|
ecdb_combo_header_set(proj->speed_combo, "Max Speed");
|
|
|
|
evas_object_show(proj->speed_combo);
|
2008-12-22 01:12:16 +00:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(em->drives, l, drive)
|
|
|
|
{
|
2009-01-11 22:13:44 +00:00
|
|
|
b = ecdb_combo_item_add(proj->drive_combo, NULL);
|
2008-12-24 18:59:22 +00:00
|
|
|
ecdb_combo_item_label_set(b, drive->product);
|
2009-01-11 22:13:44 +00:00
|
|
|
evas_object_smart_callback_add(b, "clicked", _combo_cb_clicked, proj);
|
|
|
|
ecdb_combo_append(proj->drive_combo, b);
|
2008-12-22 01:12:16 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
}
|
|
|
|
|
|
|
|
embed = ewl_embed_new();
|
|
|
|
ewl_object_fill_policy_set(EWL_OBJECT(embed), EWL_FLAG_FILL_ALL);
|
2009-01-11 22:13:44 +00:00
|
|
|
b = ewl_embed_canvas_set(EWL_EMBED(embed),
|
|
|
|
evas_object_evas_get(proj->drive_combo),
|
2008-12-22 01:12:16 +00:00
|
|
|
(void *)(long)ecore_evas_software_x11_window_get(em->main_win_ee));
|
|
|
|
ewl_embed_focus_set(EWL_EMBED(embed), TRUE);
|
|
|
|
ewl_widget_show(embed);
|
|
|
|
|
|
|
|
filelist = ecdb_custom_filelist_new();
|
|
|
|
ewl_widget_name_set(EWL_WIDGET(filelist), "ecdb/burn_data/filelist");
|
|
|
|
ewl_container_child_append(EWL_CONTAINER(embed), filelist);
|
|
|
|
ewl_widget_show(filelist);
|
|
|
|
|
|
|
|
src = ecdb_source_new();
|
|
|
|
ewl_widget_data_set(filelist, "source", src);
|
|
|
|
|
|
|
|
edje_object_part_geometry_get(swallow, "ecdb/burn_data/filelist", &x, &y,
|
|
|
|
&w, &h);
|
|
|
|
evas_object_name_set(b, "ecdb/burn_data/filelist_swallow");
|
|
|
|
evas_object_move(b, x, y);
|
|
|
|
evas_object_resize(b, w, h);
|
|
|
|
edje_object_part_swallow(swallow, "ecdb/burn_data/filelist", b);
|
2008-12-24 00:44:54 +00:00
|
|
|
|
|
|
|
b = edje_object_part_swallow_get(swallow, "ecdb/burn_data/filelist");
|
|
|
|
ecdb_widget_focus_callback_add(b, "ecdb/burn_data/filelist");
|
2008-12-24 22:59:59 +00:00
|
|
|
|
2009-01-27 04:00:34 +00:00
|
|
|
// FIXME Turn this into a normal widget
|
2009-01-11 22:13:44 +00:00
|
|
|
proj->capacity = ecdb_capacity_add(swallow, "ecdb/burn_data/capacity");
|
|
|
|
evas_object_data_set(proj->capacity, "source", src);
|
2008-12-26 19:03:11 +00:00
|
|
|
ecore_event_handler_add(ECDB_FILELIST_SIZE_CHANGED, _update_capacity,
|
2009-01-11 22:13:44 +00:00
|
|
|
proj);
|
|
|
|
evas_object_show(proj->capacity);
|
2009-01-11 02:14:02 +00:00
|
|
|
|
|
|
|
t = ecdb_config_inwin_add(swallow, NULL);
|
|
|
|
|
|
|
|
b = ecdb_check_add(t, NULL);
|
|
|
|
ecdb_check_label_set(b, "Use Joliet");
|
2009-01-11 22:13:44 +00:00
|
|
|
evas_object_smart_callback_add(b, "clicked", _joliet_clicked, proj);
|
|
|
|
evas_object_smart_callback_add(b, "proj_config", _joliet_config, proj);
|
2009-01-11 02:14:02 +00:00
|
|
|
ecdb_config_inwin_child_add(t, b, 0, 0, 1, 1);
|
2009-01-11 02:43:33 +00:00
|
|
|
evas_object_name_set(b, "ecdb/burn_data/joliet");
|
2009-01-11 02:14:02 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
|
|
|
|
b = ecdb_check_add(t, NULL);
|
|
|
|
ecdb_check_label_set(b, "Use Rockridge");
|
2009-01-11 22:13:44 +00:00
|
|
|
evas_object_smart_callback_add(b, "clicked", _rockridge_clicked, proj);
|
|
|
|
evas_object_smart_callback_add(b, "proj_config", _rockridge_config, proj);
|
2009-01-11 02:14:02 +00:00
|
|
|
ecdb_config_inwin_child_add(t, b, 0, 1, 1, 1);
|
2009-01-11 02:43:33 +00:00
|
|
|
evas_object_name_set(b, "ecdb/burn_data/rockridge");
|
2009-01-11 02:14:02 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
|
|
|
|
b = ecdb_check_add(t, NULL);
|
|
|
|
ecdb_check_label_set(b, "Follow Symlinks");
|
2009-01-11 22:13:44 +00:00
|
|
|
evas_object_smart_callback_add(b, "clicked", _symlinks_clicked, proj);
|
|
|
|
evas_object_smart_callback_add(b, "proj_config", _symlinks_config, proj);
|
2009-01-11 02:14:02 +00:00
|
|
|
ecdb_config_inwin_child_add(t, b, 0, 2, 1, 1);
|
2009-01-11 02:43:33 +00:00
|
|
|
evas_object_name_set(b, "ecdb/burn_data/symlinks");
|
2009-01-11 02:14:02 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
|
|
|
|
b = ecdb_check_add(t, NULL);
|
|
|
|
ecdb_check_label_set(b, "Ignore Hidden Files");
|
2009-01-11 22:13:44 +00:00
|
|
|
evas_object_smart_callback_add(b, "clicked", _hidden_clicked, proj);
|
|
|
|
evas_object_smart_callback_add(b, "proj_config", _hidden_config, proj);
|
2009-01-11 02:14:02 +00:00
|
|
|
ecdb_config_inwin_child_add(t, b, 0, 3, 1, 1);
|
2009-01-11 02:43:33 +00:00
|
|
|
evas_object_name_set(b, "ecdb/burn_data/hidden");
|
2009-01-11 02:14:02 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
|
|
|
|
b = ecdb_check_add(t, NULL);
|
|
|
|
ecdb_check_label_set(b, "Multi-session");
|
2009-01-11 22:13:44 +00:00
|
|
|
evas_object_smart_callback_add(b, "clicked", _multi_clicked, proj);
|
|
|
|
evas_object_smart_callback_add(b, "proj_config", _multi_config, proj);
|
2009-01-11 02:14:02 +00:00
|
|
|
ecdb_config_inwin_child_add(t, b, 1, 0, 1, 1);
|
2009-01-11 02:43:33 +00:00
|
|
|
evas_object_name_set(b, "ecdb/burn_data/multi");
|
2009-01-11 02:14:02 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
|
|
|
|
b = ecdb_check_add(t, NULL);
|
|
|
|
ecdb_check_label_set(b, "Simulate");
|
2009-01-11 22:13:44 +00:00
|
|
|
evas_object_smart_callback_add(b, "clicked", _sim_clicked, proj);
|
|
|
|
evas_object_smart_callback_add(b, "proj_config", _sim_config, proj);
|
2009-01-11 02:14:02 +00:00
|
|
|
ecdb_config_inwin_child_add(t, b, 1, 1, 1, 1);
|
2009-01-11 02:43:33 +00:00
|
|
|
evas_object_name_set(b, "ecdb/burn_data/sim");
|
2009-01-11 02:14:02 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
|
|
|
|
b = ecdb_check_add(t, NULL);
|
|
|
|
ecdb_check_label_set(b, "Use Underrun Proof");
|
2009-01-11 22:13:44 +00:00
|
|
|
evas_object_smart_callback_add(b, "clicked", _underrun_clicked, proj);
|
|
|
|
evas_object_smart_callback_add(b, "proj_config", _underrun_config, proj);
|
2009-01-11 02:14:02 +00:00
|
|
|
ecdb_config_inwin_child_add(t, b, 1, 2, 1, 1);
|
2009-01-11 02:43:33 +00:00
|
|
|
evas_object_name_set(b, "ecdb/burn_data/underrun");
|
2009-01-11 02:14:02 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
|
|
|
|
b = ecdb_entry_add(t, NULL);
|
|
|
|
ecdb_entry_text_set(b, "Volume Name");
|
|
|
|
evas_object_event_callback_add(b, EVAS_CALLBACK_FOCUS_OUT,
|
2009-01-11 22:13:44 +00:00
|
|
|
_proj_name, proj);
|
|
|
|
evas_object_smart_callback_add(b, "proj_config", _proj_config, proj);
|
2009-01-11 02:14:02 +00:00
|
|
|
ecdb_config_inwin_child_add(t, b, 1, 3, 1, 1);
|
2009-01-11 02:43:33 +00:00
|
|
|
evas_object_name_set(b, "ecdb/burn_data/name");
|
2009-01-11 02:14:02 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
|
|
|
|
b = ecdb_button_add(t, NULL);
|
|
|
|
ecdb_button_label_set(b, "Apply");
|
|
|
|
evas_object_smart_callback_add(b, "clicked", _apply_clicked, t);
|
|
|
|
ecdb_config_inwin_child_add(t, b, 0, 4, 2, 1);
|
2009-01-11 02:43:33 +00:00
|
|
|
evas_object_name_set(b, "ecdb/burn_data/apply");
|
2009-01-11 02:14:02 +00:00
|
|
|
evas_object_show(b);
|
|
|
|
|
|
|
|
// At the end so t is a valid pointer
|
2009-01-27 04:00:34 +00:00
|
|
|
b = ecdb_button_add(swallow, "ecdb/burn_data/settings");
|
|
|
|
ecdb_button_label_set(b, "Settings");
|
2009-01-30 03:59:48 +00:00
|
|
|
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
|
|
|
|
"ecdb/burn_data/settings", _settings_clicked, t);
|
2009-01-27 04:00:34 +00:00
|
|
|
evas_object_show(b);
|
2008-12-22 01:12:16 +00:00
|
|
|
}
|
|
|
|
else if (edje_object_part_swallow_get(gui, "action_area") != swallow)
|
|
|
|
{
|
|
|
|
edje_object_part_swallow(gui, "action_area", swallow);
|
|
|
|
evas_object_show(swallow);
|
|
|
|
}
|
|
|
|
|
2009-01-11 22:13:44 +00:00
|
|
|
proj = evas_object_data_get(swallow, "proj");
|
|
|
|
if (!proj)
|
2008-12-26 19:03:11 +00:00
|
|
|
{
|
2009-01-11 22:13:44 +00:00
|
|
|
proj = ecdb_burn_project_new();
|
|
|
|
evas_object_data_set(swallow, "proj", proj);
|
2008-12-26 19:03:11 +00:00
|
|
|
}
|
|
|
|
|
2008-12-22 01:12:16 +00:00
|
|
|
edje_object_signal_emit(gui, "ecdb,burn_data_page,visible", "ecdb");
|
|
|
|
edje_object_signal_emit(swallow, "ecdb,burn_data_page,visible", "ecdb");
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-01-11 22:13:44 +00:00
|
|
|
ecdb_burn_data_cleanup(Ecdb_Burn_Project *proj)
|
2008-12-22 01:12:16 +00:00
|
|
|
{
|
2008-12-24 19:45:56 +00:00
|
|
|
Ewl_Widget *filelist;
|
|
|
|
Ecdb_Source *src;
|
|
|
|
int i;
|
2008-12-22 01:12:16 +00:00
|
|
|
const char *ids[] = {"ecdb/burn_data/return", "ecdb/burn_data/begin",
|
|
|
|
"ecdb/burn_data/file", "ecdb/burn_data/drive"
|
|
|
|
"ecdb/burn_data/speed"};
|
2009-01-11 22:13:44 +00:00
|
|
|
|
|
|
|
if (!proj)
|
|
|
|
{
|
|
|
|
printf("ecdb_burn_data_cleanup: NULL project!\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
edje_object_part_text_set(proj->parent, "progress_text", "Burn Complete!");
|
2008-12-23 22:42:15 +00:00
|
|
|
ecdb_gui_controls_enable(ids, 5);
|
2009-01-11 22:13:44 +00:00
|
|
|
edje_object_signal_emit(proj->parent, "ecdb,burn_data,done", "ecdb");
|
2008-12-24 19:45:56 +00:00
|
|
|
|
|
|
|
filelist = ewl_widget_name_find("ecdb/burn_data/filelist");
|
|
|
|
src = ewl_widget_data_get(filelist, "source");
|
|
|
|
while (src->parent)
|
|
|
|
src = src->parent;
|
|
|
|
|
|
|
|
for (i = 0; i < src->num_children; i++)
|
|
|
|
{
|
|
|
|
ecdb_source_child_remove(src, src->children[i]);
|
|
|
|
ecdb_source_destroy(src->children[i]);
|
|
|
|
}
|
2009-01-11 22:13:44 +00:00
|
|
|
|
|
|
|
evas_object_data_set(proj->parent, "proj", NULL);
|
2008-12-22 01:12:16 +00:00
|
|
|
}
|
|
|
|
|