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/callbacks.c


From: sylvain cresto
Subject: [Graveman-cvs] Changes to graveman/current/src/callbacks.c
Date: Thu, 03 Mar 2005 20:16:39 -0500

Index: graveman/current/src/callbacks.c
diff -u graveman/current/src/callbacks.c:1.29 
graveman/current/src/callbacks.c:1.30
--- graveman/current/src/callbacks.c:1.29       Thu Mar  3 00:35:47 2005
+++ graveman/current/src/callbacks.c    Fri Mar  4 01:16:38 2005
@@ -51,7 +51,6 @@
 
 #ifdef ENABLE_MP3
   if (GsupportMp3 && sc_str_has_casesuffix(Anom, MP3)) {
-printf("MP3\n");
     Lstatus = getMp3Info(Anom, &LTitle, &LAlbum, &LArtist, &Llennbr, NULL);
   } else
 #endif    
@@ -1013,10 +1012,16 @@
   gchar *Ltxt = NULL;
   gchar *Ltitle = NULL;
   GtkWidget *Lwindow1 = GTK_WIDGET(sc_grave_get_widget(Lg, "topwindow"));
-  GtkWidget *Ldevice;
+  GtkWidget *Ldevice1 = NULL, *Ldevice2 = NULL;
+  gint Lmediarequis1 = _MEDIA_NONE, Lmediarequis2 = _MEDIA_NONE;
+  gint Lmediadetect1 = _MEDIA_NONE, Lmediadetect2 = _MEDIA_NONE;
+  gchar Ldevicename1[_BUF_SIZE], Ldevicename2[_BUF_SIZE];
   gboolean Lwritercdrw;
+  gboolean Liso = FALSE;
   Ttypeoperation Loperation = WRITE_CD;
 
+  *Ldevicename1 = *Ldevicename2 = 0;
+
   Lname = gtk_widget_get_name(Abtn);
 
   if (!Lname) return;
@@ -1038,7 +1043,8 @@
     }
     Ltxt = _("Do you really want to create an audio cd ?");
     Ltitle = _("Writing audio cd in progress...");
-    Ldevice = sc_grave_get_widget(Lg, "dstaudiocombo");
+    g_strlcpy(Ldevicename1, "dstaudiocombo", sizeof(Ldevicename1)-1);
+    Lmediarequis1 = _MEDIA_CDR + _MEDIA_APPENDABLE;
   } else if (g_str_has_prefix(Lname, "btnburndata") || g_str_has_prefix(Lname, 
"btnburndvddata")) {
     GtkTreeIter Liter;
     GtkTreeModel *Ltreemodel = 
gtk_tree_view_get_model(GTK_TREE_VIEW(sc_grave_get_data(Lg, "_current_list")));
@@ -1062,37 +1068,57 @@
     }
 
     if (Loperation == WRITE_CD) {
+      g_strlcpy(Ldevicename1, "dstdatacombo", sizeof(Ldevicename1)-1);
+      Liso = is_an_iso(Lg, Ldevicename1);
       if 
(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sc_grave_get_widget(Lg, 
"datamulti")))) {
         Loperation = WRITE_CD_MULTI;
         Ltxt = _("Do you really want to start or continue a multi session data 
cd ?");
+      } else if (Liso) {
+        Ltxt = _("Do you really want to create an iso image ?");
       } else {
         Ltxt = _("Do you really want to create a data cd ?");
       }
-      Ltitle = _("Writing data cd in progress...");
-      Ldevice = sc_grave_get_widget(Lg, "dstdatacombo");
+      if (!Liso) {
+        Ltitle = _("Writing data cd in progress...");
+        Lmediarequis1 = _MEDIA_CDR + _MEDIA_APPENDABLE;
+      } else {
+        Ltitle = _("Writing iso image in progress...");
+      }
     } else {
       Ltxt = _("Do you really want to create a data dvd ?");
       Ltitle = _("Writing data dvd in progress...");
+      g_strlcpy(Ldevicename1, "dstdvddatacombo", sizeof(Ldevicename1)-1);
+      Lmediarequis1 = _MEDIA_DVDRew;
     }
   } else {
     /* copie de cd */
     Ltxt = _("Do you really want to start the copy ?");
     Ltitle = _("Copying in progress...");
-    Ldevice = sc_grave_get_widget(Lg, "dstcopycombo");
+    g_strlcpy(Ldevicename1, "srccopycombo", sizeof(Ldevicename1)-1);
+    if (!is_an_iso(Lg, Ldevicename1)) Lmediarequis1 = _MEDIA_CD + 
_MEDIA_NOBLANK;
+    g_strlcpy(Ldevicename2, "dstcopycombo", sizeof(Ldevicename2)-1);
+    if (!is_an_iso(Lg, Ldevicename2)) Lmediarequis2 = _MEDIA_CDR + 
_MEDIA_APPENDABLE;
   }
+
+  if (Lmediarequis1 != _MEDIA_NONE) Ldevice1 = sc_grave_get_widget(Lg, 
Ldevicename1);
+  if (Lmediarequis2 != _MEDIA_NONE) Ldevice2 = sc_grave_get_widget(Lg, 
Ldevicename2);
  
-  /* confirmation debut de l'operation */ 
+  /* attente que l'utilisateur ai bien insere un cd */
+  if (waiting_for_user(Lg, Lmediarequis1, &Lmediadetect1, Ldevicename1,
+                           Lmediarequis2, &Lmediadetect2, 
Ldevicename2)==FALSE) return;
 
+  /* confirmation debut de l'operation */ 
   if (Loperation != WRITE_DVD) {
     /* on affiche l'option "effacer le CDRW que lorsque c'est un graveur qui 
le permet et que l'on
      * ne continue pas un cd multi session .. */
-    Lwritercdrw = DRIVE_CDRW_WRITER(get_drive_cmb(GTK_COMBO_BOX(Ldevice))) ? 
TRUE : FALSE;
+    Lwritercdrw = Ldevice1 && 
DRIVE_CDRW_WRITER(get_drive_cmb(GTK_COMBO_BOX(Ldevice1))) ? TRUE : FALSE;
     Ldialoghash = create_dialog_confirm_operation(Lwindow1, Ltxt,
-       Loperation != WRITE_CD_MULTI && Lwritercdrw == TRUE ?
+       Loperation != WRITE_CD_MULTI && Lwritercdrw == TRUE &&
+        ((Lmediadetect1 & _MEDIA_CDRW) && (Lmediadetect1 & _MEDIA_NOBLANK)) ?
         _("Blank CD-RW before writing") : NULL, conf_get_boolean("autoblank"));
   } else {
     /* confirmation gravure dvd */
-    Ldialoghash = create_dialog_select_dvdoperation(Lwindow1);
+    Ldialoghash = create_dialog_select_dvdoperation(Lwindow1, Lmediadetect1);
   }
   Lconfirm = sc_grave_get_data(Ldialoghash, "window");
 




reply via email to

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