Imported Upstream version 0.79.2

This commit is contained in:
Rogério Brito
2010-11-06 20:36:40 -02:00
parent 294f8623c4
commit 555c0daf7d
855 changed files with 28909 additions and 12770 deletions

View File

@@ -1,5 +1,5 @@
/* dvdisaster: Additional error correction for optical media.
* Copyright (C) 2004-2009 Carsten Gnoerlich.
* Copyright (C) 2004-2010 Carsten Gnoerlich.
* Project home page: http://www.dvdisaster.com
* Email: carsten@dvdisaster.com -or- cgnoerlich@fsfe.org
*
@@ -39,19 +39,6 @@ static gboolean delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
*** The right-side action buttons
***/
static void remove_the_00s(char *filename)
{ char *dot = strrchr(filename, '.');
if(dot)
{ int pos = dot-filename;
if(pos>2 && filename[pos-2] == '0'
&& filename[pos-1] == '0')
memmove(filename+pos-2, filename+pos,
strlen(filename)-pos+1);
}
}
/*
* Callback for the action buttons
*/
@@ -67,7 +54,7 @@ static void action_cb(GtkWidget *widget, gpointer data)
if(action != ACTION_CREATE_CONT)
{ g_mutex_lock(Closure->logLock);
g_string_truncate(Closure->logString, 0);
g_string_printf(Closure->logString, _("dvdisaster-%s log\n"),VERSION);
g_string_printf(Closure->logString, _("dvdisaster-%s log\n"), Closure->cookedVersion);
g_mutex_unlock(Closure->logLock);
Closure->logFileStamped = FALSE;
}
@@ -91,11 +78,29 @@ static void action_cb(GtkWidget *widget, gpointer data)
gtk_entry_set_text(GTK_ENTRY(Closure->eccEntry), Closure->eccName);
}
/* Transform foo00.[iso|ecc] into foo.[iso|ecc] when in filesplit mode */
/* The ecc file may not be labeled as an .iso image */
if(Closure->splitFiles)
{ remove_the_00s(Closure->imageName);
remove_the_00s(Closure->eccName);
if(Closure->eccName)
{ int len = strlen(Closure->eccName);
if(!strcmp(Closure->eccName, Closure->imageName))
{ CreateMessage(_("The .iso image and error correction file\n"
"must not be the same file!\n\n"
"If you intended to create or use an .iso image\n"
"which is augmented with error correction data,\n"
"please leave the error correction file name blank."),
GTK_MESSAGE_ERROR);
return;
}
if(!strcmp(Closure->eccName+len-4, ".iso"))
{ CreateMessage(_("The error correction file type must not be \".iso\".\n\n"
"If you intended to create or use an .iso image\n"
"which is augmented with error correction data,\n"
"please leave the error correction file name blank."),
GTK_MESSAGE_ERROR);
return;
}
}
/* Reset warnings which may be temporarily disabled during an action */
@@ -150,7 +155,7 @@ static void action_cb(GtkWidget *widget, gpointer data)
case ACTION_FIX:
ClearCrcCache();
if(!(method = EccFileMethod(TRUE)))
if(!(method = EccMethod(TRUE)))
break;
gtk_notebook_set_current_page(GTK_NOTEBOOK(Closure->notebook), method->tabWindowIndex+1);
@@ -172,7 +177,7 @@ static void action_cb(GtkWidget *widget, gpointer data)
/* If something is wrong with the .iso or .ecc files
we fall back to the RS01 method for verifying since it is robust
against missing files. */
if(!(method = EccFileMethod(FALSE)))
if(!(method = EccMethod(FALSE)))
if(!(method = FindMethod("RS01")))
break;