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

« back to all changes in this revision

Viewing changes to xmms/src/applet-config.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
 
 
22
This file is a part of the cairo-dock program, 
 
23
released under the terms of the GNU General Public License.
 
24
 
 
25
Written by Rémy Robertson (for any bug report, please mail me to changfu@cairo-dock.org)
 
26
Fabrice Rey (fabounet@users.berlios.de)
 
27
 
 
28
******************************************************************************/
 
29
#include <stdlib.h>
 
30
#include <string.h>
 
31
 
 
32
#include "applet-struct.h"
 
33
#include "applet-config.h"
 
34
 
 
35
 
 
36
 
 
37
CD_APPLET_GET_CONFIG_BEGIN
 
38
        //\_________________ On recupere toutes les valeurs de notre fichier de conf.
 
39
        myConfig.quickInfoType          = CD_CONFIG_GET_INTEGER_WITH_DEFAULT ("Configuration", "quick-info_type", MY_APPLET_TIME_ELAPSED);
 
40
        
 
41
        myConfig.defaultTitle                   = CD_CONFIG_GET_STRING ("Icon", "name");
 
42
        myConfig.iPlayer                                        = CD_CONFIG_GET_INTEGER_WITH_DEFAULT ("Configuration", "current-player", MY_XMMS);
 
43
        myConfig.iExtendedMode          = CD_CONFIG_GET_INTEGER_WITH_DEFAULT ("Configuration", "extended_mode", MY_DESKLET_INFO);
 
44
        
 
45
        myConfig.enableDialogs          = CD_CONFIG_GET_BOOLEAN ("Configuration", "enable_dialogs");
 
46
        myConfig.timeDialogs                    = CD_CONFIG_GET_DOUBLE_WITH_DEFAULT ("Configuration", "time_dialogs", 3000);
 
47
        myConfig.extendedDesklet        = CD_CONFIG_GET_BOOLEAN ("Configuration", "extended_desklet");
 
48
        
 
49
        myConfig.enableAnim                     = CD_CONFIG_GET_BOOLEAN ("Configuration", "enable_anim");
 
50
        myConfig.changeAnimation        = CD_CONFIG_GET_STRING ("Configuration", "change animation");
 
51
        
 
52
        myConfig.bStealTaskBarIcon      = CD_CONFIG_GET_BOOLEAN ("Configuration", "inhibate appli");
 
53
        myConfig.bIconBubble                            = CD_CONFIG_GET_BOOLEAN ("Configuration", "bubble icon");
 
54
        
 
55
        myConfig.cUserImage[PLAYER_NONE]                        = CD_CONFIG_GET_STRING ("Configuration", "default icon");
 
56
        myConfig.cUserImage[PLAYER_PLAYING]     = CD_CONFIG_GET_STRING ("Configuration", "play icon");
 
57
        myConfig.cUserImage[PLAYER_PAUSED]              = CD_CONFIG_GET_STRING ("Configuration", "pause icon");
 
58
        myConfig.cUserImage[PLAYER_STOPPED]     = CD_CONFIG_GET_STRING ("Configuration", "stop icon");
 
59
        myConfig.cUserImage[PLAYER_BROKEN]              = CD_CONFIG_GET_STRING ("Configuration", "broken icon");
 
60
CD_APPLET_GET_CONFIG_END
 
61
 
 
62
 
 
63
CD_APPLET_RESET_CONFIG_BEGIN
 
64
        g_free (myConfig.defaultTitle);
 
65
        g_free (myConfig.changeAnimation);
 
66
        
 
67
        int i;
 
68
        for (i = 0; i < PLAYER_NB_STATUS; i ++)
 
69
                g_free (myConfig.cUserImage[i]);
 
70
CD_APPLET_RESET_CONFIG_END
 
71
 
 
72
 
 
73
CD_APPLET_RESET_DATA_BEGIN
 
74
        cairo_dock_free_task (myData.pTask);
 
75
        
 
76
        int i;
 
77
        for (i = 0; i < PLAYER_NB_STATUS; i ++) {
 
78
                if (myData.pSurfaces[i] != NULL)
 
79
                        cairo_surface_destroy (myData.pSurfaces[i]);
 
80
        }
 
81
        
 
82
        g_free (myData.playingTitle);
 
83
        myData.playingTitle = NULL;
 
84
        g_free (myData.cQuickInfo);
 
85
        myData.cQuickInfo = NULL;
 
86
CD_APPLET_RESET_DATA_END