cpw.nader.asynclogging-3: af58ebfd: Squashed the last few appearance and beh...

morshed.nader at gmail.com morshed.nader at gmail.com
Thu Jan 13 23:40:47 EST 2011


----------------------------------------------------------------------
Revision: af58ebfd8e7173fee85848af8be4f2443de1af77
Parent:   7910f627b70d9b36993e82de093a9b26a2ea0900
Author:   morshed.nader at gmail.com
Date:     01/13/11 23:37:29
Branch:   im.pidgin.cpw.nader.asynclogging-3
URL: http://d.pidgin.im/viewmtn/revision/info/af58ebfd8e7173fee85848af8be4f2443de1af77

Changelog: 

Squashed the last few appearance and behavior bugs in PidginLogViewer

Changes against parent 7910f627b70d9b36993e82de093a9b26a2ea0900

  patched  pidgin/gtklog.c

-------------- next part --------------
============================================================
--- pidgin/gtklog.c	da6af353e452a20b59c1951461b37b2b15383a6d
+++ pidgin/gtklog.c	39143275f7fed6278591e1c6aced8ea1106d7632
@@ -100,6 +100,7 @@ struct _PidginLogViewerPrivate {
 	PurpleLogChatType  viewer_type;    /**< The log type of the window */
 	GtkWidget          *icon;
 	gboolean           need_log_size;
+	GtkWidget          *title_box;
 #if GTK_CHECK_VERSION(2, 20, 0)
 	GtkWidget          *spinner;       /**< A spinner to indicate a read is in progress */
 #endif
@@ -109,6 +110,7 @@ typedef struct {
 typedef struct {
 	PidginLogViewer *log_viewer;
 	PurpleLog *log;
+	gchar *string;
 
 	gboolean is_window_open;
 	gulong destroy_handler_id;
@@ -187,6 +189,7 @@ pidgin_log_data_free(_pidgin_log_data *d
 		g_signal_handler_disconnect(data->log_viewer,
 			data->destroy_handler_id);
 
+	g_free(data->string);
 	g_free(data);
 }
 
@@ -274,10 +277,14 @@ pidgin_log_search_done_cb(_pidgin_log_da
 		PidginLogViewer *lv = pidgin_log_data->log_viewer;
 		PidginLogViewerPrivate *priv = PIDGIN_LOG_VIEWER_GET_PRIVATE(lv);
 
-		if (!priv->selected)
-			select_first_log(lv);
+		if (priv->search == NULL ||
+			purple_strequal(priv->search, pidgin_log_data->string))
+		{
+			if (!priv->selected)
+				select_first_log(lv);
 
-		gtk_widget_hide(priv->search_bar);
+			gtk_widget_hide(priv->search_bar);
+		}
 	}
 
 	pidgin_log_data_free(pidgin_log_data);
@@ -302,17 +309,23 @@ pidgin_log_search_cb(GObject *object, GA
 		PidginLogViewer *lv = pidgin_log_data->log_viewer;
 		GtkTreeStore *treestore = pidgin_log_viewer_get_tree_store(lv);
 		GtkTreeIter iter;
-		const gchar *search = pidgin_log_viewer_get_search_string(lv);
 
-		if (*text && purple_strcasestr(text, search)) {
+		if (*text && purple_strcasestr(text, pidgin_log_data->string)) {
 			gtk_tree_store_append(treestore, &iter, NULL);
 			gtk_tree_store_set(treestore, &iter, 0, log_get_date(log), 1, log, -1);
 		}
 	}
 
 	g_clear_error(&error);
-	pidgin_log_viewer_update_search_bar(pidgin_log_data);
 
+	if (pidgin_log_data->is_window_open) {
+		const gchar *cur_search =
+			pidgin_log_viewer_get_search_string(pidgin_log_data->log_viewer);
+
+		if (purple_strequal(pidgin_log_data->string, cur_search))
+			pidgin_log_viewer_update_search_bar(pidgin_log_data);
+	}
+
 	if (pidgin_log_data->count < 1)
 		pidgin_log_search_done_cb(pidgin_log_data);
 }
@@ -370,6 +383,7 @@ search_cb(GtkWidget *button, PidginLogVi
 	pidgin_log_data = g_new0(_pidgin_log_data, 1);
 	pidgin_log_data->is_window_open = TRUE;
 	pidgin_log_data->log_viewer = lv;
+	pidgin_log_data->string = g_strdup(search_term);
 	pidgin_log_data->count = pidgin_log_data->total = length;
 
 	pidgin_log_data->destroy_handler_id = g_signal_connect_swapped(lv,
@@ -1031,29 +1045,25 @@ pidgin_log_viewer_update_list_bar(_pidgi
 static void
 pidgin_log_viewer_update_list_bar(_pidgin_log_data *pidgin_log_data)
 {
-	if (pidgin_log_data->is_window_open) {
-		PidginLogViewer *lv = pidgin_log_data->log_viewer;
-		GtkWidget *bar = pidgin_log_viewer_get_list_bar(lv);
-		gdouble fraction;
+	PidginLogViewer *lv = pidgin_log_data->log_viewer;
+	GtkWidget *bar = pidgin_log_viewer_get_list_bar(lv);
+	gdouble fraction;
 
-		fraction = (gdouble) pidgin_log_data->count /
-			(gdouble) pidgin_log_data->total;
-		gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar), 1.0 - fraction);
-	}
+	fraction = (gdouble) pidgin_log_data->count /
+		(gdouble) pidgin_log_data->total;
+	gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar), 1.0 - fraction);
 }
 
 static void
 pidgin_log_viewer_update_search_bar(_pidgin_log_data *pidgin_log_data)
 {
-	if (pidgin_log_data->is_window_open) {
-		PidginLogViewer *lv = pidgin_log_data->log_viewer;
-		GtkWidget *bar = pidgin_log_viewer_get_search_bar(lv);
-		gdouble fraction;
+	PidginLogViewer *lv = pidgin_log_data->log_viewer;
+	GtkWidget *bar = pidgin_log_viewer_get_search_bar(lv);
+	gdouble fraction;
 
-		fraction = (gdouble) pidgin_log_data->count /
-			(gdouble) pidgin_log_data->total;
-		gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar), 1.0 - fraction);
-	}
+	fraction = (gdouble) pidgin_log_data->count /
+		(gdouble) pidgin_log_data->total;
+	gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar), 1.0 - fraction);
 }
 
 static void
