[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/01: Add editing launchers from context menu. (bug #13290)

noreply at xfce.org noreply at xfce.org
Fri Jan 13 23:50:08 CET 2017


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 79ab1b3492a74f2b3002bed84f69082a37aff182
Author: Graeme Gott <graeme at gottcode.org>
Date:   Fri Jan 13 17:47:04 2017 -0500

    Add editing launchers from context menu. (bug #13290)
---
 panel-plugin/page.cpp | 28 +++++++++++++++++++++++++++-
 panel-plugin/page.h   |  3 ++-
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/page.cpp b/panel-plugin/page.cpp
index 276db3e..695db4f 100644
--- a/panel-plugin/page.cpp
+++ b/panel-plugin/page.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013, 2014, 2015, 2016 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014, 2015, 2016, 2017 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -262,6 +262,13 @@ G_GNUC_END_IGNORE_DEPRECATIONS
 	g_signal_connect_slot<GtkMenuItem*>(menuitem, "activate", &Page::add_selected_to_panel, this);
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 
+	menuitem = gtk_separator_menu_item_new();
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
+
+	menuitem = gtk_menu_item_new_with_label(_("Edit Application..."));
+	g_signal_connect_slot<GtkMenuItem*>(menuitem, "activate", &Page::edit_selected, this);
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
+
 	extend_context_menu(menu);
 
 	gtk_widget_show_all(menu);
@@ -426,6 +433,25 @@ void Page::add_selected_to_favorites()
 
 //-----------------------------------------------------------------------------
 
+void Page::edit_selected()
+{
+	Launcher* launcher = get_selected_launcher();
+	g_assert(launcher != NULL);
+
+	m_window->hide();
+
+	GError* error = NULL;
+	gchar* command = g_strconcat("exo-desktop-item-edit ", launcher->get_uri(), NULL);
+	if (g_spawn_command_line_async(command, &error) == false)
+	{
+		xfce_dialog_show_error(NULL, error, _("Unable to edit launcher."));
+		g_error_free(error);
+	}
+	g_free(command);
+}
+
+//-----------------------------------------------------------------------------
+
 void Page::remove_selected_from_favorites()
 {
 	Launcher* launcher = get_selected_launcher();
diff --git a/panel-plugin/page.h b/panel-plugin/page.h
index 25a0851..a32352c 100644
--- a/panel-plugin/page.h
+++ b/panel-plugin/page.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2017 Graeme Gott <graeme at gottcode.org>
  *
  * This library is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -63,6 +63,7 @@ private:
 	void add_selected_to_desktop();
 	void add_selected_to_panel();
 	void add_selected_to_favorites();
+	void edit_selected();
 	void remove_selected_from_favorites();
 	Launcher* get_selected_launcher() const;
 	void create_context_menu(GtkTreeIter* iter, GdkEvent* event);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list