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: Mon, 28 Mar 2005 19:10:27 -0500

Index: graveman/current/src/callbacks.c
diff -u graveman/current/src/callbacks.c:1.32 
graveman/current/src/callbacks.c:1.33
--- graveman/current/src/callbacks.c:1.32       Sun Mar 27 23:51:07 2005
+++ graveman/current/src/callbacks.c    Tue Mar 29 00:10:26 2005
@@ -802,11 +802,10 @@
   if (g_str_has_suffix(Lname, "combo")==FALSE) return;
         
   if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(Acombo), &Liter)) return;
-  gtk_tree_model_get(Lmodel, &Liter, 0, &Llecteur, 3, &Lident, -1);
 
-  Ldrive = (Tdriveinfo *) g_slist_nth_data(Glistdrives, Lident);
+  gtk_tree_model_get(Lmodel, &Liter, 0, &Ldrive, 3, &Lident, -1);
 
-  Lisimgiso = !strcmp(Llecteur, "iso"); 
+  Lisimgiso = !Ldrive;
 
   Lspeedname = g_strdup(Lname);
   _SWAP_COMBO(Lspeedname, "speed");
@@ -817,7 +816,6 @@
   Lpanel = (GtkWidget *)sc_grave_get_widget(Lg, Laskname);
   g_free(Laskname);
 
-  
   /* on cache ou montre la zone de saisie du nom de l'image iso */
   if (GTK_IS_WIDGET(Lpanel)) {
 
@@ -833,9 +831,8 @@
       gtk_widget_set_sensitive(Lvitesse, Lisimgiso ? FALSE : TRUE);
     }
   } 
-
   if (!Lisimgiso && GTK_IS_WIDGET(Lvitesse)) {
-    remplire_combo_vitesse(GTK_COMBO_BOX(Lvitesse), Llecteur, 
conf_get_string(Lspeedname)); 
+    remplire_combo_vitesse(GTK_COMBO_BOX(Lvitesse), Ldrive, 
conf_get_string(Lspeedname)); 
   }
 
   for (i=0; ((Lobj = sc_grave_get_datav(Lg, "%s_isotodisabled%d", Lname, i)) 
&& GTK_IS_WIDGET(Lobj)); i++) {
@@ -906,7 +903,7 @@
   GSList *Llmediarequis = g_slist_append(NULL, GINT_TO_POINTER(_MEDIA_CDR + 
_MEDIA_NOBLANK + _MEDIA_APPENDABLE));
   gboolean Lstatus;
   
-  Lstatus = waiting_for_user(_MEDIA_BLANKORAPPENDABLE, Lg, Llmediarequis, 
NULL, "dstothercombo");
+  Lstatus = waiting_for_user(_MEDIA_BLANKORAPPENDABLE, Lg, Llmediarequis, 
NULL, get_drive_info(Lg, "dstothercombo"));
   g_slist_free(Llmediarequis);
   
   if (Lstatus==FALSE) return;
@@ -985,7 +982,7 @@
   GSList *Llmediarequis = g_slist_append(NULL, GINT_TO_POINTER(_MEDIA_CDRW + 
_MEDIA_NOBLANK));
   gboolean Lstatus;
 printf("tout debut !\n");
-  Lstatus = waiting_for_user(_MEDIA_BLANKORAPPENDABLE, Lg, Llmediarequis, 
NULL, "dstothercombo");
+  Lstatus = waiting_for_user(_MEDIA_BLANKORAPPENDABLE, Lg, Llmediarequis, 
NULL, get_drive_info(Lg, "dstothercombo"));
 printf("aprew awit !\n");
   g_slist_free(Llmediarequis);
   
@@ -1023,18 +1020,16 @@
   gchar *Ltxt = NULL;
   gchar *Ltitle = NULL;
   GtkWidget *Lwindow1 = GTK_WIDGET(sc_grave_get_widget(Lg, "topwindow"));
-  GtkWidget *Ldevice1 = NULL, *Ldevice2 = NULL;
   GSList *Llmediarequis1 = NULL;
   GSList *Llmediarequis2 = NULL;
   gint Lmediatitle1 = _MEDIA_NONE, Lmediatitle2 = _MEDIA_NONE;
   gint Lmediadetect1 = _MEDIA_NONE, Lmediadetect2 = _MEDIA_NONE;
-  gchar Ldevicename1[_BUF_SIZE], Ldevicename2[_BUF_SIZE];
+ // gchar Ldevicename1[_BUF_SIZE], Ldevicename2[_BUF_SIZE];
+  Tdriveinfo *Ldevicename1 = NULL, *Ldevicename2 = NULL;
   gboolean Lwritercdrw;
   gboolean Liso = FALSE;
   Ttypeoperation Loperation = WRITE_CD;
 
-  *Ldevicename1 = *Ldevicename2 = 0;
-
   Lname = gtk_widget_get_name(Abtn);
 
   if (!Lname) return;
@@ -1056,7 +1051,7 @@
     }
     Ltxt = _("Do you really want to create an audio cd ?");
     Ltitle = _("Writing audio cd in progress...");
