[gnome-panel] menu: add computer to places menu
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] menu: add computer to places menu
- Date: Sun, 4 Feb 2018 20:02:27 +0000 (UTC)
commit 6e55f3b49ba71af958ff9629c4720defa59bc44f
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Feb 4 21:27:30 2018 +0200
menu: add computer to places menu
modules/menu/gp-places-menu.c | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/modules/menu/gp-places-menu.c b/modules/menu/gp-places-menu.c
index 248d67a..ad95b9c 100644
--- a/modules/menu/gp-places-menu.c
+++ b/modules/menu/gp-places-menu.c
@@ -236,6 +236,38 @@ append_bookmarks (GpPlacesMenu *menu)
}
static void
+append_separator (GpPlacesMenu *menu)
+{
+ GtkWidget *item;
+
+ item = gtk_separator_menu_item_new ();
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ gtk_widget_show (item);
+
+ gtk_widget_set_sensitive (item, FALSE);
+}
+
+static void
+append_computer (GpPlacesMenu *menu)
+{
+ GFile *file;
+ const gchar *label;
+ const gchar *tooltip;
+ GtkWidget *item;
+
+ file = g_file_new_for_uri ("computer://");
+
+ label = _("Computer");
+ tooltip = _("Browse all local and remote disks and folders accessible from this computer");
+
+ item = create_menu_item (menu, file, NULL, "computer", label, tooltip);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ gtk_widget_show (item);
+
+ g_object_unref (file);
+}
+
+static void
remove_item (GtkWidget *widget,
gpointer user_data)
{
@@ -251,6 +283,9 @@ menu_reload (GpPlacesMenu *menu)
append_home_dir (menu);
append_desktop_dir (menu);
append_bookmarks (menu);
+
+ append_separator (menu);
+ append_computer (menu);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]