~ubuntu-branches/ubuntu/oneiric/cairo-dock-plug-ins/oneiric-updates

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe), Matthieu Baerts (matttbe), Iain Lane
  • Date: 2011-10-09 00:19:16 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20111009001916-9czstskx2t6l0b3x
Tags: 2.4.0~2-0ubuntu1
[ Matthieu Baerts (matttbe) ]
* New upstream bug fix release. (LP: #859984)
* Upstream (short) ChangeLog (2.4.0~0beta2 -> 2.4.0~1):
 - Powermanager: correctly release the reference on the device object
 - logout: now works if there is no session-manager
 - Status-Notifier: fixed a small bug
    (wrong callback in cairo_dock_stop_watching_dbus_name_owner)
 - Folders: fixed the positionning of the new icon
    and the dialog when dropping a folder inside the dock
    and fixed the icon-rendering
 - Dustbin: use the default theme if no icon is found
 - Impulse: the default context seems to be ok and not an error
 - Status-Notifier: On Ubuntu Oneiric (with indicator-0.4)
    the ApplicationAdded signal has changed and has a new parameter
 - Disable MeMenu on Oneiric (no longer available with indicator-0.4)
 - CMakeLists.txt: Improved output messages
 - Slide view: fixed a small offset in vertical view
 - musicPlayer:
  + split MPRIS 1.0 and 2.0 to help debugging and finding the right
     name of the bug.
  + 'rhythmbox-client' tool is no longer available: used MPRIS
  + Disable Amazon service (it no longer work)
  + Cover: fixed corrupted icons: some players (e.g. the latest version
     of RB) copy covers on their cache forlder but it takes a few time.
  + Fixed the update the icon and its name if the player is stopped.
  + Prevent a crash if the name given by MPRIS is NULL
 - Powermanager: try to prevent to have a few dialogues at the same time
 - PowerManager and AlsaMixer: hidden gnome2 or 3 apps if not available
 - Messaging-Menu: Updated for Natty and Oneiric
    (dbus-menu gives us GVariant instead of GValue objects)
 - Alsamixer: fixed a small bug on reload
 - Dbus: Bash interface: Fixed a typo with emblem positions
 - Sys-monitor: fixed a bug which prevented from getting
    the CPU temperature in some cases
 - Compiz (0.9): type filter: replaced type=utility by type=Utility
 - Updated the version of all applets that have gauges
   in order to use the right directory
 - Wifi: Fixed the status if we are not connected
 - Dbus: removed a conflict with the Help applet
 - Messaging-Menu: updated applet-menu.c => Memory leaks on pixbufs
 - Dbus: Fixed a crash when changing dock theme if a 'third-party' applet
    is running
 - Netspeed: in /proc/net/dev, there are 8 values to drop after the card id
    except if there is whitespaces just after this ':' character
    and fixed order and value for ON_ICON display
 - dock-rendering/toto: removed a useless file
 - Clipper: fixed the loading of the remembered items
    (they had the wrong type) and fixed a bug if we reduce the list of items
 - Folders, dustbin, Network-Monitor: tried to not use cast if it's possible
 - Code cleaned and re-organised a few functions
   (e.g. emblem references has been renamed)
 - Removed useless files: powermanager-dbus*
 - Updating translations
 - Fixed a few warnings at the compilation
 - Removed a few useless output messages
 - Fixed these LP bugs:
  + Empty trash from the trashcan does not delete files
     from usb harddisks: LP: #658681
  + Switcher applet doesn't respect desktop numbers LP: #626782
* Upstream (short) ChangeLog (2.4.0~1 -> 2.4.0~2):
 - Messaging-Menu: fixed a wrong g_object_unref (double free)
    and a small memory leak
 - Folders: fixed a tiny warning at the compilation (32bits)
 - switcher: removed an unnecessary config parameter
 - Folders: file size: used English instead of French translation.
 - Indicator applet: Forced a cast to remove an annoying warning
    due to clumsy dbusmenu_gtkmenu_new() declaration
 - Fixed the detection of the screensaver
 - Fixed tiny warnings at the compilation (with CAIRO_CONTAINER)
* debian/control:
 - Updated the version of cairo-dock-[core;data;dev].
 - Added gvfs as 'Suggests' for cairo-dock-plug-ins-integration
    (Used for managing files)
 - Removed 'libthunar-vfs-1-dev' (libthunar-vfs is no longer installed
    by default since XFCE 4.8 and it is replaced by gvfs)
 - Removed 'indicator-me' (no longer available
    and the installation of Cairo-Dock produces an error)
 - Moved 'indicator-messages' to 'Recommends'
* debian/rules:
 - Updated the name of CMake extras flags
* debian/cairo-dock-plug-ins-data.lintian-overrides:
 - Deleted (now useless)
* debian/cairo-dock-plug-ins.lintian-overrides:
 - Cairo-Dock Plug-Ins are not linked to gldi
 - shlib-without-versioned-soname: forwarded to upstream.
* debian/cairo-dock-plug-ins-integration.lintian-overrides:
 - Cairo-Dock Plug-Ins are not linked to gldi
 - ldconfig and shlibs are not needed
* debian/cairo-dock-plug-ins.install:
 - Fixed lintian errors: package-installs-python-bytecode
* debian/control: Fixed lintian warnings:
 - python-script-but-no-python-dep
 - description-synopsis-starts-with-article
* debian/changelog:
 - Fixed lintian warning: old-fsf-address-in-copyright-file
* debian/patches/01-switcher-force-compact-view.patch: 
 - Forced the compact view because the other doesn't work

[ Iain Lane ]
* Fix Mono/CLI build to be ~policy compliant and use correct compiler

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
 
81
81
//\___________ 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).
82
82
CD_APPLET_INIT_BEGIN
83
 
        
84
 
        //\_______________ On definit le dessin de l'icone principale.
85
 
        _set_icon_label (myApplet);
86
 
        
87
 
        myIcon->iSubdockViewType = myConfig.iSubdockViewType;
88
 
        if (myDock && myConfig.iSubdockViewType == 0)
89
 
                CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE;
90
 
                ///CD_APPLET_SET_USER_IMAGE_ON_MY_ICON (myConfig.cImageFile, MY_APPLET_ICON_FILE);
91
 
        
92
 
        //\_______________ On lance la tache recuperation des fichiers.
93
 
        _set_comparaison_func (myApplet);
94
 
        if (myConfig.bShowFiles)
 
83
 
 
84
        if (myConfig.cDirPath == NULL)
95
85
        {
96
 
                cd_folders_start (myApplet);
 
86
                CD_APPLET_SET_IMAGE_ON_MY_ICON (myConfig.cImageFile);
 
87
                cairo_dock_show_temporary_dialog_with_icon (D_("Open the configuration of the applet to choose a folder to import."),
 
88
                        myIcon, myContainer,
 
89
                        8000.,
 
90
                        myConfig.iSubdockViewType == 0 ? "same icon" : MY_APPLET_SHARE_DATA_DIR"/"MY_APPLET_ICON_FILE);
97
91
        }
98
 
        else if (myDesklet)  // comme on ne charge pas les icones, on met un renderer "simple" sur notre desklet.
 
92
        else
99
93
        {
100
 
                CD_APPLET_SET_DESKLET_RENDERER ("Simple");
 
94
                //\_______________ On lance la tache recuperation des fichiers.
 
95
                _set_comparaison_func (myApplet);
 
96
                if (myConfig.bShowFiles)
 
97
                {
 
98
                        cd_folders_start (myApplet);
 
99
                }
 
100
 
 
101
                //\_______________ set the icon rendering
 
102
                if (myDock)  // dock mode: set the image or the sub-dock renderer
 
103
                {
 
104
                        cairo_dock_set_subdock_content_renderer (myIcon, myConfig.iSubdockViewType);
 
105
                        if (myConfig.iSubdockViewType == 0)
 
106
                                CD_APPLET_SET_IMAGE_ON_MY_ICON (myConfig.cImageFile);
 
107
                }
 
108
                else  // desklet mode: set the image if we don't show the files.
 
109
                {
 
110
                        if (! myConfig.bShowFiles)
 
111
                        {
 
112
                                CD_APPLET_SET_DESKLET_RENDERER ("Simple");
 
113
                                CD_APPLET_SET_IMAGE_ON_MY_ICON (myConfig.cImageFile);
 
114
                        }
 
115
                }
 
116
                
 
117
                //\_______________ set the label
 
118
                _set_icon_label (myApplet);
101
119
        }
102
120
        
103
121
        //\_______________ On enregistre nos notifications.
125
143
        {
126
144
                //\_______________ On detruit les icones des fichiers.
127
145
                cd_folders_free_all_data (myApplet);
128
 
                
129
 
                //\_______________ On met a jour l'icone principale.
130
 
                _set_icon_label (myApplet);
131
 
                
132
 
                myIcon->iSubdockViewType = myConfig.iSubdockViewType;
133
 
                if (myDock && myConfig.iSubdockViewType == 0)
134
 
                        CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE;
135
 
                        ///CD_APPLET_SET_USER_IMAGE_ON_MY_ICON (myConfig.cImageFile, MY_APPLET_ICON_FILE);
136
 
                
137
 
                //\_______________ On charge les icones dans un sous-dock.
138
 
                _set_comparaison_func (myApplet);
139
 
                if (myConfig.bShowFiles)
140
 
                {
141
 
                        cd_folders_start (myApplet);
142
 
                }
143
 
                else if (myDock && myIcon->pSubDock)  // on veut un comportement de type lanceur, donc on ne veut pas d'un sous-dock vide.
144
 
                {
145
 
                        cairo_dock_destroy_dock (myIcon->pSubDock, myIcon->cName);
146
 
                        myIcon->pSubDock = NULL;
147
 
                }
148
 
                else if (myDesklet)
149
 
                {
150
 
                        CD_APPLET_SET_DESKLET_RENDERER ("Simple");
 
146
 
 
147
                if (myConfig.cDirPath == NULL)
 
148
                {
 
149
                        CD_APPLET_SET_IMAGE_ON_MY_ICON (myConfig.cImageFile);
 
150
                        cairo_dock_show_temporary_dialog_with_icon (D_("Open the configuration of the applet to choose a folder to import."),
 
151
                                myIcon, myContainer,
 
152
                                8000.,
 
153
                                myConfig.iSubdockViewType == 0 ? "same icon" : MY_APPLET_SHARE_DATA_DIR"/"MY_APPLET_ICON_FILE);
 
154
                }
 
155
                else
 
156
                {
 
157
                        //\_______________ On charge les icones dans un sous-dock.
 
158
                        _set_comparaison_func (myApplet);
 
159
                        if (myConfig.bShowFiles)
 
160
                        {
 
161
                                cd_folders_start (myApplet);
 
162
                        }
 
163
                        else if (myDock && myIcon->pSubDock)  // dans ce cas on veut un comportement de type lanceur, donc on ne veut pas d'un sous-dock vide.
 
164
                        {
 
165
                                cairo_dock_destroy_dock (myIcon->pSubDock, myIcon->cName);
 
166
                                myIcon->pSubDock = NULL;
 
167
                        }
 
168
                        
 
169
                        //\_______________ set the icon rendering
 
170
                        if (myDock)  // dock mode: set the image or the sub-dock renderer
 
171
                        {
 
172
                                cairo_dock_set_subdock_content_renderer (myIcon, myConfig.iSubdockViewType);
 
173
                                if (myConfig.iSubdockViewType == 0)
 
174
                                        CD_APPLET_SET_IMAGE_ON_MY_ICON (myConfig.cImageFile);
 
175
                        }
 
176
                        else  // desklet mode: set the image if we don't show the files.
 
177
                        {
 
178
                                if (! myConfig.bShowFiles)
 
179
                                {
 
180
                                        CD_APPLET_SET_DESKLET_RENDERER ("Simple");
 
181
                                        CD_APPLET_SET_IMAGE_ON_MY_ICON (myConfig.cImageFile);
 
182
                                }
 
183
                        }
 
184
                        
 
185
                        //\_______________ set the label
 
186
                        _set_icon_label (myApplet);
151
187
                }
152
188
        }
153
189
CD_APPLET_RELOAD_END