[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 221/473: Move management of commands into settings.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:56:31 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 884f0f9de6f3d024a5eebf3174f13d1300d0e429
Author: Graeme Gott <graeme at gottcode.org>
Date:   Thu Nov 7 05:13:54 2013 -0500

    Move management of commands into settings.
---
 panel-plugin/CMakeLists.txt                  |    2 +-
 panel-plugin/command-button.cpp              |   83 ----------------
 panel-plugin/command.cpp                     |  130 ++++++++++++++++++++++++++
 panel-plugin/{command-button.h => command.h} |   51 +++++-----
 panel-plugin/configuration-dialog.cpp        |   17 ++--
 panel-plugin/settings.cpp                    |   29 ++++--
 panel-plugin/settings.h                      |    7 +-
 panel-plugin/window.cpp                      |   55 ++++-------
 panel-plugin/window.h                        |    4 -
 9 files changed, 207 insertions(+), 171 deletions(-)

diff --git a/panel-plugin/CMakeLists.txt b/panel-plugin/CMakeLists.txt
index e3623b5..17f34e7 100644
--- a/panel-plugin/CMakeLists.txt
+++ b/panel-plugin/CMakeLists.txt
@@ -62,7 +62,7 @@ endif()
 add_library(whiskermenu MODULE
 	applications-page.cpp
 	category.cpp
-	command-button.cpp
+	command.cpp
 	configuration-dialog.cpp
 	element.h
 	favorites-page.cpp
diff --git a/panel-plugin/command-button.cpp b/panel-plugin/command-button.cpp
deleted file mode 100644
index 101299b..0000000
--- a/panel-plugin/command-button.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2013 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
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this library.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "command-button.h"
-
-extern "C"
-{
-#include <libxfce4ui/libxfce4ui.h>
-}
-
-using namespace WhiskerMenu;
-
-//-----------------------------------------------------------------------------
-
-CommandButton::CommandButton(const gchar* icon, const gchar* text, std::string& command, const std::string& error_text) :
-	m_command(command),
-	m_error_text(error_text),
-	m_status(Unchecked)
-{
-	m_button = GTK_BUTTON(gtk_button_new());
-	gtk_button_set_relief(m_button, GTK_RELIEF_NONE);
-	gtk_widget_set_tooltip_text(GTK_WIDGET(m_button), text);
-	g_signal_connect(m_button, "clicked", G_CALLBACK(CommandButton::clicked_slot), this);
-
-	GtkWidget* image = gtk_image_new_from_icon_name(icon, GTK_ICON_SIZE_LARGE_TOOLBAR);
-	gtk_container_add(GTK_CONTAINER(m_button), GTK_WIDGET(image));
-}
-
-//-----------------------------------------------------------------------------
-
-CommandButton::~CommandButton()
-{
-	gtk_widget_destroy(GTK_WIDGET(m_button));
-}
-
-//-----------------------------------------------------------------------------
-
-void CommandButton::set_command(const std::string& command)
-{
-	m_command = command;
-	m_status = Unchecked;
-}
-
-//-----------------------------------------------------------------------------
-
-void CommandButton::check()
-{
-	if (m_status == Unchecked)
-	{
-		gchar* path = g_find_program_in_path(m_command.c_str());
-		m_status = path ? Valid : Invalid;
-		g_free(path);
-	}
-	gtk_widget_set_sensitive(GTK_WIDGET(m_button), m_status == Valid);
-}
-
-//-----------------------------------------------------------------------------
-
-void CommandButton::clicked()
-{
-	GError* error = NULL;
-	if (g_spawn_command_line_async(m_command.c_str(), &error) == false)
-	{
-		xfce_dialog_show_error(NULL, error, m_error_text.c_str());
-		g_error_free(error);
-	}
-}
-
-//-----------------------------------------------------------------------------
diff --git a/panel-plugin/command.cpp b/panel-plugin/command.cpp
new file mode 100644
index 0000000..02222ca
--- /dev/null
+++ b/panel-plugin/command.cpp
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2013 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
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this library.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "command.h"
+
+extern "C"
+{
+#include <libxfce4ui/libxfce4ui.h>
+}
+
+using namespace WhiskerMenu;
+
+//-----------------------------------------------------------------------------
+
+enum
+{
+	WHISKERMENU_COMMAND_UNCHECKED = -1,
+	WHISKERMENU_COMMAND_INVALID,
+	WHISKERMENU_COMMAND_VALID
+};
+
+//-----------------------------------------------------------------------------
+
+Command::Command(const gchar* icon, const gchar* text, const gchar* command, const gchar* error_text) :
+	m_button(NULL),
+	m_icon(g_strdup(icon)),
+	m_text(g_strdup(text)),
+	m_command(g_strdup(command)),
+	m_error_text(g_strdup(error_text)),
+	m_status(WHISKERMENU_COMMAND_UNCHECKED)
+{
+	check();
+}
+
+//-----------------------------------------------------------------------------
+
+Command::~Command()
+{
+	if (m_button)
+	{
+		g_object_unref(m_button);
+	}
+
+	g_free(m_icon);
+	g_free(m_text);
+	g_free(m_command);
+	g_free(m_error_text);
+}
+
+//-----------------------------------------------------------------------------
+
+GtkWidget* Command::get_button()
+{
+	if (m_button)
+	{
+		return m_button;
+	}
+
+	m_button = gtk_button_new();
+	gtk_button_set_relief(GTK_BUTTON(m_button), GTK_RELIEF_NONE);
+	gtk_widget_set_tooltip_text(m_button, m_text);
+	g_signal_connect(m_button, "clicked", G_CALLBACK(Command::clicked_slot), this);
+
+	GtkWidget* image = gtk_image_new_from_icon_name(m_icon, GTK_ICON_SIZE_LARGE_TOOLBAR);
+	gtk_container_add(GTK_CONTAINER(m_button), GTK_WIDGET(image));
+
+	gtk_widget_show(m_button);
+	gtk_widget_set_sensitive(m_button, m_status == WHISKERMENU_COMMAND_VALID);
+
+	g_object_ref_sink(m_button);
+
+	return m_button;
+}
+
+//-----------------------------------------------------------------------------
+
+void Command::set(const gchar* command)
+{
+	if (command != m_command)
+	{
+		g_free(m_command);
+		m_command = g_strdup(command);
+		m_status = WHISKERMENU_COMMAND_UNCHECKED;
+	}
+}
+
+//-----------------------------------------------------------------------------
+
+void Command::check()
+{
+	if (m_status == WHISKERMENU_COMMAND_UNCHECKED)
+	{
+		gchar* path = g_find_program_in_path(m_command);
+		m_status = path ? WHISKERMENU_COMMAND_VALID : WHISKERMENU_COMMAND_INVALID;
+		g_free(path);
+	}
+
+	if (m_button)
+	{
+		gtk_widget_set_sensitive(m_button, m_status == WHISKERMENU_COMMAND_VALID);
+	}
+}
+
+//-----------------------------------------------------------------------------
+
+void Command::activated()
+{
+	GError* error = NULL;
+	if (g_spawn_command_line_async(m_command, &error) == false)
+	{
+		xfce_dialog_show_error(NULL, error, m_error_text);
+		g_error_free(error);
+	}
+}
+
+//-----------------------------------------------------------------------------
diff --git a/panel-plugin/command-button.h b/panel-plugin/command.h
similarity index 57%
rename from panel-plugin/command-button.h
rename to panel-plugin/command.h
index 3440d34..9903d8a 100644
--- a/panel-plugin/command-button.h
+++ b/panel-plugin/command.h
@@ -15,10 +15,8 @@
  * along with this library.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef WHISKERMENU_COMMAND_BUTTON_H
-#define WHISKERMENU_COMMAND_BUTTON_H
-
-#include <string>
+#ifndef WHISKERMENU_COMMAND_H
+#define WHISKERMENU_COMMAND_H
 
 extern "C"
 {
@@ -28,50 +26,47 @@ extern "C"
 namespace WhiskerMenu
 {
 
-class CommandButton
+class Command
 {
-	enum Status
-	{
-		Unchecked = -1,
-		Invalid,
-		Valid
-	};
-
 public:
-	CommandButton(const gchar* icon, const gchar* text, std::string& command, const std::string& error_text);
-	~CommandButton();
+	Command(const gchar* icon, const gchar* text, const gchar* command, const gchar* error_text);
+	~Command();
 
-	GtkWidget* get_widget() const
-	{
-		return GTK_WIDGET(m_button);
-	}
+	GtkWidget* get_button();
 
-	std::string get_command() const
+	const gchar* get() const
 	{
 		return m_command;
 	}
 
-	void set_command(const std::string& command);
+	void set(const gchar* command);
 
 	void check();
 
 private:
-	void clicked();
+	void activated();
 
 private:
-	GtkButton* m_button;
-	std::string& m_command;
-	std::string m_error_text;
-	Status m_status;
+	GtkWidget* m_button;
+	gchar* m_icon;
+	gchar* m_text;
+	gchar* m_command;
+	gchar* m_error_text;
+	gint m_status;
 
 
 private:
-	static void clicked_slot(GtkButton*, CommandButton* obj)
+	static void clicked_slot(GtkButton*, Command* obj)
+	{
+		obj->activated();
+	}
+
+	static void activated_slot(GtkMenuItem*, Command* obj)
 	{
-		obj->clicked();
+		obj->activated();
 	}
 };
 
 }
 
-#endif // WHISKERMENU_COMMAND_BUTTON_H
+#endif // WHISKERMENU_COMMAND_H
diff --git a/panel-plugin/configuration-dialog.cpp b/panel-plugin/configuration-dialog.cpp
index fbba8da..0cde867 100644
--- a/panel-plugin/configuration-dialog.cpp
+++ b/panel-plugin/configuration-dialog.cpp
@@ -17,6 +17,7 @@
 
 #include "configuration-dialog.h"
 
+#include "command.h"
 #include "icon-size.h"
 #include "plugin.h"
 #include "settings.h"
@@ -205,7 +206,7 @@ void ConfigurationDialog::toggle_display_recent(GtkToggleButton* button)
 void ConfigurationDialog::settings_command_changed()
 {
 	const gchar* text = gtk_entry_get_text(GTK_ENTRY(m_settings_command));
-	wm_settings->command_settings = std::string(text ? text : "");
+	wm_settings->command_settings->set(text);
 }
 
 //-----------------------------------------------------------------------------
@@ -213,7 +214,7 @@ void ConfigurationDialog::settings_command_changed()
 void ConfigurationDialog::lockscreen_command_changed()
 {
 	const gchar* text = gtk_entry_get_text(GTK_ENTRY(m_lockscreen_command));
-	wm_settings->command_lockscreen = std::string(text ? text : "");
+	wm_settings->command_lockscreen->set(text);
 }
 
 //-----------------------------------------------------------------------------
@@ -221,7 +222,7 @@ void ConfigurationDialog::lockscreen_command_changed()
 void ConfigurationDialog::logout_command_changed()
 {
 	const gchar* text = gtk_entry_get_text(GTK_ENTRY(m_logout_command));
-	wm_settings->command_logout = std::string(text ? text : "");
+	wm_settings->command_logout->set(text);
 }
 
 //-----------------------------------------------------------------------------
@@ -233,6 +234,10 @@ void ConfigurationDialog::response(int response_id)
 		m_plugin->set_button_title(Plugin::get_button_title_default());
 	}
 
+	wm_settings->command_settings->check();
+	wm_settings->command_lockscreen->check();
+	wm_settings->command_logout->check();
+
 	if (response_id == GTK_RESPONSE_CLOSE)
 	{
 		gtk_widget_destroy(m_window);
@@ -446,7 +451,7 @@ GtkWidget* ConfigurationDialog::init_commands_tab()
 	gtk_size_group_add_widget(label_size_group, label);
 
 	m_settings_command = gtk_entry_new();
-	gtk_entry_set_text(GTK_ENTRY(m_settings_command), wm_settings->command_settings.c_str());
+	gtk_entry_set_text(GTK_ENTRY(m_settings_command), wm_settings->command_settings->get());
 	gtk_box_pack_start(hbox, m_settings_command, true, true, 0);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_settings_command);
 	g_signal_connect(m_settings_command, "changed", G_CALLBACK(ConfigurationDialog::settings_command_changed_slot), this);
@@ -461,7 +466,7 @@ GtkWidget* ConfigurationDialog::init_commands_tab()
 	gtk_size_group_add_widget(label_size_group, label);
 
 	m_lockscreen_command = gtk_entry_new();
-	gtk_entry_set_text(GTK_ENTRY(m_lockscreen_command), wm_settings->command_lockscreen.c_str());
+	gtk_entry_set_text(GTK_ENTRY(m_lockscreen_command), wm_settings->command_lockscreen->get());
 	gtk_box_pack_start(hbox, m_lockscreen_command, true, true, 0);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_lockscreen_command);
 	g_signal_connect(m_lockscreen_command, "changed", G_CALLBACK(ConfigurationDialog::lockscreen_command_changed_slot), this);
@@ -476,7 +481,7 @@ GtkWidget* ConfigurationDialog::init_commands_tab()
 	gtk_size_group_add_widget(label_size_group, label);
 
 	m_logout_command = gtk_entry_new();
-	gtk_entry_set_text(GTK_ENTRY(m_logout_command), wm_settings->command_logout.c_str());
+	gtk_entry_set_text(GTK_ENTRY(m_logout_command), wm_settings->command_logout->get());
 	gtk_box_pack_start(hbox, m_logout_command, true, true, 0);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), m_logout_command);
 	g_signal_connect(m_logout_command, "changed", G_CALLBACK(ConfigurationDialog::logout_command_changed_slot), this);
diff --git a/panel-plugin/settings.cpp b/panel-plugin/settings.cpp
index 078f398..02a633c 100644
--- a/panel-plugin/settings.cpp
+++ b/panel-plugin/settings.cpp
@@ -17,6 +17,8 @@
 
 #include "settings.h"
 
+#include "command.h"
+
 #include <algorithm>
 
 extern "C"
@@ -88,10 +90,6 @@ Settings::Settings() :
 	position_search_alternate(false),
 	position_commands_alternate(false),
 
-	command_settings("xfce4-settings-manager"),
-	command_lockscreen("xflock4"),
-	command_logout("xfce4-session-logout"),
-
 	menu_width(400),
 	menu_height(500)
 {
@@ -99,12 +97,19 @@ Settings::Settings() :
 	favorites.push_back("exo-file-manager.desktop");
 	favorites.push_back("exo-mail-reader.desktop");
 	favorites.push_back("exo-web-browser.desktop");
+
+	command_settings = new Command("preferences-desktop", _("All Settings"), "xfce4-settings-manager", _("Failed to open settings manager."));
+	command_lockscreen = new Command("system-lock-screen", _("Lock Screen"), "xflock4", _("Failed to lock screen."));
+	command_logout = new Command("system-log-out", _("Log Out"), "xfce4-session-logout", _("Failed to log out."));
 }
 
 //-----------------------------------------------------------------------------
 
 Settings::~Settings()
 {
+	delete command_settings;
+	delete command_lockscreen;
+	delete command_logout;
 }
 
 //-----------------------------------------------------------------------------
@@ -145,14 +150,18 @@ void Settings::load(char* file)
 	position_search_alternate = xfce_rc_read_bool_entry(rc, "position-search-alternate", position_search_alternate);
 	position_commands_alternate = xfce_rc_read_bool_entry(rc, "position-commands-alternate", position_commands_alternate) && position_search_alternate;
 
-	command_settings = xfce_rc_read_entry(rc, "command-settings", command_settings.c_str());
-	command_lockscreen = xfce_rc_read_entry(rc, "command-lockscreen", command_lockscreen.c_str());
-	command_logout = xfce_rc_read_entry(rc, "command-logout", command_logout.c_str());
+	command_settings->set(xfce_rc_read_entry(rc, "command-settings", command_settings->get()));
+	command_lockscreen->set(xfce_rc_read_entry(rc, "command-lockscreen", command_lockscreen->get()));
+	command_logout->set(xfce_rc_read_entry(rc, "command-logout", command_logout->get()));
 
 	menu_width = std::max(300, xfce_rc_read_int_entry(rc, "menu-width", menu_width));
 	menu_height = std::max(400, xfce_rc_read_int_entry(rc, "menu-height", menu_height));
 
 	xfce_rc_close(rc);
+
+	command_settings->check();
+	command_lockscreen->check();
+	command_logout->check();
 }
 
 //-----------------------------------------------------------------------------
