graveman-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Graveman-cvs] Changes to graveman/current/src/matos.c


From: sylvain cresto
Subject: [Graveman-cvs] Changes to graveman/current/src/matos.c
Date: Sun, 27 Mar 2005 18:51:30 -0500

Index: graveman/current/src/matos.c
diff -u graveman/current/src/matos.c:1.23 graveman/current/src/matos.c:1.24
--- graveman/current/src/matos.c:1.23   Tue Mar 22 00:27:13 2005
+++ graveman/current/src/matos.c        Sun Mar 27 23:51:07 2005
@@ -557,7 +557,7 @@
   gchar Ltitle[_BUF_SIZE];
   gchar *Ldrivelib = sc_grave_get_datav(Awaitg, "devicetitle%d", Anum);
   GtkLabel *Llabel = GTK_LABEL(sc_grave_get_widgetv(Awaitg, "label%d", Anum));
-
+printf("la man ?\n");
   *Ltitle=0;
   *Lcd = 0;
   if (Atypecd & _MEDIA_BLANKORAPPENDABLE) {
@@ -582,11 +582,15 @@
     g_snprintf(Lcd, sizeof(Lcd)-1, _("a DVD"));
   }
 
+printf("la man 2?\n");
+printf("cd [%s]\n", Lcd);
+printf("drv [%s]\n", Ldrivelib);
   if (Ainsert) {
     g_snprintf(Ltitle, sizeof(Ltitle)-1, _("Please insert %s in drive %s to 
continue..."), Lcd, Ldrivelib);
   } else {
     g_snprintf(Ltitle, sizeof(Ltitle)-1, _("Ok there is %s in drive %s."), 
Lcd, Ldrivelib);
   }
+printf("ca chie?\n");
   gtk_label_set_text(Llabel, Ltitle);
 }
 
@@ -598,58 +602,70 @@
   gint *Lcont = (gint *)sc_grave_get_data(Lg, "cont");
   gint *Ldetect = NULL;
   gchar *Ldrive;
-  gint *Lrequis;
+  GSList *Lrequis, *Lcur;
+  gint *Ltitle;
   gint Lmedialu;
-  gboolean Lstatusmedia = FALSE;
+  gint Lmediatest;
+  gboolean Lstatusmedia = TRUE;
   gint i;
-  gboolean LnewCont = FALSE;
   gboolean *Linitdisp = (gboolean *) sc_grave_get_data(Lg, "initdisp");
   
   for (i=1; 1; i++) {
     Ldrive = sc_grave_get_datav(Lg, "device%d", i);
     if (!Ldrive) break;
       
-    Lrequis = (gint *) sc_grave_get_datav(Lg, "devicerequis%d", i);
+    Lrequis = (GSList *) sc_grave_get_datav(Lg, "devicerequis%d", i);
     Ldetect = (gint *) sc_grave_get_datav(Lg, "detect%d", i);
+    Ltitle = (gint *)sc_grave_get_datav(Lg, "devicetitle%d", i);
     Lmedialu = 0;
 
     if (Linitdisp && *Linitdisp) {
-      set_waitwindow_title(Lstatusmedia, *Lrequis, i, Lg);
+      set_waitwindow_title(Lstatusmedia, *Ltitle, i, Lg);
       gtk_widget_show(GTK_WIDGET(sc_grave_get_data(Lg, "window")));
       gdk_flush ();
       *Linitdisp = FALSE;
     }
     
    printf("la DVD ?!\n"); 
-    if (*Lrequis & _MEDIA_IS_DVD) {
-      Lmedialu += get_dvdinfo(Ldrive, NULL);
-    }
+/*    if (*Lrequis & _MEDIA_IS_DVD) {*/
+      Lmedialu += get_dvdinfo(Lg, Ldrive, NULL);
+/*    }*/
 
    printf("la CD ?!\n"); 
-    if (*Lrequis & _MEDIA_IS_CD) {
-      Lmedialu += get_cdinfo(Ldrive, NULL);
-    }
+/*    if (*Lrequis & _MEDIA_IS_CD) {*/
+      Lmedialu += get_cdinfo(Lg, Ldrive, NULL);
+/*    }*/
 
     if (Ldetect) *Ldetect = Lmedialu;
-    Lstatusmedia = (!(_MEDIA_CMP_CD(*Lrequis, Lmedialu) || 
_MEDIA_CMP_DVD(*Lrequis, Lmedialu))) ||
+/*    Lstatusmedia = (!(_MEDIA_CMP_CD(*Lrequis, Lmedialu) || 
_MEDIA_CMP_DVD(*Lrequis, Lmedialu))) ||
                     ((*Lrequis & _MEDIA_BLANKORAPPENDABLE) &&
                         ((!(Lmedialu  & _MEDIA_BLANK)) && (!(Lmedialu & 
_MEDIA_APPENDABLE)))) ||
                      ((*Lrequis & _MEDIA_BLANK) && (Lmedialu & 
_MEDIA_NOBLANK)) ||
                      ((*Lrequis & _MEDIA_NOBLANK) && (Lmedialu & 
_MEDIA_BLANK)) ||
                      ((*Lrequis & _MEDIA_APPENDABLE) && (!(Lmedialu & 
_MEDIA_APPENDABLE)));
-    if (Lstatusmedia) LnewCont = TRUE;
-    
-    set_waitwindow_title(Lstatusmedia, *Lrequis, i, Lg);
+    if (Lstatusmedia) LnewCont = TRUE;*/
+printf("on a LU [%d]\n", Lmedialu);
+    for (Lcur = Lrequis; Lcur; Lcur = g_slist_next(Lcur)) {
+      Lmediatest = (int ) Lcur->data;
+printf("et on TEST [%d]\n", Lmediatest);
+printf("resu du test [%d]\n", (Lmediatest & Lmedialu));
+      if ((Lmediatest & Lmedialu) == Lmediatest) {
+        *Lcont  = 0;
+        Lstatusmedia = FALSE;
+        break;
+      }
+    }
+    set_waitwindow_title(Lstatusmedia, *Ltitle, i, Lg);
     gdk_flush ();
+
+    if (Lstatusmedia == FALSE) break;
   }
 
-  if (LnewCont == FALSE) *Lcont = 0;
-    
   return TRUE;
 }
 
-/* attente que l'utilisateur ai bien entre un cd */
-gboolean waiting_for_user(gchar *Atitle, Tgrave *Ag, gint Atypecd1, gint 
*Adetectcd1, gchar *Ldriveident1)
+/* attente que l'utilisateur ai bien insere un cd */
+gboolean waiting_for_user(gint Atitle, Tgrave *Ag, GSList *Arequiscd1, gint 
*Adetectcd1, gchar *Ldriveident1)
 {
   Tgrave *Lwaitg = sc_grave_load("window_waiting_cd.glade");
   GtkWidget *Lparent = sc_grave_get_widget(Ag, "topwindow");
@@ -657,10 +673,13 @@
   gchar *Lident1 = NULL, *Ldevicetitle1 = NULL;
   gchar *Lident2 = NULL, *Ldevicetitle2 = NULL;
   gint Lcont = 2;
+  gint Lpid = 0;
   gboolean Labort = FALSE;
   gboolean Linit = TRUE;
   guint Ltimeout = 0;
   GtkTreeIter Liter;
+
+  if (Atitle == _MEDIA_NONE) return TRUE;
   
   g_assert(Lwaitg);
   
@@ -670,8 +689,9 @@
   sc_grave_set_data(Lwaitg, Lwindow, "window");
   sc_grave_set_data(Lwaitg, &Lcont, "cont");
   sc_grave_set_data(Lwaitg, &Labort, "gabort");
+  sc_grave_set_data(Lwaitg, &Lpid, "pid");
   
-  if (Ldriveident1 && *Ldriveident1 && Atypecd1 != _MEDIA_NONE) {
+  if (Ldriveident1 && *Ldriveident1) {
     GtkComboBox *Lcombob1 = GTK_COMBO_BOX(sc_grave_get_widget(Ag, 
Ldriveident1));
     GtkTreeModel *Lmodelb1 = gtk_combo_box_get_model(Lcombob1);
     if (gtk_combo_box_get_active_iter(Lcombob1, &Liter)) {
@@ -679,10 +699,10 @@
 
       sc_grave_set_data(Lwaitg, Lident1, "device1");
       sc_grave_set_data(Lwaitg, Adetectcd1, "detect1");
-      sc_grave_set_data(Lwaitg, Ldevicetitle1, "devicetitle1");
-      sc_grave_set_data(Lwaitg, &Atypecd1, "devicerequis1");
+      sc_grave_set_data(Lwaitg, &Atitle, "devicetitle1");
+      sc_grave_set_data(Lwaitg, Arequiscd1, "devicerequis1");
 
-      set_waitwindow_title(TRUE, Atypecd1, 1, Lwaitg);
+      set_waitwindow_title(TRUE, Atitle, 1, Lwaitg);
     }
   }
 
@@ -715,6 +735,7 @@
   g_free(Ldevicetitle1); g_free(Ldevicetitle2);
 
   sc_grave_destroy(Lwaitg);
+printf("lcont => %d %d\n", Lcont, Labort);
 
   return (Lcont == 0 && Labort == FALSE);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]