@@ -1080,8 +1090,10 @@ pidgin_log_size_cb(GObject *object, GAsy
 	}
 
 	g_clear_error(&error);
-	pidgin_log_viewer_update_list_bar(pidgin_log_data);
 
+	if (pidgin_log_data->is_window_open)
+		pidgin_log_viewer_update_list_bar(pidgin_log_data);
+
 	if (pidgin_log_data->count < 1)
 		pidgin_log_done_cb(pidgin_log_data);
 }
@@ -1103,8 +1115,10 @@ pidgin_log_list_cb(GObject *object, GAsy
 		pidgin_log_viewer_add_logs(pidgin_log_data->log_viewer, list);
 
 	g_clear_error(&error);
-	pidgin_log_viewer_update_search_bar(pidgin_log_data);
 
+	if (pidgin_log_data->is_window_open)
+		pidgin_log_viewer_update_list_bar(pidgin_log_data);
+
 	if (pidgin_log_data->count < 1)
 		pidgin_log_done_cb(pidgin_log_data);
 }
@@ -1126,8 +1140,10 @@ pidgin_log_system_list_cb(GObject *objec
 		pidgin_log_viewer_add_logs(pidgin_log_data->log_viewer, list);
 
 	g_clear_error(&error);
-	pidgin_log_viewer_update_search_bar(pidgin_log_data);
 
+	if (pidgin_log_data->is_window_open)
+		pidgin_log_viewer_update_list_bar(pidgin_log_data);
+
 	if (pidgin_log_data->count < 1)
 		pidgin_log_done_cb(pidgin_log_data);
 }
