[epiphany/wip/mcatanzaro/fedora-needs-upstreamed: 14/20] Remove encoding preference from preferences dialog
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/mcatanzaro/fedora-needs-upstreamed: 14/20] Remove encoding preference from preferences dialog
- Date: Thu, 26 Feb 2015 21:05:33 +0000 (UTC)
commit b71ff83e378aa5ca356df324a121b2158438695c
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Wed Aug 6 15:41:00 2014 -0500
Remove encoding preference from preferences dialog
I can't see any benefit to this setting, besides to confuse and break
pages.
This patch does not remove the encodings dialog that allows changing the
encoding on the current page, and it doesn't remove encodings from the
window menu. We should consider these as well. Users don't need to know
anything about encodings and Firefox doesn't allow changing encoding at
all anymore.
https://bugzilla.gnome.org/show_bug.cgi?id=734381
src/prefs-dialog.c | 77 -----------------------------------------
src/resources/prefs-dialog.ui | 70 -------------------------------------
2 files changed, 0 insertions(+), 147 deletions(-)
---
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 578b158..33b5135 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -29,7 +29,6 @@
#include "ephy-embed-prefs.h"
#include "ephy-embed-shell.h"
#include "ephy-embed-utils.h"
-#include "ephy-encodings.h"
#include "ephy-file-chooser.h"
#include "ephy-file-helpers.h"
#include "ephy-gui.h"
@@ -88,7 +87,6 @@ struct PrefsDialogPrivate
GtkWidget *clear_personal_data_button;
/* language */
- GtkWidget *default_encoding_combo;
GtkTreeView *lang_treeview;
GtkWidget *lang_add_button;
GtkWidget *lang_remove_button;
@@ -104,12 +102,6 @@ struct PrefsDialogPrivate
GHashTable *iso_3166_table;
};
-enum {
- COL_TITLE_ELIDED,
- COL_ENCODING,
- NUM_COLS
-};
-
enum
{
SEARCH_ENGINE_COL_NAME,
@@ -206,7 +198,6 @@ prefs_dialog_class_init (PrefsDialogClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, PrefsDialog, clear_personal_data_button);
/* language */
- gtk_widget_class_bind_template_child_private (widget_class, PrefsDialog, default_encoding_combo);
gtk_widget_class_bind_template_child_private (widget_class, PrefsDialog, lang_treeview);
gtk_widget_class_bind_template_child_private (widget_class, PrefsDialog, lang_add_button);
gtk_widget_class_bind_template_child_private (widget_class, PrefsDialog, lang_remove_button);
@@ -298,69 +289,6 @@ combo_set_mapping (const GValue *value,
}
static void
-create_node_combo (PrefsDialog *dialog,
- EphyEncodings *encodings,
- const char *default_value)
-{
- GtkComboBox *combo;
- GtkCellRenderer *renderer;
- GtkListStore *store;
- GList *all_encodings, *p;
- char *code;
-
- code = g_settings_get_string (EPHY_SETTINGS_WEB,
- EPHY_PREFS_WEB_DEFAULT_ENCODING);
- if (code == NULL || ephy_encodings_get_encoding (encodings, code, FALSE) == NULL)
- {
- /* safe default */
- g_settings_set_string (EPHY_SETTINGS_WEB,
- EPHY_PREFS_WEB_DEFAULT_ENCODING,
- default_value);
- }
- g_free (code);
-
- combo = GTK_COMBO_BOX (dialog->priv->default_encoding_combo);
-
- store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_STRING);
- all_encodings = ephy_encodings_get_all (encodings);
- for (p = all_encodings; p; p = p->next)
- {
- GtkTreeIter iter;
- EphyEncoding *encoding = EPHY_ENCODING (p->data);
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- COL_TITLE_ELIDED,
- ephy_encoding_get_title_elided (encoding),
- -1);
- gtk_list_store_set (store, &iter,
- COL_ENCODING,
- ephy_encoding_get_encoding (encoding),
- -1);
- }
- g_list_free (all_encodings);
-
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), COL_TITLE_ELIDED,
- GTK_SORT_ASCENDING);
- gtk_combo_box_set_model (combo, GTK_TREE_MODEL (store));
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer,
- "text", COL_TITLE_ELIDED,
- NULL);
-
- g_settings_bind_with_mapping (EPHY_SETTINGS_WEB,
- EPHY_PREFS_WEB_DEFAULT_ENCODING,
- combo, "active",
- G_SETTINGS_BIND_DEFAULT,
- combo_get_mapping,
- combo_set_mapping,
- combo,
- NULL);
-}
-
-static void
language_editor_add (PrefsDialog *pd,
const char *code,
const char *desc)
@@ -1305,7 +1233,6 @@ setup_language_page (PrefsDialog *dialog)
{
PrefsDialogPrivate *priv = dialog->priv;
GSettings *web_settings;
- EphyEncodings *encodings;
web_settings = ephy_settings_get (EPHY_PREFS_WEB_SCHEMA);
@@ -1315,10 +1242,6 @@ setup_language_page (PrefsDialog *dialog)
"active",
G_SETTINGS_BIND_DEFAULT);
- encodings = EPHY_ENCODINGS (ephy_embed_shell_get_encodings (EPHY_EMBED_SHELL (ephy_shell_get_default
())));
-
- create_node_combo (dialog, encodings, "ISO-8859-1");
-
create_language_section (dialog);
}
diff --git a/src/resources/prefs-dialog.ui b/src/resources/prefs-dialog.ui
index 8d17471..630453b 100644
--- a/src/resources/prefs-dialog.ui
+++ b/src/resources/prefs-dialog.ui
@@ -981,76 +981,6 @@
<property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
- <object class="GtkBox" id="vbox156">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label1242">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">Encodings</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table72">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
- <property name="margin_start">12</property>
- <child>
- <object class="GtkLabel" id="default_encoding_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="label" translatable="yes">De_fault:</property>
- <property name="use_underline">True</property>
- <property name="justify">center</property>
- <property name="mnemonic_widget">default_encoding_combo</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"/>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="default_encoding_combo">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<object class="GtkBox" id="vbox191">
<property name="visible">True</property>
<property name="can_focus">False</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]