/[graveman]/graveman/current/src/matos.c
ViewVC logotype

Diff of /graveman/current/src/matos.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by scresto, Tue Mar 22 00:27:13 2005 UTC revision 1.24 by scresto, Sun Mar 27 23:51:07 2005 UTC
# Line 557  void set_waitwindow_title(gboolean Ainse Line 557  void set_waitwindow_title(gboolean Ainse
557    gchar Ltitle[_BUF_SIZE];    gchar Ltitle[_BUF_SIZE];
558    gchar *Ldrivelib = sc_grave_get_datav(Awaitg, "devicetitle%d", Anum);    gchar *Ldrivelib = sc_grave_get_datav(Awaitg, "devicetitle%d", Anum);
559    GtkLabel *Llabel = GTK_LABEL(sc_grave_get_widgetv(Awaitg, "label%d", Anum));    GtkLabel *Llabel = GTK_LABEL(sc_grave_get_widgetv(Awaitg, "label%d", Anum));
560    printf("la man ?\n");
561    *Ltitle=0;    *Ltitle=0;
562    *Lcd = 0;    *Lcd = 0;
563    if (Atypecd & _MEDIA_BLANKORAPPENDABLE) {    if (Atypecd & _MEDIA_BLANKORAPPENDABLE) {
# Line 582  void set_waitwindow_title(gboolean Ainse Line 582  void set_waitwindow_title(gboolean Ainse
582      g_snprintf(Lcd, sizeof(Lcd)-1, _("a DVD"));      g_snprintf(Lcd, sizeof(Lcd)-1, _("a DVD"));
583    }    }
584    
585    printf("la man 2?\n");
586    printf("cd [%s]\n", Lcd);
587    printf("drv [%s]\n", Ldrivelib);
588    if (Ainsert) {    if (Ainsert) {
589      g_snprintf(Ltitle, sizeof(Ltitle)-1, _("Please insert %s in drive %s to continue..."), Lcd, Ldrivelib);      g_snprintf(Ltitle, sizeof(Ltitle)-1, _("Please insert %s in drive %s to continue..."), Lcd, Ldrivelib);
590    } else {    } else {
591      g_snprintf(Ltitle, sizeof(Ltitle)-1, _("Ok there is %s in drive %s."), Lcd, Ldrivelib);      g_snprintf(Ltitle, sizeof(Ltitle)-1, _("Ok there is %s in drive %s."), Lcd, Ldrivelib);
592    }    }
593    printf("ca chie?\n");
594    gtk_label_set_text(Llabel, Ltitle);    gtk_label_set_text(Llabel, Ltitle);
595  }  }
596    
# Line 598  gboolean callback_waiting_for_user(gpoin Line 602  gboolean callback_waiting_for_user(gpoin
602    gint *Lcont = (gint *)sc_grave_get_data(Lg, "cont");    gint *Lcont = (gint *)sc_grave_get_data(Lg, "cont");
603    gint *Ldetect = NULL;    gint *Ldetect = NULL;
604    gchar *Ldrive;    gchar *Ldrive;
605    gint *Lrequis;    GSList *Lrequis, *Lcur;
606      gint *Ltitle;
607    gint Lmedialu;    gint Lmedialu;
608    gboolean Lstatusmedia = FALSE;    gint Lmediatest;
609      gboolean Lstatusmedia = TRUE;
610    gint i;    gint i;
   gboolean LnewCont = FALSE;  