@@ -1305,7 +1321,6 @@ pidgin_syslog_show(void)
 pidgin_syslog_show(void)
 {
 	_pidgin_log_data *pidgin_log_data;
-	PurpleAccount *account;
 	PidginLogViewer *lv;
 	GCancellable *cancel;
 	GList *accounts;
@@ -1333,8 +1348,10 @@ pidgin_syslog_show(void)
 	pidgin_log_viewer_set_list_cancel(lv, cancel);
 	pidgin_log_data->count = pidgin_log_data->total = 0;
 
-	for(accounts = purple_accounts_get_all(); accounts != NULL; accounts = g_list_next(accounts)) {
-		account = accounts->data;
+	for(accounts = purple_accounts_get_all(); accounts != NULL;
+		accounts = g_list_next(accounts))
+	{
+		PurpleAccount *account = accounts->data;
 
 		if(purple_find_prpl(purple_account_get_protocol_id(account)) != NULL) {
 			pidgin_log_data->count++;
@@ -1536,7 +1553,6 @@ pidgin_log_viewer_set_total_size(PidginL
 pidgin_log_viewer_set_total_size(PidginLogViewer *lv, gsize total)
 {
 	PidginLogViewerPrivate *priv;
-	gchar *sz_txt, *text;
 
 	g_return_if_fail(PIDGIN_IS_LOG_VIEWER(lv));
 	g_return_if_fail(pidgin_log_viewer_get_need_log_size(lv));
@@ -1544,15 +1560,19 @@ pidgin_log_viewer_set_total_size(PidginL
 	priv = PIDGIN_LOG_VIEWER_GET_PRIVATE(lv);
 	priv->size = total;
 
-	sz_txt = purple_str_size_to_units(total);
-	text = g_strdup_printf("<span weight='bold'>%s</span> %s",
-		_("Total log size:"), sz_txt);
+	if (priv->size_label != NULL) {
+		gchar *sz_txt, *text;
 
-	gtk_label_set_markup(GTK_LABEL(priv->size_label), text);
+		sz_txt = purple_str_size_to_units(total);
+		text = g_strdup_printf("<span weight='bold'>%s</span> %s",
+			_("Total log size:"), sz_txt);
 
-	g_free(sz_txt);
-	g_free(text);
+		gtk_label_set_markup(GTK_LABEL(priv->size_label), text);
 
+		g_free(sz_txt);
+		g_free(text);
+	}
+
 	g_object_notify(G_OBJECT(lv), "total-size");
 }
 
@@ -1667,106 +1687,67 @@ static void
 }
 
 static void
+pidgin_log_viewer_update_label(PidginLogViewer *lv)
+{
+	PidginLogViewerPrivate *priv = PIDGIN_LOG_VIEWER_GET_PRIVATE(lv);
+	gchar *text;
+
+	text = g_strdup_printf("<span size='larger' weight='bold'>%s</span>",
+		gtk_window_get_title(GTK_WINDOW(lv)));
+
+	gtk_label_set_markup(GTK_LABEL(priv->label), text);
+	g_free(text);
+}
+
+static void
 pidgin_log_viewer_constructed(GObject *object)
 {
 	PidginLogViewer *lv = PIDGIN_LOG_VIEWER(object);
 	PidginLogViewerPrivate *priv = PIDGIN_LOG_VIEWER_GET_PRIVATE(lv);
-	GtkCellRenderer *rend;
-	GtkDialog *dialog = GTK_DIALOG(lv);
-	GtkTreeViewColumn *col;
 	GtkTreeSelection *sel;
+	GtkDialog *dialog = GTK_DIALOG(lv);
 	GtkWidget *content_area = gtk_dialog_get_content_area(dialog);
-	GtkWidget *pane, *sw, *frame;
-	GtkWidget *find_button, *vbox, *hbox;
+	GtkWidget *icon;
 	gchar *text;
 	gboolean need_log_size;
 
-	/* Pane */
-	pane = gtk_hpaned_new();
-	gtk_container_set_border_width(GTK_CONTAINER(pane), PIDGIN_HIG_BOX_SPACE);
-	gtk_box_pack_end(GTK_BOX(content_area), pane, TRUE, TRUE, 0);
+	/* Icon */
+	icon = pidgin_log_viewer_get_icon(lv);
 
-	/* List */
-	sw = gtk_scrolled_window_new(NULL, NULL);
-	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
-	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
-	gtk_paned_add1(GTK_PANED(pane), sw);
+	if (icon != NULL) {
+		gtk_box_pack_start(GTK_BOX(priv->title_box), icon, FALSE,
+			FALSE, 0);
+		gtk_widget_show(icon);
+	}
 
-	priv->treestore = gtk_tree_store_new(3, G_TYPE_STRING, G_TYPE_OBJECT, PURPLE_TYPE_STRUCT_TM);
-	priv->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(priv->treestore));
-	gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(priv->treeview), FALSE);
-	pidgin_set_accessible_label(priv->treeview, priv->label);
 
-	rend = gtk_cell_renderer_text_new();
-	col = gtk_tree_view_column_new_with_attributes("time", rend, "markup", 0, NULL);
-	gtk_tree_view_append_column(GTK_TREE_VIEW(priv->treeview), col);
-	gtk_container_add(GTK_CONTAINER(sw), priv->treeview);
-
-	sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->treeview));
-
-	g_signal_connect(sel, "changed", G_CALLBACK(log_select_cb), lv);
-	g_signal_connect(priv->treeview, "row-activated", G_CALLBACK(log_row_activated_cb), NULL);
-	g_signal_connect(priv->treeview, "button-press-event", G_CALLBACK(log_button_press_cb), lv);
-	g_signal_connect(priv->treeview, "popup-menu", G_CALLBACK(log_popup_menu_cb), lv);
-
 	/* Log size */
 	need_log_size = pidgin_log_viewer_get_need_log_size(lv);
 
 	if (need_log_size) {
+		priv->size_label = gtk_label_new(NULL);
+		gtk_misc_set_alignment(GTK_MISC(priv->size_label), 0, 0);
+		gtk_box_pack_start(GTK_BOX(content_area), priv->size_label, FALSE, FALSE, 0);
+		gtk_widget_show(priv->size_label);
+
 		text = g_strdup_printf("<span weight='bold'>%s</span> %s",
 			_("Total log size:"), _("calculating..."));
 
 		gtk_label_set_markup(GTK_LABEL(priv->size_label), text);
 		g_free(text);
 	} else
-		gtk_widget_destroy(priv->size_label);
+		priv->size_label = NULL;
 
-	/* A fancy little box */
-	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
-	gtk_paned_add2(GTK_PANED(pane), vbox);
 
-	/* Viewer */
-	frame = pidgin_create_imhtml(FALSE, &priv->imhtml, NULL, NULL);
-	gtk_widget_set_name(priv->imhtml, "pidgin_log_imhtml");
-	gtk_widget_set_size_request(priv->imhtml, 320, 200);
-	gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
-	gtk_widget_show(frame);
+	/* Hook up all the signals */
+	sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->treeview));
 
