[devhelp: 4/9] sidebar: remove [Current][All Books] filter buttons
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp: 4/9] sidebar: remove [Current][All Books] filter buttons
- Date: Mon, 7 Oct 2013 06:43:43 +0000 (UTC)
commit 2282590027b8cf3b139a9099c4c53167efb3739f
Author: Aleksander Morgado <aleksander lanedo com>
Date: Sun Sep 29 17:28:56 2013 +0200
sidebar: remove [Current][All Books] filter buttons
Search is always done in all books, sorting current ones first.
https://bugzilla.gnome.org/show_bug.cgi?id=707608
src/dh-sidebar.c | 39 +--------------------------------------
1 files changed, 1 insertions(+), 38 deletions(-)
---
diff --git a/src/dh-sidebar.c b/src/dh-sidebar.c
index 17be54e..5894dc1 100644
--- a/src/dh-sidebar.c
+++ b/src/dh-sidebar.c
@@ -43,8 +43,6 @@ typedef struct {
DhLink *selected_link;
- GtkWidget *search_all_button;
- GtkWidget *search_current_button;
GtkWidget *entry;
GtkWidget *hitlist;
GtkWidget *sw_hitlist;
@@ -86,9 +84,7 @@ sidebar_filter_idle (DhSidebar *sidebar)
str = gtk_entry_get_text (GTK_ENTRY (priv->entry));
- book_link = (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->search_all_button)) ?
- NULL :
- dh_sidebar_get_selected_book (sidebar));
+ book_link = dh_sidebar_get_selected_book (sidebar);
link = dh_keyword_model_filter (priv->model,
str,
@@ -351,9 +347,6 @@ dh_sidebar_set_search_string (DhSidebar *sidebar,
priv = dh_sidebar_get_instance_private (sidebar);
- /* Mark "All books" as active */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->search_all_button), TRUE);
-
g_signal_handlers_block_by_func (priv->entry,
sidebar_entry_changed_cb,
sidebar);
@@ -409,15 +402,6 @@ search_cell_data_func (GtkTreeViewColumn *tree_column,
/******************************************************************************/
static void
-search_filter_button_toggled (GtkToggleButton *button,
- DhSidebar *sidebar)
-{
- sidebar_search_run_idle (sidebar);
-}
-
-/******************************************************************************/
-
-static void
sidebar_book_tree_link_selected_cb (GObject *ignored,
DhLink *link,
DhSidebar *sidebar)
@@ -492,7 +476,6 @@ dh_sidebar_init (DhSidebar *sidebar)
DhSidebarPrivate *priv;
GtkCellRenderer *cell;
GtkWidget *hbox;
- GtkWidget *button_box;
priv = dh_sidebar_get_instance_private (sidebar);
@@ -527,26 +510,6 @@ dh_sidebar_init (DhSidebar *sidebar)
G_CALLBACK (sidebar_entry_text_inserted_cb),
sidebar);
- /* Setup the Current/All Files selector */
- priv->search_current_button = gtk_radio_button_new_with_label (NULL, _("Current"));
- gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (priv->search_current_button), FALSE);
- priv->search_all_button = gtk_radio_button_new_with_label_from_widget (GTK_RADIO_BUTTON
(priv->search_current_button),
- _("All Books"));
- gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (priv->search_all_button), FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->search_all_button), TRUE);
- g_signal_connect (priv->search_current_button,
- "toggled",
- G_CALLBACK (search_filter_button_toggled),
- sidebar);
- button_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_box_pack_start (GTK_BOX (hbox), button_box, FALSE, FALSE, 0);
- gtk_style_context_add_class (gtk_widget_get_style_context (button_box),
- GTK_STYLE_CLASS_LINKED);
- gtk_style_context_add_class (gtk_widget_get_style_context (button_box),
- GTK_STYLE_CLASS_RAISED);
- gtk_box_pack_start (GTK_BOX (button_box), priv->search_current_button, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (button_box), priv->search_all_button, FALSE, FALSE, 0);
-
/* Setup the hitlist */
priv->sw_hitlist = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_no_show_all (priv->sw_hitlist, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]