[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 471/473: Add items of Xfce settings manager to allow searching. Closes #89

noreply at xfce.org noreply at xfce.org
Tue Feb 17 00:00:41 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 d45d5e2e869e33b1ab5a03e92ec0e35601aa6626
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sat Feb 14 17:32:39 2015 -0500

    Add items of Xfce settings manager to allow searching. Closes #89
---
 panel-plugin/CMakeLists.txt        |    1 +
 panel-plugin/applications-page.cpp |   31 +++++++++++++++++++++++++++++++
 panel-plugin/applications-page.h   |    1 +
 3 files changed, 33 insertions(+)

diff --git a/panel-plugin/CMakeLists.txt b/panel-plugin/CMakeLists.txt
index b0a3755..2e2b564 100644
--- a/panel-plugin/CMakeLists.txt
+++ b/panel-plugin/CMakeLists.txt
@@ -42,6 +42,7 @@ add_definitions(
 	-DPACKAGE_VERSION="${whiskermenu_version}"
 	-DBINDIR="${CMAKE_INSTALL_FULL_BINDIR}"
 	-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}"
+	-DSETTINGS_MENUFILE="${CMAKE_INSTALL_FULL_SYSCONFDIR}/xdg/menus/xfce-settings-manager.menu"
 	-DG_LOG_DOMAIN="whiskermenu"
 	-DGSEAL_ENABLE
 	-DGTK_MULTIHEAD_SAFE
diff --git a/panel-plugin/applications-page.cpp b/panel-plugin/applications-page.cpp
index 1dcedb9..993850e 100644
--- a/panel-plugin/applications-page.cpp
+++ b/panel-plugin/applications-page.cpp
@@ -27,6 +27,11 @@
 
 #include <algorithm>
 
+extern "C"
+{
+#include <libxfce4util/libxfce4util.h>
+}
+
 using namespace WhiskerMenu;
 
 //-----------------------------------------------------------------------------
@@ -43,6 +48,7 @@ enum
 ApplicationsPage::ApplicationsPage(Window* window) :
 	Page(window),
 	m_garcon_menu(NULL),
+	m_garcon_settings_menu(NULL),
 	m_load_status(STATUS_INVALID)
 {
 	// Set desktop environment for applications
@@ -69,6 +75,12 @@ ApplicationsPage::~ApplicationsPage()
 	{
 		g_object_unref(m_garcon_menu);
 	}
+
+	// Free settings menu
+	if (G_LIKELY(m_garcon_settings_menu))
+	{
+		g_object_unref(m_garcon_settings_menu);
+	}
 }
 
 //-----------------------------------------------------------------------------
@@ -232,6 +244,19 @@ void ApplicationsPage::load_contents()
 		g_signal_connect_slot<GarconMenu*>(m_garcon_menu, "reload-required", &ApplicationsPage::invalidate_applications, this);
 	}
 
+	// Create settings menu
+	if (!m_garcon_settings_menu)
+	{
+		gchar* path = xfce_resource_lookup(XFCE_RESOURCE_CONFIG, "menus/xfce-settings-manager.menu");
+		m_garcon_settings_menu = garcon_menu_new_for_path(path != NULL ? path : SETTINGS_MENUFILE);
+		g_free(path);
+
+		if (m_garcon_settings_menu)
+		{
+			g_signal_connect_slot<GarconMenu*>(m_garcon_settings_menu, "reload-required", &ApplicationsPage::invalidate_applications, this);
+		}
+	}
+
 	// Load menu
 	if (!garcon_menu_load(m_garcon_menu, NULL, NULL))
 	{
@@ -240,6 +265,12 @@ void ApplicationsPage::load_contents()
 	}
 	load_menu(m_garcon_menu, NULL);
 
+	// Load settings menu
+	if (m_garcon_settings_menu && garcon_menu_load(m_garcon_settings_menu, NULL, NULL))
+	{
+		load_menu(m_garcon_settings_menu, NULL);
+	}
+
 	// Sort items and categories
 	if (!wm_settings->load_hierarchy)
 	{
diff --git a/panel-plugin/applications-page.h b/panel-plugin/applications-page.h
index 6d12319..295d4d3 100644
--- a/panel-plugin/applications-page.h
+++ b/panel-plugin/applications-page.h
@@ -56,6 +56,7 @@ private:
 
 private:
 	GarconMenu* m_garcon_menu;
+	GarconMenu* m_garcon_settings_menu;
 	std::vector<Category*> m_categories;
 	std::map<std::string, Launcher*> m_items;
 	int m_load_status;

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


More information about the Xfce4-commits mailing list