upstream: 2:3d07b022a7df [aggregated changes for version 0.79.8]
This commit is contained in:
committed by
Stéphane Lesimple
parent
eac7884373
commit
90b5ab6443
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -324,9 +324,6 @@ void ReadDotfile()
|
||||
if(!strcmp(symbol, "max-read-attempts")) { Closure->maxReadAttempts = atoi(value); continue; }
|
||||
if(!strcmp(symbol, "min-read-attempts")) { Closure->minReadAttempts = atoi(value); continue; }
|
||||
if(!strcmp(symbol, "old-missing-sector-marker")) { Closure->dsmVersion = !atoi(value); continue; }
|
||||
if(!strcmp(symbol, "pdf-viewer")) { g_free(Closure->viewer);
|
||||
Closure->viewer = g_strdup(value); continue; }
|
||||
|
||||
if(!strcmp(symbol, "prefetch-sectors")){ Closure->prefetchSectors = atoi(value); continue; }
|
||||
if(!strcmp(symbol, "raw-mode")) { Closure->rawMode = atoi(value); continue; }
|
||||
if(!strcmp(symbol, "read-and-create")) { Closure->readAndCreate = atoi(value); continue; }
|
||||
@@ -432,7 +429,6 @@ static void update_dotfile()
|
||||
g_fprintf(dotfile, "max-read-attempts: %d\n", Closure->maxReadAttempts);
|
||||
g_fprintf(dotfile, "min-read-attempts: %d\n", Closure->minReadAttempts);
|
||||
g_fprintf(dotfile, "old-missing-sector-marker: %d\n", !Closure->dsmVersion);
|
||||
g_fprintf(dotfile, "pdf-viewer: %s\n", Closure->viewer);
|
||||
g_fprintf(dotfile, "prefetch-sectors: %d\n", Closure->prefetchSectors);
|
||||
g_fprintf(dotfile, "raw-mode: %d\n", Closure->rawMode);
|
||||
g_fprintf(dotfile, "read-and-create: %d\n", Closure->readAndCreate);
|
||||
@@ -534,8 +530,6 @@ void InitClosure()
|
||||
|
||||
Closure->deviceNames = g_ptr_array_new();
|
||||
Closure->deviceNodes = g_ptr_array_new();
|
||||
Closure->viewer = g_strdup("xdg-open");
|
||||
Closure->browser = g_strdup("xdg-open");
|
||||
Closure->methodList = g_ptr_array_new();
|
||||
Closure->methodName = g_strdup("RS01");
|
||||
Closure->dDumpDir = g_strdup(Closure->homeDir);
|
||||
@@ -661,8 +655,6 @@ void FreeClosure()
|
||||
cond_free(Closure->logFile);
|
||||
cond_free(Closure->binDir);
|
||||
cond_free(Closure->docDir);
|
||||
cond_free(Closure->viewer);
|
||||
cond_free(Closure->browser);
|
||||
cond_free(Closure->errorTitle);
|
||||
cond_free(Closure->simulateCD);
|
||||
cond_free(Closure->dDumpDir);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -294,8 +294,6 @@ typedef struct _GlobalClosure
|
||||
int logFileStamped; /* time stamp written to log file */
|
||||
char *binDir; /* place where the binary resides */
|
||||
char *docDir; /* place where our documentation resides */
|
||||
char *viewer; /* Name of preferred PDF viewer */
|
||||
char *browser; /* Name of preferred browser */
|
||||
|
||||
GMutex progressLock; /* A mutex protected the stuff below */
|
||||
char bs[256]; /* A string of 255 backspace characters */
|
||||
@@ -1458,7 +1456,7 @@ int ProbeAltiVec(void);
|
||||
*** show-manual.c
|
||||
***/
|
||||
|
||||
void ShowPDF(char*);
|
||||
void ShowURL(char*);
|
||||
|
||||
/***
|
||||
*** show-html.c
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -37,7 +37,7 @@ void register_rs01(void)
|
||||
|
||||
/*** Standard infomation and methods */
|
||||
|
||||
strncpy(method->name, "RS01", 4);
|
||||
memcpy(method->name, "RS01", 4);
|
||||
method->menuEntry = g_strdup(_("Error correction file (RS01)"));
|
||||
method->description = g_strdup(_("Classic Reed-Solomon method based on polynomial arithmetic"));
|
||||
method->create = RS01Create;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -38,7 +38,7 @@ void register_rs02(void)
|
||||
|
||||
/*** Standard infomation and methods */
|
||||
|
||||
strncpy(method->name, "RS02", 4);
|
||||
memcpy(method->name, "RS02", 4);
|
||||
method->menuEntry = g_strdup(_("Augmented image (RS02)"));
|
||||
method->description = g_strdup(_("Reed-Solomon method with improved tolerance for defective ecc data"));
|
||||
method->create = RS02Create;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -38,7 +38,7 @@ void register_rs03(void)
|
||||
|
||||
/*** Standard infomation and methods */
|
||||
|
||||
strncpy(method->name, "RS03", 4);
|
||||
memcpy(method->name, "RS03", 4);
|
||||
method->menuEntry = g_strdup(_("Multithreaded RS codec (RS03)"));
|
||||
method->description = g_strdup(_("Multithreaded Reed-Solomon codec for error correction files and augmented images"));
|
||||
method->create = RS03Create;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* The Reed-Solomon error correction draws a lot of inspiration - and even code -
|
||||
* from Phil Karn's excellent Reed-Solomon library: http://www.ka9q.net/code/fec/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -22,6 +22,7 @@
|
||||
// DVDISASTER_GUI_FILE
|
||||
|
||||
#include "dvdisaster.h"
|
||||
#include "build.h"
|
||||
|
||||
/***
|
||||
*** Online help system for the preferences
|
||||
@@ -598,8 +599,7 @@ static gint about_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
|
||||
{ case GDK_BUTTON_PRESS:
|
||||
if(!inside) return FALSE; /* Defect in certain Gtk versions? */
|
||||
if(!strcmp(label,"GPL")) ShowGPL();
|
||||
else if(strlen(label) > 4 && !strncmp(label, "http", 4)) ShowHTML(g_strdup(label));
|
||||
else ShowPDF(g_strdup(label));
|
||||
else ShowURL(g_strdup(label));
|
||||
break;
|
||||
case GDK_ENTER_NOTIFY:
|
||||
g_sprintf(text, "<span underline=\"single\" color=\"blue\">%s</span>", label);
|
||||
@@ -737,7 +737,7 @@ void AboutDialog()
|
||||
AboutText(vbox, "%s", text);
|
||||
g_free(text);
|
||||
|
||||
AboutText(vbox, _("Copyright 2004-2017 Carsten Gnoerlich.\nCopyright 2019 The dvdisaster development team."));
|
||||
AboutText(vbox, _("Copyright 2004-2017 Carsten Gnoerlich.\nCopyright 2019-2021 The dvdisaster development team."));
|
||||
|
||||
sep = gtk_hseparator_new();
|
||||
gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 10);
|
||||
@@ -755,8 +755,12 @@ void AboutDialog()
|
||||
|
||||
AboutText(vbox, _("\ne-mail: support@dvdisaster.org"));
|
||||
|
||||
AboutText(vbox, "WWW: %s", HOMEPAGE);
|
||||
|
||||
text = g_strdup_printf("WWW: [%s]", HOMEPAGE);
|
||||
AboutTextWithLink(vbox, text, HOMEPAGE);
|
||||
g_free(text);
|
||||
|
||||
#ifdef SYS_NETBSD
|
||||
AboutText(vbox, _("\nNetBSD port: Sergey Svishchev <svs@ropnet.ru>"));
|
||||
#endif
|
||||
/* Show it */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2006 Andrei Grecu
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -116,7 +116,7 @@ static void menu_cb(GtkWidget *widget, gpointer data)
|
||||
break;
|
||||
|
||||
case MENU_HELP_MANUAL:
|
||||
ShowPDF(NULL);
|
||||
ShowURL(NULL);
|
||||
break;
|
||||
|
||||
case MENU_HELP_ABOUT:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -216,7 +216,7 @@ static void print_greetings(FILE *where)
|
||||
|
||||
greetings_shown = 1;
|
||||
g_fprintf(where, "%s.\n%s\n", Closure->versionString,
|
||||
_("Copyright 2004-2017 Carsten Gnoerlich.\nCopyright 2019 The dvdisaster development team."));
|
||||
_("Copyright 2004-2017 Carsten Gnoerlich.\nCopyright 2019-2021 The dvdisaster development team."));
|
||||
/* TRANSLATORS: Excluding all kinds of warranty might be harmful under your
|
||||
legislature. If in doubt, just translate the following like "This is free
|
||||
software; please refer to the conditions of the GNU GENERAL PUBLIC LICENSE
|
||||
@@ -641,7 +641,8 @@ void Stop(char *format, ...)
|
||||
#ifndef WITH_CLI_ONLY_YES
|
||||
if(!Closure->guiMode)
|
||||
#endif
|
||||
{ g_printf("%s", _("\n*\n* dvdisaster - can not continue:\n*\n"));
|
||||
{ print_greetings(stdout);
|
||||
g_printf("%s", _("\n*\n* dvdisaster - can not continue:\n*\n"));
|
||||
va_start(argp, format);
|
||||
g_vprintf(format, argp);
|
||||
va_end(argp);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* The Reed-Solomon error correction draws a lot of inspiration - and even code -
|
||||
* from Phil Karn's excellent Reed-Solomon library: http://www.ka9q.net/code/fec/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* The Reed-Solomon error correction draws a lot of inspiration - and even code -
|
||||
* from Phil Karn's excellent Reed-Solomon library: http://www.ka9q.net/code/fec/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -443,8 +443,8 @@ RS02Layout *CalcRS02Layout(Image *image)
|
||||
{ case 'r': /* pick number of roots */
|
||||
{ char buf[len+1];
|
||||
|
||||
memcpy(buf, Closure->redundancy, len);
|
||||
buf[len] = '\0';
|
||||
memcpy(buf, Closure->redundancy, len-1);
|
||||
buf[len-1]=0;
|
||||
requested_roots = atoi(buf);
|
||||
break;
|
||||
}
|
||||
@@ -453,7 +453,7 @@ RS02Layout *CalcRS02Layout(Image *image)
|
||||
int percent;
|
||||
|
||||
memcpy(buf, Closure->redundancy, len-1);
|
||||
buf[len-1] = '\0';
|
||||
buf[len-1]=0;
|
||||
percent = atoi(buf);
|
||||
|
||||
for(requested_roots = 7; requested_roots < 171; requested_roots++)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -19,348 +19,79 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
// DVDISASTER_GUI_FILE
|
||||
|
||||
#include "dvdisaster.h"
|
||||
|
||||
#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_KFREEBSD) || \
|
||||
defined(SYS_NETBSD) || defined(SYS_HURD)
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#ifdef SYS_MINGW
|
||||
#include "windows.h"
|
||||
#include "shellapi.h"
|
||||
#endif
|
||||
|
||||
/***
|
||||
*** Ask user to specify his viewer
|
||||
***/
|
||||
|
||||
#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_KFREEBSD) || \
|
||||
defined(SYS_NETBSD) || defined(SYS_HURD)
|
||||
|
||||
#define SEARCH_BUTTON 1
|
||||
|
||||
typedef struct
|
||||
{ GtkWidget *dialog;
|
||||
GtkWidget *entry;
|
||||
GtkWidget *search;
|
||||
GtkWidget *filesel;
|
||||
GtkWidget *fileok;
|
||||
GtkWidget *filecancel;
|
||||
void ShowURL(char *target)
|
||||
{ guint64 ignore;
|
||||
pid_t pid;
|
||||
int hyperlink = 0;
|
||||
char *path;
|
||||
} viewer_dialog_info;
|
||||
|
||||
static void response_cb(GtkWidget *widget, int response, gpointer data)
|
||||
{ viewer_dialog_info *bdi = (viewer_dialog_info*)data;
|
||||
|
||||
switch(response)
|
||||
{ case GTK_RESPONSE_ACCEPT:
|
||||
if(Closure->viewer) g_free(Closure->viewer);
|
||||
Closure->viewer = g_strdup(gtk_entry_get_text(GTK_ENTRY(bdi->entry)));
|
||||
ShowPDF(bdi->path);
|
||||
break;
|
||||
|
||||
case GTK_RESPONSE_REJECT:
|
||||
if(bdi->path) g_free(bdi->path);
|
||||
break;
|
||||
|
||||
if(target && !strncmp(target, "http", 4))
|
||||
{ hyperlink = 1;
|
||||
path = g_strdup(target);
|
||||
}
|
||||
gtk_widget_destroy(widget);
|
||||
if(bdi->filesel)
|
||||
gtk_widget_destroy(bdi->filesel);
|
||||
g_free(bdi);
|
||||
}
|
||||
|
||||
static void search_cb(GtkWidget *widget, gpointer data)
|
||||
{ viewer_dialog_info *bdi = (viewer_dialog_info*)data;
|
||||
|
||||
if(widget == bdi->search)
|
||||
{ bdi->filesel = gtk_file_selection_new(_utf("windowtitle|Choose a PDF viewer"));
|
||||
bdi->fileok = GTK_FILE_SELECTION(bdi->filesel)->ok_button;
|
||||
bdi->filecancel = GTK_FILE_SELECTION(bdi->filesel)->cancel_button;
|
||||
ReverseCancelOK(GTK_DIALOG(bdi->filesel));
|
||||
gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(bdi->filesel));
|
||||
g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(bdi->filesel)->ok_button), "clicked",
|
||||
G_CALLBACK(search_cb), bdi);
|
||||
|
||||
g_signal_connect(G_OBJECT(GTK_FILE_SELECTION(bdi->filesel)->cancel_button), "clicked",
|
||||
G_CALLBACK(search_cb), bdi);
|
||||
|
||||
gtk_widget_show(bdi->filesel);
|
||||
}
|
||||
|
||||
if(widget == bdi->fileok)
|
||||
{
|
||||
if(Closure->viewer) g_free(Closure->viewer);
|
||||
Closure->viewer = g_strdup(gtk_file_selection_get_filename(GTK_FILE_SELECTION(bdi->filesel)));
|
||||
ShowPDF(bdi->path);
|
||||
gtk_widget_destroy(bdi->filesel);
|
||||
gtk_widget_destroy(bdi->dialog);
|
||||
g_free(bdi);
|
||||
return;
|
||||
}
|
||||
|
||||
if(widget == bdi->filecancel)
|
||||
{ gtk_widget_destroy(bdi->filesel);
|
||||
bdi->filesel = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void viewer_dialog(char *path)
|
||||
{ GtkWidget *dialog, *vbox, *hbox, *label, *entry, *button;
|
||||
viewer_dialog_info *bdi = g_malloc0(sizeof(viewer_dialog_info));
|
||||
|
||||
/* Create the dialog */
|
||||
|
||||
dialog = gtk_dialog_new_with_buttons(_utf("windowtitle|PDF viewer required"),
|
||||
Closure->window, GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL);
|
||||
bdi->dialog = dialog;
|
||||
if(path)
|
||||
{ bdi->path = g_strdup(path);
|
||||
}
|
||||
|
||||
vbox = gtk_vbox_new(FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox, FALSE, FALSE, 0);
|
||||
gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
|
||||
|
||||
/* Insert the contents */
|
||||
|
||||
label = gtk_label_new(NULL);
|
||||
gtk_label_set_markup(GTK_LABEL(label), _utf("<b>Could not find a suitable PDF viewer.</b>\n\n"
|
||||
"Which PDF viewer would you like to use\n"
|
||||
"for reading the online documentation?\n\n"
|
||||
"Please enter its name (e.g. xpdf) or\n"
|
||||
"use the \"Search\" button for a file dialog.\n")),
|
||||
gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 10);
|
||||
|
||||
hbox = gtk_hbox_new(FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 10);
|
||||
|
||||
bdi->entry = entry = gtk_entry_new();
|
||||
gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 10);
|
||||
|
||||
bdi->search = button = gtk_button_new_with_label(_utf("Search"));
|
||||
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(search_cb), bdi);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 10);
|
||||
|
||||
/* Show it */
|
||||
|
||||
g_signal_connect(dialog, "response", G_CALLBACK(response_cb), bdi);
|
||||
|
||||
gtk_widget_show_all(dialog);
|
||||
}
|
||||
#endif /* SYS_ unix-like */
|
||||
|
||||
/***
|
||||
*** Show the manual in an external viewer
|
||||
***/
|
||||
|
||||
/*
|
||||
* Check the child processes exit status
|
||||
* to find whether the viewer could be invoked.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{ pid_t pid;
|
||||
char *path;
|
||||
GtkWidget *msg;
|
||||
int seconds;
|
||||
} viewer_info;
|
||||
|
||||
|
||||
static void msg_destroy_cb(GtkWidget *widget, gpointer data)
|
||||
{ viewer_info *bi = (viewer_info*)data;
|
||||
|
||||
bi->msg = NULL;
|
||||
}
|
||||
|
||||
#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_KFREEBSD) || \
|
||||
defined(SYS_NETBSD) || defined(SYS_HURD)
|
||||
|
||||
/*
|
||||
* The following list of viewers
|
||||
* will be tried one at a time until one entry succeeds by:
|
||||
* - returning zero
|
||||
* - not returning within 60 seconds
|
||||
*/
|
||||
|
||||
static int viewer_index;
|
||||
static void try_viewer(viewer_info*);
|
||||
|
||||
static char *viewers[] =
|
||||
{ "evince",
|
||||
"xpdf",
|
||||
"okular",
|
||||
"gv",
|
||||
"mupdf",
|
||||
"pdfcube",
|
||||
"zathura",
|
||||
NULL
|
||||
};
|
||||
|
||||
static gboolean viewer_timeout_func(gpointer data)
|
||||
{ viewer_info *bi = (viewer_info*)data;
|
||||
int status;
|
||||
|
||||
waitpid(bi->pid, &status, WNOHANG);
|
||||
|
||||
/* At least mozilla returns random values under FreeBSD on success,
|
||||
so we can't rely on the return value exept our own 110 one. */
|
||||
|
||||
if(WIFEXITED(status))
|
||||
{
|
||||
switch(WEXITSTATUS(status))
|
||||
{ case 110: /* viewer did not execute */
|
||||
viewer_index++;
|
||||
if(!viewers[viewer_index]) /* all viewers from the list failed */
|
||||
{ viewer_dialog(bi->path);
|
||||
|
||||
if(bi->msg)
|
||||
gtk_widget_destroy(bi->msg);
|
||||
if(bi->path)
|
||||
g_free(bi->path);
|
||||
g_free(bi);
|
||||
}
|
||||
else /* try next viewer from list */
|
||||
{ bi->seconds = 0;
|
||||
try_viewer(bi);
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
case 0: /* viewer assumed to be successful */
|
||||
default:
|
||||
if(bi->msg)
|
||||
gtk_widget_destroy(bi->msg);
|
||||
if(bi->path)
|
||||
g_free(bi->path);
|
||||
g_free(bi);
|
||||
return FALSE;
|
||||
|
||||
/* Process local files */
|
||||
|
||||
if(!hyperlink)
|
||||
{ if(!Closure->docDir)
|
||||
{
|
||||
CreateMessage(_("Documentation not installed."), GTK_MESSAGE_ERROR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bi->seconds++;
|
||||
if(bi->seconds == 10 && bi->msg)
|
||||
{ gtk_widget_destroy(bi->msg);
|
||||
bi->msg = NULL;
|
||||
}
|
||||
/* If no target is given, show the manual. */
|
||||
|
||||
return bi->seconds > 60 ? FALSE : TRUE;
|
||||
}
|
||||
#endif /* SYS_ unix-like */
|
||||
if(!target)
|
||||
{ path = g_strdup_printf("%s/manual.pdf",Closure->docDir);
|
||||
}
|
||||
else
|
||||
if(*target != '/') path = g_strdup_printf("%s/%s",Closure->docDir, target);
|
||||
else path = g_strdup(target);
|
||||
|
||||
if(!LargeStat(path, &ignore))
|
||||
{
|
||||
CreateMessage(_("Documentation file\n%s\nnot found.\n"), GTK_MESSAGE_ERROR, path);
|
||||
g_free(path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SYS_MINGW
|
||||
static gboolean viewer_timeout_func(gpointer data)
|
||||
{ viewer_info *bi = (viewer_info*)data;
|
||||
/* Okay, Billy wins big time here ;-) */
|
||||
|
||||
ShellExecute(NULL, "open", path, NULL, NULL, SW_SHOWNORMAL);
|
||||
#else
|
||||
|
||||
/* fork xdg-open */
|
||||
|
||||
bi->seconds++;
|
||||
|
||||
if(bi->seconds >= 10)
|
||||
{ if(bi->msg)
|
||||
{ gtk_widget_destroy(bi->msg);
|
||||
bi->msg = NULL;
|
||||
}
|
||||
//if(bi->url) g_free(bi->url);
|
||||
g_free(bi);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif /* SYS_MINGW */
|
||||
|
||||
/*
|
||||
* Invoke the viewer
|
||||
*/
|
||||
|
||||
#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_KFREEBSD) || \
|
||||
defined(SYS_NETBSD) || defined(SYS_HURD)
|
||||
static void try_viewer(viewer_info *bi)
|
||||
{ pid_t pid;
|
||||
|
||||
bi->pid = pid = fork();
|
||||
pid = fork();
|
||||
|
||||
if(pid == -1)
|
||||
{ printf("fork failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* make the parent remember and wait() for the viewer */
|
||||
|
||||
if(pid > 0)
|
||||
{ g_timeout_add(1000, viewer_timeout_func, (gpointer)bi);
|
||||
|
||||
if(viewer_index)
|
||||
{ g_free(Closure->viewer);
|
||||
Closure->viewer = g_strdup(viewers[viewer_index]);
|
||||
}
|
||||
}
|
||||
|
||||
/* try calling the viewer */
|
||||
|
||||
if(pid == 0)
|
||||
{ char *argv[10];
|
||||
int argc = 0;
|
||||
|
||||
argv[argc++] = viewer_index ? viewers[viewer_index] : Closure->viewer;
|
||||
argv[argc++] = bi->path;
|
||||
argv[argc++] = "xdg-open";
|
||||
argv[argc++] = path;
|
||||
argv[argc++] = NULL;
|
||||
execvp(argv[0], argv);
|
||||
|
||||
_exit(110); /* couldn't execute */
|
||||
}
|
||||
}
|
||||
#endif /* SYS_ unix-like */
|
||||
|
||||
|
||||
void ShowPDF(char *target)
|
||||
{ viewer_info *bi = g_malloc0(sizeof(viewer_info));
|
||||
guint64 ignore;
|
||||
|
||||
if(!Closure->docDir)
|
||||
{
|
||||
CreateMessage(_("Documentation not installed."), GTK_MESSAGE_ERROR);
|
||||
g_free(bi);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If no target is given, show the manual. */
|
||||
|
||||
if(!target)
|
||||
{ bi->path = g_strdup_printf("%s/manual.pdf",Closure->docDir);
|
||||
}
|
||||
else
|
||||
if(*target != '/') bi->path = g_strdup_printf("%s/%s",Closure->docDir, target);
|
||||
else bi->path = g_strdup(target);
|
||||
|
||||
if(!LargeStat(bi->path, &ignore))
|
||||
{
|
||||
CreateMessage(_("Documentation file\n%s\nnot found.\n"), GTK_MESSAGE_ERROR, bi->path);
|
||||
g_free(bi->path);
|
||||
g_free(bi);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Lock the help button and show a message for 10 seconds. */
|
||||
|
||||
TimedInsensitive(Closure->helpButton, 10000);
|
||||
bi->msg = CreateMessage(_("Please hang on until the viewer comes up!"), GTK_MESSAGE_INFO);
|
||||
g_signal_connect(G_OBJECT(bi->msg), "destroy", G_CALLBACK(msg_destroy_cb), bi);
|
||||
|
||||
/* Try the first viwer */
|
||||
|
||||
#ifdef SYS_MINGW
|
||||
/* Okay, Billy wins big time here ;-) */
|
||||
|
||||
ShellExecute(NULL, "open", bi->path, NULL, NULL, SW_SHOWNORMAL);
|
||||
g_timeout_add(1000, viewer_timeout_func, (gpointer)bi);
|
||||
#endif
|
||||
|
||||
#if defined(SYS_LINUX) || defined(SYS_FREEBSD) || defined(SYS_DARWIN) || defined(SYS_NETBSD)
|
||||
viewer_index = 0;
|
||||
try_viewer(bi);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
@@ -178,7 +178,7 @@ static void bp_get_string(unsigned char *dest, unsigned char *src, int begin, in
|
||||
static void bp_set_string(unsigned char *dest, char *src, int begin, int end)
|
||||
{ int length = end-begin+1;
|
||||
|
||||
strncpy((char*)(dest+begin-1), src, length);
|
||||
memcpy((char*)(dest+begin-1), src, length);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -797,10 +797,12 @@ void FreeIsoHeader(IsoHeader *ih)
|
||||
|
||||
void AddFile(IsoHeader *ih, char *name, guint64 size)
|
||||
{ static int n;
|
||||
char iso[22], joliet[strlen(name)+3];
|
||||
char iso[22]; /* 15 would be enough but compiler figures out 22 */
|
||||
char joliet[strlen(name)+3];
|
||||
|
||||
n++;
|
||||
sprintf(iso,"RAN_%04d.DAT;1", n);
|
||||
|
||||
add_file_record(ih->proot, iso, size, 25,
|
||||
106, 7, 16, 12, 28, 10, 8);
|
||||
sprintf(joliet,"%s;1", name);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* dvdisaster: Additional error correction for optical media.
|
||||
* Copyright (C) 2004-2017 Carsten Gnoerlich.
|
||||
* Copyright (C) 2019 The dvdisaster development team.
|
||||
* Copyright (C) 2019-2021 The dvdisaster development team.
|
||||
*
|
||||
* Email: support@dvdisaster.org
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user