[epiphany] Revert "prefs-dialog: Bring back default encoding preference"



commit bb0f1f29f6fe02b461b51c701278f8fdbc2c63b3
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Feb 22 19:16:52 2017 -0600

    Revert "prefs-dialog: Bring back default encoding preference"
    
    This reverts commit 88aacc4f86762c805d2abf092c727e363282b64f.
    
    This combo is seriously broken; it only opens the first time you click
    on it, and the menu opens way off on the left side of the screen. It's
    just too broken to have in 3.24. Oh well.

 src/prefs-dialog.c                |   75 -------------------------------------
 src/resources/gtk/prefs-dialog.ui |   39 -------------------
 2 files changed, 0 insertions(+), 114 deletions(-)
---
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 6c6df87..b866e1f 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -28,7 +28,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"
@@ -102,7 +101,6 @@ struct _PrefsDialog {
   GtkWidget *clear_personal_data_button;
 
   /* language */
-  GtkWidget *default_encoding_combo;
   GtkTreeView *lang_treeview;
   GtkWidget *lang_add_button;
   GtkWidget *lang_remove_button;
@@ -150,12 +148,6 @@ typedef struct {
 #endif
 
 enum {
-  COL_TITLE_ELIDED,
-  COL_ENCODING,
-  NUM_COLS
-};
-
-enum {
   SEARCH_ENGINE_COL_NAME,
   SEARCH_ENGINE_COL_STOCK_URL,
   SEARCH_ENGINE_COL_URL,
@@ -628,7 +620,6 @@ prefs_dialog_class_init (PrefsDialogClass *klass)
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, clear_personal_data_button);
 
   /* language */
-  gtk_widget_class_bind_template_child (widget_class, PrefsDialog, default_encoding_combo);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, lang_treeview);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, lang_add_button);
   gtk_widget_class_bind_template_child (widget_class, PrefsDialog, lang_remove_button);
@@ -728,67 +719,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->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)
@@ -1858,7 +1788,6 @@ static void
 setup_language_page (PrefsDialog *dialog)
 {
   GSettings *web_settings;
-  EphyEncodings *encodings;
 
   web_settings = ephy_settings_get (EPHY_PREFS_WEB_SCHEMA);
 
@@ -1868,10 +1797,6 @@ setup_language_page (PrefsDialog *dialog)
                    "active",
                    G_SETTINGS_BIND_DEFAULT);
 
-  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/gtk/prefs-dialog.ui b/src/resources/gtk/prefs-dialog.ui
index 42fabc6..7af529c 100644
--- a/src/resources/gtk/prefs-dialog.ui
+++ b/src/resources/gtk/prefs-dialog.ui
@@ -666,45 +666,6 @@
                       <object class="GtkLabel">
                         <property name="visible">True</property>
                         <property name="halign">start</property>
-                        <property name="label" translatable="yes">Encodings</property>
-                        <attributes>
-                          <attribute name="weight" value="bold"/>
-                        </attributes>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="GtkGrid">
-                        <property name="visible">True</property>
-                        <property name="column-spacing">12</property>
-                        <property name="margin-start">12</property>
-                        <child>
-                          <object class="GtkLabel">
-                            <property name="visible">True</property>
-                            <property name="halign">start</property>
-                            <property name="label" translatable="yes">De_fault:</property>
-                            <property name="use-underline">True</property>
-                            <property name="mnemonic-widget">default_encoding_combo</property>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtkComboBox" id="default_encoding_combo">
-                            <property name="visible">True</property>
-                            <property name="hexpand">True</property>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkBox">
-                    <property name="visible">True</property>
-                    <property name="orientation">vertical</property>
-                    <property name="spacing">6</property>
-                    <child>
-                      <object class="GtkLabel">
-                        <property name="visible">True</property>
-                        <property name="halign">start</property>
                         <property name="label" translatable="yes">Languages</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]