@@ -193,9 +202,9 @@ void Settings::save(char* file)
 	xfce_rc_write_bool_entry(rc, "position-search-alternate", position_search_alternate);
 	xfce_rc_write_bool_entry(rc, "position-commands-alternate", position_commands_alternate);
 
-	xfce_rc_write_entry(rc, "command-settings", command_settings.c_str());
-	xfce_rc_write_entry(rc, "command-lockscreen", command_lockscreen.c_str());
-	xfce_rc_write_entry(rc, "command-logout", command_logout.c_str());
+	xfce_rc_write_entry(rc, "command-settings", command_settings->get());
+	xfce_rc_write_entry(rc, "command-lockscreen", command_lockscreen->get());
+	xfce_rc_write_entry(rc, "command-logout", command_logout->get());
 
 	xfce_rc_write_int_entry(rc, "menu-width", menu_width);
 	xfce_rc_write_int_entry(rc, "menu-height", menu_height);
diff --git a/panel-plugin/settings.h b/panel-plugin/settings.h
index cc25949..fe6a2e2 100644
--- a/panel-plugin/settings.h
+++ b/panel-plugin/settings.h
@@ -26,6 +26,7 @@
 namespace WhiskerMenu
 {
 
+class Command;
 class Plugin;
 
 class Settings
@@ -61,9 +62,9 @@ public:
 	bool position_search_alternate;
 	bool position_commands_alternate;
 
-	std::string command_settings;
-	std::string command_lockscreen;
-	std::string command_logout;
+	Command* command_settings;
+	Command* command_lockscreen;
+	Command* command_logout;
 
 	int menu_width;
 	int menu_height;
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 520166c..3a05d34 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -18,7 +18,7 @@
 #include "window.h"
 
 #include "applications-page.h"
-#include "command-button.h"
+#include "command.h"
 #include "favorites-page.h"
 #include "launcher-view.h"
 #include "recent-page.h"
@@ -104,17 +104,9 @@ Window::Window() :
 	g_free(username);
 
 	// Create action buttons
-	m_settings_button = new CommandButton("preferences-desktop", _("All Settings"),
-			wm_settings->command_settings, _("Failed to open settings manager."));
-	g_signal_connect_swapped(m_settings_button->get_widget(), "clicked", G_CALLBACK(Window::hide_slot), this);
-
-	m_lockscreen_button = new CommandButton("system-lock-screen", _("Lock Screen"),
-			wm_settings->command_lockscreen, _("Failed to lock screen."));
-	g_signal_connect_swapped(m_lockscreen_button->get_widget(), "clicked", G_CALLBACK(Window::hide_slot), this);
-
-	m_logout_button = new CommandButton("system-log-out", _("Log Out"),
-			wm_settings->command_logout, _("Failed to log out."));
-	g_signal_connect_swapped(m_logout_button->get_widget(), "clicked", G_CALLBACK(Window::hide_slot), this);
+	g_signal_connect_swapped(wm_settings->command_settings->get_button(), "clicked", G_CALLBACK(Window::hide_slot), this);
+	g_signal_connect_swapped(wm_settings->command_lockscreen->get_button(), "clicked", G_CALLBACK(Window::hide_slot), this);
+	g_signal_connect_swapped(wm_settings->command_logout->get_button(), "clicked", G_CALLBACK(Window::hide_slot), this);
 
 	m_resizer = new ResizerWidget(m_window);
 
@@ -163,9 +155,9 @@ Window::Window() :
 	// Create box for packing commands
 	m_commands_align = GTK_ALIGNMENT(gtk_alignment_new(1, 0, 0, 0));
 	m_commands_box = GTK_BOX(gtk_hbox_new(false, 0));
-	gtk_box_pack_start(m_commands_box, GTK_WIDGET(m_settings_button->get_widget()), false, false, 0);
-	gtk_box_pack_start(m_commands_box, GTK_WIDGET(m_lockscreen_button->get_widget()), false, false, 0);
-	gtk_box_pack_start(m_commands_box, GTK_WIDGET(m_logout_button->get_widget()), false, false, 0);
+	gtk_box_pack_start(m_commands_box, GTK_WIDGET(wm_settings->command_settings->get_button()), false, false, 0);
+	gtk_box_pack_start(m_commands_box, GTK_WIDGET(wm_settings->command_lockscreen->get_button()), false, false, 0);
+	gtk_box_pack_start(m_commands_box, GTK_WIDGET(wm_settings->command_logout->get_button()), false, false, 0);
 	gtk_container_add(GTK_CONTAINER(m_commands_align), GTK_WIDGET(m_commands_box));
 
 	// Create box for packing username, commands, and resize widget
@@ -237,10 +229,6 @@ Window::~Window()
 	delete m_recent;
 	delete m_favorites;
 
-	delete m_settings_button;
-	delete m_lockscreen_button;
-	delete m_logout_button;
-
 	delete m_resizer;
 	g_object_unref(m_window);
 }
