Use the speed and drive chosen when burning, and add a speed convert function.

This commit is contained in:
Jaime Thomas 2008-12-21 04:37:50 +00:00
parent 4119206824
commit 031fe03541
4 changed files with 31 additions and 14 deletions

View File

@ -39,6 +39,14 @@ _button_cb_begin(void *data, Evas_Object *obj, void *event_info)
o = evas_object_name_find(evas_object_evas_get(obj), "ecdb/erase/drive");
drive = ecdb_combo_selected_get(o);
if (drive < 0)
{
printf("Choose a drive!\n");
ecdb_erase_project_destroy(proj);
edje_object_part_text_set(swallow, "progress_text", "Choose a Drive!");
return;
}
if (!ecdb_aquire_drive(ECDB_PROJECT(proj), drive))
{
printf("Couldn't grab drive!\n");

View File

@ -563,27 +563,14 @@ ecdb_gui_combo_header_from_speeds(Evas_Object *c, const char *name, void *data,
Evas_Object *ret;
Ecdb_Drive_Info *drive;
char buf[1024];
int i, num_speeds, count;
drive = data;
if (!drive)
return NULL;
num_speeds = drive->write_speeds[0];
count = 1;
sel++;
for (i = 1; i < num_speeds; i++)
{
if ((drive->write_speeds[i]) <= 0)
continue;
if (count == sel)
break;
count++;
}
ret = ecdb_label_add(c, name);
snprintf(buf, sizeof(buf), "%d", drive->write_speeds[count]);
snprintf(buf, sizeof(buf), "%d", ecdb_speed_convert(drive, sel));
ecdb_label_text_set(ret, buf);
evas_object_show(ret);

View File

@ -262,3 +262,24 @@ ecdb_dnd_entry_dnd_set(Evas_Object *o, Ecore_X_Selection_Data_Files *files)
ecdb_entry_text_set(o, uri->path);
efreet_uri_free(uri);
}
int
ecdb_speed_convert(Ecdb_Drive_Info *drive, int sel)
{
int count, num_speeds, i;
count = 1;
sel++;
num_speeds = drive->write_speeds[0];
for (i = 0; i < num_speeds; i++)
{
if (drive->write_speeds[i] <= 0)
continue;
if (count == sel)
return drive->write_speeds[count];
count++;
}
return -1;
}

View File

@ -17,6 +17,7 @@ int ecdb_image_init(void);
int ecdb_match_keyword(const char *chk, const char *key, int len);
char *ecdb_strip_next_argument(const char *strip);
char *ecdb_strip_string(const char *strip);
int ecdb_speed_convert(Ecdb_Drive_Info *drive, int sel);
// Also consider moving dnd stuff into its own file
int ecdb_dnd_position(void *data, int type, void *event);