[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 233/473: Add command to switch users.
noreply at xfce.org
noreply at xfce.org
Mon Feb 16 23:56:43 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 050ccb4212b670ab3567b3f4a0321c5e97785afa
Author: Graeme Gott <graeme at gottcode.org>
Date: Mon Nov 11 06:38:08 2013 -0500
Add command to switch users.
---
panel-plugin/configuration-dialog.cpp | 5 +++++
panel-plugin/configuration-dialog.h | 1 +
panel-plugin/settings.cpp | 6 ++++++
panel-plugin/settings.h | 1 +
panel-plugin/window.cpp | 19 +++++++++++++------
5 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/panel-plugin/configuration-dialog.cpp b/panel-plugin/configuration-dialog.cpp
index a3a6ce7..c9c609f 100644
--- a/panel-plugin/configuration-dialog.cpp
+++ b/panel-plugin/configuration-dialog.cpp
@@ -218,6 +218,7 @@ void ConfigurationDialog::response(int response_id)
wm_settings->command_settings->check();
wm_settings->command_lockscreen->check();
+ wm_settings->command_switchuser->check();
wm_settings->command_logout->check();
wm_settings->command_menueditor->check();
@@ -429,6 +430,10 @@ GtkWidget* ConfigurationDialog::init_commands_tab()
m_lockscreen_command = new CommandEdit(wm_settings->command_lockscreen);
gtk_box_pack_start(panel_vbox, m_lockscreen_command->get_widget(), false, false, 0);
+ // Add switch user command entry
+ m_switchuser_command = new CommandEdit(wm_settings->command_switchuser);
+ gtk_box_pack_start(panel_vbox, m_switchuser_command->get_widget(), false, false, 0);
+
// Add log out command entry
m_logout_command = new CommandEdit(wm_settings->command_logout);
gtk_box_pack_start(panel_vbox, m_logout_command->get_widget(), false, false, 0);
diff --git a/panel-plugin/configuration-dialog.h b/panel-plugin/configuration-dialog.h
index ea6823c..887e4f5 100644
--- a/panel-plugin/configuration-dialog.h
+++ b/panel-plugin/configuration-dialog.h
@@ -86,6 +86,7 @@ private:
CommandEdit* m_settings_command;
CommandEdit* m_lockscreen_command;
+ CommandEdit* m_switchuser_command;
CommandEdit* m_logout_command;
CommandEdit* m_menueditor_command;
diff --git a/panel-plugin/settings.cpp b/panel-plugin/settings.cpp
index b81bca4..ea83c6d 100644
--- a/panel-plugin/settings.cpp
+++ b/panel-plugin/settings.cpp
@@ -100,6 +100,7 @@ Settings::Settings() :
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_switchuser = new Command("system-users", _("Switch _Users"), "gdmflexiserver", _("Failed to switch users."));
command_logout = new Command("system-log-out", _("Log _Out"), "xfce4-session-logout", _("Failed to log out."));
command_menueditor = new Command("xfce4-menueditor", _("_Edit Applications"), "menulibre", _("Failed to launch menu editor."));
}
@@ -110,6 +111,7 @@ Settings::~Settings()
{
delete command_settings;
delete command_lockscreen;
+ delete command_switchuser;
delete command_logout;
delete command_menueditor;
}
@@ -154,11 +156,13 @@ void Settings::load(char* file)
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_switchuser->set(xfce_rc_read_entry(rc, "command-switchuser", command_switchuser->get()));
command_logout->set(xfce_rc_read_entry(rc, "command-logout", command_logout->get()));
command_menueditor->set(xfce_rc_read_entry(rc, "command-menueditor", command_menueditor->get()));
command_settings->set_shown(xfce_rc_read_bool_entry(rc, "show-command-settings", command_settings->get_shown()));
command_lockscreen->set_shown(xfce_rc_read_bool_entry(rc, "show-command-lockscreen", command_lockscreen->get_shown()));
+ command_switchuser->set_shown(xfce_rc_read_bool_entry(rc, "show-command-switchuser", command_switchuser->get_shown()));
command_logout->set_shown(xfce_rc_read_bool_entry(rc, "show-command-logout", command_logout->get_shown()));
command_menueditor->set_shown(xfce_rc_read_bool_entry(rc, "show-command-menueditor", command_menueditor->get_shown()));
@@ -213,11 +217,13 @@ void Settings::save(char* file)
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-switchuser", command_switchuser->get());
xfce_rc_write_entry(rc, "command-logout", command_logout->get());
xfce_rc_write_entry(rc, "command-menueditor", command_menueditor->get());
xfce_rc_write_bool_entry(rc, "show-command-settings", command_settings->get_shown());
xfce_rc_write_bool_entry(rc, "show-command-lockscreen", command_lockscreen->get_shown());
+ xfce_rc_write_bool_entry(rc, "show-command-switchuser", command_switchuser->get_shown());
xfce_rc_write_bool_entry(rc, "show-command-logout", command_logout->get_shown());
xfce_rc_write_bool_entry(rc, "show-command-menueditor", command_menueditor->get_shown());
diff --git a/panel-plugin/settings.h b/panel-plugin/settings.h
index 05f3eba..d8a61a2 100644
--- a/panel-plugin/settings.h
+++ b/panel-plugin/settings.h
@@ -64,6 +64,7 @@ public:
Command* command_settings;
Command* command_lockscreen;
+ Command* command_switchuser;
Command* command_logout;
Command* command_menueditor;
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index b9a9c76..d760955 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -106,6 +106,7 @@ Window::Window() :
// Create action buttons
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_switchuser->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);
@@ -157,6 +158,7 @@ Window::Window() :
m_commands_box = GTK_BOX(gtk_hbox_new(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_switchuser->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));
@@ -266,6 +268,7 @@ void Window::show(GtkWidget* parent, bool horizontal)
// Make sure commands are valid and visible
wm_settings->command_settings->check();
wm_settings->command_lockscreen->check();
+ wm_settings->command_switchuser->check();
wm_settings->command_logout->check();
wm_settings->command_menueditor->check();
@@ -441,7 +444,8 @@ void Window::show(GtkWidget* parent, bool horizontal)
gtk_alignment_set(m_commands_align, 1, 0, 0, 0);
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_commands_box, GTK_WIDGET(wm_settings->command_switchuser->get_button()), 2);
+ gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_logout->get_button()), 3);
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);
@@ -457,8 +461,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(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_settings->get_button()), 3);
+ gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_lockscreen->get_button()), 2);
+ gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_switchuser->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);
@@ -477,7 +482,8 @@ void Window::show(GtkWidget* parent, bool horizontal)
gtk_alignment_set(m_commands_align, 1, 0, 0, 0);
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_commands_box, GTK_WIDGET(wm_settings->command_switchuser->get_button()), 2);
+ gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_logout->get_button()), 3);
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);
@@ -491,8 +497,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(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_settings->get_button()), 3);
+ gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_lockscreen->get_button()), 2);
+ gtk_box_reorder_child(m_commands_box, GTK_WIDGET(wm_settings->command_switchuser->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);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list