611    gboolean *Linitdisp = (gboolean *) sc_grave_get_data(Lg, "initdisp");    gboolean *Linitdisp = (gboolean *) sc_grave_get_data(Lg, "initdisp");
612        
613    for (i=1; 1; i++) {    for (i=1; 1; i++) {
614      Ldrive = sc_grave_get_datav(Lg, "device%d", i);      Ldrive = sc_grave_get_datav(Lg, "device%d", i);
615      if (!Ldrive) break;      if (!Ldrive) break;
616                
617      Lrequis = (gint *) sc_grave_get_datav(Lg, "devicerequis%d", i);      Lrequis = (GSList *) sc_grave_get_datav(Lg, "devicerequis%d", i);
618      Ldetect = (gint *) sc_grave_get_datav(Lg, "detect%d", i);      Ldetect = (gint *) sc_grave_get_datav(Lg, "detect%d", i);
619        Ltitle = (gint *)sc_grave_get_datav(Lg, "devicetitle%d", i);
620      Lmedialu = 0;      Lmedialu = 0;
621    
622      if (Linitdisp && *Linitdisp) {      if (Linitdisp && *Linitdisp) {
623        set_waitwindow_title(Lstatusmedia, *Lrequis, i, Lg);        set_waitwindow_title(Lstatusmedia, *Ltitle, i, Lg);
624        gtk_widget_show(GTK_WIDGET(sc_grave_get_data(Lg, "window")));        gtk_widget_show(GTK_WIDGET(sc_grave_get_data(Lg, "window")));
625        gdk_flush ();        gdk_flush ();
626        *Linitdisp = FALSE;        *Linitdisp = FALSE;
627      }      }
628            
629     printf("la DVD ?!\n");     printf("la DVD ?!\n");
630      if (*Lrequis & _MEDIA_IS_DVD) {  /*    if (*Lrequis & _MEDIA_IS_DVD) {*/
631        Lmedialu += get_dvdinfo(Ldrive, NULL);        Lmedialu += get_dvdinfo(Lg, Ldrive, NULL);
632      }  /*    }*/
633    
634     printf("la CD ?!\n");     printf("la CD ?!\n");
635      if (*Lrequis & _MEDIA_IS_CD) {  /*    if (*Lrequis & _MEDIA_IS_CD) {*/
636        Lmedialu += get_cdinfo(Ldrive, NULL);        Lmedialu += get_cdinfo(Lg, Ldrive, NULL);
637      }  /*    }*/
638    
639      if (Ldetect) *Ldetect = Lmedialu;      if (Ldetect) *Ldetect = Lmedialu;
640      Lstatusmedia = (!(_MEDIA_CMP_CD(*Lrequis, Lmedialu) || _MEDIA_CMP_DVD(*Lrequis, Lmedialu))) ||  /*    Lstatusmedia = (!(_MEDIA_CMP_CD(*Lrequis, Lmedialu) || _MEDIA_CMP_DVD(*Lrequis, Lmedialu))) ||
641                      ((*Lrequis & _MEDIA_BLANKORAPPENDABLE) &&                      ((*Lrequis & _MEDIA_BLANKORAPPENDABLE) &&
642                          ((!(Lmedialu  & _MEDIA_BLANK)) && (!(Lmedialu & _MEDIA_APPENDABLE)))) ||                          ((!(Lmedialu  & _MEDIA_BLANK)) && (!(Lmedialu & _MEDIA_APPENDABLE)))) ||
643                       ((*Lrequis & _MEDIA_BLANK) && (Lmedialu & _MEDIA_NOBLANK)) ||                       ((*Lrequis & _MEDIA_BLANK) && (Lmedialu & _MEDIA_NOBLANK)) ||
644                       ((*Lrequis & _MEDIA_NOBLANK) && (Lmedialu & _MEDIA_BLANK)) ||                       ((*Lrequis & _MEDIA_NOBLANK) && (Lmedialu & _MEDIA_BLANK)) ||
645                       ((*Lrequis & _MEDIA_APPENDABLE) && (!(Lmedialu & _MEDIA_APPENDABLE)));                       ((*Lrequis & _MEDIA_APPENDABLE) && (!(Lmedialu & _MEDIA_APPENDABLE)));
646      if (Lstatusmedia) LnewCont = TRUE;      if (Lstatusmedia) LnewCont = TRUE;*/
647        printf("on a LU [%d]\n", Lmedialu);
648      set_waitwindow_title(Lstatusmedia, *Lrequis, i, Lg);      for (Lcur = Lrequis; Lcur; Lcur = g_slist_next(Lcur)) {
649          Lmediatest = (int ) Lcur->data;
650    printf("et on TEST [%d]\n", Lmediatest);
651    printf("resu du test [%d]\n", (Lmediatest & Lmedialu));
652          if ((Lmediatest & Lmedialu) == Lmediatest) {
653            *Lcont  = 0;
654            Lstatusmedia = FALSE;
655            break;
656          }
657        }
658        set_waitwindow_title(Lstatusmedia, *Ltitle, i, Lg);
659      gdk_flush ();      gdk_flush ();
660    
661        if (Lstatusmedia == FALSE) break;
662    }    }
663    
   if (LnewCont == FALSE) *Lcont = 0;  
       
