fancy_prefs.enable_proxy = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON(prefs_page->proxy_checkbox));
fancy_prefs.proxy_str = pref_get_pref_from_entry(GTK_ENTRY(prefs_page->proxy_str));
+#ifdef G_OS_WIN32
+ /* pref_get_pref_from_entry() escapes the backslashes in strings,
+ * we do not want that, since this entry contains a Windows path.
+ * Let's just strdup it. */
+ fancy_prefs.stylesheet = g_strdup(gtk_entry_get_text(
+ GTK_ENTRY(prefs_page->stylesheet)));
+#else
fancy_prefs.stylesheet = pref_get_pref_from_entry(GTK_ENTRY(prefs_page->stylesheet));
+#endif
save_fancy_prefs(page);
}
viewer->override_prefs_plugins = fancy_prefs.enable_plugins;
viewer->override_prefs_java = fancy_prefs.enable_java;
- gchar *tmp = g_uri_escape_string(fancy_prefs.stylesheet, "/", TRUE);
+ gchar *tmp;
+#ifdef G_OS_WIN32
+ /* Replace backslashes with forward slashes, since we'll be
+ * using this string in an URI. */
+ gchar *tmp2 = g_strdup(fancy_prefs.stylesheet);
+ gchar *c;
+ for (c = tmp2; *c != '\0'; c++) {
+ if (*c == '\\')
+ *c = '/';
+ }
+
+ /* Escape string for use in an URI, keeping dir separators
+ * and colon for Windows drive name ("C:") intact. */
+ tmp = g_uri_escape_string(tmp2, "/:", TRUE);
+ g_free(tmp2);
+#else
+ /* Escape string for use in an URI, keeping dir separators
+ * intact. */
+ tmp = g_uri_escape_string(fancy_prefs.stylesheet, "/", TRUE);
+#endif
viewer->override_stylesheet = g_strconcat("file://", tmp, NULL);
g_free(tmp);
- debug_print("Passing '%s' stylesheet URI to Webkit\n",
+ debug_print("Passing '%s' as stylesheet URI to Webkit\n",
viewer->override_stylesheet);
g_signal_handlers_block_by_func(G_OBJECT(viewer->enable_images),