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: Tue, 03 May 2005 21:31:20 -0400

Index: graveman/current/src/matos.c
diff -u graveman/current/src/matos.c:1.32 graveman/current/src/matos.c:1.33
--- graveman/current/src/matos.c:1.32   Tue May  3 01:22:35 2005
+++ graveman/current/src/matos.c        Wed May  4 01:31:06 2005
@@ -203,7 +203,9 @@
       Lstatus = FALSE;
     } else {
       sc_grave_set_data(Ag, &Liso, "iso"); /* image iso */
+
       Lstatus = burn_from_image("copy", Ag, Aerror);
+      Lstatus = burn_iso2dvd(Ag, Aerror);
       sc_grave_del_data(Ag, "iso");
     }
   } else if (!Lgraveur) {
@@ -418,21 +420,21 @@
 gboolean deltempdir(gchar *Ldirpath)
 {
   gchar *Lfullname;
-  DIR *Ldir;
-  struct dirent *Lunfic;
+  GDir *Ldir;
+  const gchar *Lunfic;
 
   if (!Ldirpath || !*Ldirpath) return TRUE;
 
-  Ldir = opendir(Ldirpath);
+  Ldir = g_dir_open(Ldirpath, 0, NULL);
   if (!Ldir) {
     g_warning("erreur lors de l'ouverture de [%s]: %s\n", Ldirpath, 
strerror(errno));
     return FALSE;
   }
 
-  while ((Lunfic = readdir(Ldir))) {
-    if (!strcmp(Lunfic->d_name, ".") || !strcmp(Lunfic->d_name, "..")) 
continue;
+  while ((Lunfic = g_dir_read_name(Ldir))) {
+    if (!strcmp(Lunfic, ".") || !strcmp(Lunfic, "..")) continue;
 
-    Lfullname = g_strdup_printf("%s/%s", Ldirpath, Lunfic->d_name);
+    Lfullname = g_strdup_printf("%s/%s", Ldirpath, Lunfic);
 
     if (g_file_test(Lfullname, G_FILE_TEST_IS_DIR)) {
       /* on vide le repertoire avant */
@@ -446,7 +448,7 @@
     g_free(Lfullname);
   }
 
-  closedir(Ldir);
+  g_dir_close(Ldir);
 
   _DEB("on efface => %s\n", Ldirpath);
   if (rmdir(Ldirpath)==-1) {
@@ -515,7 +517,7 @@
   if (Lgraveur) {
     if (Lsimul) Ltodo++; /* 1 pour la simulation */
 
-    Lstatus = burn_dvd(Ag, Aerror);
+    Lstatus = burn_data2dvd(Ag, Aerror);
   } else {
     Ltmp = _FILENAME(gtk_entry_get_text(Lgraveuriso));
     g_strlcpy(Liso, Ltmp, MAXPATHLEN-1);
@@ -542,21 +544,21 @@
 gchar* get_media_label(gint Atypecd, gchar *Abuf, gint Alen) {
   *Abuf = 0;
 
-  if (Atypecd & _MEDIA_TITLE_BLANKORAPPENDABLE) {
+  if ((Atypecd & _MEDIA_TITLE_BLANKORAPPENDABLE) == 
_MEDIA_TITLE_BLANKORAPPENDABLE) {
     g_snprintf(Abuf, Alen, _("an empty or appendable CDR/RW"));
-  } else if ((Atypecd & _MEDIA_DVDP_RW) || (Atypecd & _MEDIA_DVDM_RW)) {
+  } else if (((Atypecd & _MEDIA_DVDP_RW) == _MEDIA_DVDP_RW) || ((Atypecd & 
_MEDIA_DVDM_RW) == _MEDIA_DVDM_RW)) {
     g_snprintf(Abuf, Alen, _("a DVDRW"));
-  } else if (Atypecd & _MEDIA_TITLE_DVDRew) {
+  } else if ((Atypecd & _MEDIA_TITLE_DVDRew) == _MEDIA_TITLE_DVDRew) {
     g_snprintf(Abuf, Alen, _("an empty or appendable DVDR/RW"));
-  } else if ((Atypecd & _MEDIA_DVDR_P) || (Atypecd & _MEDIA_DVDR_M)) {
+  } else if (((Atypecd & _MEDIA_DVDR_P) == _MEDIA_DVDR_P) || ((Atypecd & 
_MEDIA_DVDR_M) == _MEDIA_DVDR_M)) {
     g_snprintf(Abuf, Alen, _("a DVDR"));
-  } else if (Atypecd & _MEDIA_DVD) {
+  } else if ((Atypecd & _MEDIA_DVD) == _MEDIA_DVD) {
     g_snprintf(Abuf, Alen, _("a DVD"));
-  } else if (Atypecd & _MEDIA_CDRW) {
+  } else if ((Atypecd & _MEDIA_CDRW) == _MEDIA_CDRW) {
     g_snprintf(Abuf, Alen, _("a CDRW"));
-  } else if (Atypecd & _MEDIA_CDR) {
+  } else if ((Atypecd & _MEDIA_CDR) == _MEDIA_CDR) {
     g_snprintf(Abuf, Alen, _("a CDR"));
-  } else if (Atypecd & _MEDIA_CD) {
+  } else if ((Atypecd & _MEDIA_CD) == _MEDIA_CD) {
     g_snprintf(Abuf, Alen, _("a CD"));
   } else if (Atypecd == _MEDIA_NONE) {
     g_snprintf(Abuf, Alen, _("no media"));
@@ -600,7 +602,7 @@
   GSList *Lrequis, *Lcur;
   Tdriveinfo *Ldrive = NULL;
   gint *Lmediatitle;
-  gint Lmedialu;
+  gint Lmedialu = _MEDIA_NONE;
   gint Lmediatest;
   gboolean Lstatusmedia = TRUE;
   gboolean *Linitdisp = (gboolean *) sc_grave_get_data(Lg, "initdisp");
@@ -610,7 +612,6 @@
   Lrequis = (GSList *) sc_grave_get_data(Lg, "devicerequis1");
   Ldetect = (gint *) sc_grave_get_data(Lg, "detect1");
   Lmediatitle = (gint *)sc_grave_get_data(Lg, "mediatitle1");
-  Lmedialu = 0;
 
   if (Linitdisp && *Linitdisp) {
     set_waitwindow_title(Lstatusmedia, *Lmediatitle, -1, Lg);
@@ -618,11 +619,16 @@
     gdk_flush ();
     *Linitdisp = FALSE;
   }
-    
+   
+ _DEB("le premier avant le dvd [%d]", Lmedialu); 
   Lmedialu += get_dvdinfo(Lg, Ldrive, NULL);
 
-  Lmedialu += get_cdinfo(Lg, Ldrive, NULL);
+ _DEB("le deuxieme avant le cd [%d]", Lmedialu); 
+  if (Lmedialu == _MEDIA_NONE) {
+    Lmedialu += get_cdinfo(Lg, Ldrive, NULL);
+  }
 
+ _DEB("[%d] la troisieme apres tout [%d]", Ldetect ? 1 : 0, Lmedialu); 
   if (Ldetect) *Ldetect = Lmedialu;
 
   for (Lcur = Lrequis; Lcur; Lcur = g_slist_next(Lcur)) {
@@ -736,6 +742,25 @@
   return Ldrive ? TRUE : FALSE;
 }
 
+/* creation ou ajout de la liste des medias requis */
+GSList *manage_mediarequis(GSList *Acurlist, ...)
+{
+  GSList *Lcurlist = Acurlist ? Acurlist : NULL;
+  va_list Llist;
+  gint Lt;
+
+  va_start(Llist, Acurlist);
+  while (1) {
+    Lt = va_arg(Llist, gint);
+    if (Lt == -1) break;
+
+  Lcurlist = g_slist_append(Lcurlist, GINT_TO_POINTER(Lt));
+  }
+  va_end(Llist);
+
+  return Lcurlist;
+}
+
 /*
  * vim:et:ts=8:sts=2:sw=2
  */




reply via email to

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