Imported Upstream version 0.79.2

This commit is contained in:
Rogério Brito
2010-11-06 20:36:40 -02:00
committed by TANIGUCHI Takaki
parent c3da7b4a44
commit bfe15b23fb
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
*
@@ -94,11 +94,7 @@ typedef struct _prefs_context
/* Widgets for changing preferences settings. The are two copies (A and B)
of each; one for the standard dialog and one embedded in the online help. */
GtkWidget *radioDriveA, *radioDriveB;
GtkWidget *radioISOA, *radioISOB;
GtkWidget *radioECCA, *radioECCB;
GtkWidget *suffixA, *suffixB;
GtkWidget *splitA, *splitB;
GtkWidget *radioLinearA, *radioLinearB;
GtkWidget *radioAdaptiveA, *radioAdaptiveB;
GtkWidget *minAttemptsScaleA, *minAttemptsScaleB;
@@ -115,6 +111,8 @@ typedef struct _prefs_context
GtkWidget *jumpScaleA, *jumpScaleB;
GtkWidget *daoButtonA, *daoButtonB;
GtkWidget *dsmButtonA, *dsmButtonB;
GtkWidget *recogRS02A, *recogRS02B;
GtkWidget *recogRS03A, *recogRS03B;
GtkWidget *byteEntryA, *byteEntryB;
GtkWidget *byteCheckA, *byteCheckB;
GtkWidget *spinUpA, *spinUpB;
@@ -127,6 +125,7 @@ typedef struct _prefs_context
GtkWidget *ejectA, *ejectB;
GtkWidget *readAndCreateButtonA, *readAndCreateButtonB;
GtkWidget *unlinkImageButtonA, *unlinkImageButtonB;
GtkWidget *confirmDeletionA, *confirmDeletionB;
GtkWidget *mainNotebook;
GtkWidget *methodChooserA,*methodChooserB;
GtkWidget *methodNotebook;
@@ -330,21 +329,24 @@ static void close_cb(GtkWidget *widget, gpointer data)
*** Setting preferences from external functions
***/
void UpdatePrefsQuerySize(void)
void UpdatePrefsExhaustiveSearch(void)
{ prefs_context *pc = (prefs_context*)Closure->prefsContext;
if(Closure->prefsContext)
switch(Closure->querySize)
{ case 0: activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioDriveA), TRUE);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioDriveB), TRUE);
break;
case 1: activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioISOA), TRUE);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioISOB), TRUE);
break;
case 2: activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioECCA), TRUE);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioECCB), TRUE);
break;
}
{ activate_toggle_button(GTK_TOGGLE_BUTTON(pc->recogRS02A), Closure->examineRS02);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->recogRS02B), Closure->examineRS02);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->recogRS03A), Closure->examineRS03);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->recogRS03B), Closure->examineRS03);
}
}
void UpdatePrefsConfirmDeletion(void)
{ prefs_context *pc = (prefs_context*)Closure->prefsContext;
if(Closure->prefsContext)
{ activate_toggle_button(GTK_TOGGLE_BUTTON(pc->confirmDeletionA), Closure->confirmDeletion);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->confirmDeletionB), Closure->confirmDeletion);
}
}
/*
@@ -365,9 +367,10 @@ enum
{ TOGGLE_READ_CREATE,
TOGGLE_UNLINK,
TOGGLE_SUFFIX,
TOGGLE_RECOG_RS02,
TOGGLE_RECOG_RS03,
TOGGLE_DAO,
TOGGLE_DSM,
TOGGLE_2GB,
TOGGLE_RANGE,
TOGGLE_RAW,
TOGGLE_RAW_20H,
@@ -379,6 +382,7 @@ enum
TOGGLE_EJECT,
TOGGLE_VERBOSE,
TOGGLE_LOGFILE,
TOGGLE_CONFIRM_DELETION,
SPIN_DELAY,
SPIN_INTERNAL_ATTEMPTS,
@@ -453,6 +457,12 @@ static void toggle_cb(GtkWidget *widget, gpointer data)
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->unlinkImageButtonB), state);
break;
case TOGGLE_CONFIRM_DELETION:
Closure->confirmDeletion = state;
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->confirmDeletionA), state);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->confirmDeletionB), state);
break;
case TOGGLE_SUFFIX:
Closure->autoSuffix = state;
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->suffixA), state);
@@ -483,6 +493,18 @@ static void toggle_cb(GtkWidget *widget, gpointer data)
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->daoButtonB), state);
break;
case TOGGLE_RECOG_RS02:
Closure->examineRS02 = state;
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->recogRS02A), state);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->recogRS02B), state);
break;
case TOGGLE_RECOG_RS03:
Closure->examineRS03 = state;
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->recogRS03A), state);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->recogRS03B), state);
break;
case TOGGLE_DSM:
Closure->dsmVersion = state;
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->dsmButtonA), state);
@@ -495,12 +517,6 @@ static void toggle_cb(GtkWidget *widget, gpointer data)
}
break;
case TOGGLE_2GB:
Closure->splitFiles = state;
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->splitA), state);
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->splitB), state);
break;
case TOGGLE_RAW:
Closure->readRaw = state;
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->rawButtonA), state);
@@ -996,44 +1012,6 @@ static GtkWidget* non_linear_scale(GtkWidget **hbox_out, non_linear_info *nli,
return scale;
}
/*
* Image size query method selection
*/
static void imgsize_cb(GtkWidget *widget, gpointer data)
{ int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
int selection = GPOINTER_TO_INT(data);
prefs_context *pc = (prefs_context*)Closure->prefsContext;
if(!state) /* only track changes to activate state */
return;
Closure->querySize = selection;
switch(selection)
{ case 0:
if(pc->radioDriveA)
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioDriveA), TRUE);
if(pc->radioDriveB)
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioDriveB), TRUE);
break;
case 1:
if(pc->radioISOA)
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioISOA), TRUE);
if(pc->radioISOB)
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioISOB), TRUE);
break;
case 2:
if(pc->radioECCA)
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioECCA), TRUE);
if(pc->radioECCB)
activate_toggle_button(GTK_TOGGLE_BUTTON(pc->radioECCB), TRUE);
break;
}
}
/*
* Read strategy selection
*/
@@ -1397,7 +1375,8 @@ void UpdateMethodPreferences(void)
for(i=0; i<Closure->methodList->len; i++)
{ Method *method = g_ptr_array_index(Closure->methodList, i);
method->resetPrefsPage(method);
if(method->resetPrefsPage)
method->resetPrefsPage(method);
}
}
@@ -1448,80 +1427,6 @@ void CreatePreferencesWindow(void)
vbox = create_page(notebook, _utf("Image"));
/** Image size */
frame = gtk_frame_new(_utf("Image size"));
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
vbox2 = gtk_vbox_new(FALSE, 15);
gtk_container_set_border_width(GTK_CONTAINER(vbox2), 10);
gtk_container_add(GTK_CONTAINER(frame), vbox2);
lwoh = CreateLabelWithOnlineHelp(_("Image size determination"), _("Get Image size from: "));
RegisterPreferencesHelpWindow(lwoh);
for(i=0; i<2; i++)
{ GtkWidget *hbox = gtk_hbox_new(FALSE, 4);
GtkWidget *radio1, *radio2, *radio3;
gtk_box_pack_start(GTK_BOX(hbox), i ? lwoh->normalLabel : lwoh->linkBox, FALSE, FALSE, 0);
radio1 = gtk_radio_button_new(NULL);
g_signal_connect(G_OBJECT(radio1), "toggled", G_CALLBACK(imgsize_cb), (gpointer)0);
gtk_box_pack_start(GTK_BOX(hbox), radio1, FALSE, FALSE, 0);
lab = gtk_label_new(_utf("Drive"));
gtk_container_add(GTK_CONTAINER(radio1), lab);
radio2 = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(radio1));
g_signal_connect(G_OBJECT(radio2), "toggled", G_CALLBACK(imgsize_cb), (gpointer)1);
gtk_box_pack_start(GTK_BOX(hbox), radio2, FALSE, FALSE, 0);
lab = gtk_label_new(_utf("ISO/UDF"));
gtk_container_add(GTK_CONTAINER(radio2), lab);
radio3 = gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(radio2));
g_signal_connect(G_OBJECT(radio3), "toggled", G_CALLBACK(imgsize_cb), (gpointer)2);
gtk_box_pack_start(GTK_BOX(hbox), radio3, FALSE, FALSE, 0);
lab = gtk_label_new(_utf("ECC/RS02"));
gtk_container_add(GTK_CONTAINER(radio3), lab);
switch(Closure->querySize)
{ case 0: activate_toggle_button(GTK_TOGGLE_BUTTON(radio1), TRUE); break;
case 1: activate_toggle_button(GTK_TOGGLE_BUTTON(radio2), TRUE); break;
case 2: activate_toggle_button(GTK_TOGGLE_BUTTON(radio3), TRUE); break;
}
if(!i)
{ pc->radioDriveA = radio1;
pc->radioISOA = radio2;
pc->radioECCA = radio3;
gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
}
else
{ pc->radioDriveB = radio1;
pc->radioISOB = radio2;
pc->radioECCB = radio3;
AddHelpWidget(lwoh, hbox);
}
}
AddHelpParagraph(lwoh,
_("<b>Image size determination</b>\n\n"
"Use <i>ECC/RS02</i> for reading images augmented with error correction data; "
"else pick <i>ISO/UDF</i>.\n\n"
"<b>ECC/RS02:</b> The Image size is determined from the error correction data. "
"Reading RS02 augmented images requires this option; otherwise the images "
"may be incomplete. However if the medium does not contain error correction "
"data, the start of the reading operation may be delayed significantly.\n\n"
"<b>ISO/UDF:</b> The image size is determined from the ISO/UDF file system.\n"
"Caution: This is only suitable for working with error correction files. "
"Images containing RS02 error correction information may be truncated.\n\n"
"<b>Drive:</b> The image size reported by the drive will be used. "
"As this information is typically wrong for DVD-RW/+RW/-RAM media this option "
"is only present for backwards compatibility with older dvdisaster versions."));
/** Reading preferences */
frame = gtk_frame_new(_utf("Image creation"));
@@ -1630,6 +1535,93 @@ void CreatePreferencesWindow(void)
"prevent sectors from being read which are required for a succesful error correction.\n\n"
"These settings are only effective for the current session and will not be saved."));
/*** Image recognization */
frame = gtk_frame_new(_utf("Error correction data recognization"));
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
vbox2 = gtk_vbox_new(FALSE, 15);
gtk_container_set_border_width(GTK_CONTAINER(vbox2), 10);
gtk_container_add(GTK_CONTAINER(frame), vbox2);
/* RS02 */
lwoh = CreateLabelWithOnlineHelp(_("Exhaustive RS02 header search"), _("Perform exhaustive search for RS02 headers"));
RegisterPreferencesHelpWindow(lwoh);
for(i=0; i<2; i++)
{ GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
GtkWidget *button = gtk_check_button_new();
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), i ? lwoh->normalLabel : lwoh->linkBox, FALSE, FALSE, 0);
if(!i) pc->recogRS02A = button;
else pc->recogRS02B = button;
activate_toggle_button(GTK_TOGGLE_BUTTON(button), Closure->examineRS02);
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(toggle_cb), GINT_TO_POINTER(TOGGLE_RECOG_RS02));
if(!i) gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
else AddHelpWidget(lwoh, hbox);
}
AddHelpParagraph(lwoh,
_("<b>Exhaustive RS02 header search</b>\n\n"
"When this setting is off only a quick check "
"for RS02 data is performed. If the medium or "
"image is damaged, the quick test may not suffice "
"to identify the image as being augmented with RS02.\n\n"
"Therefore you should turn this option <b>on</b> "
"if a medium/image contains RS02 data, but is not "
"being recognized as such. Searching for the RS02 "
"information may cause a significant delay at the "
"start of reading and scanning processes.\n\n"
"Leave this option <b>off</b> when you are "
"processing media or images which are not augmented "
"with RS02 data. Otherwise you will waste a lot of "
"time searching for the RS02 signatures and increase "
"wear on the drive."
));
/* RS03 */
lwoh = CreateLabelWithOnlineHelp(_("Recover RS03 signatures"), _("Find and recover RS03 signatures"));
RegisterPreferencesHelpWindow(lwoh);
for(i=0; i<2; i++)
{ GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
GtkWidget *button = gtk_check_button_new();
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), i ? lwoh->normalLabel : lwoh->linkBox, FALSE, FALSE, 0);
if(!i) pc->recogRS03A = button;
else pc->recogRS03B = button;
activate_toggle_button(GTK_TOGGLE_BUTTON(button), Closure->examineRS03);
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(toggle_cb), GINT_TO_POINTER(TOGGLE_RECOG_RS03));
if(!i) gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
else AddHelpWidget(lwoh, hbox);
}
AddHelpParagraph(lwoh,
_("<b>Exhaustive RS03 header search</b>\n\n"
"When this setting is off only a quick check "
"for RS03 data is performed. If the medium or "
"image is damaged, the quick test may not suffice "
"to identify the image as being augmented with RS03.\n\n"
"Therefore you should turn this option <b>on</b> "
"if a medium/image contains RS03 data, but is not "
"being recognized as such. Searching for the RS03 "
"information may cause a significant delay at the "
"start of reading and scanning processes.\n\n"
"Leave this option <b>off</b> when you are "
"processing media or images which are not augmented "
"with RS03 data. Otherwise you will waste a lot of "
"time searching for the RS03 signatures and increase "
"wear on the drive."
));
/** Image properties */
frame = gtk_frame_new(_utf("Image properties"));
@@ -1674,9 +1666,8 @@ void CreatePreferencesWindow(void)
"(sometimes also called \"SAO / Session at once\") mode for writing single "
"session media."));
/** Image format */
if(Closure->debugMode) /* hidden until version 0.80 */
{ /* because of severe compatibility issues */
/*** Image format */
frame = gtk_frame_new(_utf("Image format"));
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
@@ -1720,8 +1711,8 @@ if(Closure->debugMode) /* hidden until version 0.80 */
"N.b.: dvdisaster >= 0.72 will automatically recognize "
"both tag formats when reading images; setting this value "
"only affects the creation of new images."));
}
/* byte filling */
/** byte filling */
if(Closure->debugMode)
{
@@ -1871,7 +1862,7 @@ if(Closure->debugMode) /* hidden until version 0.80 */
else pc->radioRawModeOtherB = radio3;
g_signal_connect(G_OBJECT(radio3), "toggled", G_CALLBACK(toggle_cb), GINT_TO_POINTER(TOGGLE_RAW_OTHER));
gtk_box_pack_start(GTK_BOX(hbox), radio3, FALSE, FALSE, 0);
lab = gtk_label_new(_("other:"));
lab = gtk_label_new(_utf("other:"));
gtk_container_add(GTK_CONTAINER(radio3), lab);
entry = gtk_entry_new();
@@ -2424,8 +2415,11 @@ if(Closure->debugMode) /* hidden until version 0.80 */
for(j=0; j<Closure->methodList->len; j++)
{ Method *method = g_ptr_array_index(Closure->methodList, j);
char *utf;
gtk_combo_box_append_text(GTK_COMBO_BOX(chooser), method->menuEntry);
utf = g_locale_to_utf8(method->menuEntry, -1, NULL, NULL, NULL);
gtk_combo_box_append_text(GTK_COMBO_BOX(chooser), utf);
g_free(utf);
if(!strncmp(Closure->methodName, method->name, 4))
method_idx = j;
@@ -2447,24 +2441,22 @@ if(Closure->debugMode) /* hidden until version 0.80 */
AddHelpParagraph(lwoh, _("<b>Error correction method</b>\n\n"
"dvdisaster creates error correction data which is used to recover "
"unreadable sectors if the disc becomes damaged later on. There are "
"two different ways available for storing the error correction "
"different codecs and ways available for storing the error correction "
"information:\n"));
AddHelpListItem(lwoh, _("Error correction files (RS01 method)\n"
"Error correction files are the only way of protecting existing media "
"as they can be stored somewhere else. They are kept on a separate "
"medium which must also be protected by dvdisaster, as data loss in "
"an error correction file will render it unusable.\n"));
AddHelpListItem(lwoh, _("The RS01 codec\n"
"RS01 is the recommended codec for storing error correction data in separate files.\n"));
AddHelpListItem(lwoh, _("The RS02 codec\n"
"RS02 is the currently recommended codec for "
"augmenting images with error correction data.\n"));
AddHelpListItem(lwoh, _("Augmented images (RS02 method)\n"
"The error correction data will be stored along with the user data on the "
"same CD/DVD. This requires the creation of an image file prior to writing the "
"medium. The error correction data will be appended to that image. "
"Damaged sectors in the error correction "
"information reduce the data recovery capacity, but do not make recovery "
"impossible - a second medium for keeping or protecting the error correction "
"information is not required."));
AddHelpListItem(lwoh, _("The RS03 codec (Warning: experimental)\n"
"RS03 can either store error correction data in a separate file "
"or augment the image with it. It provides multithreading "
"to scale with multicore processors and contains some subtle improvements "
"over RS01 and RS02. However it should not be used for productive work "
"unless a stable version is released with dvdisaster V0.80."));
/* sub pages for individual method configuration */
@@ -2536,38 +2528,6 @@ if(Closure->debugMode) /* hidden until version 0.80 */
"When this switch is set, files will be automatically appended with \".iso\" "
"or \".ecc\" suffixes if no other file name extension is already present."));
/* 2GB button */
lwoh = CreateLabelWithOnlineHelp(_("File splitting"), _("Split files into segments &lt;= 2GB"));
RegisterPreferencesHelpWindow(lwoh);
for(i=0; i<2; i++)
{ GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
GtkWidget *button = gtk_check_button_new();
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), i ? lwoh->normalLabel : lwoh->linkBox, FALSE, FALSE, 0);
activate_toggle_button(GTK_TOGGLE_BUTTON(button), Closure->splitFiles);
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(toggle_cb), GINT_TO_POINTER(TOGGLE_2GB));
if(!i)
{ pc->splitA = button;
gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
}
else
{ pc->splitB = button;
AddHelpWidget(lwoh, hbox);
}
}
AddHelpParagraph(lwoh,
_("<b>File splitting</b>\n\n"
"Allows working with file systems which are limited to 2GB per file, e.g. "
"FAT from Windows. Created files are spread over upto 100 segments "
"called \"medium00.iso\", \"medium01.iso\" etc. at the cost of a small "
"performance hit."));
/*** Automatic file creation and deletion */
frame = gtk_frame_new(_utf("Automatic file creation and deletion"));
@@ -2636,6 +2596,45 @@ if(Closure->debugMode) /* hidden until version 0.80 */
"If this switch is set the image file will be deleted following the successful "
"generation of the respective error correction file."));
/*** Deletion confirmation */
frame = gtk_frame_new(_utf("Confirm file overwriting"));
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
vbox2 = gtk_vbox_new(FALSE, 15);
gtk_container_set_border_width(GTK_CONTAINER(vbox2), 10);
gtk_container_add(GTK_CONTAINER(frame), vbox2);
/* automatic creation */
lwoh = CreateLabelWithOnlineHelp(_("Confirm file overwriting"), _("Ask before overwriting image and ecc files"));
RegisterPreferencesHelpWindow(lwoh);
for(i=0; i<2; i++)
{ GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
GtkWidget *button = gtk_check_button_new();
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), i ? lwoh->normalLabel : lwoh->linkBox, FALSE, FALSE, 0);
activate_toggle_button(GTK_TOGGLE_BUTTON(button), Closure->confirmDeletion);
g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(toggle_cb), GINT_TO_POINTER(TOGGLE_CONFIRM_DELETION));
if(!i)
{ pc->confirmDeletionA = button;
gtk_box_pack_start(GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
}
else
{ pc->confirmDeletionB = button;
AddHelpWidget(lwoh, hbox);
}
}
AddHelpParagraph(lwoh,
_("<b>Ask before overwriting image and ecc files</b>\n\n"
"dvdisaster will ask you for confirmation "
"when it is going to overwrite an existing image "
"or error correction file if this option is checked."));
/*** GUI page */
vbox = create_page(notebook, _utf("Appearance"));