~cairo-dock-team/ubuntu/quantal/cairo-dock-plug-ins/3.0.2

« back to all changes in this revision

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

Tags: upstream-2.2.0~0beta4
ImportĀ upstreamĀ versionĀ 2.2.0~0beta4

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "applet-notifications.h"
25
25
#include "applet-bookmarks.h"
26
26
#include "applet-load-icons.h"
 
27
#include "applet-disk-usage.h"
27
28
#include "applet-struct.h"
28
29
#include "applet-init.h"
29
30
 
30
31
 
31
32
CD_APPLET_DEFINITION (N_("shortcuts"),
32
33
        2, 0, 0,
33
 
        CAIRO_DOCK_CATEGORY_DESKTOP,
 
34
        CAIRO_DOCK_CATEGORY_APPLET_FILES,
34
35
        N_("An applet that let you access quickly to all of your shortcuts.\n"
35
36
        "It can manage disks, network points, and Nautilus bookmarks (even if you don't have Nautilus).\n"
36
37
        "Drag and drop a folder on the main icon or the sub-dock to add a bookmark.\n"
37
 
        "Middle-click on the main icon to acces your desktop easily.\n"
 
38
        "Middle-click on the main icon to show your home folder.\n"
38
39
        "Middle-click on a mounting point icon to (un)mount is quickly.\n"
39
40
        "The applet can also display valuable information about your disks, like free space, type, etc."),
40
 
        "Fabounet (Fabrice Rey) & Jackass (Benjamin SANS)")
 
41
        "Fabounet (Fabrice Rey) & Jackass (Benjamin SANS)")
41
42
 
42
43
 
43
44
CD_APPLET_INIT_BEGIN
 
45
        if (! cairo_dock_reserve_data_slot (myApplet))
 
46
                return;
 
47
        
44
48
        if (myDock)
45
49
                CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE;  // set the default icon if none is specified in conf.
46
50
        
51
55
                myApplet);
52
56
        cairo_dock_launch_task (myData.pTask);
53
57
        
 
58
        cairo_dock_register_notification (CAIRO_DOCK_CLICK_ICON, (CairoDockNotificationFunc) CD_APPLET_ON_CLICK_FUNC, CAIRO_DOCK_RUN_FIRST, myApplet);  // on se met en premier pour pas que le dock essaye de lancer nos icones.
54
59
        CD_APPLET_REGISTER_FOR_BUILD_MENU_EVENT;
55
60
        CD_APPLET_REGISTER_FOR_MIDDLE_CLICK_EVENT;
56
61
        CD_APPLET_REGISTER_FOR_DROP_DATA_EVENT;
 
62
        cairo_dock_register_notification (CAIRO_DOCK_STOP_ICON, (CairoDockNotificationFunc) cd_shortcuts_free_data, CAIRO_DOCK_RUN_AFTER, myApplet);
57
63
CD_APPLET_INIT_END
58
64
 
59
65
 
60
66
CD_APPLET_STOP_BEGIN
61
67
        //\_______________ On se desabonne de nos notifications.
 
68
        CD_APPLET_UNREGISTER_FOR_CLICK_EVENT;
62
69
        CD_APPLET_UNREGISTER_FOR_BUILD_MENU_EVENT;
63
70
        CD_APPLET_UNREGISTER_FOR_MIDDLE_CLICK_EVENT;
64
71
        CD_APPLET_UNREGISTER_FOR_DROP_DATA_EVENT;
 
72
        cairo_dock_remove_notification_func (CAIRO_DOCK_STOP_ICON, (CairoDockNotificationFunc) cd_shortcuts_free_data, myApplet);
65
73
CD_APPLET_STOP_END
66
74
 
67
75
 
81
89
                        myApplet);
82
90
                cairo_dock_launch_task (myData.pTask);
83
91
        }
84
 
        else if (myDesklet)  // on recharge juste la vue du desklet qui a change de taille.
85
 
        {
86
 
                const gchar *cDeskletRendererName = NULL;
87
 
                switch (myConfig.iDeskletRendererType)
88
 
                {
89
 
                        case CD_DESKLET_SLIDE :
90
 
                        default :
91
 
                                cDeskletRendererName = "Slide";
92
 
                        break ;
93
 
                        
94
 
                        case CD_DESKLET_TREE :
95
 
                                cDeskletRendererName = "Tree";
96
 
                        break ;
97
 
                }
98
 
                CD_APPLET_SET_DESKLET_RENDERER_WITH_DATA (cDeskletRendererName, NULL);
99
 
        }
100
 
        else
101
 
        {
102
 
                // rien a faire, cairo-dock va recharger notre sous-dock.
103
 
        }
104
92
CD_APPLET_RELOAD_END
105
93