"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "rs01-window.c" between
dvdisaster-0.72.6.tar.gz and dvdisaster-0.79.5.tar.gz

About: dvdisaster provides a margin of safety against data loss on CD, DVD and BD media caused by aging or scratches. Development version.

rs01-window.c  (dvdisaster-0.72.6):rs01-window.c  (dvdisaster-0.79.5)
/* dvdisaster: Additional error correction for optical media. /* dvdisaster: Additional error correction for optical media.
* Copyright (C) 2004-2014 Carsten Gnoerlich. * Copyright (C) 2004-2015 Carsten Gnoerlich.
* Project home page: http://www.dvdisaster.com
* Email: carsten@dvdisaster.com -or- cgnoerlich@fsfe.org
* *
* This program is free software; you can redistribute it and/or modify * Email: carsten@dvdisaster.org -or- cgnoerlich@fsfe.org
* Project homepage: http://www.dvdisaster.org
*
* This file is part of dvdisaster.
*
* dvdisaster is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * dvdisaster is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with dvdisaster. If not, see <http://www.gnu.org/licenses/>.
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA,
* or direct your browser at http://www.gnu.org.
*/ */
#include "dvdisaster.h" #include "dvdisaster.h"
#include "rs01-includes.h" #include "rs01-includes.h"
/*** /***
*** Forward declarations *** Forward declarations
***/ ***/
static void redraw_curve(RS01Widgets*); static void redraw_curve(RS01Widgets*);
static void update_geometry(RS01Widgets*); static void update_geometry(RS01Widgets*);
/* Protected widget access */
static void activate_toggle_button(GtkToggleButton *toggle, int state)
{ if(toggle) gtk_toggle_button_set_active(toggle, state);
}
static void set_range_value(GtkRange *range, int value)
{ if(range) gtk_range_set_value(range, value);
}
static void set_spin_button_value(GtkSpinButton *spin, int value)
{ if(spin) gtk_spin_button_set_value(spin, value);
}
/*** /***
*** Encoding window *** Encoding window
***/ ***/
/* /*
* Reset the notebook contents for new encoding action * Reset the notebook contents for new encoding action
*/ */
void ResetRS01EncodeWindow(Method *method) void ResetRS01EncodeWindow(Method *method)
{ RS01Widgets *wl = (RS01Widgets*)method->widgetList; { RS01Widgets *wl = (RS01Widgets*)method->widgetList;
skipping to change at line 311 skipping to change at line 326
} }
/* /*
* Expose callback * Expose callback
*/ */
static gboolean expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer dat a) static gboolean expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer dat a)
{ RS01Widgets *wl = (RS01Widgets*)data; { RS01Widgets *wl = (RS01Widgets*)data;
if(event->count) /* Exposure compression */ if(event->count) /* Exposure compression */
return TRUE; { return TRUE;
}
update_geometry(wl); update_geometry(wl);
redraw_curve(wl); redraw_curve(wl);
return TRUE; return TRUE;
} }
/* /*
* Reset the notebook contents for new fixing action * Reset the notebook contents for new fixing action
*/ */
skipping to change at line 415 skipping to change at line 431
#define SYMBOLSIZE 8 #define SYMBOLSIZE 8
#define FIELDSIZE (1<<SYMBOLSIZE) #define FIELDSIZE (1<<SYMBOLSIZE)
#define FIELDMAX (FIELDSIZE-1) #define FIELDMAX (FIELDSIZE-1)
enum enum
{ PREF_NROOTS = 0, { PREF_NROOTS = 0,
PREF_CACHE = 1, PREF_CACHE = 1,
PREF_ECC_SIZE = 2 PREF_ECC_SIZE = 2
}; };
#ifdef HAVE_32BIT
static int cache_size[] = { 8, 16, 32, 64, 96, 128, 192, 256, 384, 512, 768,
1024, 1536 };
#else
static int cache_size[] = { 8, 16, 32, 64, 96, 128, 192, 256, 384, 512, 768, static int cache_size[] = { 8, 16, 32, 64, 96, 128, 192, 256, 384, 512, 768,
1024, 1536, 2048, 2560, 3072, 4096, 5120, 6144, 7168, 8192 }; 1024, 1536, 2048, 2560, 3072, 4096, 5120, 6144, 7168, 8192 };
// 11264, 15360, 23552, 31744, 48128, 64512 }; #endif
static gchar* format_cb(GtkScale *scale, gdouble value, gpointer data) static gchar* format_cb(GtkScale *scale, gdouble value, gpointer data)
{ int nroots = value; { int nroots = value;
int ndata = FIELDMAX - nroots; int ndata = FIELDMAX - nroots;
char *label; char *label;
if(GPOINTER_TO_INT(data) == PREF_CACHE) if(GPOINTER_TO_INT(data) == PREF_CACHE)
{ {
label = g_strdup(" "); label = g_strdup(" ");
} }
skipping to change at line 444 skipping to change at line 464
return label; return label;
} }
static void cache_cb(GtkWidget *widget, gpointer data) static void cache_cb(GtkWidget *widget, gpointer data)
{ RS01Widgets *wl = (RS01Widgets*)data; { RS01Widgets *wl = (RS01Widgets*)data;
LabelWithOnlineHelp *lwoh = wl->cacheLwoh; LabelWithOnlineHelp *lwoh = wl->cacheLwoh;
int value; int value;
char *text, *utf; char *text, *utf;
value = gtk_range_get_value(GTK_RANGE(widget)); value = gtk_range_get_value(GTK_RANGE(widget));
Closure->cacheMB = cache_size[value]; Closure->cacheMiB = cache_size[value];
text = g_strdup_printf(_("%d MB of file cache"), Closure->cacheMB); text = g_strdup_printf(_("%d MiB of file cache"), Closure->cacheMiB);
utf = g_locale_to_utf8(text, -1, NULL, NULL, NULL); utf = g_locale_to_utf8(text, -1, NULL, NULL, NULL);
gtk_label_set_markup(GTK_LABEL(lwoh->normalLabel), utf); gtk_label_set_markup(GTK_LABEL(lwoh->normalLabel), utf);
gtk_label_set_markup(GTK_LABEL(lwoh->linkLabel), utf); gtk_label_set_markup(GTK_LABEL(lwoh->linkLabel), utf);
SetOnlineHelpLinkText(lwoh, text); SetOnlineHelpLinkText(lwoh, text);
UpdateMethodPreferences(); UpdateMethodPreferences();
g_free(text); g_free(text);
g_free(utf); g_free(utf);
} }
static void nroots_cb(GtkWidget *widget, gpointer data) static void nroots_cb(GtkWidget *widget, gpointer data)
{ RS01Widgets *wl = (RS01Widgets*)data; { RS01Widgets *wl = (RS01Widgets*)data;
int value; int value;
value = gtk_range_get_value(GTK_RANGE(widget)); value = gtk_range_get_value(GTK_RANGE(widget));
if(Closure->redundancy) g_free(Closure->redundancy); if(Closure->redundancy) g_free(Closure->redundancy);
Closure->redundancy = g_strdup_printf("%d", value); Closure->redundancy = g_strdup_printf("%d", value);
if(widget == wl->redundancyScaleA) if(widget == wl->redundancyScaleA)
gtk_range_set_value(GTK_RANGE(wl->redundancyScaleB), value); set_range_value(GTK_RANGE(wl->redundancyScaleB), value);
else gtk_range_set_value(GTK_RANGE(wl->redundancyScaleA), value); else set_range_value(GTK_RANGE(wl->redundancyScaleA), value);
UpdateMethodPreferences();
} }
static void ecc_size_cb(GtkWidget *widget, gpointer data) static void ecc_size_cb(GtkWidget *widget, gpointer data)
{ RS01Widgets *wl = (RS01Widgets*)data; { RS01Widgets *wl = (RS01Widgets*)data;
int value; int value;
value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget)); value = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
if(Closure->redundancy) g_free(Closure->redundancy); if(Closure->redundancy) g_free(Closure->redundancy);
Closure->redundancy = g_strdup_printf("%dm", value); Closure->redundancy = g_strdup_printf("%dm", value);
if(widget == wl->redundancySpinA) if(widget == wl->redundancySpinA)
gtk_spin_button_set_value(GTK_SPIN_BUTTON(wl->redundancySpinB), atoi(Clo sure->redundancy)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(wl->redundancySpinB), atoi(Clo sure->redundancy));
else gtk_spin_button_set_value(GTK_SPIN_BUTTON(wl->redundancySpinA), atoi(Clo sure->redundancy)); else gtk_spin_button_set_value(GTK_SPIN_BUTTON(wl->redundancySpinA), atoi(Clo sure->redundancy));
UpdateMethodPreferences();
} }
static void toggle_cb(GtkWidget *widget, gpointer data) static void toggle_cb(GtkWidget *widget, gpointer data)
{ Method *method = (Method*)data; { Method *method = (Method*)data;
RS01Widgets *wl = (RS01Widgets*)method->widgetList; RS01Widgets *wl = (RS01Widgets*)method->widgetList;
int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); int state = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
if(state == TRUE) if(state == TRUE)
{ if(widget == wl->radio3A || widget == wl->radio3B) { if(widget == wl->radio3A || widget == wl->radio3B)
{ gtk_widget_set_sensitive(wl->redundancyScaleA, TRUE); { gtk_widget_set_sensitive(wl->redundancyScaleA, TRUE);
skipping to change at line 514 skipping to change at line 537
else else
{ gtk_widget_set_sensitive(wl->redundancySpinA, FALSE); { gtk_widget_set_sensitive(wl->redundancySpinA, FALSE);
gtk_widget_set_sensitive(wl->redundancySpinB, FALSE); gtk_widget_set_sensitive(wl->redundancySpinB, FALSE);
gtk_widget_set_sensitive(wl->radio4LabelA, FALSE); gtk_widget_set_sensitive(wl->radio4LabelA, FALSE);
gtk_widget_set_sensitive(wl->radio4LabelB, FALSE); gtk_widget_set_sensitive(wl->radio4LabelB, FALSE);
} }
if( widget == wl->radio1A /* Normal */ if( widget == wl->radio1A /* Normal */
|| widget == wl->radio1B) || widget == wl->radio1B)
{ {
gtk_range_set_value(GTK_RANGE(wl->redundancyScaleA), 32); set_range_value(GTK_RANGE(wl->redundancyScaleA), 32);
gtk_range_set_value(GTK_RANGE(wl->redundancyScaleB), 32); set_range_value(GTK_RANGE(wl->redundancyScaleB), 32);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio1A), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio1A), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio1B), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio1B), TRUE);
if(Closure->redundancy) g_free(Closure->redundancy); if(Closure->redundancy) g_free(Closure->redundancy);
Closure->redundancy = g_strdup("normal"); Closure->redundancy = g_strdup("normal");
} }
if( widget == wl->radio2A /* High */ if( widget == wl->radio2A /* High */
|| widget == wl->radio2B) || widget == wl->radio2B)
{ {
gtk_range_set_value(GTK_RANGE(wl->redundancyScaleA), 64); set_range_value(GTK_RANGE(wl->redundancyScaleA), 64);
gtk_range_set_value(GTK_RANGE(wl->redundancyScaleB), 64); set_range_value(GTK_RANGE(wl->redundancyScaleB), 64);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio2A), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio2A), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio2B), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio2B), TRUE);
if(Closure->redundancy) g_free(Closure->redundancy); if(Closure->redundancy) g_free(Closure->redundancy);
Closure->redundancy = g_strdup("high"); Closure->redundancy = g_strdup("high");
} }
if( widget == wl->radio3A /* number of roots */ if( widget == wl->radio3A /* number of roots */
|| widget == wl->radio3B) || widget == wl->radio3B)
skipping to change at line 558 skipping to change at line 581
if( widget == wl->radio4A /* relative to space usage */ if( widget == wl->radio4A /* relative to space usage */
|| widget == wl->radio4B) || widget == wl->radio4B)
{ int space = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(wl->redund ancySpinA)); { int space = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(wl->redund ancySpinA));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio4A), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio4A), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio4B), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio4B), TRUE);
if(Closure->redundancy) g_free(Closure->redundancy); if(Closure->redundancy) g_free(Closure->redundancy);
Closure->redundancy = g_strdup_printf("%dm", space); Closure->redundancy = g_strdup_printf("%dm", space);
} }
UpdateMethodPreferences();
} }
} }
void ResetRS01PrefsPage(Method *method) void ResetRS01PrefsPage(Method *method)
{ RS01Widgets *wl = (RS01Widgets*)method->widgetList; { RS01Widgets *wl = (RS01Widgets*)method->widgetList;
int index; int index;
/* Redundancy selection */
if(Closure->redundancy)
{
if(!strcmp(Closure->redundancy, "normal"))
{ if(wl->radio1A && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wl->ra
dio1A)) == FALSE)
{ activate_toggle_button(GTK_TOGGLE_BUTTON(wl->radio1A), TRUE);
activate_toggle_button(GTK_TOGGLE_BUTTON(wl->radio1B), TRUE);
}
}
else if(!strcmp(Closure->redundancy, "high"))
{ if(wl->radio2A && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(wl->ra
dio2A)) == FALSE)
{ activate_toggle_button(GTK_TOGGLE_BUTTON(wl->radio2A), TRUE);
activate_toggle_button(GTK_TOGGLE_BUTTON(wl->radio2B), TRUE);
}
}
else
{ int last = strlen(Closure->redundancy)-1;
if(Closure->redundancy[last] == 'm')
{ if(wl->redundancySpinA)
{ int old = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(wl->red
undancySpinA));
int new;
Closure->redundancy[last] = 0;
new = atoi(Closure->redundancy);
Closure->redundancy[last] = 'm';
if(new != old)
{ set_spin_button_value(GTK_SPIN_BUTTON(wl->redundancySpinA), new
);
set_spin_button_value(GTK_SPIN_BUTTON(wl->redundancySpinB), new
);
}
if(wl->radio4A && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w
l->radio4A)) == FALSE)
{ activate_toggle_button(GTK_TOGGLE_BUTTON(wl->radio4A), TRUE);
activate_toggle_button(GTK_TOGGLE_BUTTON(wl->radio4B), TRUE);
}
}
}
else
{ if(wl->redundancyScaleA)
{ int old = gtk_range_get_value(GTK_RANGE(wl->redundancyScaleA));
int new = atoi(Closure->redundancy);
if(new != old)
{ set_range_value(GTK_RANGE(wl->redundancyScaleA), new);
set_range_value(GTK_RANGE(wl->redundancyScaleB), new);
}
if(wl->radio3A && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w
l->radio3A)) == FALSE)
{ activate_toggle_button(GTK_TOGGLE_BUTTON(wl->radio3A), TRUE);
activate_toggle_button(GTK_TOGGLE_BUTTON(wl->radio3B), TRUE);
}
}
}
}
}
/* Memory caching */
for(index = 0; index < sizeof(cache_size)/sizeof(int); index++) for(index = 0; index < sizeof(cache_size)/sizeof(int); index++)
if(cache_size[index] > Closure->cacheMB) if(cache_size[index] > Closure->cacheMiB)
break; break;
gtk_range_set_value(GTK_RANGE(wl->cacheScaleA), index > 0 ? index-1 : index); set_range_value(GTK_RANGE(wl->cacheScaleA), index > 0 ? index-1 : index);
gtk_range_set_value(GTK_RANGE(wl->cacheScaleB), index > 0 ? index-1 : index); set_range_value(GTK_RANGE(wl->cacheScaleB), index > 0 ? index-1 : index);
} }
void CreateRS01PrefsPage(Method *method, GtkWidget *parent) void CreateRS01PrefsPage(Method *method, GtkWidget *parent)
{ RS01Widgets *wl = (RS01Widgets*)method->widgetList; { RS01Widgets *wl = (RS01Widgets*)method->widgetList;
GtkWidget *frame, *hbox, *vbox, *lab, *scale, *spin; GtkWidget *frame, *hbox, *vbox, *lab, *scale, *spin;
GtkWidget *radio; GtkWidget *radio;
LabelWithOnlineHelp *lwoh; LabelWithOnlineHelp *lwoh;
unsigned int i, index; unsigned int i, index;
char *text; char *text;
skipping to change at line 720 skipping to change at line 805
else else
{ wl->radio4B = radio; { wl->radio4B = radio;
gtk_box_pack_start(GTK_BOX(hbox), lwoh->normalLabel, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), lwoh->normalLabel, FALSE, FALSE, 0);
} }
spin = gtk_spin_button_new_with_range(0, 100000, 100); spin = gtk_spin_button_new_with_range(0, 100000, 100);
g_signal_connect(spin, "value-changed", G_CALLBACK(ecc_size_cb), (gpointer )wl); g_signal_connect(spin, "value-changed", G_CALLBACK(ecc_size_cb), (gpointer )wl);
gtk_entry_set_width_chars(GTK_ENTRY(spin), 8); gtk_entry_set_width_chars(GTK_ENTRY(spin), 8);
gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), spin, FALSE, FALSE, 0);
lab = gtk_label_new(_utf("MB for error correction data")); lab = gtk_label_new(_utf("MiB for error correction data"));
gtk_box_pack_start(GTK_BOX(hbox), lab, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), lab, FALSE, FALSE, 0);
gtk_widget_set_sensitive(spin, FALSE); gtk_widget_set_sensitive(spin, FALSE);
gtk_widget_set_sensitive(lab, FALSE); gtk_widget_set_sensitive(lab, FALSE);
if(!i) if(!i)
{ wl->redundancySpinA = spin; { wl->redundancySpinA = spin;
wl->radio4LabelA = lab; wl->radio4LabelA = lab;
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
} }
else else
{ wl->redundancySpinB = spin; { wl->redundancySpinB = spin;
wl->radio4LabelB = lab; wl->radio4LabelB = lab;
AddHelpWidget(lwoh, hbox); AddHelpWidget(lwoh, hbox);
} }
} }
AddHelpParagraph(lwoh, _("<b>Space-delimited redundancy</b>\n\n" AddHelpParagraph(lwoh, _("<b>Space-delimited redundancy</b>\n\n"
"Specifies the maximum size of the error correction f ile in MB. " "Specifies the maximum size of the error correction f ile in MiB. "
"dvdisaster will choose a suitable redundancy setting so that " "dvdisaster will choose a suitable redundancy setting so that "
"the overall size of the error correction file does n ot exceed " "the overall size of the error correction file does n ot exceed "
"the given limit.\n\n" "the given limit.\n\n"
"<b>Advance notice:</b> When using the same size sett ing for " "<b>Advance notice:</b> When using the same size sett ing for "
"images of vastly different size, smaller images rece ive more " "images of vastly different size, smaller images rece ive more "
"redundancy than larger ones. This is usually not wha t you want.")); "redundancy than larger ones. This is usually not wha t you want."));
/*** Preset redundancy values */ /*** Preset redundancy values */
if(Closure->redundancy) if(Closure->redundancy)
skipping to change at line 764 skipping to change at line 849
{ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio2A), TRUE); { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio2A), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio2B), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio2B), TRUE);
} }
else else
{ int last = strlen(Closure->redundancy)-1; { int last = strlen(Closure->redundancy)-1;
if(Closure->redundancy[last] == 'm') if(Closure->redundancy[last] == 'm')
{ Closure->redundancy[last] = 0; { Closure->redundancy[last] = 0;
gtk_spin_button_set_value(GTK_SPIN_BUTTON(wl->redundancySpinA), atoi( Closure->redundancy)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(wl->redundancySpinA), atoi( Closure->redundancy));
gtk_spin_button_set_value(GTK_SPIN_BUTTON(wl->redundancySpinB), atoi( Closure->redundancy)); gtk_spin_button_set_value(GTK_SPIN_BUTTON(wl->redundancySpinB), atoi( Closure->redundancy));
Closure->redundancy[last] = 'm';
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio4A), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio4A), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio4B), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio4B), TRUE);
} }
else else
{ gtk_range_set_value(GTK_RANGE(wl->redundancyScaleA), atoi(Closure->re dundancy)); { gtk_range_set_value(GTK_RANGE(wl->redundancyScaleA), atoi(Closure->re dundancy));
gtk_range_set_value(GTK_RANGE(wl->redundancyScaleB), atoi(Closure->re dundancy)); gtk_range_set_value(GTK_RANGE(wl->redundancyScaleB), atoi(Closure->re dundancy));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio3A), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio3A), TRUE);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio3B), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wl->radio3B), TRUE);
} }
} }
} }
/* Memory utilization */ /* Memory utilization */
frame = gtk_frame_new(_utf("Memory utilization")); frame = gtk_frame_new(_utf("Memory utilization"));
gtk_box_pack_start(GTK_BOX(parent), frame, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(parent), frame, FALSE, FALSE, 0);
text = g_strdup_printf(_("%d MB of file cache"), Closure->cacheMB); text = g_strdup_printf(_("%d MiB of file cache"), Closure->cacheMiB);
lwoh = CreateLabelWithOnlineHelp(_("File cache"), text); lwoh = CreateLabelWithOnlineHelp(_("File cache"), text);
RegisterPreferencesHelpWindow(lwoh); RegisterPreferencesHelpWindow(lwoh);
g_free(text); g_free(text);
wl->cacheLwoh = lwoh; wl->cacheLwoh = lwoh;
LockLabelSize(GTK_LABEL(lwoh->normalLabel), _utf("%d MB of file cache"), 2222 LockLabelSize(GTK_LABEL(lwoh->normalLabel), _utf("%d MiB of file cache"), 222
); 2);
LockLabelSize(GTK_LABEL(lwoh->linkLabel), _utf("%d MB of file cache"), 2222); LockLabelSize(GTK_LABEL(lwoh->linkLabel), _utf("%d MiB of file cache"), 2222)
;
for(i=0; i<2; i++) for(i=0; i<2; i++)
{ GtkWidget *hbox = gtk_hbox_new(FALSE, 4); { GtkWidget *hbox = gtk_hbox_new(FALSE, 4);
int n_entries = sizeof(cache_size)/sizeof(int); int n_entries = sizeof(cache_size)/sizeof(int);
lab = gtk_label_new(_utf("Use")); lab = gtk_label_new(_utf("Use"));
gtk_box_pack_start(GTK_BOX(hbox), lab, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), lab, FALSE, FALSE, 0);
for(index = 0; index < n_entries; index++) for(index = 0; index < n_entries; index++)
if(cache_size[index] > Closure->cacheMB) if(cache_size[index] > Closure->cacheMiB)
break; break;
scale = gtk_hscale_new_with_range(0,n_entries-1,1); scale = gtk_hscale_new_with_range(0,n_entries-1,1);
gtk_scale_set_value_pos(GTK_SCALE(scale), GTK_POS_RIGHT); gtk_scale_set_value_pos(GTK_SCALE(scale), GTK_POS_RIGHT);
gtk_range_set_increments(GTK_RANGE(scale), 1, 1); gtk_range_set_increments(GTK_RANGE(scale), 1, 1);
gtk_range_set_value(GTK_RANGE(scale), index > 0 ? index-1 : index); gtk_range_set_value(GTK_RANGE(scale), index > 0 ? index-1 : index);
g_signal_connect(scale, "format-value", G_CALLBACK(format_cb), (gpointer)P REF_CACHE); g_signal_connect(scale, "format-value", G_CALLBACK(format_cb), (gpointer)P REF_CACHE);
g_signal_connect(scale, "value-changed", G_CALLBACK(cache_cb), (gpointer)w l); g_signal_connect(scale, "value-changed", G_CALLBACK(cache_cb), (gpointer)w l);
gtk_box_pack_start(GTK_BOX(hbox), scale, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), scale, TRUE, TRUE, 0);
skipping to change at line 825 skipping to change at line 911
else else
{ wl->cacheScaleB = scale; { wl->cacheScaleB = scale;
gtk_box_pack_start(GTK_BOX(hbox), lwoh->normalLabel, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), lwoh->normalLabel, FALSE, FALSE, 0);
AddHelpWidget(lwoh, hbox); AddHelpWidget(lwoh, hbox);
} }
} }
AddHelpParagraph(lwoh, _("<b>File cache</b>\n\n" AddHelpParagraph(lwoh, _("<b>File cache</b>\n\n"
"dvdisaster optimizes access to the image and error c orrection " "dvdisaster optimizes access to the image and error c orrection "
"files by maintaining its own cache. " "files by maintaining its own cache. "
"The preset of 32MB is suitable for most systems.")); "The preset of 32MiB is suitable for most systems.")) ;
} }
 End of changes. 26 change blocks. 
30 lines changed or deleted 124 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS