[gnome-software/ramcq/no-baobab] shell: only show "Examine Disk" button when baobab is available



commit 6f029be42a4dafd59ad5fe4b0d30c6ee181aed70
Author: Robert McQueen <rob endlessm com>
Date:   Thu Sep 6 16:47:00 2018 +0100

    shell: only show "Examine Disk" button when baobab is available
    
    Mask the visibility of "Examine Disk" based on whether "baobab" can be
    launched.

 src/gs-shell.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/gs-shell.c b/src/gs-shell.c
index d935a41a..e1355e85 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -467,6 +467,12 @@ gs_shell_plugin_events_sources_cb (GtkWidget *widget, GsShell *shell)
        gs_shell_show_sources (shell);
 }
 
+static gboolean
+gs_shell_plugin_events_no_space_cb_available (void)
+{
+       return (g_find_program_in_path ("baobab") != NULL);
+}
+
 static void
 gs_shell_plugin_events_no_space_cb (GtkWidget *widget, GsShell *shell)
 {
@@ -938,7 +944,8 @@ gs_shell_show_event_app_notify (GsShell *shell,
 
        /* no-space button */
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_events_no_space"));
-       gtk_widget_set_visible (widget, (buttons & GS_SHELL_EVENT_BUTTON_NO_SPACE) > 0);
+       gtk_widget_set_visible (widget, (buttons & GS_SHELL_EVENT_BUTTON_NO_SPACE) > 0 &&
+                                       gs_shell_plugin_events_no_space_cb_available());
 
        /* network settings button */
        widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "button_events_network_settings"));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]