| 203 |
Lstatus = FALSE; |
Lstatus = FALSE; |
| 204 |
} else { |
} else { |
| 205 |
sc_grave_set_data(Ag, &Liso, "iso"); /* image iso */ |
sc_grave_set_data(Ag, &Liso, "iso"); /* image iso */ |
| 206 |
|
|
| 207 |
Lstatus = burn_from_image("copy", Ag, Aerror); |
Lstatus = burn_from_image("copy", Ag, Aerror); |
| 208 |
|
Lstatus = burn_iso2dvd(Ag, Aerror); |
| 209 |
sc_grave_del_data(Ag, "iso"); |
sc_grave_del_data(Ag, "iso"); |
| 210 |
} |
} |
| 211 |
} else if (!Lgraveur) { |
} else if (!Lgraveur) { |
| 420 |
gboolean deltempdir(gchar *Ldirpath) |
gboolean deltempdir(gchar *Ldirpath) |
| 421 |
{ |
{ |
| 422 |
gchar *Lfullname; |
gchar *Lfullname; |
| 423 |
DIR *Ldir; |
GDir *Ldir; |
| 424 |
struct dirent *Lunfic; |
const gchar *Lunfic; |
| 425 |
|
|
| 426 |
if (!Ldirpath || !*Ldirpath) return TRUE; |
if (!Ldirpath || !*Ldirpath) return TRUE; |
| 427 |
|
|
| 428 |
Ldir = opendir(Ldirpath); |
Ldir = g_dir_open(Ldirpath, 0, NULL); |
| 429 |
if (!Ldir) { |
if (!Ldir) { |
| 430 |
g_warning("erreur lors de l'ouverture de [%s]: %s\n", Ldirpath, strerror(errno)); |
g_warning("erreur lors de l'ouverture de [%s]: %s\n", Ldirpath, strerror(errno)); |
| 431 |
return FALSE; |
return FALSE; |
| 432 |
} |
} |
| 433 |
|
|
| 434 |
while ((Lunfic = readdir(Ldir))) { |
while ((Lunfic = g_dir_read_name(Ldir))) { |
| 435 |
if (!strcmp(Lunfic->d_name, ".") || !strcmp(Lunfic->d_name, "..")) continue; |
if (!strcmp(Lunfic, ".") || !strcmp(Lunfic, "..")) continue; |
| 436 |
|
|
| 437 |
Lfullname = g_strdup_printf("%s/%s", Ldirpath, Lunfic->d_name); |
Lfullname = g_strdup_printf("%s/%s", Ldirpath, Lunfic); |
| 438 |
|
|
| 439 |
if (g_file_test(Lfullname, G_FILE_TEST_IS_DIR)) { |
if (g_file_test(Lfullname, G_FILE_TEST_IS_DIR)) { |
| 440 |
/* on vide le repertoire avant */ |
/* on vide le repertoire avant */ |
| 448 |
g_free(Lfullname); |
g_free(Lfullname); |
| 449 |
} |
} |
| 450 |
|
|
| 451 |
closedir(Ldir); |
g_dir_close(Ldir); |
| 452 |
|
|
| 453 |
_DEB("on efface => %s\n", Ldirpath); |
_DEB("on efface => %s\n", Ldirpath); |
| 454 |
if (rmdir(Ldirpath)==-1) { |
if (rmdir(Ldirpath)==-1) { |
| 517 |
if (Lgraveur) { |
if (Lgraveur) { |
| 518 |
if (Lsimul) Ltodo++; /* 1 pour la simulation */ |
if (Lsimul) Ltodo++; /* 1 pour la simulation */ |
| 519 |
|
|
| 520 |
Lstatus = burn_dvd(Ag, Aerror); |
Lstatus = burn_data2dvd(Ag, Aerror); |
| 521 |
} else { |
} else { |
| 522 |
Ltmp = _FILENAME(gtk_entry_get_text(Lgraveuriso)); |
Ltmp = _FILENAME(gtk_entry_get_text(Lgraveuriso)); |
| 523 |
g_strlcpy(Liso, Ltmp, MAXPATHLEN-1); |
g_strlcpy(Liso, Ltmp, MAXPATHLEN-1); |
| 544 |
gchar* get_media_label(gint Atypecd, gchar *Abuf, gint Alen) { |
gchar* get_media_label(gint Atypecd, gchar *Abuf, gint Alen) { |
| 545 |
*Abuf = 0; |
*Abuf = 0; |
| 546 |
|
|
| 547 |
if (Atypecd & _MEDIA_TITLE_BLANKORAPPENDABLE) { |
if ((Atypecd & _MEDIA_TITLE_BLANKORAPPENDABLE) == _MEDIA_TITLE_BLANKORAPPENDABLE) { |
| 548 |
g_snprintf(Abuf, Alen, _("an empty or appendable CDR/RW")); |
g_snprintf(Abuf, Alen, _("an empty or appendable CDR/RW")); |
| 549 |
} 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)) { |
| 550 |
g_snprintf(Abuf, Alen, _("a DVDRW")); |
g_snprintf(Abuf, Alen, _("a DVDRW")); |
| 551 |
} else if (Atypecd & _MEDIA_TITLE_DVDRew) { |
} else if ((Atypecd & _MEDIA_TITLE_DVDRew) == _MEDIA_TITLE_DVDRew) { |
| 552 |
g_snprintf(Abuf, Alen, _("an empty or appendable DVDR/RW")); |
g_snprintf(Abuf, Alen, _("an empty or appendable DVDR/RW")); |
| 553 |
} 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)) { |
| 554 |
g_snprintf(Abuf, Alen, _("a DVDR")); |
g_snprintf(Abuf, Alen, _("a DVDR")); |
| 555 |
} else if (Atypecd & _MEDIA_DVD) { |
} else if ((Atypecd & _MEDIA_DVD) == _MEDIA_DVD) { |
| 556 |
g_snprintf(Abuf, Alen, _("a DVD")); |
g_snprintf(Abuf, Alen, _("a DVD")); |
| 557 |
} else if (Atypecd & _MEDIA_CDRW) { |
} else if ((Atypecd & _MEDIA_CDRW) == _MEDIA_CDRW) { |
| 558 |
g_snprintf(Abuf, Alen, _("a CDRW")); |
g_snprintf(Abuf, Alen, _("a CDRW")); |
| 559 |
} else if (Atypecd & _MEDIA_CDR) { |
} else if ((Atypecd & _MEDIA_CDR) == _MEDIA_CDR) { |
| 560 |
g_snprintf(Abuf, Alen, _("a CDR")); |
g_snprintf(Abuf, Alen, _("a CDR")); |
| 561 |
} else if (Atypecd & _MEDIA_CD) { |
} else if ((Atypecd & _MEDIA_CD) == _MEDIA_CD) { |
| 562 |
g_snprintf(Abuf, Alen, _("a CD")); |
g_snprintf(Abuf, Alen, _("a CD")); |
| 563 |
} else if (Atypecd == _MEDIA_NONE) { |
} else if (Atypecd == _MEDIA_NONE) { |
| 564 |
g_snprintf(Abuf, Alen, _("no media")); |
g_snprintf(Abuf, Alen, _("no media")); |
| 602 |
GSList *Lrequis, *Lcur; |
GSList *Lrequis, *Lcur; |
| 603 |
Tdriveinfo *Ldrive = NULL; |
Tdriveinfo *Ldrive = NULL; |
| 604 |
gint *Lmediatitle; |
gint *Lmediatitle; |
| 605 |
gint Lmedialu; |
gint Lmedialu = _MEDIA_NONE; |
| 606 |
gint Lmediatest; |
gint Lmediatest; |
| 607 |
gboolean Lstatusmedia = TRUE; |
gboolean Lstatusmedia = TRUE; |
| 608 |
gboolean *Linitdisp = (gboolean *) sc_grave_get_data(Lg, "initdisp"); |
gboolean *Linitdisp = (gboolean *) sc_grave_get_data(Lg, "initdisp"); |
| 612 |
Lrequis = (GSList *) sc_grave_get_data(Lg, "devicerequis1"); |
Lrequis = (GSList *) sc_grave_get_data(Lg, "devicerequis1"); |
| 613 |
Ldetect = (gint *) sc_grave_get_data(Lg, "detect1"); |
Ldetect = (gint *) sc_grave_get_data(Lg, "detect1"); |
| 614 |
Lmediatitle = (gint *)sc_grave_get_data(Lg, "mediatitle1"); |
Lmediatitle = (gint *)sc_grave_get_data(Lg, "mediatitle1"); |
|
Lmedialu = 0; |
|
| 615 |
|
|
| 616 |
if (Linitdisp && *Linitdisp) { |
if (Linitdisp && *Linitdisp) { |
| 617 |
set_waitwindow_title(Lstatusmedia, *Lmediatitle, -1, Lg); |
set_waitwindow_title(Lstatusmedia, *Lmediatitle, -1, Lg); |
| 619 |
gdk_flush (); |
gdk_flush (); |
| 620 |
*Linitdisp = FALSE; |
*Linitdisp = FALSE; |
| 621 |
} |
} |
| 622 |
|
|
| 623 |
|
_DEB("le premier avant le dvd [%d]", Lmedialu); |
| 624 |
Lmedialu += get_dvdinfo(Lg, Ldrive, NULL); |
Lmedialu += get_dvdinfo(Lg, Ldrive, NULL); |
| 625 |
|
|
| 626 |
Lmedialu += get_cdinfo(Lg, Ldrive, NULL); |
_DEB("le deuxieme avant le cd [%d]", Lmedialu); |
| 627 |
|
if (Lmedialu == _MEDIA_NONE) { |
| 628 |
|
Lmedialu += get_cdinfo(Lg, Ldrive, NULL); |
| 629 |
|
} |
| 630 |
|
|
| 631 |
|
_DEB("[%d] la troisieme apres tout [%d]", Ldetect ? 1 : 0, Lmedialu); |
| 632 |
if (Ldetect) *Ldetect = Lmedialu; |
if (Ldetect) *Ldetect = Lmedialu; |
| 633 |
|
|
| 634 |
for (Lcur = Lrequis; Lcur; Lcur = g_slist_next(Lcur)) { |
for (Lcur = Lrequis; Lcur; Lcur = g_slist_next(Lcur)) { |
| 742 |
return Ldrive ? TRUE : FALSE; |
return Ldrive ? TRUE : FALSE; |
| 743 |
} |
} |
| 744 |
|
|
| 745 |
|
/* creation ou ajout de la liste des medias requis */ |
| 746 |
|
GSList *manage_mediarequis(GSList *Acurlist, ...) |
| 747 |
|
{ |
| 748 |
|
GSList *Lcurlist = Acurlist ? Acurlist : NULL; |
| 749 |
|
va_list Llist; |
| 750 |
|
gint Lt; |
| 751 |
|
|
| 752 |
|
va_start(Llist, Acurlist); |
| 753 |
|
while (1) { |
| 754 |
|
Lt = va_arg(Llist, gint); |
| 755 |
|
if (Lt == -1) break; |
| 756 |
|
|
| 757 |
|
Lcurlist = g_slist_append(Lcurlist, GINT_TO_POINTER(Lt)); |
| 758 |
|
} |
| 759 |
|
va_end(Llist); |
| 760 |
|
|
| 761 |
|
return Lcurlist; |
| 762 |
|
} |
| 763 |
|
|
| 764 |
/* |
/* |
| 765 |
* vim:et:ts=8:sts=2:sw=2 |
* vim:et:ts=8:sts=2:sw=2 |
| 766 |
*/ |
*/ |