-    g_strlcpy(Ldevicename1, "dstaudiocombo", sizeof(Ldevicename1)-1);
+    Ldevicename1 = get_drive_info(Lg, "dstaudiocombo");
     Llmediarequis1 = g_slist_append(Llmediarequis1, GINT_TO_POINTER(_MEDIA_CDR 
+ _MEDIA_BLANK));
     Llmediarequis1 = g_slist_append(Llmediarequis1, GINT_TO_POINTER(_MEDIA_CDR 
+ _MEDIA_APPENDABLE));
     Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_CDRW + _MEDIA_BLANK));
@@ -1068,7 +1063,7 @@
     GtkTreeModel *Ltreemodel = 
gtk_tree_view_get_model(GTK_TREE_VIEW(sc_grave_get_data(Lg, "_current_list")));
     /* gravure cd de donnee, on verifie qu'il y ai au
      * moins un fichier/repertoire dans la liste */
-
+printf("oui on passe la !\n");
     if (g_str_has_prefix(Lname, "btnburndvddata")) {
       Loperation = WRITE_DVD;
     }
@@ -1086,13 +1081,13 @@
     }
 
     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")))) {
+      Ldevicename1 = get_drive_info(Lg, "dstdatacombo");
+      Liso = !Ldevicename1;
+      if (Liso) {
+        Ltxt = _("Do you really want to create an iso image ?");
+      } else 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 ?");
       }
@@ -1108,27 +1103,39 @@
         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);
