556 |
{ |
{ |
557 |
Tgrave *Lg = (Tgrave *)Adata; |
Tgrave *Lg = (Tgrave *)Adata; |
558 |
gint *Lcont = (gint *)sc_grave_get_data(Lg, "cont"); |
gint *Lcont = (gint *)sc_grave_get_data(Lg, "cont"); |
559 |
|
gchar *Ldrive; |
560 |
|
gint *Lrequis; |
561 |
|
gint Lmedia; |
562 |
|
gint i; |
563 |
|
|
564 |
|
for (i=1; 1; i++) { |
565 |
|
Ldrive = sc_grave_get_datav(Lg, "device%d", i); |
566 |
|
if (!Ldrive) break; |
567 |
|
|
568 |
|
Lrequis = (gint *) sc_grave_get_datav(Lg, "devicesrequis%d", i); |
569 |
|
|
570 |
|
if (*Lrequis | _MEDIA_IS_CD) { |
571 |
|
printf("oui on interroge le lecteur dvd\n"); |
572 |
|
Lmedia = get_dvdinfo(Ldrive, NULL); |
573 |
|
printf("===%d\n", Lmedia); |
574 |
|
|
575 |
|
} |
576 |
|
|
577 |
|
if (*Lrequis | _MEDIA_IS_DVD) { |
578 |
|
printf("oui on interroge le lecteur cd\n"); |
579 |
|
Lmedia = get_cdinfo(Ldrive, NULL); |
580 |
|
printf("===%d\n", Lmedia); |
581 |
|
} |
582 |
|
|
583 |
|
} |
584 |
|
|
585 |
return TRUE; |
return TRUE; |
586 |
} |
} |
587 |
|
|
588 |
gboolean waiting_for_user(Tgrave *Ag, gint Atypecd, gchar *Ldriveident1, gint Ld1requis, gchar *Ldriveident2, gint Ld2requis) |
gboolean waiting_for_user(Tgrave *Ag, gint Atypecd1, gchar *Ldriveident1, gint Atypecd2, gchar *Ldriveident2) |
589 |
{ |
{ |
590 |
Tgrave *Lwaitg = sc_grave_load("window_waiting_cd.glade"); |
Tgrave *Lwaitg = sc_grave_load("window_waiting_cd.glade"); |
591 |
GtkWidget *Lparent = sc_grave_get_widget(Lwaitg, "topwindow"); |
GtkWidget *Lparent = sc_grave_get_widget(Ag, "topwindow"); |
592 |
GtkWidget *Lwindow; |
GtkWidget *Lwindow; |
593 |
|
gchar *Lident; |
594 |
gboolean Lcont = TRUE; |
gboolean Lcont = TRUE; |
595 |
guint Ltimeout; |
guint Ltimeout; |
596 |
|
printf("toto deb\n"); |
597 |
g_assert(Lwaitg); |
g_assert(Lwaitg); |
598 |
|
|
599 |
Lwindow = GTK_WIDGET(sc_grave_get_widget(Lwaitg, "window_waiting_cd")); |
Lwindow = GTK_WIDGET(sc_grave_get_widget(Lwaitg, "window_waiting_cd")); |
600 |
|
|
601 |
sc_grave_set_data(Lwaitg, Lwindow, "window"); |
sc_grave_set_data(Lwaitg, Lwindow, "window"); |
602 |
sc_grave_set_data(Lwaitg, &Lcont, "cont"); |
sc_grave_set_data(Lwaitg, &Lcont, "cont"); |
603 |
|
|
604 |
if (Ldriveident1) { |
if (Ldriveident1) { |
605 |
sc_grave_set_data(Lwaitg, Ldriveident1, "device1"); |
Lident = get_combo_value(sc_grave_get_widget(Ag, Ldriveident1)); |
606 |
sc_grave_set_data(Lwaitg, &Ld1requis, "devicesrequis1"); |
sc_grave_set_data(Lwaitg, Lident, "device1"); |
607 |
|
sc_grave_set_data(Lwaitg, &Atypecd1, "devicesrequis1"); |
608 |
} |
} |
609 |
if (Ldriveident2) { |
if (Ldriveident2) { |
610 |
sc_grave_set_data(Lwaitg, Ldriveident2, "device2"); |
Lident = get_combo_value(sc_grave_get_widget(Ag, Ldriveident2)); |
611 |
sc_grave_set_data(Lwaitg, &Ld2requis, "devicesrequis2"); |
sc_grave_set_data(Lwaitg, Lident, "device2"); |
612 |
|
sc_grave_set_data(Lwaitg, &Atypecd2, "devicesrequis2"); |
613 |
} |
} |
614 |
|
printf("yopla = 1\n"); |
615 |
gtk_window_set_transient_for(GTK_WINDOW(Lwindow), GTK_WINDOW(Lparent)); |
gtk_window_set_transient_for(GTK_WINDOW(Lwindow), GTK_WINDOW(Lparent)); |
616 |
|
|
617 |
|
printf("yopla = 2\n"); |
618 |
gtk_widget_show(Lwindow); |
gtk_widget_show(Lwindow); |
619 |
|
|
620 |
|
printf("yopla = 3\n"); |
621 |
Ltimeout = g_timeout_add(1500, callback_waiting_for_user, Lwaitg); |
Ltimeout = g_timeout_add(1500, callback_waiting_for_user, Lwaitg); |
622 |
while (Lcont == TRUE) { |
while (Lcont == TRUE) { |
623 |
gtk_main_iteration(); |
gtk_main_iteration(); |