Formatting changes.
This commit is contained in:
parent
48f67e3844
commit
7207b1b406
@ -164,19 +164,19 @@ ecdb_setup(void)
|
||||
em->dnd_candidates = ecore_list_new();
|
||||
|
||||
if (!ecore_file_mkdir("/tmp/ecdb"))
|
||||
{
|
||||
printf("Creation of temporary directory failed!\n");
|
||||
}
|
||||
|
||||
ECDB_DRIVE_ACTION_FINISHED = ecore_event_type_new();
|
||||
ECDB_DRIVE_ACTION_BEGUN = ecore_event_type_new();
|
||||
ECDB_DRIVE_ACTION_UPDATE = ecore_event_type_new();
|
||||
|
||||
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, ecdb_shutdown,
|
||||
NULL);
|
||||
ecore_event_handler_add(ECORE_X_EVENT_XDND_POSITION, ecdb_dnd_position,
|
||||
em);
|
||||
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, ecdb_shutdown, NULL);
|
||||
ecore_event_handler_add(ECORE_X_EVENT_XDND_POSITION, ecdb_dnd_position, em);
|
||||
ecore_event_handler_add(ECORE_X_EVENT_XDND_DROP, ecdb_dnd_drop, em);
|
||||
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,
|
||||
ecdb_dnd_selection, em);
|
||||
ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY, ecdb_dnd_selection,
|
||||
em);
|
||||
|
||||
if (!ecdb_aquire_drive_info())
|
||||
{
|
||||
|
@ -10,7 +10,9 @@ ecdb_audio_project_new(void)
|
||||
|
||||
proj = calloc(1, sizeof(Ecdb_Audio_Project));
|
||||
if (!proj)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (!ecdb_audio_project_init(proj))
|
||||
{
|
||||
FREE(proj);
|
||||
@ -24,7 +26,9 @@ int
|
||||
ecdb_audio_project_init(Ecdb_Audio_Project *proj)
|
||||
{
|
||||
if (!ecdb_project_init(ECDB_PROJECT(proj)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ecdb_project_type_set(ECDB_PROJECT(proj), ECDB_AUDIO_PROJECT);
|
||||
proj->tracks = ecdb_source_new();
|
||||
@ -81,10 +85,10 @@ transcode_data_cb(void *data, int type, void *event)
|
||||
printf("Transcode complete\n");
|
||||
proj->num_transcode_complete++;
|
||||
}
|
||||
|
||||
/* How to handle errors? */
|
||||
else
|
||||
printf("Error!\n");
|
||||
{
|
||||
printf("Error!\n"); // How to handle these?
|
||||
}
|
||||
|
||||
if (proj->num_tracks == proj->num_transcode_complete)
|
||||
{
|
||||
|
@ -119,8 +119,7 @@ ecdb_burn_project(Ecdb_Burn_Project *proj)
|
||||
|
||||
if (burn_track_set_source(track, source) != BURN_SOURCE_OK)
|
||||
{
|
||||
printf("Error: Cannot attach source object to track "
|
||||
"object!\n");
|
||||
printf("Error: Cannot attach source object to track object!\n");
|
||||
burn_session_free(data->session);
|
||||
burn_disc_free(data->disc);
|
||||
ecore_list_destroy(data->sources);
|
||||
@ -133,12 +132,13 @@ ecdb_burn_project(Ecdb_Burn_Project *proj)
|
||||
ecore_list_append(data->sources, source);
|
||||
ecore_list_append(data->tracks, track);
|
||||
|
||||
opts = burn_write_opts_new(ECDB_PROJECT(proj)->drive->
|
||||
tangible[0].drive);
|
||||
opts = burn_write_opts_new(ECDB_PROJECT(proj)->drive->tangible[0].drive);
|
||||
burn_write_opts_set_perform_opc(opts, proj->opc);
|
||||
burn_write_opts_set_multi(opts, proj->multi);
|
||||
if (proj->simulate)
|
||||
{
|
||||
printf("Simulating Burn!\n");
|
||||
}
|
||||
burn_write_opts_set_simulate(opts, proj->simulate);
|
||||
burn_drive_set_speed(ECDB_PROJECT(proj)->drive->tangible->drive, 0,
|
||||
proj->speed);
|
||||
@ -148,8 +148,7 @@ ecdb_burn_project(Ecdb_Burn_Project *proj)
|
||||
if (burn_write_opts_auto_write_type(opts, data->disc, reasons, 0)
|
||||
== BURN_WRITE_NONE)
|
||||
{
|
||||
printf("Error: Failed to find a suitable write mode for "
|
||||
"disc!\n");
|
||||
printf("Error: Failed to find a suitable write mode for disc!\n");
|
||||
burn_session_free(data->session);
|
||||
burn_disc_free(data->disc);
|
||||
burn_write_opts_free(opts);
|
||||
@ -163,14 +162,11 @@ ecdb_burn_project(Ecdb_Burn_Project *proj)
|
||||
burn_write_opts_free(opts);
|
||||
|
||||
printf("Disc now burning\n");
|
||||
ECDB_PROJECT(proj)->pipe = ecore_pipe_add(ecdb_burn_progress_handler,
|
||||
NULL);
|
||||
pthread_create(&progress_update, NULL, ecdb_drive_progress_update,
|
||||
proj);
|
||||
ECDB_PROJECT(proj)->pipe = ecore_pipe_add(ecdb_burn_progress_handler, NULL);
|
||||
pthread_create(&progress_update, NULL, ecdb_drive_progress_update, proj);
|
||||
pthread_detach(progress_update);
|
||||
ECDB_PROJECT(proj)->ev_handler = ecore_event_handler_add
|
||||
(ECDB_DRIVE_ACTION_FINISHED, ecdb_burn_finished,
|
||||
data);
|
||||
(ECDB_DRIVE_ACTION_FINISHED, ecdb_burn_finished, data);
|
||||
|
||||
return ECDB_ERROR_NONE;
|
||||
}
|
||||
@ -189,19 +185,22 @@ ecdb_drive_progress_update(void *data)
|
||||
{
|
||||
printf("No tangible drive!\n");
|
||||
ecore_pipe_del(proj->pipe);
|
||||
/* Call failure here */
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
drive = proj->drive->tangible[0].drive;
|
||||
|
||||
printf("Progress update active\n");
|
||||
while (burn_drive_get_status(drive, NULL) == BURN_DRIVE_SPAWNING)
|
||||
{
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE)
|
||||
{
|
||||
if (p.sectors > 0)
|
||||
{
|
||||
ecore_pipe_write(proj->pipe, &p, sizeof(p));
|
||||
}
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
@ -236,9 +235,13 @@ ecdb_burn_progress_handler(void *data, void *buffer, unsigned int nbyte)
|
||||
* percentage/sector to set
|
||||
*/
|
||||
if (last_sector <= p->sector)
|
||||
{
|
||||
last_sector = p->sector;
|
||||
}
|
||||
else
|
||||
{
|
||||
last_sector = p->sectors;
|
||||
}
|
||||
|
||||
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
|
||||
"burn_image_page");
|
||||
@ -276,6 +279,7 @@ ecdb_burn_finished(void *data, int type, void *event)
|
||||
case ECDB_AUDIO_PROJECT:
|
||||
ecdb_audio_project_destroy(ECDB_AUDIO(proj->proj));
|
||||
break;
|
||||
|
||||
default:
|
||||
ecdb_burn_project_destroy(ECDB_BURN(proj->proj));
|
||||
}
|
||||
|
@ -12,13 +12,17 @@ ecdb_aquire_drive_info(void)
|
||||
|
||||
ret = 0;
|
||||
if (em->drives)
|
||||
{
|
||||
ecore_list_destroy(em->drives);
|
||||
}
|
||||
|
||||
em->drives = ecore_list_new();
|
||||
ecore_list_free_cb_set(em->drives, ecdb_drive_info_free_cb);
|
||||
|
||||
while (!ret)
|
||||
{
|
||||
ret = burn_drive_scan(&drives_current, &drive_num);
|
||||
}
|
||||
|
||||
for (i = 0; i < drive_num; i++)
|
||||
{
|
||||
@ -27,7 +31,9 @@ ecdb_aquire_drive_info(void)
|
||||
drive = calloc(1, sizeof(Ecdb_Drive_Info));
|
||||
|
||||
if (!drive)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* It would be nice if there was an easier way to do this */
|
||||
drive->product = strdup(drives_current[i].product);
|
||||
@ -129,12 +135,16 @@ ecdb_print_drive_info(void)
|
||||
for (i = 1; i < j; i ++)
|
||||
{
|
||||
if ((h = drive->write_speeds[i]))
|
||||
{
|
||||
printf("Write: %d\n", h);
|
||||
}
|
||||
if ((h = drive->read_speeds[i]))
|
||||
{
|
||||
printf("Read: %d\n", h);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
ecdb_aquire_drive(Ecdb_Project *proj, unsigned int idx)
|
||||
|
@ -12,7 +12,10 @@ ecdb_erase_project_new(void)
|
||||
|
||||
proj = calloc(1, sizeof(Ecdb_Erase_Project));
|
||||
if (!proj)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!ecdb_erase_project_init(proj))
|
||||
{
|
||||
FREE(proj);
|
||||
@ -26,7 +29,9 @@ int
|
||||
ecdb_erase_project_init(Ecdb_Erase_Project *proj)
|
||||
{
|
||||
if (!ecdb_project_init(ECDB_PROJECT(proj)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Proper defaults */
|
||||
ecdb_project_type_set(ECDB_PROJECT(proj), ECDB_ERASE_PROJECT);
|
||||
@ -71,17 +76,14 @@ ecdb_erase_disc(Ecdb_Erase_Project *proj)
|
||||
else if (disc_state == BURN_DISC_FULL || BURN_DISC_APPENDABLE)
|
||||
{
|
||||
printf("Beginning to erase disc!\n");
|
||||
ECDB_PROJECT(proj)->pipe = ecore_pipe_add
|
||||
(ecdb_erase_progress_handler,
|
||||
ECDB_PROJECT(proj)->pipe = ecore_pipe_add(ecdb_erase_progress_handler,
|
||||
NULL);
|
||||
burn_disc_erase(ECDB_PROJECT(proj)->drive->
|
||||
tangible[0].drive, proj->quick);
|
||||
pthread_create(&progress_update, NULL,
|
||||
ecdb_drive_progress_update, proj);
|
||||
burn_disc_erase(ECDB_PROJECT(proj)->drive->tangible[0].drive,
|
||||
proj->quick);
|
||||
pthread_create(&progress_update, NULL, ecdb_drive_progress_update, proj);
|
||||
pthread_detach(progress_update);
|
||||
ECDB_PROJECT(proj)->ev_handler = ecore_event_handler_add
|
||||
(ECDB_DRIVE_ACTION_FINISHED,
|
||||
ecdb_erase_finished, proj);
|
||||
(ECDB_DRIVE_ACTION_FINISHED, ecdb_erase_finished, proj);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
@ -116,9 +118,13 @@ ecdb_erase_progress_handler(void *data, void *buffer, unsigned int nbyte)
|
||||
* percentage/sector to set
|
||||
*/
|
||||
if (last_sector <= p->sector)
|
||||
{
|
||||
last_sector = p->sector;
|
||||
}
|
||||
else
|
||||
{
|
||||
last_sector = p->sectors;
|
||||
}
|
||||
|
||||
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
|
||||
"erase_page");
|
||||
|
@ -3,13 +3,11 @@
|
||||
static void free_file(Ewl_Filelist_File *file);
|
||||
static void ecdb_custom_filelist_cb_clicked(Ewl_Widget *w, void *ev,
|
||||
void *data);
|
||||
|
||||
static Ewl_Widget *ecdb_custom_filelist_view_widget_fetch(void *data,
|
||||
unsigned int row, unsigned int column);
|
||||
static void *ecdb_custom_filelist_model_data_fetch(void *data, unsigned int row,
|
||||
unsigned int column);
|
||||
|
||||
|
||||
static void ecdb_custom_filelist_model_filter(Ewl_Filelist_Directory *dir);
|
||||
static unsigned int ecdb_custom_filelist_model_data_unref(void *data);
|
||||
static Ewl_Filelist_Directory *ecdb_custom_filelist_directory_new
|
||||
@ -33,11 +31,9 @@ ecdb_custom_filelist_new(void)
|
||||
ewl_callback_append(ret, EWL_CALLBACK_DND_DATA_RECEIVED,
|
||||
ecdb_custom_filelist_dnd_dropped_cb, NULL);
|
||||
ewl_dnd_accepted_types_set(ret, dnd_types);
|
||||
ewl_callback_del_type(EWL_FILELIST(ret)->controller,
|
||||
EWL_CALLBACK_CLICKED);
|
||||
ewl_callback_prepend(EWL_FILELIST(ret)->controller,
|
||||
EWL_CALLBACK_CLICKED, ecdb_custom_filelist_cb_clicked,
|
||||
ret);
|
||||
ewl_callback_del_type(EWL_FILELIST(ret)->controller, EWL_CALLBACK_CLICKED);
|
||||
ewl_callback_prepend(EWL_FILELIST(ret)->controller, EWL_CALLBACK_CLICKED,
|
||||
ecdb_custom_filelist_cb_clicked, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -87,7 +83,10 @@ ecdb_custom_filelist_directory_set(Ewl_Filelist *fl, Ecdb_Source *src)
|
||||
Ewl_Event_Action_Response ev_data;
|
||||
|
||||
data = ewl_mvc_data_get(EWL_MVC(fl->controller));
|
||||
if (data) ecdb_custom_filelist_model_data_unref(data);
|
||||
if (data)
|
||||
{
|
||||
ecdb_custom_filelist_model_data_unref(data);
|
||||
}
|
||||
|
||||
data = ecdb_custom_filelist_directory_new(src);
|
||||
ewl_mvc_data_set(EWL_MVC(fl->controller), data);
|
||||
@ -117,9 +116,9 @@ ecdb_custom_filelist_directory_new(Ecdb_Source *parent)
|
||||
ecore_list_free_cb_set(dirs, ECORE_FREE_CB(free_file));
|
||||
|
||||
if (!parent)
|
||||
{
|
||||
return NULL;
|
||||
|
||||
/* No up for now */
|
||||
}
|
||||
|
||||
while ((src = parent->children[i]))
|
||||
{
|
||||
@ -148,12 +147,10 @@ ecdb_custom_filelist_directory_new(Ecdb_Source *parent)
|
||||
nf++;
|
||||
}
|
||||
|
||||
/* Oops */
|
||||
i++;
|
||||
}
|
||||
|
||||
dir = calloc(1, sizeof(Ewl_Filelist_Directory));
|
||||
|
||||
dir->files = ecore_list_new();
|
||||
dir->dirs = ecore_list_new();
|
||||
dir->rfiles = files;
|
||||
@ -251,7 +248,9 @@ ecdb_custom_filelist_model_data_fetch(void *data, unsigned int row,
|
||||
|
||||
/* Check if in dirs or files list */
|
||||
if (row < fld->num_dirs)
|
||||
{
|
||||
file = ecore_list_index_goto(fld->dirs, row);
|
||||
}
|
||||
else
|
||||
{
|
||||
i = (row - fld->num_dirs);
|
||||
@ -260,12 +259,9 @@ ecdb_custom_filelist_model_data_fetch(void *data, unsigned int row,
|
||||
|
||||
if (column == 1) ret = ewl_filelist_size_get(file->size);
|
||||
else if (column == 2) ret = ewl_filelist_perms_get(file->mode);
|
||||
else if (column == 3) ret = ewl_filelist_username_get
|
||||
(file->username);
|
||||
else if (column == 4) ret = ewl_filelist_groupname_get
|
||||
(file->groupname);
|
||||
else if (column == 5) ret = ewl_filelist_modtime_get
|
||||
(file->modtime);
|
||||
else if (column == 3) ret = ewl_filelist_username_get(file->username);
|
||||
else if (column == 4) ret = ewl_filelist_groupname_get(file->groupname);
|
||||
else if (column == 5) ret = ewl_filelist_modtime_get(file->modtime);
|
||||
else ret = strdup(file->name);
|
||||
|
||||
/* ret needs to be freed by the view or with model_data_free_set */
|
||||
@ -286,7 +282,9 @@ ecdb_custom_filelist_cb_clicked(Ewl_Widget *w, void *ev, void *data)
|
||||
fl = data;
|
||||
|
||||
if (!ewl_mvc_selected_count_get(EWL_MVC(fl->controller)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (md->clicks != 2)
|
||||
{
|
||||
@ -294,8 +292,8 @@ ecdb_custom_filelist_cb_clicked(Ewl_Widget *w, void *ev, void *data)
|
||||
return;
|
||||
}
|
||||
|
||||
c = ewl_container_child_at_recursive_get(EWL_CONTAINER(fl),
|
||||
md->base.x, md->base.y);
|
||||
c = ewl_container_child_at_recursive_get(EWL_CONTAINER(fl), md->base.x,
|
||||
md->base.y);
|
||||
|
||||
while (c && c->parent)
|
||||
{
|
||||
@ -308,7 +306,9 @@ ecdb_custom_filelist_cb_clicked(Ewl_Widget *w, void *ev, void *data)
|
||||
}
|
||||
|
||||
if (!i)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
file = ecdb_custom_filelist_selected_file_get(fl);
|
||||
|
||||
@ -339,12 +339,15 @@ ecdb_custom_filelist_selected_file_get(Ewl_Filelist *fl)
|
||||
idx = ewl_mvc_selected_get(EWL_MVC(fl->controller));
|
||||
data = EWL_SELECTION(idx)->data;
|
||||
if (idx->row < data->num_dirs)
|
||||
{
|
||||
file = ecore_list_index_goto(data->dirs, idx->row);
|
||||
}
|
||||
else
|
||||
{
|
||||
i = (idx->row - data->num_dirs);
|
||||
file = ecore_list_index_goto(data->files, i);
|
||||
}
|
||||
|
||||
FREE(idx);
|
||||
return strdup(file->name);
|
||||
}
|
||||
@ -359,8 +362,7 @@ ecdb_custom_filelist_view_widget_fetch(void *data, unsigned int row __UNUSED__,
|
||||
/* Create icon */
|
||||
ret = ewl_icon_simple_new();
|
||||
ewl_icon_constrain_set(EWL_ICON(ret), EWL_ICON_SIZE_MEDIUM);
|
||||
ewl_box_orientation_set(EWL_BOX(ret),
|
||||
EWL_ORIENTATION_HORIZONTAL);
|
||||
ewl_box_orientation_set(EWL_BOX(ret), EWL_ORIENTATION_HORIZONTAL);
|
||||
ewl_object_alignment_set(EWL_OBJECT(ret), EWL_FLAG_ALIGN_LEFT);
|
||||
|
||||
/* Get and set data into icon */
|
||||
@ -368,16 +370,19 @@ ecdb_custom_filelist_view_widget_fetch(void *data, unsigned int row __UNUSED__,
|
||||
{
|
||||
stock = ewl_filelist_stock_icon_get(data);
|
||||
img = ewl_icon_theme_icon_path_get(stock, EWL_ICON_SIZE_MEDIUM);
|
||||
if (img) ewl_icon_image_set(EWL_ICON(ret), img, NULL);
|
||||
|
||||
if (img)
|
||||
{
|
||||
ewl_icon_image_set(EWL_ICON(ret), img, NULL);
|
||||
}
|
||||
filename = ecore_file_file_get(data);
|
||||
ewl_icon_label_set(EWL_ICON(ret), filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
ewl_icon_label_set(EWL_ICON(ret), data);
|
||||
}
|
||||
|
||||
FREE(data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,6 @@
|
||||
/*
|
||||
* vim:ts=3:sw=3:sts=3:expandtab
|
||||
*/
|
||||
#include "ecdb.h"
|
||||
|
||||
static void ecdb_handle_typebuf(Evas_Object *gui);
|
||||
@ -53,8 +56,7 @@ _cb_filelist_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *eo,
|
||||
Evas_Object *gui = data;
|
||||
evas_object_focus_set(eo, TRUE);
|
||||
|
||||
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate",
|
||||
"ecdb");
|
||||
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate", "ecdb");
|
||||
edje_object_part_text_set(gui, "filelist_overlay_text", NULL);
|
||||
|
||||
}
|
||||
@ -68,8 +70,7 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
|
||||
|
||||
if (!strcmp(ek->key, "Escape"))
|
||||
{
|
||||
edje_object_signal_emit(gui,
|
||||
"ecdb,filelist_overlay,deactivate", "ecdb");
|
||||
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate", "ecdb");
|
||||
edje_object_part_text_set(gui, "filelist_overlay_text", NULL);
|
||||
}
|
||||
|
||||
@ -94,9 +95,10 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
|
||||
text[len - 1] = '\0';
|
||||
|
||||
if (len == 1)
|
||||
edje_object_signal_emit(gui,
|
||||
"ecdb,filelist_overlay,deactivate",
|
||||
{
|
||||
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate",
|
||||
"ecdb");
|
||||
}
|
||||
edje_object_part_text_set(gui, "filelist_overlay_text", text);
|
||||
FREE(text);
|
||||
}
|
||||
@ -115,9 +117,13 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
|
||||
return;
|
||||
|
||||
if ((ek->string) && (*ek->string) && (!ek->string[1]))
|
||||
{
|
||||
append = ek->string;
|
||||
}
|
||||
else if ((ek->keyname) && (*ek->keyname) && (!ek->key[1]))
|
||||
{
|
||||
append = ek->keyname;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (text)
|
||||
@ -126,7 +132,9 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
|
||||
}
|
||||
|
||||
if (!text)
|
||||
{
|
||||
text = strdup(append);
|
||||
}
|
||||
else
|
||||
{
|
||||
len = strlen(text) + 2;
|
||||
@ -138,12 +146,11 @@ _cb_filelist_key_down(void *data, Evas *e __UNUSED__,
|
||||
* transition in that case
|
||||
*/
|
||||
if (strlen(text) == 1)
|
||||
edje_object_signal_emit(gui,
|
||||
"ecdb,filelist_overlay,activate",
|
||||
"ecdb");
|
||||
{
|
||||
edje_object_signal_emit(gui, "ecdb,filelist_overlay,activate", "ecdb");
|
||||
}
|
||||
edje_object_part_text_set(gui, "filelist_overlay_text", text);
|
||||
|
||||
free(text);
|
||||
FREE(text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,10 +171,10 @@ ecdb_create_main_gui(void)
|
||||
ecore_evas_title_set(em->main_win_ee, "ECDB");
|
||||
ecore_evas_name_class_set(em->main_win_ee, "ECDB", "ECDB");
|
||||
ecore_evas_avoid_damage_set(em->main_win_ee, 1);
|
||||
ecore_x_dnd_aware_set(ecore_evas_software_x11_window_get
|
||||
(em->main_win_ee), 1);
|
||||
ecore_x_dnd_type_set(ecore_evas_software_x11_window_get
|
||||
(em->main_win_ee), "*", 1);
|
||||
ecore_x_dnd_aware_set(ecore_evas_software_x11_window_get(em->main_win_ee),
|
||||
1);
|
||||
ecore_x_dnd_type_set(ecore_evas_software_x11_window_get(em->main_win_ee),
|
||||
"*", 1);
|
||||
|
||||
ecore_evas_callback_delete_request_set(em->main_win_ee, ecdb_shutdown);
|
||||
ecore_evas_callback_destroy_set(em->main_win_ee, ecdb_shutdown);
|
||||
@ -218,9 +225,10 @@ ecdb_handle_typebuf(Evas_Object *gui)
|
||||
Ewl_Filelist_Filter *filter;
|
||||
const char *ext;
|
||||
|
||||
if (!(ext = edje_object_part_text_get(gui,
|
||||
"filelist_overlay_text")))
|
||||
if (!(ext = edje_object_part_text_get(gui, "filelist_overlay_text")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
fl = ewl_widget_name_find("main_filelist");
|
||||
|
||||
@ -235,41 +243,42 @@ ecdb_handle_typebuf(Evas_Object *gui)
|
||||
if ((dir) && (dir[0] == '/'))
|
||||
{
|
||||
if (ecore_file_exists(dir))
|
||||
ewl_filelist_directory_set(EWL_FILELIST(fl),
|
||||
dir);
|
||||
{
|
||||
ewl_filelist_directory_set(EWL_FILELIST(fl), dir);
|
||||
}
|
||||
}
|
||||
else if (dir[0] == '~')
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
|
||||
snprintf(path, PATH_MAX, "%s%s", getenv("HOME"),
|
||||
&dir[1]);
|
||||
snprintf(path, PATH_MAX, "%s%s", getenv("HOME"), &dir[1]);
|
||||
|
||||
if (ecore_file_exists(path))
|
||||
ewl_filelist_directory_set(EWL_FILELIST(fl),
|
||||
path);
|
||||
{
|
||||
ewl_filelist_directory_set(EWL_FILELIST(fl), path);
|
||||
}
|
||||
}
|
||||
else if (dir)
|
||||
{
|
||||
/* Try to concate it to our current directory */
|
||||
char path[PATH_MAX];
|
||||
|
||||
snprintf(path, PATH_MAX, "%s/%s",
|
||||
ewl_filelist_directory_get
|
||||
snprintf(path, PATH_MAX, "%s/%s", ewl_filelist_directory_get
|
||||
(EWL_FILELIST(fl)), dir);
|
||||
|
||||
if (ecore_file_exists(path))
|
||||
ewl_filelist_directory_set(EWL_FILELIST(fl),
|
||||
path);
|
||||
{
|
||||
ewl_filelist_directory_set(EWL_FILELIST(fl), path);
|
||||
}
|
||||
}
|
||||
|
||||
if (dir)
|
||||
free(dir);
|
||||
{
|
||||
FREE(dir);
|
||||
}
|
||||
|
||||
edje_object_signal_emit(gui, "ecdb,filelist_overlay,"
|
||||
"deactivate", "ecdb");
|
||||
edje_object_part_text_set(gui, "filelist_overlay_text",
|
||||
NULL);
|
||||
edje_object_signal_emit(gui, "deactivate", "ecdb");
|
||||
edje_object_part_text_set(gui, "filelist_overlay_text", NULL);
|
||||
return;
|
||||
}
|
||||
else if (!ecdb_match_keyword(ext, "exit", 4))
|
||||
@ -281,7 +290,9 @@ ecdb_handle_typebuf(Evas_Object *gui)
|
||||
|
||||
filter = ewl_filelist_filter_get(EWL_FILELIST(fl));
|
||||
if (!filter)
|
||||
{
|
||||
filter = calloc(sizeof(Ewl_Filelist_Filter), 1);
|
||||
}
|
||||
|
||||
if (filter->extension)
|
||||
{
|
||||
@ -290,21 +301,22 @@ ecdb_handle_typebuf(Evas_Object *gui)
|
||||
FREE(filter->extension);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
filter->extension = strdup(ext);
|
||||
ewl_filelist_filter_set(EWL_FILELIST(fl), filter);
|
||||
ewl_filelist_refresh(EWL_FILELIST(fl));
|
||||
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate",
|
||||
"ecdb");
|
||||
edje_object_signal_emit(gui, "ecdb,filelist_overlay,deactivate", "ecdb");
|
||||
edje_object_part_text_set(gui, "filelist_overlay_text", NULL);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ecdb_cb_controls_focused(void *data, Evas_Object *o,
|
||||
const char *emission, const char *source)
|
||||
ecdb_cb_controls_focused(void *data, Evas_Object *o, const char *emission,
|
||||
const char *source)
|
||||
{
|
||||
static char *old_source;
|
||||
Evas_Object *unsel;
|
||||
@ -314,12 +326,14 @@ ecdb_cb_controls_focused(void *data, Evas_Object *o,
|
||||
unsel = evas_object_name_find(ecore_evas_get(em->main_win_ee),
|
||||
old_source);
|
||||
edje_object_signal_emit(unsel, "ecdb,focus,out", "ecdb");
|
||||
free(old_source);
|
||||
FREE(old_source);
|
||||
old_source = strdup(source);
|
||||
}
|
||||
else if (!old_source)
|
||||
{
|
||||
old_source = strdup(source);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
@ -335,13 +349,14 @@ ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
* now
|
||||
*/
|
||||
if (!strcmp(source, "ecdb/burn_data"))
|
||||
{
|
||||
ecdb_filelist_show();
|
||||
}
|
||||
else if (!strcmp(source, "ecdb/erase"))
|
||||
{
|
||||
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
|
||||
"welcome_page");
|
||||
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide",
|
||||
"ecdb");
|
||||
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide", "ecdb");
|
||||
ecdb_erase_page_show();
|
||||
}
|
||||
else if (!strcmp(source, "ecdb/burn_image"))
|
||||
@ -349,12 +364,13 @@ ecdb_cb_welcome_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
ecdb_filelist_show();
|
||||
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
|
||||
"welcome_page");
|
||||
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide",
|
||||
"ecdb");
|
||||
edje_object_signal_emit(swallow, "ecdb,welcome_page,hide", "ecdb");
|
||||
ecdb_burn_image_page_show();
|
||||
}
|
||||
else if (swallow)
|
||||
{
|
||||
edje_object_signal_emit(gui, "ecdb,filelist,hide", "ecdb");
|
||||
}
|
||||
|
||||
printf("Action: %s\n", source);
|
||||
}
|
||||
@ -373,8 +389,7 @@ ecdb_cb_erase_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
{
|
||||
char *signal;
|
||||
|
||||
edje_object_part_text_set(swallow, "progress_text",
|
||||
"Begin Erase");
|
||||
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");
|
||||
@ -412,7 +427,6 @@ ecdb_cb_erase_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
}
|
||||
|
||||
speed = 0;
|
||||
|
||||
edje_object_signal_emit(swallow, "ecdb,erase,start", "ecdb");
|
||||
const char *ids[] = {"ecdb/erase/return", "ecdb/erase/begin",
|
||||
"ecdb/erase/speed"};
|
||||
@ -439,8 +453,7 @@ ecdb_cb_burn_image_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
{
|
||||
char *signal;
|
||||
|
||||
edje_object_part_text_set(swallow, "progress_text",
|
||||
"Begin Burn");
|
||||
edje_object_part_text_set(swallow, "progress_text", "Begin Burn");
|
||||
edje_object_part_text_set(swallow, "progress_percent", "0%");
|
||||
signal = evas_object_data_get(swallow, "hide_signal");
|
||||
edje_object_signal_emit(swallow, signal, "ecdb");
|
||||
@ -454,7 +467,6 @@ ecdb_cb_burn_image_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
Ecdb_Burn_Project *proj;
|
||||
Evas_Object *entry;
|
||||
Ecdb_Source *iso_file;
|
||||
Efreet_Uri *uri;
|
||||
const char *file;
|
||||
char *sanitized_file;
|
||||
char buf[1024];
|
||||
@ -471,11 +483,9 @@ ecdb_cb_burn_image_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
sanitized_file[0] = '\0';
|
||||
ecore_strlcpy(sanitized_file, file, strlen(file) - 3);
|
||||
|
||||
uri = efreet_uri_decode(sanitized_file);
|
||||
iso_file = ecdb_source_new();
|
||||
ecdb_source_data_set(iso_file, uri->path);
|
||||
ecdb_source_data_set(iso_file, sanitized_file);
|
||||
ecdb_source_child_append(proj->files, iso_file);
|
||||
efreet_uri_free(uri);
|
||||
|
||||
snprintf(buf, sizeof(buf), "Commencing...");
|
||||
edje_object_part_text_set(swallow, "progress_text", buf);
|
||||
@ -494,9 +504,7 @@ ecdb_cb_burn_image_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
case ECDB_ERROR_NONE:
|
||||
edje_object_signal_emit(gui,
|
||||
"ecdb,filelist,hide", "ecdb");
|
||||
edje_object_signal_emit(swallow,
|
||||
"ecdb,burn_image,start",
|
||||
"ecdb");
|
||||
edje_object_signal_emit(swallow, "ecdb,burn_image,start", "ecdb");
|
||||
const char *ids[] = {"ecdb/burn_image/return",
|
||||
"ecdb/burn_image/begin",
|
||||
"ecdb/burn_image/file"};
|
||||
@ -508,13 +516,11 @@ ecdb_cb_burn_image_page_buttons_clicked(void *data, Evas_Object *o,
|
||||
break;
|
||||
|
||||
case ECDB_ERROR_SOURCE_ATTACH:
|
||||
snprintf(buf, sizeof(buf),
|
||||
"Couldn't attach source data!");
|
||||
snprintf(buf, sizeof(buf), "Couldn't attach source data!");
|
||||
break;
|
||||
|
||||
case ECDB_ERROR_WRITE_MODE:
|
||||
snprintf(buf, sizeof(buf),
|
||||
"No suitable burn mode!");
|
||||
snprintf(buf, sizeof(buf), "No suitable burn mode!");
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -549,37 +555,31 @@ ecdb_welcome_page_show(void)
|
||||
|
||||
swallow = edje_object_add(ecore_evas_get(em->main_win_ee));
|
||||
evas_object_name_set(swallow, "welcome_page");
|
||||
edje_object_file_set(swallow, em->theme_path,
|
||||
"ecdb/welcome_page");
|
||||
edje_object_part_geometry_get(gui, "active_area",
|
||||
&x, &y, &w, &h);
|
||||
edje_object_file_set(swallow, em->theme_path, "ecdb/welcome_page");
|
||||
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, "mouse,down,1",
|
||||
"ecdb/*", ecdb_cb_controls_focused,
|
||||
NULL);
|
||||
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
|
||||
"ecdb/*", ecdb_cb_welcome_page_buttons_clicked,
|
||||
NULL);
|
||||
edje_object_signal_callback_add(swallow, "hide,finished",
|
||||
"welcome_page", ecdb_cb_page_hide_finished,
|
||||
NULL);
|
||||
edje_object_signal_callback_add(swallow, "mouse,down,1", "ecdb/*",
|
||||
ecdb_cb_controls_focused, NULL);
|
||||
edje_object_signal_callback_add(swallow, "mouse,clicked,1", "ecdb/*",
|
||||
ecdb_cb_welcome_page_buttons_clicked, NULL);
|
||||
edje_object_signal_callback_add(swallow, "hide,finished", "welcome_page",
|
||||
ecdb_cb_page_hide_finished, NULL);
|
||||
evas_object_show(swallow);
|
||||
|
||||
Evas_Object *b;
|
||||
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"};
|
||||
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 = edje_object_add(ecore_evas_get(em->main_win_ee));
|
||||
evas_object_name_set(b, ids[i]);
|
||||
edje_object_file_set(b, em->theme_path, "ecdb/button");
|
||||
edje_object_part_geometry_get(swallow, ids[i], &x,
|
||||
&y, &w, &h);
|
||||
edje_object_part_geometry_get(swallow, ids[i], &x, &y, &w, &h);
|
||||
edje_object_part_text_set(b, "label", labels[i]);
|
||||
evas_object_move(b, x, y);
|
||||
evas_object_resize(b, w, h);
|
||||
@ -587,8 +587,7 @@ ecdb_welcome_page_show(void)
|
||||
evas_object_show(b);
|
||||
|
||||
/* Place this after */
|
||||
ecdb_button_icon_swallow(ecore_evas_get
|
||||
(em->main_win_ee), b, ids[i]);
|
||||
ecdb_button_icon_swallow(ecore_evas_get(em->main_win_ee), b, ids[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -618,20 +617,17 @@ ecdb_filelist_show(void)
|
||||
Ewl_Widget *embed, *filelist;
|
||||
|
||||
embed = ewl_embed_new();
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(embed),
|
||||
EWL_FLAG_FILL_ALL);
|
||||
ewl_object_fill_policy_set(EWL_OBJECT(embed), EWL_FLAG_FILL_ALL);
|
||||
swallow = ewl_embed_canvas_set(EWL_EMBED(embed),
|
||||
ecore_evas_get(em->main_win_ee),
|
||||
(void *)(long)ecore_evas_software_x11_window_get
|
||||
(em->main_win_ee));
|
||||
(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 = ewl_filelist_new();
|
||||
ewl_widget_name_set(EWL_WIDGET(filelist), "main_filelist");
|
||||
ewl_container_child_append(EWL_CONTAINER(embed), filelist);
|
||||
ewl_filelist_directory_set(EWL_FILELIST(filelist),
|
||||
getenv("HOME"));
|
||||
ewl_filelist_directory_set(EWL_FILELIST(filelist), getenv("HOME"));
|
||||
ewl_widget_show(filelist);
|
||||
|
||||
edje_object_part_geometry_get(gui, "filelist", &x, &y, &w, &h);
|
||||
@ -639,8 +635,7 @@ ecdb_filelist_show(void)
|
||||
evas_object_move(swallow, x, y);
|
||||
evas_object_resize(swallow, w, h);
|
||||
edje_object_part_swallow(gui, "filelist", swallow);
|
||||
evas_object_event_callback_add(swallow,
|
||||
EVAS_CALLBACK_MOUSE_DOWN,
|
||||
evas_object_event_callback_add(swallow, EVAS_CALLBACK_MOUSE_DOWN,
|
||||
_cb_filelist_mouse_down, gui);
|
||||
evas_object_event_callback_add(swallow, EVAS_CALLBACK_KEY_DOWN,
|
||||
_cb_filelist_key_down, gui);
|
||||
@ -697,26 +692,21 @@ ecdb_erase_page_show(void)
|
||||
Evas_Coord x, y, w, h;
|
||||
|
||||
swallow = edje_object_add(ecore_evas_get(em->main_win_ee));
|
||||
edje_object_file_set(swallow, em->theme_path,
|
||||
"ecdb/erase_page");
|
||||
edje_object_file_set(swallow, em->theme_path, "ecdb/erase_page");
|
||||
evas_object_name_set(swallow, "erase_page");
|
||||
evas_object_data_set(swallow, "hide_signal",
|
||||
"ecdb,erase_page,hide");
|
||||
edje_object_part_geometry_get(gui, "active_area",
|
||||
&x, &y, &w, &h);
|
||||
evas_object_data_set(swallow, "hide_signal", "ecdb,erase_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);
|
||||
evas_object_show(swallow);
|
||||
edje_object_signal_callback_add(swallow, "mouse,down,1",
|
||||
"ecdb/*", ecdb_cb_controls_focused,
|
||||
NULL);
|
||||
edje_object_signal_callback_add(swallow, "mouse,down,1", "ecdb/*",
|
||||
ecdb_cb_controls_focused, NULL);
|
||||
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
|
||||
"ecdb/erase/*",
|
||||
ecdb_cb_erase_page_buttons_clicked, NULL);
|
||||
edje_object_signal_callback_add(swallow, "hide,finished",
|
||||
"erase_page", ecdb_cb_page_hide_finished,
|
||||
NULL);
|
||||
edje_object_signal_callback_add(swallow, "hide,finished", "erase_page",
|
||||
ecdb_cb_page_hide_finished, NULL);
|
||||
evas_object_show(swallow);
|
||||
|
||||
int i;
|
||||
@ -732,8 +722,7 @@ ecdb_erase_page_show(void)
|
||||
b = edje_object_add(ecore_evas_get(em->main_win_ee));
|
||||
evas_object_name_set(b, ids[i]);
|
||||
edje_object_file_set(b, em->theme_path, wtype[i]);
|
||||
edje_object_part_geometry_get(swallow, ids[i], &x,
|
||||
&y, &w, &h);
|
||||
edje_object_part_geometry_get(swallow, ids[i], &x, &y, &w, &h);
|
||||
evas_object_move(b, x, y);
|
||||
evas_object_resize(b, w, h);
|
||||
edje_object_part_text_set(b, "label", labels[i]);
|
||||
@ -741,8 +730,10 @@ ecdb_erase_page_show(void)
|
||||
evas_object_show(b);
|
||||
|
||||
if (!strcmp("ecdb/button", wtype[i]))
|
||||
ecdb_button_icon_swallow(ecore_evas_get(
|
||||
em->main_win_ee), b, ids[i]);
|
||||
{
|
||||
ecdb_button_icon_swallow(ecore_evas_get(em->main_win_ee), b,
|
||||
ids[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -770,33 +761,28 @@ ecdb_burn_image_page_show(void)
|
||||
Evas_Coord x, y, w, h;
|
||||
|
||||
swallow = edje_object_add(ecore_evas_get(em->main_win_ee));
|
||||
edje_object_file_set(swallow, em->theme_path,
|
||||
"ecdb/burn_image_page");
|
||||
edje_object_file_set(swallow, em->theme_path, "ecdb/burn_image_page");
|
||||
evas_object_name_set(swallow, "burn_image_page");
|
||||
evas_object_data_set(swallow, "hide_signal",
|
||||
"ecdb,burn_image_page,hide");
|
||||
edje_object_part_geometry_get(gui, "active_area",
|
||||
&x, &y, &w, &h);
|
||||
evas_object_data_set(swallow, "hide_signal", "ecdb,burn_image_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);
|
||||
evas_object_show(swallow);
|
||||
edje_object_signal_callback_add(swallow, "mouse,down,1",
|
||||
"ecdb/*", ecdb_cb_controls_focused,
|
||||
NULL);
|
||||
edje_object_signal_callback_add(swallow, "mouse,down,1", "ecdb/*",
|
||||
ecdb_cb_controls_focused, NULL);
|
||||
edje_object_signal_callback_add(swallow, "mouse,clicked,1",
|
||||
"ecdb/burn_image/*",
|
||||
ecdb_cb_burn_image_page_buttons_clicked, NULL);
|
||||
edje_object_signal_callback_add(swallow, "hide,finished",
|
||||
"burn_image_page", ecdb_cb_page_hide_finished,
|
||||
ecdb_cb_burn_image_page_buttons_clicked,
|
||||
NULL);
|
||||
edje_object_signal_callback_add(swallow, "hide,finished",
|
||||
"burn_image_page",
|
||||
ecdb_cb_page_hide_finished, NULL);
|
||||
evas_object_show(swallow);
|
||||
|
||||
int i;
|
||||
char *labels[] = {"Return to Main Page", "Start Burn",
|
||||
"Burn File"};
|
||||
char *ids[] = {"ecdb/burn_image/return",
|
||||
"ecdb/burn_image/begin",
|
||||
char *labels[] = {"Return to Main Page", "Start Burn", "Burn File"};
|
||||
char *ids[] = {"ecdb/burn_image/return", "ecdb/burn_image/begin",
|
||||
"ecdb/burn_image/file"};
|
||||
char *wtype[] = {"ecdb/button", "ecdb/button", "ecdb/entry"};
|
||||
|
||||
@ -806,8 +792,7 @@ ecdb_burn_image_page_show(void)
|
||||
b = edje_object_add(ecore_evas_get(em->main_win_ee));
|
||||
evas_object_name_set(b, ids[i]);
|
||||
edje_object_file_set(b, em->theme_path, wtype[i]);
|
||||
edje_object_part_geometry_get(swallow, ids[i], &x,
|
||||
&y, &w, &h);
|
||||
edje_object_part_geometry_get(swallow, ids[i], &x, &y, &w, &h);
|
||||
evas_object_move(b, x, y);
|
||||
evas_object_resize(b, w, h);
|
||||
edje_object_part_text_set(b, "label", labels[i]);
|
||||
@ -815,13 +800,14 @@ ecdb_burn_image_page_show(void)
|
||||
evas_object_show(b);
|
||||
|
||||
if (!strcmp("ecdb/button", wtype[i]))
|
||||
ecdb_button_icon_swallow(ecore_evas_get(
|
||||
em->main_win_ee), b, ids[i]);
|
||||
{
|
||||
ecdb_button_icon_swallow(ecore_evas_get(em->main_win_ee), b,
|
||||
ids[i]);
|
||||
}
|
||||
else if (!strcmp("ecdb/entry", wtype[i]))
|
||||
{
|
||||
ecore_list_append(em->dnd_candidates, b);
|
||||
evas_object_data_set(b, "dnd_call_func",
|
||||
ecdb_dnd_entry_dnd_set);
|
||||
evas_object_data_set(b, "dnd_call_func", ecdb_dnd_entry_dnd_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -833,8 +819,7 @@ ecdb_burn_image_page_show(void)
|
||||
}
|
||||
|
||||
edje_object_signal_emit(gui, "ecdb,burn_image_page,visible", "ecdb");
|
||||
edje_object_signal_emit(swallow, "ecdb,burn_image_page,visible",
|
||||
"ecdb");
|
||||
edje_object_signal_emit(swallow, "ecdb,burn_image_page,visible", "ecdb");
|
||||
}
|
||||
|
||||
/* Hurrah! Fancyness */
|
||||
@ -853,8 +838,7 @@ ecdb_gui_controls_disable(const char **ids, int n)
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
obj = evas_object_name_find(ecore_evas_get(em->main_win_ee),
|
||||
ids[i]);
|
||||
obj = evas_object_name_find(ecore_evas_get(em->main_win_ee), ids[i]);
|
||||
edje_object_signal_emit(obj, "ecdb,disable", "ecdb");
|
||||
}
|
||||
}
|
||||
@ -867,8 +851,7 @@ ecdb_gui_controls_enable(const char **ids, int n)
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
obj = evas_object_name_find(ecore_evas_get(em->main_win_ee),
|
||||
ids[i]);
|
||||
obj = evas_object_name_find(ecore_evas_get(em->main_win_ee), ids[i]);
|
||||
edje_object_signal_emit(obj, "ecdb,enable", "ecdb");
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,9 @@ ecdb_source_new(void)
|
||||
|
||||
src = calloc(1, sizeof(Ecdb_Source));
|
||||
if (!src)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (!ecdb_source_init(src))
|
||||
{
|
||||
FREE(src);
|
||||
@ -27,7 +29,9 @@ ecdb_source_init(Ecdb_Source *src)
|
||||
src->num_children = 0;
|
||||
src->children = calloc(1, sizeof(Ecdb_Source));
|
||||
if (!src->children)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
src->children[src->num_children] = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
@ -55,7 +59,9 @@ void
|
||||
ecdb_source_data_set(Ecdb_Source *src, const char *dst)
|
||||
{
|
||||
if ((!src) || (!ecore_file_exists(dst)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
src->dst = eina_stringshare_add(dst);
|
||||
|
||||
@ -83,7 +89,7 @@ ecdb_source_add_directory_recursive(Ecdb_Source *parent)
|
||||
snprintf(path, PATH_MAX, "%s/%s", parent->dst, src);
|
||||
ecdb_source_data_set(child, path);
|
||||
ecdb_source_child_append(parent, child);
|
||||
free(src);
|
||||
FREE(src);
|
||||
}
|
||||
ecore_list_destroy(files);
|
||||
}
|
||||
@ -158,8 +164,7 @@ ecdb_source_add_children_rec(Ecdb_Source *parent, IsoImage *image)
|
||||
if (cs->dir)
|
||||
{
|
||||
iso_tree_add_new_dir(ISO_DIR(parent->node),
|
||||
ecore_file_file_get(cs->dst),
|
||||
&cd);
|
||||
ecore_file_file_get(cs->dst), &cd);
|
||||
cs->node = ISO_NODE(cd);
|
||||
/* If the source has children, find the node from above
|
||||
* (if applicable), and recursively add to it */
|
||||
@ -190,7 +195,9 @@ ecdb_image_project(Ecdb_Burn_Project *proj)
|
||||
BurnSource *data_src, *fifo_src;
|
||||
|
||||
if ((!proj->files) || (!proj->files->num_children))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* To handle already-suplied image files */
|
||||
if (proj->files->num_children == 1)
|
||||
@ -198,8 +205,7 @@ ecdb_image_project(Ecdb_Burn_Project *proj)
|
||||
efreet_mime_init();
|
||||
c = proj->files->children[0];
|
||||
if ((!ecore_file_is_dir(c->dst)) &&
|
||||
(!strcmp(efreet_mime_type_get(c->dst),
|
||||
"application/x-cd-image")))
|
||||
(!strcmp(efreet_mime_type_get(c->dst), "application/x-cd-image")))
|
||||
{
|
||||
data_src = burn_file_source_new(c->dst, NULL);
|
||||
goto FIFO_CREATE;
|
||||
@ -222,20 +228,33 @@ ecdb_image_project(Ecdb_Burn_Project *proj)
|
||||
|
||||
/* Set all ids */
|
||||
if (proj->publisher_id)
|
||||
{
|
||||
iso_image_set_publisher_id(image, proj->publisher_id);
|
||||
}
|
||||
if (proj->data_preparer_id)
|
||||
iso_image_set_data_preparer_id(image,
|
||||
proj->data_preparer_id);
|
||||
{
|
||||
iso_image_set_data_preparer_id(image, proj->data_preparer_id);
|
||||
}
|
||||
if (proj->system_id)
|
||||
{
|
||||
iso_image_set_system_id(image, proj->system_id);
|
||||
}
|
||||
if (proj->application_id)
|
||||
{
|
||||
iso_image_set_application_id(image, proj->application_id);
|
||||
}
|
||||
if (proj->copywrite_id)
|
||||
{
|
||||
iso_image_set_copyright_file_id(image, proj->copywrite_id);
|
||||
}
|
||||
if (proj->abstract_id)
|
||||
{
|
||||
iso_image_set_abstract_file_id(image, proj->abstract_id);
|
||||
}
|
||||
if (proj->biblio_id)
|
||||
{
|
||||
iso_image_set_biblio_file_id(image, proj->biblio_id);
|
||||
}
|
||||
|
||||
if (!iso_write_opts_new(&opts, 2))
|
||||
{
|
||||
@ -266,8 +285,8 @@ ecdb_image_project(Ecdb_Burn_Project *proj)
|
||||
|
||||
/* And, convert to fifo */
|
||||
FIFO_CREATE:
|
||||
fifo_src = burn_fifo_source_new(data_src,
|
||||
proj->fifo_chunksize, proj->fifo_chunks, 0);
|
||||
fifo_src = burn_fifo_source_new(data_src, proj->fifo_chunksize,
|
||||
proj->fifo_chunks, 0);
|
||||
burn_source_free(data_src);
|
||||
return fifo_src;
|
||||
}
|
||||
|
@ -7,7 +7,9 @@ ecdb_project_new(void)
|
||||
|
||||
proj = calloc(1, sizeof(Ecdb_Project));
|
||||
if (!proj)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (!ecdb_project_init(proj))
|
||||
{
|
||||
FREE(proj);
|
||||
@ -38,12 +40,20 @@ ecdb_project_type_set(Ecdb_Project *proj, unsigned int t)
|
||||
int
|
||||
ecdb_shutdown(void *data, int type, void *event)
|
||||
{
|
||||
if (em->drives) ecore_list_destroy(em->drives);
|
||||
if (em->dnd_candidates) ecore_list_destroy(em->dnd_candidates);
|
||||
free(em);
|
||||
if (em->drives)
|
||||
{
|
||||
ecore_list_destroy(em->drives);
|
||||
}
|
||||
if (em->dnd_candidates)
|
||||
{
|
||||
ecore_list_destroy(em->dnd_candidates);
|
||||
}
|
||||
FREE(em);
|
||||
|
||||
if (!ecore_file_recursive_rm("/tmp/ecdb"))
|
||||
{
|
||||
printf("Removal of temporary directory failed!\n");
|
||||
}
|
||||
ewl_main_quit();
|
||||
return FALSE;
|
||||
}
|
||||
@ -52,7 +62,9 @@ int
|
||||
ecdb_burn_init(void)
|
||||
{
|
||||
if (!burn_initialize())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
burn_msgs_set_severities("NEVER", "SORRY", "ecdb: ");
|
||||
burn_set_signal_handling("ecdb: ", NULL, 0);
|
||||
@ -64,7 +76,9 @@ int
|
||||
ecdb_image_init(void)
|
||||
{
|
||||
if (!iso_init())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
iso_set_msgs_severities("NEVER", "SORRY", "ecdb: ");
|
||||
|
||||
return 1;
|
||||
@ -78,8 +92,10 @@ ecdb_match_keyword(const char *chk, const char *key, int len)
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (chk[i] != key[i])
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@ -111,7 +127,9 @@ ecdb_strip_next_argument(const char *strip)
|
||||
do
|
||||
{
|
||||
if (*t1 == ' ')
|
||||
{
|
||||
space = TRUE;
|
||||
}
|
||||
|
||||
if ((*t1 != ' ') && (space == TRUE))
|
||||
{
|
||||
@ -126,9 +144,13 @@ ecdb_strip_next_argument(const char *strip)
|
||||
|
||||
/* Given no more args */
|
||||
if (!len)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
len++;
|
||||
}
|
||||
|
||||
/* Make a new string and copy everything over */
|
||||
ret = malloc(sizeof(char) * len);
|
||||
@ -165,10 +187,12 @@ ecdb_dnd_position(void *data, int type, void *event)
|
||||
|
||||
ev = event;
|
||||
if (ev->win != ecore_evas_software_x11_window_get(em->main_win_ee))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
ecore_evas_geometry_get(em->main_win_ee, &window_x,
|
||||
&window_y, &window_w, &window_h);
|
||||
ecore_evas_geometry_get(em->main_win_ee, &window_x, &window_y, &window_w,
|
||||
&window_h);
|
||||
ecore_list_first_goto(em->dnd_candidates);
|
||||
while ((o = ecore_list_next(em->dnd_candidates)))
|
||||
{
|
||||
@ -179,16 +203,14 @@ ecdb_dnd_position(void *data, int type, void *event)
|
||||
y += window_y;
|
||||
|
||||
if ((ev->position.x >= x) && (ev->position.x <= (x+w))
|
||||
&& (ev->position.y >= y)
|
||||
&& (ev->position.y <= (y + h)))
|
||||
&& (ev->position.y >= y) && (ev->position.y <= (y + h)))
|
||||
{
|
||||
rect.x = x;
|
||||
rect.y = y;
|
||||
rect.width = w;
|
||||
rect.height = h;
|
||||
em->drop_object = o;
|
||||
ecore_x_dnd_send_status(1, 1, rect,
|
||||
ECORE_X_DND_ACTION_PRIVATE);
|
||||
ecore_x_dnd_send_status(1, 1, rect, ECORE_X_DND_ACTION_PRIVATE);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -220,8 +242,7 @@ ecdb_dnd_selection(void *data, int type, void *event)
|
||||
{
|
||||
Ecore_X_Event_Selection_Notify *ev;
|
||||
Ecore_X_Selection_Data_Files *files;
|
||||
void (*call_func)(Evas_Object *, Ecore_X_Selection_Data_Files *) =
|
||||
NULL;
|
||||
void (*call_func)(Evas_Object *, Ecore_X_Selection_Data_Files *) = NULL;
|
||||
|
||||
ev = event;
|
||||
if ((!em->drop_object) || (ev->selection != ECORE_X_SELECTION_XDND)
|
||||
@ -233,7 +254,9 @@ ecdb_dnd_selection(void *data, int type, void *event)
|
||||
|
||||
call_func = evas_object_data_get(em->drop_object, "dnd_call_func");
|
||||
if (call_func != NULL)
|
||||
{
|
||||
call_func(em->drop_object, files);
|
||||
}
|
||||
|
||||
em->drop_object = NULL;
|
||||
ecore_x_dnd_send_finished();
|
||||
@ -246,5 +269,9 @@ ecdb_dnd_selection(void *data, int type, void *event)
|
||||
void
|
||||
ecdb_dnd_entry_dnd_set(Evas_Object *o, Ecore_X_Selection_Data_Files *files)
|
||||
{
|
||||
edje_object_part_text_set(o, "label", files->files[0]);
|
||||
Efreet_Uri *uri;
|
||||
|
||||
uri = efreet_uri_decode(files->files[0]);
|
||||
edje_object_part_text_set(o, "label", uri->path);
|
||||
efreet_uri_free(uri);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user