-#if GTK_CHECK_VERSION(2, 20, 0)
-	priv->spinner = gtk_spinner_new();
-	gtk_spinner_start(GTK_SPINNER(priv->spinner));
-	gtk_box_pack_start(GTK_BOX(vbox), priv->spinner, TRUE, FALSE, 0);
-#endif
+	g_signal_connect(lv, "notify::title", G_CALLBACK(pidgin_log_viewer_update_label), NULL);
+	g_signal_connect(sel, "changed", G_CALLBACK(log_select_cb), lv);
+	g_signal_connect(priv->treeview, "row-activated", G_CALLBACK(log_row_activated_cb), NULL);
+	g_signal_connect(priv->treeview, "button-press-event", G_CALLBACK(log_button_press_cb), lv);
+	g_signal_connect(priv->treeview, "popup-menu", G_CALLBACK(log_popup_menu_cb), lv);
 
-	/* Search box */
-	hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
-	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
-
-	priv->entry = gtk_entry_new();
-	find_button = gtk_button_new_from_stock(GTK_STOCK_FIND);
-
-	gtk_box_pack_start(GTK_BOX(hbox), priv->entry, TRUE, TRUE, 0);
-	gtk_box_pack_start(GTK_BOX(hbox), find_button, FALSE, FALSE, 0);
-
-	g_signal_connect(priv->entry, "activate", G_CALLBACK(search_cb), lv);
-	g_signal_connect(find_button, "clicked", G_CALLBACK(search_cb), lv);
-
-	/* Progress bars */
-	priv->list_bar = gtk_progress_bar_new();
-	priv->search_bar = gtk_progress_bar_new();
-
-	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(priv->list_bar), _("Waiting for logs ..."));
-	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(priv->search_bar), _("Searching logs ..."));
-
-	gtk_box_pack_start(GTK_BOX(vbox), priv->list_bar, FALSE, FALSE, 0);
-	gtk_box_pack_start(GTK_BOX(vbox), priv->search_bar, FALSE, FALSE, 0);
-
-	gtk_widget_show_all(GTK_WIDGET(lv));
-	gtk_widget_hide(GTK_WIDGET(lv));
-	gtk_widget_hide(priv->search_bar);
-#if GTK_CHECK_VERSION(2, 20, 0)
-	gtk_widget_hide(priv->spinner);
-#endif
 }
 
 static void
