[cairo-commit] roadster/src searchwindow.c,1.22,1.23
Ian McIntosh
commit at pdx.freedesktop.org
Sun Sep 25 14:16:22 PDT 2005
Committed by: ian
Update of /cvs/cairo/roadster/src
In directory gabe:/tmp/cvs-serv28982/src
Modified Files:
searchwindow.c
Log Message:
* data/roadster.glade: Ooops, didn't mean to commit vertical sidebar tabs. :)
Index: searchwindow.c
===================================================================
RCS file: /cvs/cairo/roadster/src/searchwindow.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- searchwindow.c 25 Sep 2005 19:02:37 -0000 1.22
+++ searchwindow.c 25 Sep 2005 21:16:20 -0000 1.23
@@ -65,7 +65,7 @@
GtkListStore* pResultsListStore;
GHashTable* pResultsHashTable;
-
+
GtkMenuItem* pNextSearchResultMenuItem;
GtkMenuItem* pPreviousSearchResultMenuItem;
@@ -74,6 +74,7 @@
static void searchwindow_on_resultslist_selection_changed(GtkTreeSelection *treeselection, gpointer user_data);
static void searchwindow_set_message(gchar* pszMessage);
+static void searchwindow_update_next_and_prev_buttons();
void searchwindow_init(GladeXML* pGladeXML)
{
@@ -108,6 +109,8 @@
// Attach handler for selection-changed signal
GtkTreeSelection *pTreeSelection = gtk_tree_view_get_selection(g_SearchWindow.pResultsTreeView);
g_signal_connect(G_OBJECT(pTreeSelection), "changed", (GtkSignalFunc)searchwindow_on_resultslist_selection_changed, NULL);
+
+ searchwindow_update_next_and_prev_buttons();
}
void searchwindow_clear_results(void)
@@ -120,6 +123,14 @@
// Scroll window all the way left. (Vertical scroll is reset by emptying the list.)
gtk_adjustment_set_value(gtk_tree_view_get_hadjustment(g_SearchWindow.pResultsTreeView), 0.0);
+
+ searchwindow_update_next_and_prev_buttons();
+}
+
+static void searchwindow_update_next_and_prev_buttons()
+{
+ gtk_widget_set_sensitive(g_SearchWindow.pNextSearchResultMenuItem, g_SearchWindow.nNumResults > 0);
+ gtk_widget_set_sensitive(g_SearchWindow.pPreviousSearchResultMenuItem, g_SearchWindow.nNumResults > 0);
}
void searchwindow_set_message(gchar* pszMessage)
@@ -200,6 +211,7 @@
g_hash_table_destroy(g_SearchWindow.pResultsHashTable);
//gtk_widget_set_sensitive(GTK_WIDGET(g_SearchWindow.pSearchButton), TRUE);
+ searchwindow_update_next_and_prev_buttons();
}
// add a result row to the list
@@ -297,16 +309,19 @@
static void searchwindow_on_resultslist_selection_changed(GtkTreeSelection *treeselection, gpointer user_data)
{
searchwindow_go_to_selected_result();
+ searchwindow_update_next_and_prev_buttons();
}
void searchwindow_on_nextresultbutton_clicked(GtkWidget *pWidget, gpointer* p)
{
util_gtk_tree_view_select_next(g_SearchWindow.pResultsTreeView);
+ searchwindow_update_next_and_prev_buttons();
}
void searchwindow_on_previousresultbutton_clicked(GtkWidget *pWidget, gpointer* p)
{
util_gtk_tree_view_select_previous(g_SearchWindow.pResultsTreeView);
+ searchwindow_update_next_and_prev_buttons();
}
void searchwindow_on_searchentry_changed(GtkWidget *pWidget, gpointer* p)
More information about the cairo-commit
mailing list