2
* This file is a part of the Cairo-Dock project
4
* Copyright : (C) see the 'copyright' file.
5
* E-mail : see the 'copyright' file.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 3
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
24
#include <glib/gi18n.h>
26
#include "applet-struct.h"
27
#include "applet-notifications.h"
32
if (myConfig.cUserAction != NULL)
34
cairo_dock_launch_command (myConfig.cUserAction);
38
gboolean bLoggedOut = cairo_dock_fm_logout ();
41
if (g_iDesktopEnv == CAIRO_DOCK_KDE)
43
int answer = cairo_dock_ask_question_and_wait ("Log out ?", myIcon, myContainer);
44
if (answer == GTK_RESPONSE_YES)
46
system ("dcop ksmserver default logout 0 0 0"); // kdmctl shutdown reboot forcenow // kdeinit_shutdown
47
system ("qdbus org.kde.ksmserver /KSMServer logout 0 2 0");
52
cd_warning ("couldn't guess what to do to log out.");
57
static _shutdown (void)
59
if (myConfig.cUserAction2 != NULL)
61
cairo_dock_launch_command (myConfig.cUserAction2);
65
gboolean bShutdowned = cairo_dock_fm_shutdown ();
68
if (g_iDesktopEnv == CAIRO_DOCK_KDE)
70
int answer = cairo_dock_ask_question_and_wait ("Shutdown ?", myIcon, myContainer);
71
if (answer == GTK_RESPONSE_YES)
73
system ("dcop ksmserver default logout 0 0 0"); // kdmctl shutdown reboot forcenow // kdeinit_shutdown
78
cd_warning ("couldn't guess what to do to shutdown.");
83
CD_APPLET_ON_CLICK_BEGIN
87
if (cairo_dock_get_current_active_window () == myIcon->Xid && myTaskBar.bMinimizeOnClick)
88
cairo_dock_minimize_xwindow (myIcon->Xid);
90
cairo_dock_show_xwindow (myIcon->Xid);
94
if (myConfig.bInvertButtons)
100
CD_APPLET_ON_CLICK_END
103
CD_APPLET_ON_MIDDLE_CLICK_BEGIN
105
if (myConfig.bInvertButtons)
110
CD_APPLET_ON_MIDDLE_CLICK_END
113
CD_APPLET_ON_BUILD_MENU_BEGIN
115
GtkWidget *pSubMenu = CD_APPLET_CREATE_MY_SUB_MENU ();
116
CD_APPLET_ADD_ABOUT_IN_MENU (pSubMenu);
118
CD_APPLET_ON_BUILD_MENU_END