[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 27/44: Add editing launchers from context menu. (bug #13290)
noreply at xfce.org
noreply at xfce.org
Wed Feb 1 15:13:13 CET 2017
This is an automated email from the git hooks/post-receive script.
gottcode pushed a commit to annotated tag v1.7.0
in repository panel-plugins/xfce4-whiskermenu-plugin.
commit 9a20531af0936139e3941e53fc4e0f353a0debaa
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 10fae6e..40c7c38 100644
--- a/panel-plugin/page.cpp
+++ b/panel-plugin/page.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014, 2015 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2014, 2015, 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
@@ -259,6 +259,13 @@ void Page::create_context_menu(GtkTreeIter* iter, GdkEvent* event)
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);
@@ -418,6 +425,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