@@ -275,11 +263,6 @@ void Window::show(GtkWidget* parent, bool horizontal)
 	m_recent->get_view()->reload_icon_size();
 	m_applications->get_view()->reload_icon_size();
 
-	// Make sure commands are valid
-	m_settings_button->check();
-	m_lockscreen_button->check();
-	m_logout_button->check();
-
 	// Make sure applications list is current; does nothing unless list has changed
 	if (m_applications->load_applications())
 	{
@@ -450,9 +433,9 @@ void Window::show(GtkWidget* parent, bool horizontal)
 			gtk_misc_set_alignment(GTK_MISC(m_username), 0.0f, 0.5f);
 
 			gtk_alignment_set(m_commands_align, 1, 0, 0, 0);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_settings_button->get_widget()), 0);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_lockscreen_button->get_widget()), 1);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_logout_button->get_widget()), 2);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_settings->get_button()), 0);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_lockscreen->get_button()), 1);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_logout->get_button()), 2);
 
 			gtk_box_reorder_child(m_title_box, GTK_WIDGET(m_username), 0);
 			gtk_box_reorder_child(m_title_box, GTK_WIDGET(m_resizer->get_widget()), 1);
@@ -468,9 +451,9 @@ void Window::show(GtkWidget* parent, bool horizontal)
 			gtk_misc_set_alignment(GTK_MISC(m_username), 1.0f, 0.5f);
 
 			gtk_alignment_set(m_commands_align, 0, 0, 0, 0);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_settings_button->get_widget()), 2);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_lockscreen_button->get_widget()), 1);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_logout_button->get_widget()), 0);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_settings->get_button()), 2);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_lockscreen->get_button()), 1);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_logout->get_button()), 0);
 
 			gtk_box_reorder_child(m_title_box, GTK_WIDGET(m_username), 1);
 			gtk_box_reorder_child(m_title_box, GTK_WIDGET(m_resizer->get_widget()), 0);
