Imported Upstream version 0.72.3

This commit is contained in:
TANIGUCHI Takaki
2012-03-06 11:08:15 +09:00
parent 205701b3de
commit 30255c97b3
713 changed files with 13953 additions and 28840 deletions

View File

@@ -1,5 +1,5 @@
/* dvdisaster: Additional error correction for optical media.
* Copyright (C) 2004-2010 Carsten Gnoerlich.
* Copyright (C) 2004-2011 Carsten Gnoerlich.
* Project home page: http://www.dvdisaster.com
* Email: carsten@dvdisaster.com -or- cgnoerlich@fsfe.org
*
@@ -192,6 +192,36 @@ static void register_reader(read_closure *rc)
}
}
/*
* If ecc file exists and automatic ecc creation is enabled,
* ask user if we may remove the existing one.
*/
static void confirm_ecc_file_deletion(read_closure *rc)
{
if(Closure->readAndCreate && !rc->scanMode)
{ gint64 ignore;
if(LargeStat(Closure->eccName, &ignore))
{ if(Closure->guiMode)
{ int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Automatic error correction file creation is enabled,\n"
"and \"%s\" already exists.\n"
"Overwrite it?\n"),
Closure->eccName);
if(!answer)
{ SwitchAndSetFootline(Closure->readLinearNotebook, 1, Closure->readLinearFootline,
_("<span %s>Aborted by user request!</span>"),
Closure->redMarkup);
rc->unreportedError = FALSE;
cleanup((gpointer)rc);
}
}
}
}
}
/*
* See if we have ecc data which belongs to the medium
*/
@@ -340,7 +370,9 @@ reopen_image:
if(!Closure->guiMode)
Stop(_("Image file does not match the CD/DVD."));
else
{ int answer = ConfirmImageDeletion(Closure->imageName);
{ int answer = ModalDialog(GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, NULL,
_("Image file already exists and does not match the CD/DVD.\n"
"The existing image file will be deleted."));
if(!answer)
{ rc->unreportedError = FALSE;
@@ -797,6 +829,11 @@ void ReadMediumLinear(gpointer data)
register_reader(rc);
/* If ecc file exists and automatic ecc creation is enabled,
ask user if we may remove the existing one. */
confirm_ecc_file_deletion(rc);
/*** Timer setup */
rc->speedTimer = g_timer_new();
@@ -1302,19 +1339,19 @@ step_counter:
else if( rc->readOK == rc->sectors /* no user limited range */
&& rc->pass == 1 /* md5sum invalid after first pass */
&& memcmp(rc->ei->eh->mediumSum, Closure->md5Cache, 16))
t = g_strdup_printf(_("All sectors successfully read, but wrong image checksum."));
else t = g_strdup_printf(_("All sectors successfully read. Checksums match."));
t = g_strdup(_("All sectors successfully read, but wrong image checksum."));
else t = g_strdup(_("All sectors successfully read. Checksums match."));
break;
case ECC_RS02:
if(!md5_failure)
t = g_strdup_printf(_("All sectors successfully read. Checksums match."));
t = g_strdup(_("All sectors successfully read. Checksums match."));
else
{ t = g_strdup_printf(_("All sectors successfully read, %s!"), md5_failure);
g_free(md5_failure); md5_failure=NULL;
}
break;
default:
t = g_strdup_printf(_("All sectors successfully read."));
t = g_strdup(_("All sectors successfully read."));
break;
}
}