-      Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_DVDR + _MEDIA_BLANK));
-      Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_DVDR + _MEDIA_APPENDABLE));
-      Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_DVDPRW));
-      Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_DVDMRW));
-      Lmediatitle1 = _MEDIA_DVDRew;
+printf("la man ! DVDDVDVDVDVD\n");
+      Ldevicename1 = get_drive_info(Lg, "dstdvddatacombo");
+      Liso = !Ldevicename1;
+      if (!Liso) {
+        Ltxt = _("Do you really want to create a data dvd ?");
+        Ltitle = _("Writing data dvd in progress...");
+        Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_DVDR + _MEDIA_BLANK));
+        Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_DVDR + _MEDIA_APPENDABLE));
+        Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_DVDPRW));
+        Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_DVDMRW));
+        Lmediatitle1 = _MEDIA_DVDRew;
+      } else {
+  printf("ok trankil\n");
+        /* creation image iso */
+        Loperation = WRITE_CD;
+        Ltxt = _("Do you really want to create an iso image ?");
+      }
     }
   } else {
     /* copie de cd */
+
+printf("copie ?!\n");
     Ltxt = _("Do you really want to start the copy ?");
     Ltitle = _("Copying in progress...");
-    g_strlcpy(Ldevicename1, "srccopycombo", sizeof(Ldevicename1)-1);
-    if (!is_an_iso(Lg, Ldevicename1)) {
+    Ldevicename1 = get_drive_info(Lg, "srccopycombo");
+    Liso = !Ldevicename1;
+    if (!Liso) {
       Llmediarequis1 = g_slist_append(Llmediarequis1, 
GINT_TO_POINTER(_MEDIA_CD + _MEDIA_NOBLANK));
       Lmediatitle1 = _MEDIA_CD;
     }
-    g_strlcpy(Ldevicename2, "dstcopycombo", sizeof(Ldevicename2)-1);
-printf("devname2 == > %s\n", Ldevicename2);    
-    if (!is_an_iso(Lg, Ldevicename2)) {
+    Ldevicename2 = get_drive_info(Lg, "dstcopycombo");
+
+    if (Ldevicename2) {
       Llmediarequis2 = g_slist_append(Llmediarequis2, 
GINT_TO_POINTER(_MEDIA_CDR + _MEDIA_BLANK));
       Llmediarequis2 = g_slist_append(Llmediarequis2, 
GINT_TO_POINTER(_MEDIA_CDR + _MEDIA_APPENDABLE));
       Llmediarequis2 = g_slist_append(Llmediarequis2, 
GINT_TO_POINTER(_MEDIA_CDRW + _MEDIA_BLANK));
@@ -1138,11 +1145,11 @@
     }
   }
 
-  if (g_slist_length(Llmediarequis1)) Ldevice1 = sc_grave_get_widget(Lg, 
Ldevicename1);
-  if (g_slist_length(Llmediarequis2)) Ldevice2 = sc_grave_get_widget(Lg, 
Ldevicename2);
+/*  if (g_slist_length(Llmediarequis1)) Ldevice1 = sc_grave_get_widget(Lg, 
Ldevicename1);
+  if (g_slist_length(Llmediarequis2)) Ldevice2 = sc_grave_get_widget(Lg, 
Ldevicename2);*/
  
   /* attente que l'utilisateur ai bien insere un cd */
-printf("attente 1\n");  
+printf("attente 1 mediatitle1 [%d]\n", Lmediatitle1);  
   if (waiting_for_user(Lmediatitle1, Lg, Llmediarequis1, &Lmediadetect1, 
Ldevicename1)==FALSE) return;
 printf("attente 2\n");  
   if (waiting_for_user(Lmediatitle2, Lg, Llmediarequis2, &Lmediadetect2, 
Ldevicename2)==FALSE) return;
@@ -1150,15 +1157,16 @@
 
   /* 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 = Ldevice1 && 
DRIVE_CDRW_WRITER(get_drive_cmb(GTK_COMBO_BOX(Ldevice1))) ? TRUE : FALSE;
+    /* on affiche l'option "effacer le CDRW que lorsque c'est un graveur qui 
le permet */    
+    Lwritercdrw = Ldevicename1 && DRIVE_CDRW_WRITER(Ldevicename1) ? TRUE : 
FALSE;
+printf("ici ca chie !?\n");    
     Ldialoghash = create_dialog_confirm_operation(Lwindow1, Ltxt,
-       Loperation != WRITE_CD_MULTI && Lwritercdrw == TRUE &&
+       Lwritercdrw == TRUE &&
         ((Lmediadetect1 & _MEDIA_CDRW) && (Lmediadetect1 & _MEDIA_NOBLANK)) ?
         _("Blank CD-RW before writing") : NULL, conf_get_boolean("autoblank"));
   } else {
     /* confirmation gravure dvd */
+printf("oui !\n");    
     Ldialoghash = create_dialog_select_dvdoperation(Lwindow1, Lmediadetect1);
   }
   Lconfirm = sc_grave_get_data(Ldialoghash, "window");
@@ -1172,12 +1180,16 @@
 
       g_assert(GTK_IS_WIDGET(Labcheck));
       if (Lwritercdrw == TRUE) {
+printf("ici ca chie2 !?\n");    
         Luseautoblank = 
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Labcheck));
+printf("ici ca chie3 !?\n");    
       }
       sc_grave_set_data(Lg, &Luseautoblank, "useautoblank");
     } else {
       GtkRadioButton *Labradio = 
GTK_RADIO_BUTTON(sc_grave_get_widget(Ldialoghash, "burninitial"));
+printf("ici ca chie4 !?\n");    
       Ltypeburn = 
g_strdup(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Labradio)) ? "-Z" : 
"-M");
+printf("ici ca chie5 !?\n");    
       sc_grave_set_data(Lg, Ltypeburn, "typeburn");
     }
 




reply via email to

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