~ubuntu-branches/ubuntu/saucy/cairo-dock-plug-ins/saucy

« back to all changes in this revision

Viewing changes to logout/src/applet-init.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2009-08-26 21:07:39 UTC
  • Revision ID: james.westby@ubuntu.com-20090826210739-gyjuuqezrzuluao4
Tags: upstream-2.0.8.1
ImportĀ upstreamĀ versionĀ 2.0.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
* This file is a part of the Cairo-Dock project
 
3
*
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
 
6
*
 
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.
 
11
*
 
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/>.
 
18
*/
 
19
 
 
20
 
 
21
#include "stdlib.h"
 
22
 
 
23
#include "applet-config.h"
 
24
#include "applet-notifications.h"
 
25
#include "applet-struct.h"
 
26
#include "applet-init.h"
 
27
 
 
28
 
 
29
CD_APPLET_DEFINITION ("logout",
 
30
        2, 0, 0,
 
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)")
 
36
 
 
37
 
 
38
CD_APPLET_INIT_BEGIN
 
39
        if (myDesklet)
 
40
        {
 
41
                CD_APPLET_SET_DESKLET_RENDERER ("Simple");
 
42
        }
 
43
        
 
44
        CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE;  // set the default icon if none is specified in conf.
 
45
        
 
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);
 
48
        
 
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;
 
53
CD_APPLET_INIT_END
 
54
 
 
55
 
 
56
CD_APPLET_STOP_BEGIN
 
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;
 
61
        
 
62
        CD_APPLET_MANAGE_APPLICATION ("x-session-manager", FALSE);  // on relache le controle de l'icone de la fenetre.
 
63
CD_APPLET_STOP_END
 
64
 
 
65
 
 
66
CD_APPLET_RELOAD_BEGIN
 
67
        if (myDesklet)
 
68
        {
 
69
                CD_APPLET_SET_DESKLET_RENDERER ("Simple");
 
70
        }
 
71
        
 
72
        if (CD_APPLET_MY_CONFIG_CHANGED)
 
73
        {
 
74
                CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE;  // set the default icon if none is specified in conf.
 
75
        }
 
76
CD_APPLET_RELOAD_END