[gnome-panel/wip/3.0-freeze-break: 30/32] panel: Add shutdown item in menu if shutdown is not available



commit cbb961cef3bb7e3cadd6b4f9078ff0f3b2836296
Author: Vincent Untz <vuntz gnome org>
Date:   Thu Mar 24 14:12:02 2011 +0100

    panel: Add shutdown item in menu if shutdown is not available
    
    This was a small regression introduced with the lockdown change.

 gnome-panel/panel-menu-items.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/gnome-panel/panel-menu-items.c b/gnome-panel/panel-menu-items.c
index 16cbd95..2a5a12e 100644
--- a/gnome-panel/panel-menu-items.c
+++ b/gnome-panel/panel-menu-items.c
@@ -44,6 +44,7 @@
 #include <libpanel-util/panel-glib.h>
 #include <libpanel-util/panel-keyfile.h>
 #include <libpanel-util/panel-launch.h>
+#include <libpanel-util/panel-session-manager.h>
 #include <libpanel-util/panel-show.h>
 
 #include "menu.h"
@@ -1569,15 +1570,18 @@ panel_menu_items_append_lock_logout (GtkWidget *menu)
 					G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
 	}
 
-	item = panel_menu_items_create_action_item_full (PANEL_ACTION_SHUTDOWN,
-							 NULL, NULL, TRUE);
-	if (item != NULL) {
-		gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-		g_object_bind_property (panel_lockdown_get (),
-					"disable-log-out",
-					item,
-					"visible",
-					G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
+	/* FIXME: should be dynamic */
+	if (panel_session_manager_is_shutdown_available (panel_session_manager_get ())) {
+		item = panel_menu_items_create_action_item_full (PANEL_ACTION_SHUTDOWN,
+								 NULL, NULL, TRUE);
+		if (item != NULL) {
+			gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+			g_object_bind_property (panel_lockdown_get (),
+						"disable-log-out",
+						item,
+						"visible",
+						G_BINDING_SYNC_CREATE|G_BINDING_INVERT_BOOLEAN);
+		}
 	}
 }
 



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