664    return TRUE;    return TRUE;
665  }  }
666    
667  /* attente que l'utilisateur ai bien entre un cd */  /* attente que l'utilisateur ai bien insere un cd */
668  gboolean waiting_for_user(gchar *Atitle, Tgrave *Ag, gint Atypecd1, gint *Adetectcd1, gchar *Ldriveident1)  gboolean waiting_for_user(gint Atitle, Tgrave *Ag, GSList *Arequiscd1, gint *Adetectcd1, gchar *Ldriveident1)
669  {  {
670    Tgrave *Lwaitg = sc_grave_load("window_waiting_cd.glade");    Tgrave *Lwaitg = sc_grave_load("window_waiting_cd.glade");
671    GtkWidget *Lparent = sc_grave_get_widget(Ag, "topwindow");    GtkWidget *Lparent = sc_grave_get_widget(Ag, "topwindow");
# Line 657  gboolean waiting_for_user(gchar *Atitle, Line 673  gboolean waiting_for_user(gchar *Atitle,
673    gchar *Lident1 = NULL, *Ldevicetitle1 = NULL;    gchar *Lident1 = NULL, *Ldevicetitle1 = NULL;
674    gchar *Lident2 = NULL, *Ldevicetitle2 = NULL;    gchar *Lident2 = NULL, *Ldevicetitle2 = NULL;
675    gint Lcont = 2;    gint Lcont = 2;
676      gint Lpid = 0;
677    gboolean Labort = FALSE;    gboolean Labort = FALSE;
678    gboolean Linit = TRUE;    gboolean Linit = TRUE;
679    guint Ltimeout = 0;    guint Ltimeout = 0;
680    GtkTreeIter Liter;    GtkTreeIter Liter;
681    
682      if (Atitle == _MEDIA_NONE) return TRUE;
683        
684    g_assert(Lwaitg);    g_assert(Lwaitg);
685        
# Line 670  gboolean waiting_for_user(gchar *Atitle, Line 689  gboolean waiting_for_user(gchar *Atitle,
689    sc_grave_set_data(Lwaitg, Lwindow, "window");    sc_grave_set_data(Lwaitg, Lwindow, "window");
690    sc_grave_set_data(Lwaitg, &Lcont, "cont");    sc_grave_set_data(Lwaitg, &Lcont, "cont");
691    sc_grave_set_data(Lwaitg, &Labort, "gabort");    sc_grave_set_data(Lwaitg, &Labort, "gabort");
692      sc_grave_set_data(Lwaitg, &Lpid, "pid");
693        
694    if (Ldriveident1 && *Ldriveident1 && Atypecd1 != _MEDIA_NONE) {    if (Ldriveident1 && *Ldriveident1) {
695      GtkComboBox *Lcombob1 = GTK_COMBO_BOX(sc_grave_get_widget(Ag, Ldriveident1));      GtkComboBox *Lcombob1 = GTK_COMBO_BOX(sc_grave_get_widget(Ag, Ldriveident1));
696      GtkTreeModel *Lmodelb1 = gtk_combo_box_get_model(Lcombob1);      GtkTreeModel *Lmodelb1 = gtk_combo_box_get_model(Lcombob1);
697      if (gtk_combo_box_get_active_iter(Lcombob1, &Liter)) {      if (gtk_combo_box_get_active_iter(Lcombob1, &Liter)) {
# Line 679  gboolean waiting_for_user(gchar *Atitle, Line 699  gboolean waiting_for_user(gchar *Atitle,
699    
700        sc_grave_set_data(Lwaitg, Lident1, "device1");        sc_grave_set_data(Lwaitg, Lident1, "device1");
701        sc_grave_set_data(Lwaitg, Adetectcd1, "detect1");        sc_grave_set_data(Lwaitg, Adetectcd1, "detect1");
702        sc_grave_set_data(Lwaitg, Ldevicetitle1, "devicetitle1");        sc_grave_set_data(Lwaitg, &Atitle, "devicetitle1");
703        sc_grave_set_data(Lwaitg, &Atypecd1, "devicerequis1");        sc_grave_set_data(Lwaitg, Arequiscd1, "devicerequis1");
704    
705        set_waitwindow_title(TRUE, Atypecd1, 1, Lwaitg);        set_waitwindow_title(TRUE, Atitle, 1, Lwaitg);
706      }      }
707    }    }
708    
# Line 715  printf("la !!!! !\n"); Line 735  printf("la !!!! !\n");
735    g_free(Ldevicetitle1); g_free(Ldevicetitle2);    g_free(Ldevicetitle1); g_free(Ldevicetitle2);
736    
737    sc_grave_destroy(Lwaitg);    sc_grave_destroy(Lwaitg);
738    printf("lcont => %d %d\n", Lcont, Labort);
739    
740    return (Lcont == 0 && Labort == FALSE);    return (Lcont == 0 && Labort == FALSE);
741  }  }

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26