@@ -486,9 +469,9 @@ void Window::show(GtkWidget* parent, bool horizontal)
 			gtk_misc_set_alignment(GTK_MISC(m_username), 0.0f, 0.5f);
 
 			gtk_alignment_set(m_commands_align, 1, 0, 0, 0);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_settings_button->get_widget()), 0);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_lockscreen_button->get_widget()), 1);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_logout_button->get_widget()), 2);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_settings->get_button()), 0);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_lockscreen->get_button()), 1);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_logout->get_button()), 2);
 
 			gtk_box_reorder_child(m_title_box, GTK_WIDGET(m_username), 0);
 			gtk_box_reorder_child(m_title_box, GTK_WIDGET(m_commands_align), 1);
@@ -502,9 +485,9 @@ void Window::show(GtkWidget* parent, bool horizontal)
 			gtk_misc_set_alignment(GTK_MISC(m_username), 1.0f, 0.5f);
 
 			gtk_alignment_set(m_commands_align, 0, 0, 0, 0);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_settings_button->get_widget()), 2);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_lockscreen_button->get_widget()), 1);
-			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(m_logout_button->get_widget()), 0);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_settings->get_button()), 2);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_lockscreen->get_button()), 1);
+			gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_logout->get_button()), 0);
 
 			gtk_box_reorder_child(m_title_box, GTK_WIDGET(m_username), 2);
 			gtk_box_reorder_child(m_title_box, GTK_WIDGET(m_commands_align), 1);
diff --git a/panel-plugin/window.h b/panel-plugin/window.h
index da3200e..0a8e975 100644
--- a/panel-plugin/window.h
+++ b/panel-plugin/window.h
@@ -31,7 +31,6 @@ namespace WhiskerMenu
 {
 
 class ApplicationsPage;
-class CommandButton;
 class FavoritesPage;
 class Launcher;
 class Page;
@@ -121,9 +120,6 @@ private:
 	ResizerWidget* m_resizer;
 
 	GtkAlignment* m_commands_align;
-	CommandButton* m_settings_button;
-	CommandButton* m_lockscreen_button;
-	CommandButton* m_logout_button;
 
 	GtkEntry* m_search_entry;
 

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


More information about the Xfce4-commits mailing list