From f6235b6d9d8f854ff4df6494f4f996c7876d1316 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Thu, 21 Jun 2012 18:30:21 +0000 Subject: LinGui: disable status icon progress when status icon is disabled git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4763 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/callbacks.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'gtk/src/callbacks.c') diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index dfed0dda7..8e710e53a 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2845,19 +2845,22 @@ ghb_backend_events(signal_user_data_t *ud) status_str = searching_status_string(ud, &status.queue); label = GTK_LABEL(GHB_WIDGET(ud->builder, "queue_status")); gtk_label_set_text (label, status_str); + if (ghb_settings_get_boolean(ud->settings, "show_status")) + { #if !GTK_CHECK_VERSION(2, 16, 0) - GtkStatusIcon *si; + GtkStatusIcon *si; - si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status")); - gtk_status_icon_set_tooltip(si, status_str); + si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status")); + gtk_status_icon_set_tooltip(si, status_str); #endif #if defined(_USE_APP_IND) - char * ai_status_str= g_strdup_printf( - "%.2f%%", - 100.0 * status.queue.progress); - app_indicator_set_label( ud->ai, ai_status_str, "99.99%"); - g_free(ai_status_str); + char * ai_status_str= g_strdup_printf( + "%.2f%%", + 100.0 * status.queue.progress); + app_indicator_set_label( ud->ai, ai_status_str, "99.99%"); + g_free(ai_status_str); #endif + } gtk_label_set_text (work_status, status_str); gtk_progress_bar_set_fraction (progress, status.queue.progress); g_free(status_str); @@ -2890,20 +2893,23 @@ ghb_backend_events(signal_user_data_t *ud) status_str = working_status_string(ud, &status.queue); label = GTK_LABEL(GHB_WIDGET(ud->builder, "queue_status")); gtk_label_set_text (label, status_str); + if (ghb_settings_get_boolean(ud->settings, "show_status")) + { #if defined(_USE_APP_IND) - char * ai_status_str= g_strdup_printf( - "%.2f%%", - 100.0 * status.queue.progress); - app_indicator_set_label( ud->ai, ai_status_str, "99.99%"); - g_free(ai_status_str); + char * ai_status_str= g_strdup_printf( + "%.2f%%", + 100.0 * status.queue.progress); + app_indicator_set_label( ud->ai, ai_status_str, "99.99%"); + g_free(ai_status_str); #else #if !GTK_CHECK_VERSION(2, 16, 0) - GtkStatusIcon *si; + GtkStatusIcon *si; - si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status")); - gtk_status_icon_set_tooltip(si, status_str); + si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status")); + gtk_status_icon_set_tooltip(si, status_str); #endif #endif + } gtk_label_set_text (work_status, status_str); gtk_progress_bar_set_fraction (progress, status.queue.progress); g_free(status_str); -- cgit v1.2.3