[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 362/473: Add about entry to context menu. Closes #57.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:58:52 CET 2015


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 418e199556547ec7f59deb5488318aadee402eb2
Author: Graeme Gott <graeme at gottcode.org>
Date:   Mon Apr 14 10:15:02 2014 -0400

    Add about entry to context menu. Closes #57.
---
 CMakeLists.txt              |    1 +
 panel-plugin/CMakeLists.txt |    2 ++
 panel-plugin/plugin.cpp     |   24 ++++++++++++++++++++++++
 panel-plugin/plugin.h       |    1 +
 4 files changed, 28 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 12a33d7..bfeca11 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,7 @@ if(${whiskermenu_version_tag} MATCHES "git")
 			WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 			OUTPUT_VARIABLE whiskermenu_version_build)
 		string(REGEX REPLACE "^.*-g" "" whiskermenu_version_build "${whiskermenu_version_build}")
+		string(REGEX REPLACE "\n" "" whiskermenu_version_build "${whiskermenu_version_build}")
 	endif()
 	set(whiskermenu_version "${whiskermenu_version}.${whiskermenu_version_tag}-${whiskermenu_version_build}")
 endif()
diff --git a/panel-plugin/CMakeLists.txt b/panel-plugin/CMakeLists.txt
index 120fcdb..a433ae1 100644
--- a/panel-plugin/CMakeLists.txt
+++ b/panel-plugin/CMakeLists.txt
@@ -38,6 +38,8 @@ link_directories(
 add_definitions(
 	-DGETTEXT_PACKAGE="xfce4-whiskermenu-plugin"
 	-DPACKAGE_LOCALE_DIR="${CMAKE_INSTALL_FULL_LOCALEDIR}"
+	-DPACKAGE_NAME="xfce4-whiskermenu-plugin"
+	-DPACKAGE_VERSION="${whiskermenu_version}"
 	-DBINDIR="${CMAKE_INSTALL_FULL_BINDIR}"
 	-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}"
 	-DG_LOG_DOMAIN="whiskermenu"
diff --git a/panel-plugin/plugin.cpp b/panel-plugin/plugin.cpp
index 6dfcb9b..5d057f3 100644
--- a/panel-plugin/plugin.cpp
+++ b/panel-plugin/plugin.cpp
@@ -162,8 +162,10 @@ Plugin::Plugin(XfcePanelPlugin* plugin) :
 #endif
 	g_signal_connect_slot(plugin, "remote-event", &Plugin::remote_event, this);
 	g_signal_connect_slot<XfcePanelPlugin*>(plugin, "save", &Plugin::save, this);
+	g_signal_connect_slot<XfcePanelPlugin*>(plugin, "about", &Plugin::show_about, this);
 	g_signal_connect_slot(plugin, "size-changed", &Plugin::size_changed, this);
 
+	xfce_panel_plugin_menu_show_about(plugin);
 	xfce_panel_plugin_menu_show_configure(plugin);
 	xfce_panel_plugin_menu_insert_item(plugin, GTK_MENU_ITEM(wm_settings->command[Settings::CommandMenuEditor]->get_menuitem()));
 
@@ -378,6 +380,28 @@ void Plugin::save()
 
 //-----------------------------------------------------------------------------
 
+void Plugin::show_about()
+{
+	const gchar* authors[] = {
+		"Graeme Gott <graeme at gottcode.org>",
+		NULL };
+
+	gtk_show_about_dialog
+		(NULL,
+		"authors", authors,
+		"comments", _("Alternate application launcher for Xfce"),
+		"copyright", _("Copyright \302\251 2013-2014 Graeme Gott"),
+		"license", XFCE_LICENSE_GPL,
+		"logo-icon-name", "xfce4-whiskermenu",
+		"program-name", PACKAGE_NAME,
+		"translator-credits", _("translator-credits"),
+		"version", PACKAGE_VERSION,
+		"website", "http://gottcode.org/xfce4-whiskermenu-plugin/",
+		NULL);
+}
+
+//-----------------------------------------------------------------------------
+
 gboolean Plugin::size_changed(XfcePanelPlugin*, gint size)
 {
 	GtkOrientation panel_orientation = xfce_panel_plugin_get_orientation(m_plugin);
diff --git a/panel-plugin/plugin.h b/panel-plugin/plugin.h
index 28a033a..c710b28 100644
--- a/panel-plugin/plugin.h
+++ b/panel-plugin/plugin.h
@@ -68,6 +68,7 @@ private:
 #endif
 	gboolean remote_event(XfcePanelPlugin*, gchar* name, GValue* value);
 	void save();
+	void show_about();
 	gboolean size_changed(XfcePanelPlugin*, gint size);
 	void popup_menu(bool at_cursor, bool activate_button);
 

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


More information about the Xfce4-commits mailing list