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

« back to all changes in this revision

Viewing changes to rame/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
#include <string.h>
 
22
#include <cairo-dock.h>
 
23
 
 
24
#include "applet-struct.h"
 
25
#include "applet-rame.h"
 
26
#include "applet-config.h"
 
27
 
 
28
 
 
29
CD_APPLET_GET_CONFIG_BEGIN
 
30
 
 
31
        //\_________________ On recupere toutes les valeurs de notre fichier de conf.
 
32
        myConfig.defaultTitle = CD_CONFIG_GET_STRING ("Icon", "name");
 
33
        myConfig.iCheckInterval = CD_CONFIG_GET_INTEGER ("Configuration", "delay");
 
34
        myConfig.bShowSwap =  CD_CONFIG_GET_BOOLEAN ("Configuration", "show swap");
 
35
        myConfig.iInfoDisplay = CD_CONFIG_GET_INTEGER ("Configuration", "info display");
 
36
        myConfig.cGThemePath = CD_CONFIG_GET_GAUGE_THEME ("Configuration", "theme");
 
37
        myConfig.fAlpha = CD_CONFIG_GET_DOUBLE ("Configuration", "watermark alpha");
 
38
        if (myConfig.fAlpha != 0)
 
39
        {
 
40
                myConfig.cWatermarkImagePath = CD_CONFIG_GET_FILE_PATH ("Configuration", "watermark image", MY_APPLET_ICON_FILE);
 
41
        }
 
42
        myConfig.bShowFreeMemory = CD_CONFIG_GET_BOOLEAN ("Configuration", "show free");
 
43
        
 
44
        myConfig.bUseGraphic = CD_CONFIG_GET_BOOLEAN ("Configuration", "use graphic");
 
45
        myConfig.iGraphType = CD_CONFIG_GET_INTEGER ("Configuration", "graphic type");
 
46
        CD_CONFIG_GET_COLOR_RVB ("Configuration", "low color", myConfig.fLowColor);
 
47
        CD_CONFIG_GET_COLOR_RVB ("Configuration", "high color", myConfig.fHigholor);
 
48
        CD_CONFIG_GET_COLOR ("Configuration", "bg color", myConfig.fBgColor);
 
49
        CD_CONFIG_GET_COLOR_RVB ("Configuration", "low color2", myConfig.fLowColor2);
 
50
        CD_CONFIG_GET_COLOR_RVB ("Configuration", "high color2", myConfig.fHigholor2);
 
51
        myConfig.bMixGraph = CD_CONFIG_GET_BOOLEAN ("Configuration", "mix graph");
 
52
        
 
53
        
 
54
        myConfig.iNbDisplayedProcesses = CD_CONFIG_GET_INTEGER ("Configuration", "top");
 
55
        myConfig.bTopInPercent = CD_CONFIG_GET_BOOLEAN ("Configuration", "top in percent");
 
56
        
 
57
        myConfig.pTopTextDescription = cairo_dock_duplicate_label_description (&myDialogs.dialogTextDescription);
 
58
        CD_CONFIG_GET_COLOR_RVB ("Configuration", "top color start", myConfig.pTopTextDescription->fColorStart);
 
59
        CD_CONFIG_GET_COLOR_RVB ("Configuration", "top color stop", myConfig.pTopTextDescription->fColorStop);
 
60
        myConfig.pTopTextDescription->bVerticalPattern = TRUE;
 
61
        
 
62
        myConfig.cSystemMonitorCommand = CD_CONFIG_GET_STRING ("Configuration", "sys monitor");
 
63
CD_APPLET_GET_CONFIG_END
 
64
 
 
65
 
 
66
CD_APPLET_RESET_CONFIG_BEGIN
 
67
        g_free (myConfig.defaultTitle);
 
68
        cairo_dock_free_label_description (myConfig.pTopTextDescription);
 
69
        g_free (myConfig.cWatermarkImagePath);
 
70
        g_free (myConfig.cSystemMonitorCommand);
 
71
CD_APPLET_RESET_CONFIG_END
 
72
 
 
73
 
 
74
CD_APPLET_RESET_DATA_BEGIN      
 
75
        cairo_dock_free_task (myData.pTask);
 
76
        
 
77
        //Adieu la jauge...
 
78
        cairo_dock_free_gauge(myData.pGauge);
 
79
        cairo_dock_free_graph (myData.pGraph);
 
80
        
 
81
        cairo_dock_free_task (myData.pTopTask);
 
82
        cairo_dock_dialog_unreference (myData.pTopDialog);
 
83
        cairo_surface_destroy (myData.pTopSurface);
 
84
        cd_rame_clean_all_processes ();
 
85
        g_free (myData.pTopList);
 
86
        g_free (myData.pPreviousTopList);
 
87
CD_APPLET_RESET_DATA_END
 
88