aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-07-15 00:44:35 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-07-15 00:44:35 +0800
commita73d4d600b8be7e21cd6ea9e956f6a7c6c3e4828 (patch)
treef597297100d3eaeb0dc76819a37e43d966f06a84 /src
parente1ddd3e07929a6200ae58272b22c8bb98de323c7 (diff)
downloadgsoc2013-epiphany-a73d4d600b8be7e21cd6ea9e956f6a7c6c3e4828.tar
gsoc2013-epiphany-a73d4d600b8be7e21cd6ea9e956f6a7c6c3e4828.tar.gz
gsoc2013-epiphany-a73d4d600b8be7e21cd6ea9e956f6a7c6c3e4828.tar.bz2
gsoc2013-epiphany-a73d4d600b8be7e21cd6ea9e956f6a7c6c3e4828.tar.lz
gsoc2013-epiphany-a73d4d600b8be7e21cd6ea9e956f6a7c6c3e4828.tar.xz
gsoc2013-epiphany-a73d4d600b8be7e21cd6ea9e956f6a7c6c3e4828.tar.zst
gsoc2013-epiphany-a73d4d600b8be7e21cd6ea9e956f6a7c6c3e4828.zip
Improve sort/priority API.
2004-07-14 Marco Pesenti Gritti <marco@gnome.org> * lib/widgets/ephy-node-view.c: (compare_string_values), (ephy_node_view_sort_func), (ephy_node_view_add_data_column), (ephy_node_view_add_column), (ephy_node_view_set_priority), (ephy_node_view_set_sort), (ephy_node_view_init): * lib/widgets/ephy-node-view.h: Improve sort/priority API. * src/bookmarks/ephy-bookmarks-editor.c: (ephy_bookmarks_editor_construct): * src/ephy-encoding-dialog.c: (ephy_encoding_dialog_init): * src/ephy-history-window.c: (ephy_history_window_construct): Sort history items by last visit
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c14
-rw-r--r--src/ephy-encoding-dialog.c6
-rw-r--r--src/ephy-history-window.c17
3 files changed, 25 insertions, 12 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index a22ae3191..26f657154 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -1500,10 +1500,13 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
ephy_node_view_add_column (EPHY_NODE_VIEW (key_view), _("Topics"),
G_TYPE_STRING,
EPHY_NODE_KEYWORD_PROP_NAME,
- EPHY_NODE_KEYWORD_PROP_PRIORITY,
- EPHY_NODE_VIEW_AUTO_SORT |
+ EPHY_NODE_VIEW_SHOW_PRIORITY |
EPHY_NODE_VIEW_EDITABLE |
EPHY_NODE_VIEW_SEARCHABLE, NULL);
+ ephy_node_view_set_priority (EPHY_NODE_VIEW (key_view),
+ EPHY_NODE_KEYWORD_PROP_PRIORITY);
+ ephy_node_view_set_sort (EPHY_NODE_VIEW (key_view), G_TYPE_STRING,
+ EPHY_NODE_KEYWORD_PROP_NAME, GTK_SORT_ASCENDING);
gtk_container_add (GTK_CONTAINER (scrolled_window), key_view);
gtk_widget_set_size_request (key_view, 130, -1);
gtk_widget_show (key_view);
@@ -1560,15 +1563,16 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor)
col_id);
editor->priv->title_col = ephy_node_view_add_column
(EPHY_NODE_VIEW (bm_view), _("Title"),
- G_TYPE_STRING, EPHY_NODE_BMK_PROP_TITLE, -1,
- EPHY_NODE_VIEW_AUTO_SORT |
+ G_TYPE_STRING, EPHY_NODE_BMK_PROP_TITLE,
EPHY_NODE_VIEW_EDITABLE |
EPHY_NODE_VIEW_SEARCHABLE,
provide_favicon);
editor->priv->address_col = ephy_node_view_add_column
(EPHY_NODE_VIEW (bm_view), _("Address"),
G_TYPE_STRING, EPHY_NODE_BMK_PROP_LOCATION,
- -1, 0, NULL);
+ 0, NULL);
+ ephy_node_view_set_sort (EPHY_NODE_VIEW (bm_view), G_TYPE_STRING,
+ EPHY_NODE_BMK_PROP_TITLE, GTK_SORT_ASCENDING);
gtk_container_add (GTK_CONTAINER (scrolled_window), bm_view);
gtk_widget_show (bm_view);
editor->priv->bm_view = bm_view;
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c
index adf0f61f3..3f6cae00b 100644
--- a/src/ephy-encoding-dialog.c
+++ b/src/ephy-encoding-dialog.c
@@ -315,11 +315,13 @@ ephy_encoding_dialog_init (EphyEncodingDialog *dialog)
ephy_node_view_add_column (EPHY_NODE_VIEW (treeview), _("Encodings"),
G_TYPE_STRING,
EPHY_NODE_ENCODING_PROP_TITLE_ELIDED,
- -1,
- EPHY_NODE_VIEW_AUTO_SORT |
EPHY_NODE_VIEW_SEARCHABLE,
NULL);
+ ephy_node_view_set_sort (EPHY_NODE_VIEW (treeview), G_TYPE_STRING,
+ EPHY_NODE_ENCODING_PROP_TITLE_ELIDED,
+ GTK_SORT_ASCENDING);
+
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(treeview), FALSE);
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index 76da44ec3..69f3a3c91 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -1272,10 +1272,14 @@ ephy_history_window_construct (EphyHistoryWindow *editor)
ephy_node_view_add_column (EPHY_NODE_VIEW (sites_view), _("Sites"),
G_TYPE_STRING,
EPHY_NODE_PAGE_PROP_TITLE,
- EPHY_NODE_PAGE_PROP_PRIORITY,
- EPHY_NODE_VIEW_AUTO_SORT |
- EPHY_NODE_VIEW_SEARCHABLE,
+ EPHY_NODE_VIEW_SEARCHABLE |
+ EPHY_NODE_VIEW_SHOW_PRIORITY,
provide_favicon);
+ ephy_node_view_set_priority (EPHY_NODE_VIEW (sites_view),
+ EPHY_NODE_PAGE_PROP_PRIORITY);
+ ephy_node_view_set_sort (EPHY_NODE_VIEW (sites_view), G_TYPE_STRING,
+ EPHY_NODE_PAGE_PROP_TITLE,
+ GTK_SORT_ASCENDING);
gtk_container_add (GTK_CONTAINER (scrolled_window), sites_view);
gtk_widget_show (sites_view);
editor->priv->sites_view = sites_view;
@@ -1325,15 +1329,18 @@ ephy_history_window_construct (EphyHistoryWindow *editor)
n_page_drag_types, col_id);
col = ephy_node_view_add_column (EPHY_NODE_VIEW (pages_view), _("Title"),
G_TYPE_STRING, EPHY_NODE_PAGE_PROP_TITLE,
- -1, EPHY_NODE_VIEW_USER_SORT |
+ EPHY_NODE_VIEW_SORTABLE |
EPHY_NODE_VIEW_SEARCHABLE, NULL);
gtk_tree_view_column_set_max_width (col, 250);
editor->priv->title_col = col;
col = ephy_node_view_add_column (EPHY_NODE_VIEW (pages_view), _("Address"),
G_TYPE_STRING, EPHY_NODE_PAGE_PROP_LOCATION,
- -1, EPHY_NODE_VIEW_USER_SORT, NULL);
+ EPHY_NODE_VIEW_SORTABLE, NULL);
gtk_tree_view_column_set_max_width (col, 200);
editor->priv->address_col = col;
+ ephy_node_view_set_sort (EPHY_NODE_VIEW (pages_view), G_TYPE_INT,
+ EPHY_NODE_PAGE_PROP_LAST_VISIT,
+ GTK_SORT_DESCENDING);
gtk_container_add (GTK_CONTAINER (scrolled_window), pages_view);
gtk_widget_show (pages_view);
editor->priv->pages_view = pages_view;