69
75
case CD_LOCK_SCREEN:
70
76
cairo_dock_fm_lock_screen ();
75
CD_APPLET_ON_CLICK_BEGIN
77
/**if (myIcon->Xid != 0)
79
if (cairo_dock_get_current_active_window () == myIcon->Xid && myTaskBar.bMinimizeOnClick)
80
cairo_dock_minimize_xwindow (myIcon->Xid);
82
cairo_dock_show_xwindow (myIcon->Xid);
86
// on execute l'action meme si la fenetre est deja ouverte (ca lui redonne le focus), car si on avait deja execute l'autre action, ca empeche de faire celle-ci.
87
_execute_action (myConfig.iActionOnClick);
90
CD_APPLET_ON_CLICK_END
80
cd_logout_display_actions ();
93
84
CD_APPLET_ON_MIDDLE_CLICK_BEGIN
95
86
_execute_action (myConfig.iActionOnMiddleClick);
97
88
CD_APPLET_ON_MIDDLE_CLICK_END
100
static void _cd_logout (GtkMenuItem *menu_item, gpointer data)
106
static void _cd_shutdown (GtkMenuItem *menu_item, gpointer data)
112
static void _cd_lock_screen (GtkMenuItem *menu_item, gpointer data)
115
cairo_dock_fm_lock_screen ();
119
static void _cd_logout_guest_session (GtkMenuItem *menu_item, gpointer data)
122
cd_logout_launch_guest_session ();
126
static void _cd_logout_program_shutdown (GtkMenuItem *menu_item, gpointer data)
129
cd_logout_program_shutdown ();
91
static void cd_logout_manage_users (GtkMenuItem *menu_item, gchar *cUserName)
93
GError * error = NULL;
94
if (! g_spawn_command_line_async("gnome-control-center user-accounts", &error)) // Gnome3
96
cd_warning ("Couldn't launch 'gnome-control-center user-accounts': %s", error->message);
98
} /// TODO: handle other DE ...
132
100
CD_APPLET_ON_BUILD_MENU_BEGIN
134
GtkWidget *pSubMenu = CD_APPLET_CREATE_MY_SUB_MENU ();
137
if (! myData.bCapabilitiesChecked) // if we're using our own logout methods, they are all accessible from the left-click, so no need to add the following actions in the right-click menu.
139
if (myConfig.iActionOnClick != CD_LOGOUT) // logout action not on click => put it in the menu
141
if (myConfig.iActionOnMiddleClick == CD_LOGOUT) // logout action on middle-click
142
cLabel = g_strdup_printf ("%s (%s)", D_("Log out"), D_("middle-click"));
144
cLabel = g_strdup (D_("Log out"));
145
CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, MY_APPLET_SHARE_DATA_DIR"/system-log-out.svg", _cd_logout, CD_APPLET_MY_MENU);
148
if (myConfig.iActionOnClick != CD_SHUTDOWN) // shutdown action not on click => put it in the menu
150
if (myConfig.iActionOnMiddleClick == CD_SHUTDOWN) // logout action on middle-click
151
cLabel = g_strdup_printf ("%s (%s)", D_("Shut down"), D_("middle-click"));
153
cLabel = g_strdup (D_("Shut down"));
154
CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, MY_APPLET_SHARE_DATA_DIR"/system-shutdown.svg", _cd_shutdown, CD_APPLET_MY_MENU);
157
if (myConfig.iActionOnClick != CD_LOCK_SCREEN) // lockscreen action not on click => put it in the menu
159
if (myConfig.iActionOnMiddleClick == CD_LOCK_SCREEN) // lockscreen action on middle-click
160
cLabel = g_strdup_printf ("%s (%s)", D_("Lock screen"), D_("middle-click"));
162
cLabel = g_strdup (D_("Lock screen"));
163
CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, MY_APPLET_SHARE_DATA_DIR"/locked.svg", _cd_lock_screen, CD_APPLET_MY_MENU);
167
if (cd_logout_have_guest_session ()) // Guest Session
169
CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Guest session"), MY_APPLET_SHARE_DATA_DIR"/system-guest.svg", _cd_logout_guest_session, CD_APPLET_MY_MENU);
172
CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Program an automatic shut-down"), MY_APPLET_SHARE_DATA_DIR"/icon-scheduling.svg", _cd_logout_program_shutdown, CD_APPLET_MY_MENU); // pas beaucoup d'entrees => on le met dans le menu global.
174
CD_APPLET_ADD_ABOUT_IN_MENU (pSubMenu);
101
if (g_iDesktopEnv == CAIRO_DOCK_GNOME)
103
CD_APPLET_ADD_IN_MENU_WITH_STOCK (D_("Manage users"), GTK_STOCK_EDIT, cd_logout_manage_users, CD_APPLET_MY_MENU);
176
105
CD_APPLET_ON_BUILD_MENU_END
108
void cd_logout_on_keybinding_pull (const gchar *keystring, gpointer user_data)
110
cairo_dock_fm_lock_screen ();
113
void cd_logout_on_keybinding_pull2 (const gchar *keystring, gpointer user_data)
115
cd_logout_display_actions ();