aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog17
-rw-r--r--data/glade/epiphany.glade192
-rw-r--r--embed/ephy-encodings.c68
-rw-r--r--embed/ephy-encodings.h2
-rw-r--r--src/ephy-encoding-dialog.c183
5 files changed, 243 insertions, 219 deletions
diff --git a/ChangeLog b/ChangeLog
index 86bede8c7..4e236b854 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2003-10-20 Christian Persch <chpe@cvs.gnome.org>
+
+ Encoding menu improvements, Episode V:
+ MPT strikes back.
+
+ * data/glade/epiphany.glade:
+ * embed/ephy-encodings.c: (ephy_encodings_finalize),
+ (ephy_encodings_init):
+ * embed/ephy-encodings.h:
+ * src/ephy-encoding-dialog.c: (encoding_is_automatic),
+ (sync_embed_cb), (activate_choice),
+ (ephy_encoding_dialog_response_cb), (view_node_selected_cb),
+ (view_node_activated_cb), (ephy_encoding_dialog_init):
+
+ Replace the 2-pane view with a single list, and restore
+ the automatic and manual radio buttons.
+
2003-10-20 Marco Pesenti Gritti <marco@gnome.org>
* src/ephy-history-window.c: (setup_filters),
diff --git a/data/glade/epiphany.glade b/data/glade/epiphany.glade
index a443fc3a2..ec66aef85 100644
--- a/data/glade/epiphany.glade
+++ b/data/glade/epiphany.glade
@@ -919,8 +919,8 @@ It's not possible to view this file type directly in the browser:</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
- <property name="default_width">400</property>
- <property name="default_height">380</property>
+ <property name="default_width">300</property>
+ <property name="default_height">420</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">False</property>
@@ -960,18 +960,6 @@ It's not possible to view this file type directly in the browser:</property>
<property name="response_id">-5</property>
</widget>
</child>
-
- <child>
- <widget class="GtkButton" id="automatic_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Automatic</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-11</property>
- </widget>
- </child>
</widget>
<packing>
<property name="padding">0</property>
@@ -982,53 +970,187 @@ It's not possible to view this file type directly in the browser:</property>
</child>
<child>
- <widget class="GtkVBox" id="vbox147">
+ <widget class="GtkVBox" id="vbox144">
<property name="border_width">5</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
- <property name="spacing">0</property>
+ <property name="spacing">18</property>
<child>
- <widget class="GtkHPaned" id="hpaned1">
+ <widget class="GtkVBox" id="vbox148">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="position">128</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
<child>
- <widget class="GtkScrolledWindow" id="categories_scroller">
+ <widget class="GtkRadioButton" id="automatic_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+ <property name="label" translatable="yes">&lt;b&gt;_Automatic&lt;/b&gt;</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox101">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="higlabel2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
<child>
- <placeholder/>
+ <widget class="GtkLabel" id="label1246">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Use the encoding specified by the document</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">True</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
</child>
</widget>
<packing>
- <property name="shrink">True</property>
- <property name="resize">False</property>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
</packing>
</child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkVBox" id="manual_vbox">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkScrolledWindow" id="list_scroller">
+ <widget class="GtkRadioButton" id="manual_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+ <property name="label" translatable="yes">&lt;b&gt;Use a different _encoding:&lt;/b&gt;</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">automatic_button</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox100">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkLabel" id="higlabel1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes"> </property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
<child>
- <placeholder/>
+ <widget class="GtkVBox" id="vbox146">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">6</property>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolled_window">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
</child>
</widget>
<packing>
- <property name="shrink">True</property>
- <property name="resize">True</property>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
</packing>
</child>
</widget>
diff --git a/embed/ephy-encodings.c b/embed/ephy-encodings.c
index 1105207df..51e2d3a52 100644
--- a/embed/ephy-encodings.c
+++ b/embed/ephy-encodings.c
@@ -41,7 +41,6 @@ struct EphyEncodingsPrivate
EphyNode *root;
EphyNode *encodings;
EphyNode *detectors;
- EphyNode *categories;
GHashTable *hash;
GSList *recent;
};
@@ -151,30 +150,11 @@ encoding_entries [] =
};
static const guint n_encoding_entries = G_N_ELEMENTS (encoding_entries);
-/* make sure this covers all LG_* groups ! */
-/* FIXME: those categories are pretty bad :( */
-static const struct
-{
- char *title;
- EphyLanguageGroup groups;
-}
-geo_entries [] =
-{
- { N_("Universal"), LG_UNICODE },
- { N_("Eastern Asia"), LG_CHINESE_SIMP | LG_CHINESE_TRAD | LG_JAPANESE | LG_KOREAN | LG_VIETNAMESE | LG_THAI },
- { N_("Western Asia"), LG_CAUCASIAN | LG_TURKISH | LG_INDIAN },
- { N_("Eastern European"), LG_BALTIC | LG_CYRILLIC | LG_UKRAINIAN | LG_C_EUROPEAN },
- { N_("Western European"), LG_WESTERN | LG_GREEK | LG_NORDIC | LG_SE_EUROPEAN },
- { N_("Middle Eastern"), LG_ARABIC | LG_PERSIAN | LG_HEBREW }
-};
-static const guint n_geo_entries = G_N_ELEMENTS (geo_entries);
-
enum
{
ALL_NODE_ID = 2,
ENCODINGS_NODE_ID = 3,
- DETECTORS_NODE_ID = 5,
- CATEGORIES_NODE_ID = 7
+ DETECTORS_NODE_ID = 5
};
#define RECENT_KEY "/apps/epiphany/general/recent_encodings"
@@ -222,7 +202,6 @@ ephy_encodings_finalize (GObject *object)
ephy_node_unref (encodings->priv->encodings);
ephy_node_unref (encodings->priv->detectors);
- ephy_node_unref (encodings->priv->categories);
ephy_node_unref (encodings->priv->root);
g_slist_foreach (encodings->priv->recent, (GFunc) g_free, NULL);
@@ -315,14 +294,6 @@ ephy_encodings_get_all (EphyEncodings *encodings)
return encodings->priv->encodings;
}
-EphyNode *
-ephy_encodings_get_categories (EphyEncodings *encodings)
-{
- g_return_val_if_fail (EPHY_IS_ENCODINGS (encodings), NULL);
-
- return encodings->priv->categories;
-}
-
void
ephy_encodings_add_recent (EphyEncodings *encodings,
const char *code)
@@ -399,12 +370,10 @@ ephy_encodings_init (EphyEncodings *encodings)
encodings->priv->root = ephy_node_new_with_id (db, ALL_NODE_ID);
encodings->priv->encodings = ephy_node_new_with_id (db, ENCODINGS_NODE_ID);
encodings->priv->detectors = ephy_node_new_with_id (db, DETECTORS_NODE_ID);
- encodings->priv->categories = ephy_node_new_with_id (db, CATEGORIES_NODE_ID);
ephy_node_ref (encodings->priv->root);
ephy_node_ref (encodings->priv->encodings);
ephy_node_ref (encodings->priv->detectors);
- ephy_node_ref (encodings->priv->categories);
/* now fill the db */
for (i = 0; i < n_encoding_entries; i++)
@@ -462,41 +431,6 @@ ephy_encodings_init (EphyEncodings *encodings)
g_value_unset (&value);
}
- /* setup list of categories for 2-pane view in ephy-encoding-dialog */
- for (i=0; i < n_geo_entries; i++)
- {
- EphyNode *node;
- GValue value = { 0, };
- GList *list, *l;
-
- node = ephy_node_new (db);
- ephy_node_add_child (encodings->priv->categories, node);
-
- g_value_init (&value, G_TYPE_STRING);
- g_value_set_string (&value, _(geo_entries[i].title));
- ephy_node_set_property (node, EPHY_NODE_ENCODING_PROP_TITLE, &value);
- g_value_unset (&value);
-
- g_value_init (&value, G_TYPE_STRING);
- g_value_take_string (&value, g_utf8_collate_key (_(geo_entries[i].title), -1));
- ephy_node_set_property (node, EPHY_NODE_ENCODING_PROP_COLLATION_KEY, &value);
- g_value_unset (&value);
-
- g_value_init (&value, G_TYPE_INT);
- g_value_set_int (&value, encoding_entries[i].groups);
- ephy_node_set_property (node, EPHY_NODE_ENCODING_PROP_LANGUAGE_GROUPS, &value);
- g_value_unset (&value);
-
- /* add the encodings to the category */
- list = ephy_encodings_get_encodings (encodings, geo_entries[i].groups);
- for (l = list; l != NULL; l = l->next)
- {
- ephy_node_add_child (node, (EphyNode *) l->data);
- }
- g_list_free (list);
-
- }
-
/* get the list of recently used encodings */
list = eel_gconf_get_string_list (RECENT_KEY);
diff --git a/embed/ephy-encodings.h b/embed/ephy-encodings.h
index 29034e13a..bae868529 100644
--- a/embed/ephy-encodings.h
+++ b/embed/ephy-encodings.h
@@ -135,8 +135,6 @@ GList *ephy_encodings_get_encodings (EphyEncodings *encodings,
EphyNode *ephy_encodings_get_all (EphyEncodings *encodings);
-EphyNode *ephy_encodings_get_categories (EphyEncodings *encodings);
-
GList *ephy_encodings_get_detectors (EphyEncodings *encodings);
void ephy_encodings_add_recent (EphyEncodings *encodings,
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c
index 5f7e653a1..b87799d44 100644
--- a/src/ephy-encoding-dialog.c
+++ b/src/ephy-encoding-dialog.c
@@ -28,7 +28,6 @@
#include "ephy-embed.h"
#include "ephy-embed-shell.h"
#include "ephy-shell.h"
-#include "ephy-gui.h"
#include "ephy-node.h"
#include "ephy-node-view.h"
#include "ephy-debug.h"
@@ -37,20 +36,24 @@
#include <gtk/gtkbutton.h>
#include <gtk/gtktreeview.h>
#include <gtk/gtktreeselection.h>
+#include <gtk/gtktogglebutton.h>
+#include <gtk/gtkdialog.h>
#include <bonobo/bonobo-i18n.h>
#include <string.h>
enum
{
- CATEGORIES_SCROLLER_PROP,
- LIST_SCROLLER_PROP
+ SCROLLED_WINDOW_PROP,
+ AUTOMATIC_PROP,
+ MANUAL_PROP
};
static const
EphyDialogProperty properties [] =
{
- { CATEGORIES_SCROLLER_PROP, "categories_scroller", NULL, PT_NORMAL, NULL },
- { LIST_SCROLLER_PROP, "list_scroller", NULL, PT_NORMAL, NULL },
+ { SCROLLED_WINDOW_PROP, "scrolled_window", NULL, PT_NORMAL, NULL },
+ { AUTOMATIC_PROP, "automatic_button", NULL, PT_NORMAL, NULL },
+ { AUTOMATIC_PROP, "manual_button", NULL, PT_NORMAL, NULL },
{ -1, NULL, NULL }
};
@@ -62,7 +65,6 @@ struct EphyEncodingDialogPrivate
EphyEncodings *encodings;
EphyWindow *window;
EphyEmbed *embed;
- GtkWidget *cat_view;
GtkWidget *enc_view;
EphyNodeFilter *filter;
EphyNode *selected_node;
@@ -111,17 +113,12 @@ ephy_encoding_dialog_get_type (void)
return ephy_type_encoding_dialog;
}
-static void
-setup_filter (EphyEncodingDialog *dialog, EphyNode *category)
+static gboolean
+encoding_is_automatic (EphyEncodingInfo *info)
{
- ephy_node_filter_empty (dialog->priv->filter);
-
- ephy_node_filter_add_expression (dialog->priv->filter,
- ephy_node_filter_expression_new (EPHY_NODE_FILTER_EXPRESSION_HAS_PARENT,
- category),
- 0);
-
- ephy_node_filter_done_changing (dialog->priv->filter);
+ g_return_val_if_fail (info != NULL, FALSE);
+
+ return (info->encoding_source < EMBED_ENCODING_PARENT_FORCED);
}
static void
@@ -129,13 +126,13 @@ sync_embed_cb (EphyEncodingDialog *dialog, GParamSpec *pspec, gpointer dummy)
{
EphyEmbed *embed;
EphyEncodingInfo *info;
- EphyNode *node, *categories;
+ EphyNode *node;
gresult result;
GtkTreeSelection *selection;
GtkTreeModel *model;
GList *rows;
- GPtrArray *children;
- int i;
+ GtkWidget *button;
+ gboolean is_automatic;
dialog->priv->update_tag = TRUE;
@@ -148,25 +145,7 @@ sync_embed_cb (EphyEncodingDialog *dialog, GParamSpec *pspec, gpointer dummy)
node = ephy_encodings_get_node (dialog->priv->encodings, info->encoding);
g_return_if_fail (EPHY_IS_NODE (node));
- /* select the correct category in the left pane ... */
- categories = ephy_encodings_get_categories (dialog->priv->encodings);
-
- children = ephy_node_get_children (categories);
- for (i = 0; i < children->len; i++)
- {
- EphyNode *kid;
-
- kid = g_ptr_array_index (children, i);
- if (ephy_node_has_child (kid, node))
- {
- ephy_node_view_select_node (EPHY_NODE_VIEW (dialog->priv->cat_view),
- kid);
- break;
- }
- }
- ephy_node_thaw (categories);
-
- /* ... and the active encoding in the right pane */
+ /* select the current encoding in the list view */
ephy_node_view_select_node (EPHY_NODE_VIEW (dialog->priv->enc_view),
node);
@@ -177,13 +156,21 @@ sync_embed_cb (EphyEncodingDialog *dialog, GParamSpec *pspec, gpointer dummy)
rows = gtk_tree_selection_get_selected_rows (selection, &model);
if (rows != NULL)
{
- gtk_tree_view_set_cursor (GTK_TREE_VIEW (dialog->priv->enc_view),
- (GtkTreePath *)rows->data,
- NULL, FALSE);
- g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
- g_list_free (rows);
+ gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (dialog->priv->enc_view),
+ (GtkTreePath *) rows->data,
+ NULL, /* column */
+ TRUE,
+ 0.5,
+ 0.0);
+ g_list_foreach (rows, (GFunc)gtk_tree_path_free, NULL);
+ g_list_free (rows);
}
+ is_automatic = encoding_is_automatic (info);
+
+ button = ephy_dialog_get_control (EPHY_DIALOG (dialog), AUTOMATIC_PROP);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), is_automatic);
+
ephy_encoding_info_free (info);
dialog->priv->update_tag = FALSE;
@@ -216,6 +203,8 @@ activate_choice (EphyEncodingDialog *dialog)
{
EphyEmbed *embed;
EphyEncodingInfo *info;
+ GtkWidget *button;
+ gboolean is_automatic;
gresult result;
LOG ("going manual")
@@ -226,7 +215,19 @@ activate_choice (EphyEncodingDialog *dialog)
result = ephy_embed_get_encoding_info (embed, &info);
if (result != G_OK || info == NULL) return;
- if (dialog->priv->selected_node != NULL)
+ button = ephy_dialog_get_control (EPHY_DIALOG (dialog), AUTOMATIC_PROP);
+ is_automatic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
+
+ if (is_automatic)
+ {
+ /* only unset if it was forced before */
+ if ((info->forced_encoding != NULL && info->forced_encoding[0] != '\0')
+ || info->encoding_source >= EMBED_ENCODING_PARENT_FORCED)
+ {
+ ephy_embed_set_encoding (embed, "");
+ }
+ }
+ else if (dialog->priv->selected_node != NULL)
{
const char *code;
@@ -245,31 +246,6 @@ activate_choice (EphyEncodingDialog *dialog)
ephy_encoding_info_free (info);
}
-static void
-activate_automatic (EphyEncodingDialog *dialog)
-{
- EphyEmbed *embed;
- EphyEncodingInfo *info;
- gresult result;
-
- LOG ("going automatic")
-
- embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog));
- g_return_if_fail (EPHY_IS_EMBED (embed));
-
- result = ephy_embed_get_encoding_info (embed, &info);
- if (result != G_OK || info == NULL) return;
-
- if ((info->forced_encoding != NULL && info->forced_encoding[0] != '\0')
- || info->encoding_source >= EMBED_ENCODING_PARENT_FORCED)
- {
- /* clear forced encoding */
- ephy_embed_set_encoding (embed, "");
- }
-
- ephy_encoding_info_free (info);
-}
-
void
ephy_encoding_dialog_response_cb (GtkWidget *widget,
gint response,
@@ -280,9 +256,6 @@ ephy_encoding_dialog_response_cb (GtkWidget *widget,
case GTK_RESPONSE_OK:
activate_choice (dialog);
break;
- case -11: /* Automatic */
- activate_automatic (dialog);
- break;
default:
break;
}
@@ -291,19 +264,18 @@ ephy_encoding_dialog_response_cb (GtkWidget *widget,
}
static void
-category_node_selected_cb (EphyNodeView *view,
- EphyNode *node,
- EphyEncodingDialog *dialog)
-{
- setup_filter (dialog, node);
-}
-
-static void
view_node_selected_cb (EphyNodeView *view,
EphyNode *node,
EphyEncodingDialog *dialog)
{
+ GtkWidget *button;
+
dialog->priv->selected_node = node;
+
+ if (dialog->priv->update_tag) return;
+
+ button = ephy_dialog_get_control (EPHY_DIALOG (dialog), MANUAL_PROP);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
}
static void
@@ -311,20 +283,24 @@ view_node_activated_cb (GtkWidget *view,
EphyNode *node,
EphyEncodingDialog *dialog)
{
+ GtkWidget *button;
+
dialog->priv->selected_node = node;
- if (dialog->priv->update_tag == FALSE)
- {
- activate_choice (dialog);
+ if (dialog->priv->update_tag) return;
- g_object_unref (dialog);
- }
+ button = ephy_dialog_get_control (EPHY_DIALOG (dialog), MANUAL_PROP);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+
+ activate_choice (dialog);
+
+ g_object_unref (dialog);
}
static void
ephy_encoding_dialog_init (EphyEncodingDialog *dialog)
{
- GtkWidget *treeview, *scroller;
+ GtkWidget *treeview, *scroller, *button;
GtkTreeSelection *selection;
EphyNode *node;
@@ -342,34 +318,6 @@ ephy_encoding_dialog_init (EphyEncodingDialog *dialog)
"epiphany.glade",
"encoding_dialog");
- node = ephy_encodings_get_categories (dialog->priv->encodings);
- treeview = ephy_node_view_new (node, dialog->priv->filter);
-
- ephy_node_view_add_column (EPHY_NODE_VIEW (treeview), _("Location"),
- G_TYPE_STRING,
- EPHY_NODE_ENCODING_PROP_TITLE,
- -1,
- EPHY_NODE_VIEW_AUTO_SORT |
- EPHY_NODE_VIEW_SEARCHABLE,
- NULL);
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
-
- g_signal_connect (G_OBJECT (treeview),
- "node_selected",
- G_CALLBACK (category_node_selected_cb),
- dialog);
-
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(treeview), FALSE);
- gtk_widget_show (treeview);
-
- scroller = ephy_dialog_get_control
- (EPHY_DIALOG (dialog), CATEGORIES_SCROLLER_PROP);
- gtk_container_add (GTK_CONTAINER (scroller), treeview);
-
- dialog->priv->cat_view = treeview;
-
dialog->priv->filter = ephy_node_filter_new ();
node = ephy_encodings_get_all (dialog->priv->encodings);
@@ -399,9 +347,14 @@ ephy_encoding_dialog_init (EphyEncodingDialog *dialog)
gtk_widget_show (treeview);
scroller = ephy_dialog_get_control
- (EPHY_DIALOG (dialog), LIST_SCROLLER_PROP);
+ (EPHY_DIALOG (dialog), SCROLLED_WINDOW_PROP);
gtk_container_add (GTK_CONTAINER (scroller), treeview);
+ button = ephy_dialog_get_control (EPHY_DIALOG (dialog), AUTOMATIC_PROP);
+ gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (button)->child), TRUE);
+ button = ephy_dialog_get_control (EPHY_DIALOG (dialog), MANUAL_PROP);
+ gtk_label_set_use_markup (GTK_LABEL (GTK_BIN (button)->child), TRUE);
+
dialog->priv->enc_view = treeview;
g_signal_connect (G_OBJECT (dialog), "notify::embed",