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/>.
23
#include "applet-config.h"
24
#include "applet-notifications.h"
25
#include "applet-struct.h"
26
#include "applet-init.h"
29
CD_APPLET_DEFINITION ("logout",
31
CAIRO_DOCK_CATEGORY_DESKTOP,
32
N_("A very simple applet that adds an icon to log out from your session\n"
33
"Left click to log out, middle click to shutdown\n"
34
"You can invert this order if you prefer to shutdown on left-click."),
35
"Fabounet (Fabrice Rey)")
41
CD_APPLET_SET_DESKLET_RENDERER ("Simple");
44
CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE; // set the default icon if none is specified in conf.
46
if (g_iDesktopEnv == CAIRO_DOCK_GNOME || g_iDesktopEnv == CAIRO_DOCK_XFCE) // on prend le controle de l'icone de la fenetre.
47
CD_APPLET_MANAGE_APPLICATION ("x-session-manager", TRUE);
49
//\_______________ On enregistre nos notifications.
50
CD_APPLET_REGISTER_FOR_CLICK_EVENT;
51
CD_APPLET_REGISTER_FOR_MIDDLE_CLICK_EVENT;
52
CD_APPLET_REGISTER_FOR_BUILD_MENU_EVENT;
57
//\_______________ On se desabonne de nos notifications.
58
CD_APPLET_UNREGISTER_FOR_CLICK_EVENT;
59
CD_APPLET_UNREGISTER_FOR_MIDDLE_CLICK_EVENT;
60
CD_APPLET_UNREGISTER_FOR_BUILD_MENU_EVENT;
62
CD_APPLET_MANAGE_APPLICATION ("x-session-manager", FALSE); // on relache le controle de l'icone de la fenetre.
66
CD_APPLET_RELOAD_BEGIN
69
CD_APPLET_SET_DESKLET_RENDERER ("Simple");
72
if (CD_APPLET_MY_CONFIG_CHANGED)
74
CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE; // set the default icon if none is specified in conf.