@@ -2086,10 +2067,12 @@ pidgin_log_viewer_init(PidginLogViewer *
 pidgin_log_viewer_init(PidginLogViewer *lv)
 {
 	PidginLogViewerPrivate *priv = PIDGIN_LOG_VIEWER_GET_PRIVATE(lv);
+	GtkCellRenderer *rend;
+	GtkTreeViewColumn *col;
 	GtkDialog *dialog = GTK_DIALOG(lv);
 	GtkWindow *window = GTK_WINDOW(lv);
-	GtkWidget *icon, *title_box, *content_area;
-	gchar *text;
+	GtkWidget *content_area = gtk_dialog_get_content_area(dialog);
+	GtkWidget *pane, *sw, *frame, *find_button, *vbox, *hbox;
 
 	/* Window */
 	gtk_dialog_add_buttons(dialog, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
@@ -2100,38 +2083,97 @@ pidgin_log_viewer_init(PidginLogViewer *
 
 	gtk_container_set_border_width (GTK_CONTAINER(lv), PIDGIN_HIG_BOX_SPACE);
 	gtk_dialog_set_has_separator(dialog, FALSE);
-	content_area = gtk_dialog_get_content_area(dialog);
 	gtk_box_set_spacing(GTK_BOX(content_area), 0);
 	gtk_window_set_role(window, "log_viewer");
 
-	/* Icon */
-	icon = pidgin_log_viewer_get_icon(lv);
 
-	if (icon != NULL) {
-		title_box = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
-		gtk_container_set_border_width(GTK_CONTAINER(title_box), PIDGIN_HIG_BOX_SPACE);
-		gtk_box_pack_start(GTK_BOX(content_area), title_box, FALSE, FALSE, 0);
-		gtk_box_pack_start(GTK_BOX(title_box), icon, FALSE, FALSE, 0);
-	} else
-		title_box = content_area;
+	/* Box for icon and label */
+	priv->title_box = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+	gtk_container_set_border_width(GTK_CONTAINER(priv->title_box), PIDGIN_HIG_BOX_SPACE);
+	gtk_box_pack_start(GTK_BOX(content_area), priv->title_box, FALSE, FALSE, 0);
 
-	/* Label */
+
+	/* Title Label */
 	priv->label = gtk_label_new(NULL);
+	gtk_misc_set_alignment(GTK_MISC(priv->label), 0, 0);
+	gtk_box_pack_end(GTK_BOX(priv->title_box), priv->label, FALSE, FALSE, 0);
+	gtk_widget_show(priv->label);
 
-	text = g_strdup_printf("<span size='larger' weight='bold'>%s</span>",
-		gtk_window_get_title(window));
 
-	gtk_label_set_markup(GTK_LABEL(priv->label), text);
-	gtk_misc_set_alignment(GTK_MISC(priv->label), 0, 0);
-	gtk_box_pack_start(GTK_BOX(title_box), priv->label, FALSE, FALSE, 0);
-	g_free(text);
+	/* Pane */
+	pane = gtk_hpaned_new();
+	gtk_container_set_border_width(GTK_CONTAINER(pane), PIDGIN_HIG_BOX_SPACE);
+	gtk_box_pack_start(GTK_BOX(content_area), pane, TRUE, TRUE, 0);
 
-	/* Log size */
-	priv->size_label = gtk_label_new(NULL);
-	gtk_misc_set_alignment(GTK_MISC(priv->size_label), 0, 0);
-	gtk_box_pack_end(GTK_BOX(content_area), priv->size_label, FALSE, FALSE, 0);
 
+	/* List */
+	sw = gtk_scrolled_window_new(NULL, NULL);
+	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN);
+	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+	gtk_paned_add1(GTK_PANED(pane), sw);
 
+	priv->treestore = gtk_tree_store_new(3, G_TYPE_STRING, G_TYPE_OBJECT, PURPLE_TYPE_STRUCT_TM);
+	priv->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(priv->treestore));
+	gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(priv->treeview), FALSE);
+	pidgin_set_accessible_label(priv->treeview, priv->label);
+
+	rend = gtk_cell_renderer_text_new();
+	col = gtk_tree_view_column_new_with_attributes("time", rend, "markup", 0, NULL);
+	gtk_tree_view_append_column(GTK_TREE_VIEW(priv->treeview), col);
+	gtk_container_add(GTK_CONTAINER(sw), priv->treeview);
+
+
+	/* A fancy little box for the viewer and search entry */
+	vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+	gtk_paned_add2(GTK_PANED(pane), vbox);
+
+
+	/* Viewer */
+	frame = pidgin_create_imhtml(FALSE, &priv->imhtml, NULL, NULL);
+	gtk_widget_set_name(priv->imhtml, "pidgin_log_imhtml");
+	gtk_widget_set_size_request(priv->imhtml, 320, 200);
+	gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+	gtk_widget_show(frame);
+
+#if GTK_CHECK_VERSION(2, 20, 0)
+	priv->spinner = gtk_spinner_new();
+	gtk_spinner_start(GTK_SPINNER(priv->spinner));
+	gtk_box_pack_start(GTK_BOX(vbox), priv->spinner, TRUE, FALSE, 0);
+#endif
+
+
+	/* Search box */
+	hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+	priv->entry = gtk_entry_new();
+	find_button = gtk_button_new_from_stock(GTK_STOCK_FIND);
+
+	gtk_box_pack_start(GTK_BOX(hbox), priv->entry, TRUE, TRUE, 0);
+	gtk_box_pack_start(GTK_BOX(hbox), find_button, FALSE, FALSE, 0);
+
+	g_signal_connect(priv->entry, "activate", G_CALLBACK(search_cb), lv);
+	g_signal_connect(find_button, "clicked", G_CALLBACK(search_cb), lv);
+
+
+	/* Progress bars */
+	priv->list_bar = gtk_progress_bar_new();
+	priv->search_bar = gtk_progress_bar_new();
+
+	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(priv->list_bar), _("Waiting for logs ..."));
+	gtk_progress_bar_set_text(GTK_PROGRESS_BAR(priv->search_bar), _("Searching logs ..."));
+
+	gtk_box_pack_start(GTK_BOX(vbox), priv->list_bar, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), priv->search_bar, FALSE, FALSE, 0);
+
+	gtk_widget_show_all(GTK_WIDGET(lv));
+	gtk_widget_hide(GTK_WIDGET(lv));
+	gtk_widget_hide(priv->search_bar);
+#if GTK_CHECK_VERSION(2, 20, 0)
+	gtk_widget_hide(priv->spinner);
+#endif
+
+
 	priv->logs = NULL;
 	priv->search = NULL;
 	priv->size = 0;


More information about the Commits mailing list