~ubuntu-branches/ubuntu/quantal/cairo-dock-plug-ins/quantal-201208191523

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-08-10 00:05:57 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810000557-pfxoz5w7hbyclcqh
Tags: 2.2.0~0beta4-0ubuntu1
* New Upstream Version (LP: #614625)
* Fixed a few bugs on LP:
 - LP: #483963: Dustbin applet does not display trashes on all volumes
 - LP: #485159: Some apps have problem with Systray
 - LP: #500677: ~/.xsession-errors is too much used by CD
 - LP: #500979: Shortcuts: the order gets messed up
 - LP: #521531: Mail: crashes on Maildir
 - LP: #519915: GTG: create a new applet to control GTG
 - LP: #526138: GMenu doesn't handle desktop file exec strings properly
 - LP: #531317: CMake: Added an error if the prefix of 'cairo-dock-plugins'
                 is not the same 'cairo-dock-core'
 - LP: #531319: CMake: check the version of 'cairo-dock' when building
                 'cairo-dock-plugins'
 - LP: #537115: Click at the position where icon lavel was, the icon
                 and dock still receive the event
 - LP: #537943: Terminal applet shortkey behaviour
 - LP: #538637: Trash applet doesn't create .trashinfo files on XFCE
 - More details on the 'ChangeLog' file
* debian/rules:
 - Autotools has been replaced by CMake
 - cdbs is now used.
* debian/copyright:
 - Updated with the new applets
* debian/control:
 - Autotools has been replaced by CMake
 - Added libcurl4-gnutls-dev, libindicator-dev, libdbusmenu-glib-dev
   libido-0.1-dev, libical-dev, libdbusmenu-gtk-dev as Build-deps
 - Bump Standard-Version to 3.9.1
 - Wget is required for dnd2share applet
 - Added the exact realease for 'cairo-dock-dev' in order to prevent any
    build error if this package is not already available (thx to didrocks)
* debian/cairo-dock-plug-ins*.install:
 - All sonames are now installed into lib32 or lib64 (lib*)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "applet-init.h"
28
28
 
29
29
 
30
 
CD_APPLET_DEFINITION ("GMenu",
 
30
CD_APPLET_DEFINE_BEGIN ("GMenu",
31
31
        2, 0, 0,
32
 
        CAIRO_DOCK_CATEGORY_DESKTOP,
 
32
        CAIRO_DOCK_CATEGORY_APPLET_DESKTOP,
33
33
        N_("Displays the common Applications menu and the Recently used files.\n"
34
34
        "It is compatible with any XDG compliant menu (Gnome, XFCE, KDE, ...)\n"
35
35
        "Middle-click to open a dialog to quickly launch any command (you can set up a shortkey for it, like ALT+F2)\n"
36
36
        "You can also set up a shortkey to pop up the menu (like ALT+F1)"),
37
37
        "Fabounet (Fabrice Rey)")
 
38
        CD_APPLET_DEFINE_COMMON_APPLET_INTERFACE
 
39
        CD_APPLET_REDEFINE_TITLE (N_("Applications Menu"))
 
40
CD_APPLET_DEFINE_END
38
41
 
39
42
 
40
43
//\___________ Here is where you initiate your applet. myConfig is already set at this point, and also myIcon, myContainer, myDock, myDesklet (and myDrawContext if you're in dock mode). The macro CD_APPLET_MY_CONF_FILE and CD_APPLET_MY_KEY_FILE can give you access to the applet's conf-file and its corresponding key-file (also available during reload). If you're in desklet mode, myDrawContext is still NULL, and myIcon's buffers has not been filled, because you may not need them then (idem when reloading).
78
81
 
79
82
//\___________ The reload occurs in 2 occasions : when the user changes the applet's config, and when the user reload the cairo-dock's config or modify the desklet's size. The macro CD_APPLET_MY_CONFIG_CHANGED can tell you this. myConfig has already been reloaded at this point if you're in the first case, myData is untouched. You also have the macro CD_APPLET_MY_CONTAINER_TYPE_CHANGED that can tell you if you switched from dock/desklet to desklet/dock mode.
80
83
CD_APPLET_RELOAD_BEGIN
81
 
        if (myDesklet)
82
 
        {
83
 
                CD_APPLET_SET_DESKLET_RENDERER ("Simple");  // set a desklet renderer.
84
 
        }
85
 
        
86
84
        if (CD_APPLET_MY_CONFIG_CHANGED)
87
85
        {
 
86
                if (myDesklet && CD_APPLET_MY_CONTAINER_TYPE_CHANGED)  // we are now in a desklet, set a renderer.
 
87
                {
 
88
                        CD_APPLET_SET_DESKLET_RENDERER ("Simple");
 
89
                }
 
90
 
88
91
                CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE;  // set the default icon if none is specified in conf.
89
92
                
90
93
                cd_keybinder_bind (myConfig.cMenuShortkey, (CDBindkeyHandler) cd_menu_on_shortkey_menu, myApplet);  // shortkey were unbinded during reset_config.