[gnome-flashback] desktop: add Display Settings to desktop menu



commit bace859a958d7fe5e76789e83ce1fe8c911e4c61
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Nov 14 20:34:56 2019 +0200

    desktop: add Display Settings to desktop menu

 gnome-flashback/libdesktop/gf-icon-view.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
---
diff --git a/gnome-flashback/libdesktop/gf-icon-view.c b/gnome-flashback/libdesktop/gf-icon-view.c
index 248cc13..9cd59ba 100644
--- a/gnome-flashback/libdesktop/gf-icon-view.c
+++ b/gnome-flashback/libdesktop/gf-icon-view.c
@@ -570,6 +570,20 @@ change_background_cb (GtkMenuItem *item,
     }
 }
 
+static void
+display_settings_cb (GtkMenuItem *item,
+                     GfIconView  *self)
+{
+  GError *error;
+
+  error = NULL;
+  if (!gf_launch_desktop_file ("gnome-display-panel.desktop", &error))
+    {
+      g_warning ("%s", error->message);
+      g_error_free (error);
+    }
+}
+
 static void
 open_terminal_cb (GtkMenuItem *item,
                   GfIconView  *self)
@@ -616,6 +630,14 @@ create_popup_menu (GfIconView *self)
                     G_CALLBACK (change_background_cb),
                     self);
 
+  item = gtk_menu_item_new_with_label (_("Display Settings"));
+  gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item);
+  gtk_widget_show (item);
+
+  g_signal_connect (item, "activate",
+                    G_CALLBACK (display_settings_cb),
+                    self);
+
   item = gtk_separator_menu_item_new ();
   gtk_menu_shell_append (GTK_MENU_SHELL (popup_menu), item);
   gtk_widget_show (item);


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