A bit of theme work, some random widget fixes here and there, and fix a lot of memory problems with burn_data.

This commit is contained in:
Jaime Thomas 2009-02-26 03:30:21 +00:00
parent 493d2817bc
commit 4a389c96a0
10 changed files with 104 additions and 69 deletions

View File

@ -201,6 +201,7 @@ group {
description {
state: "default" 0.0;
color: 255 255 255 255;
rel1 {
to: "bg";
@ -219,7 +220,7 @@ group {
description {
state: "hidden" 0.0;
inherit: "default" 0.0;
visible: 0;
color: 255 255 255 0;
}
}
@ -249,7 +250,6 @@ group {
}
}
/* Needed later
part {
name: "progress_outline";
type: IMAGE;
@ -257,6 +257,7 @@ group {
description {
state: "default" 0.0;
color: 255 255 255 0;
rel1 {
to: "bg";
@ -265,9 +266,10 @@ group {
}
rel2 {
to: "bg";
relative: 0.5 1.0;
offset: -1 -10;
to_y: "bg";
to_x: "ecdb/burn_data/return";
relative: 0.0 1.0;
offset: -5 -10;
}
image {
@ -275,12 +277,19 @@ group {
border: 9 9 9 9;
}
}
description {
state: "visible" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
}
part {
name: "progress_text";
type: TEXT;
effect: SOFT_SHADOW;
clip_to: "progress_outline";
description {
state: "default" 0.0;
@ -320,6 +329,7 @@ group {
name: "progress_percent";
type: TEXT;
effect: SOFT_SHADOW;
clip_to: "progress_outline";
description {
state: "default" 0.0;
@ -348,7 +358,7 @@ group {
}
}
}
*/
part {
name: "disabled_hack";
type: RECT;
@ -424,6 +434,44 @@ group {
target: "disabled_hack";
}
program {
name: "burn_data_page,useless,hide";
signal: "ecdb,burn_data,start";
source: "ecdb";
action: STATE_SET "hidden" 0.0;
target: "ecdb/burn_data/filelist";
target: "ecdb/burn_data/capacity";
transition: DECELERATE 0.5;
}
program {
name: "burn_data_page,useful,show";
signal: "ecdb,burn_data,start";
source: "ecdb";
action: STATE_SET "visible" 0.0;
target: "progress_outline";
transition: DECELERATE 0.5;
}
program {
name: "burn_data_page,useful,hide";
signal: "ecdb,burn_data,reset";
source: "ecdb";
action: STATE_SET "default" 0.0;
target: "progress_outline";
transition: DECELERATE 0.5;
}
program {
name: "burn_data_page,useless,show";
signal: "ecdb,burn_data,reset";
source: "ecdb";
action: STATE_SET "default" 0.0;
target: "ecdb/burn_data/filelist";
target: "ecdb/burn_data/capacity";
transition: DECELERATE 0.5;
}
program {
name: "burn_data_page,controls_enable";
signal: "ecdb,burn_data,done";

View File

@ -5,7 +5,7 @@
int ECDB_DRIVE_ACTION_FINISHED = 0;
int ECDB_DRIVE_ACTION_BEGUN = 0;
int ECDB_DRIVE_ACTION_UPDATE = 0;
int ECDB_FILELIST_SIZE_CHANGED = 0;
unsigned int ECDB_FILELIST_SIZE_CHANGED = 0;
Ecdb_Main *em;
int ecdb_setup();

View File

@ -71,7 +71,7 @@ extern Ecdb_Main *em;
extern int ECDB_DRIVE_ACTION_FINISHED;
extern int ECDB_DRIVE_ACTION_BEGUN;
extern int ECDB_DRIVE_ACTION_UPDATE;
extern int ECDB_FILELIST_SIZE_CHANGED;
extern unsigned int ECDB_FILELIST_SIZE_CHANGED;
#include "ecdb_common.h"
#include "ecdb_projects.h"

View File

@ -276,7 +276,7 @@ ecdb_burn_finished(void *data, int type, void *event)
//ecdb_burn_audio_cleanup(proj->page);
break;
case ECDB_BURN_PROJECT:
case ECDB_DATA_PROJECT:
ecdb_burn_data_cleanup(proj->page);
break;
@ -295,10 +295,9 @@ ecdb_burn_finished(void *data, int type, void *event)
void
ecdb_sources_list_free(Eina_List *list)
{
Eina_List *l;
void *data;
EINA_LIST_FOREACH(list, l, data)
EINA_LIST_FREE(list, data)
burn_source_free(data);
list = eina_list_free(list);
@ -307,10 +306,9 @@ ecdb_sources_list_free(Eina_List *list)
void
ecdb_tracks_list_free(Eina_List *list)
{
Eina_List *l;
void *data;
EINA_LIST_FOREACH(list, l, data)
EINA_LIST_FREE(list, data)
burn_track_free(data);
list = eina_list_free(list);

View File

@ -59,9 +59,6 @@ _page_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *ev __UNUSED__)
proj = evas_object_data_get(obj, "proj");
if (proj)
ecdb_data_project_destroy(proj);
if (src)
ecdb_source_destroy(src);
}
static void
@ -598,8 +595,7 @@ ecdb_burn_data_page_show(Ecdb_Page *page)
evas_object_data_set(proj->capacity, "src", src);
evas_object_show(proj->capacity);
t = ecdb_config_inwin_add(bp->ret, NULL);
ecdb_config_inwin_follow_set(t, bp->drive_combo);
t = ecdb_config_inwin_add(page->data, NULL);
b = ecdb_check_add(t, NULL);
ecdb_check_label_set(b, "Use Joliet");

View File

@ -116,21 +116,22 @@ ecdb_print_drive_info(void)
em->drives = eina_list_nth_list(em->drives, 0);
EINA_LIST_FOREACH(em->drives, l, drive)
{
EINA_ERROR_PINFO("Vendor: %s, Product: %s, Revision: %s, "
/* Leave these as printfs, they shouldn't go the stderr */
printf("Vendor: %s, Product: %s, Revision: %s, "
"Location: %s\n",
drive->vendor, drive->product,
drive->revision, drive->location);
EINA_ERROR_PINFO("Profile name: %s, Loaded: %d\n",
printf("Profile name: %s, Loaded: %d\n",
drive->profile_name,
drive->profile_loaded);
EINA_ERROR_PINFO("Read DVDRAM: %d, Read DVDR: %d, Read DVDROM: %d, "
printf("Read DVDRAM: %d, Read DVDR: %d, Read DVDROM: %d, "
"Read CDR: %d, Read CDRW: %d\n",
drive->read_dvdram,
drive->read_dvdr,
drive->read_dvdrom,
drive->read_cdr,
drive->read_cdrw);
EINA_ERROR_PINFO("Write DVDRAM: %d, Write DVDR: %d, Write CDR: %d, "
printf("Write DVDRAM: %d, Write DVDR: %d, Write CDR: %d, "
"Write Simulate: %d\n",
drive->write_dvdram,
drive->write_dvdr,
@ -143,11 +144,11 @@ ecdb_print_drive_info(void)
{
if ((h = drive->write_speeds[i]))
{
EINA_ERROR_PINFO("Write: %d\n", h);
printf("Write: %d\n", h);
}
if ((h = drive->read_speeds[i]))
{
EINA_ERROR_PINFO("Read: %d\n", h);
printf("Read: %d\n", h);
}
}
}

View File

@ -48,8 +48,17 @@ ecdb_source_destroy(Ecdb_Source *src)
return;
/* free the non-recursive stuff */
if (src->dst) eina_stringshare_del(src->dst);
if (src->node) iso_node_unref(src->node);
if (src->dst)
{
eina_stringshare_del(src->dst);
src->dst = NULL;
}
/* Not sure what to do here. The nodes should already be dealt with
* in normal operation. Maybe have another function that specifically
* deals with this in error cases. Anyways, commented out for now
*/
//if (src->node) iso_node_unref(src->node);
if (src->children)
{
for (i = 0; src->children[i]; i++)
@ -84,14 +93,14 @@ ecdb_source_data_set(Ecdb_Source *src, const char *dst)
void
ecdb_source_add_directory_recursive(Ecdb_Source *parent)
{
Ecore_List *files;
Eina_List *files;
Ecdb_Source *child;
char path[PATH_MAX];
char *src;
files = ecore_file_ls(parent->dst);
while ((src = ecore_list_first_remove(files)))
EINA_LIST_FREE(files, src)
{
child = ecdb_source_new();
snprintf(path, PATH_MAX, "%s/%s", parent->dst, src);
@ -99,7 +108,7 @@ ecdb_source_add_directory_recursive(Ecdb_Source *parent)
ecdb_source_child_append(parent, child);
FREE(src);
}
ecore_list_destroy(files);
files = eina_list_free(files);
}
void
@ -116,6 +125,12 @@ ecdb_source_child_append(Ecdb_Source *src, Ecdb_Source *child)
orig = src->size;
src->num_children++;
/* This is really inefficient when adding directories with lots and lots
* of child files. Its good enough not to be a hugely critical thing,
* but before release I need to test against using a list, or before
* adding a directory count the list and malloc the entire size. Also
* need to worry about multi-file drag and drop.
*/
src->children = realloc(src->children, sizeof(Ecdb_Source) *
(src->num_children + 1));
src->children[src->num_children - 1] = child;

View File

@ -87,7 +87,11 @@ void
ecdb_burn_project_destroy(Ecdb_Burn_Project *proj)
{
EINA_ERROR_PINFO("burn\n");
if (proj->files) ecdb_source_destroy(proj->files);
if (proj->files)
{
ecdb_source_destroy(proj->files);
proj->files = NULL;
}
ecdb_project_destroy(ECDB_PROJECT(proj));
}

View File

@ -848,7 +848,7 @@ ecdb_combo_expand(Evas_Object *c)
ecore_evas_geometry_get(em->main_win_ee, NULL, NULL, &w, &h);
evas_object_resize(cd->back, w, h);
evas_object_pass_events_set(cd->back, 0);
evas_object_layer_set(cd->back, evas_object_layer_get(c) + 1);
evas_object_raise(cd->back);
edje_object_signal_emit(cd->back, "ecdb,combo,back,show", "ecdb");
location = _combo_best_location(c);
@ -889,7 +889,7 @@ ecdb_combo_expand(Evas_Object *c)
eina_iterator_free(it);
evas_object_resize(cd->popup, w, h2);
evas_object_pass_events_set(cd->popup, 0);
evas_object_layer_set(cd->popup, evas_object_layer_get(cd->back) + 1);
evas_object_raise(cd->popup);
edje_object_signal_emit(cd->popup, buf, "ecdb");
cd->expanded = 1;
@ -1080,7 +1080,6 @@ ecdb_label_text_set(Evas_Object *l, const char *text)
typedef struct _Config_Inwin_Data Config_Inwin_Data;
struct _Config_Inwin_Data
{
Evas_Object *follow; // For hide/resize functions
Evas_Object *parent; // Used to calculate the popup layers
Evas_Object *back;
Evas_Object *popup;
@ -1128,46 +1127,16 @@ _config_inwin_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
Config_Inwin_Data *iwd;
iwd = data;
if (!evas_object_event_callback_del(iwd->follow, EVAS_CALLBACK_HIDE,
if (!evas_object_event_callback_del(iwd->parent, EVAS_CALLBACK_HIDE,
_config_inwin_hide))
EINA_ERROR_PWARN("EVAS_CALLBACK_HIDE callback removal failure!\n");
if (!evas_object_event_callback_del(iwd->follow, EVAS_CALLBACK_RESIZE,
if (!evas_object_event_callback_del(iwd->parent, EVAS_CALLBACK_RESIZE,
_config_inwin_resize))
EINA_ERROR_PWARN("EVAS_CALLBACK_RESIZE callback removal failure!\n");
FREE(iwd);
}
/* We ideally would just follow the object supplied as the parent,
* but there were some problems with this and setting the popup and background
* layers. It would work intermittantly.
*/
void
ecdb_config_inwin_follow_set(Evas_Object *inwin, Evas_Object *follow)
{
Config_Inwin_Data *iwd;
if (!inwin )
{
EINA_ERROR_PWARN("NULL inwin!\n");
return;
}
if (!follow)
{
EINA_ERROR_PWARN("NULL follow!\n");
return;
}
iwd = evas_object_data_get(inwin, "iwd");
iwd->follow = follow;
evas_object_event_callback_add(follow, EVAS_CALLBACK_RESIZE,
_config_inwin_resize, iwd);
evas_object_event_callback_add(follow, EVAS_CALLBACK_HIDE,
_config_inwin_hide, iwd);
}
Evas_Object *
ecdb_config_inwin_add(Evas_Object *parent, const char *name)
{
@ -1203,6 +1172,12 @@ ecdb_config_inwin_add(Evas_Object *parent, const char *name)
evas_object_data_set(iwd->popup, "iwd", iwd);
iwd->visible = 0;
/* Add the callbacks used to contain this to the parent */
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE,
_config_inwin_resize, iwd);
evas_object_event_callback_add(parent, EVAS_CALLBACK_HIDE,
_config_inwin_hide, iwd);
return iwd->popup;
}
@ -1226,14 +1201,14 @@ ecdb_config_inwin_show(Evas_Object *inwin)
}
evas_object_pass_events_set(iwd->back, 0);
evas_object_layer_set(iwd->back, evas_object_layer_get(iwd->parent) + 1);
evas_object_raise(iwd->back);
edje_object_signal_emit(iwd->back, "ecdb,config_inwin,back,show", "ecdb");
evas_object_show(iwd->back);
evas_object_pass_events_set(iwd->popup, 0);
evas_object_layer_set(iwd->popup, evas_object_layer_get(iwd->back) + 1);
evas_object_raise(iwd->popup);
edje_object_signal_emit(iwd->popup, "ecdb,config_inwin,popup,show", "ecdb");
evas_object_show(iwd->popup);
iwd->visible = 1;
}

View File

@ -51,8 +51,6 @@ Evas_Object *ecdb_label_add(Evas_Object *parent, const char *name);
void ecdb_label_text_set(Evas_Object *l, const char *text);
Evas_Object *ecdb_config_inwin_add(Evas_Object *parent, const char *name);
void ecdb_config_inwin_follow_set(Evas_Object *inwin,
Evas_Object *follow);
void ecdb_config_inwin_show(Evas_Object *inwin);
void ecdb_config_inwin_hide(Evas_Object *inwin);
void ecdb_config_inwin_child_add(Evas_Object *inwin, Evas_Object *child,