Show the X writing speed, and sort the speeds returned.

This commit is contained in:
Jaime Thomas
2008-12-23 02:26:24 +00:00
parent b15ff43eb7
commit b919f4c125
3 changed files with 54 additions and 7 deletions

View File

@@ -129,7 +129,7 @@ _combo_cb_clicked(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *c1, *c2, *b;
Ecdb_Drive_Info *drive;
int sel, i, num_speeds;
int sel, i, num_speeds, speed;
char buf[1024];
c2 = data;
@@ -148,7 +148,22 @@ _combo_cb_clicked(void *data, Evas_Object *obj, void *event_info)
continue;
b = ecdb_button_add(c2, NULL);
snprintf(buf, sizeof(buf), "%d", drive->write_speeds[i]);
if ((drive->profile_name) && (drive->profile_name[0] != '\0'))
{
if (drive->profile_name[0] == 'C')
speed = drive->write_speeds[i] / 150;
else if (drive->profile_name[0] == 'D')
speed = drive->write_speeds[i] / 1352;
else
speed = drive->write_speeds[i] / 4500;
}
else
{
speed = 0;
}
snprintf(buf, sizeof(buf), "%dX (%dkb/s)", speed, drive->write_speeds[i]);
ecdb_button_label_set(b, buf);
ecdb_combo_append(c2, b);
evas_object_show(b);