2
* This file is a part of the Cairo-Dock project
4
* Copyright : (C) see the 'copyright' file.
5
* E-mail : see the 'copyright' file.
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.
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/>.
22
#include <cairo-dock.h>
24
#include "applet-struct.h"
25
#include "applet-config.h"
27
CD_APPLET_GET_CONFIG_BEGIN
28
//\_________________ On recupere toutes les valeurs de notre fichier de conf.
29
myConfig.defaultTitle = CD_CONFIG_GET_STRING ("Icon", "name");
30
myConfig.iCheckInterval = CD_CONFIG_GET_INTEGER ("Configuration", "delay");
32
myConfig.iInfoDisplay = CD_CONFIG_GET_INTEGER ("Configuration", "info display");
33
myConfig.cGThemePath = CD_CONFIG_GET_GAUGE_THEME ("Configuration", "theme");
35
myConfig.bUseGraphic = CD_CONFIG_GET_BOOLEAN ("Configuration", "use graphic");
36
myConfig.iGraphType = CD_CONFIG_GET_INTEGER ("Configuration", "graphic type");
37
CD_CONFIG_GET_COLOR_RVB ("Configuration", "low color", myConfig.fLowColor);
38
CD_CONFIG_GET_COLOR_RVB ("Configuration", "high color", myConfig.fHigholor);
39
CD_CONFIG_GET_COLOR ("Configuration", "bg color", myConfig.fBgColor);
41
myConfig.fAlpha = CD_CONFIG_GET_DOUBLE ("Configuration", "watermark alpha");
42
if (myConfig.fAlpha != 0)
44
myConfig.cWatermarkImagePath = CD_CONFIG_GET_FILE_PATH ("Configuration", "watermark image", MY_APPLET_ICON_FILE);
47
myConfig.iNbDisplayedProcesses = CD_CONFIG_GET_INTEGER ("Configuration", "top");
48
myConfig.iProcessCheckInterval = CD_CONFIG_GET_INTEGER ("Configuration", "top delay");
50
myConfig.pTopTextDescription = cairo_dock_duplicate_label_description (&myDialogs.dialogTextDescription);
51
CD_CONFIG_GET_COLOR_RVB ("Configuration", "top color start", myConfig.pTopTextDescription->fColorStart);
52
CD_CONFIG_GET_COLOR_RVB ("Configuration", "top color stop", myConfig.pTopTextDescription->fColorStop);
53
myConfig.pTopTextDescription->bVerticalPattern = TRUE;
55
myConfig.cSystemMonitorCommand = CD_CONFIG_GET_STRING ("Configuration", "sys monitor");
56
myConfig.fUserHZ = CD_CONFIG_GET_INTEGER_WITH_DEFAULT ("Configuration", "HZ", 100);
57
CD_APPLET_GET_CONFIG_END
60
CD_APPLET_RESET_CONFIG_BEGIN
61
g_free (myConfig.defaultTitle);
62
cairo_dock_free_label_description (myConfig.pTopTextDescription);
63
g_free (myConfig.cWatermarkImagePath);
64
g_free (myConfig.cSystemMonitorCommand);
65
CD_APPLET_RESET_CONFIG_END
68
CD_APPLET_RESET_DATA_BEGIN
69
cairo_dock_free_task (myData.pTask);
70
g_timer_destroy (myData.pClock);
72
cairo_dock_free_gauge (myData.pGauge);
73
cairo_dock_free_graph (myData.pGraph);
75
cairo_dock_free_task (myData.pTopTask);
76
if (myData.pTopClock != NULL)
77
g_timer_destroy (myData.pTopClock);
78
g_free (myData.pTopList);
79
if (myData.pProcessTable != NULL)
80
g_hash_table_destroy (myData.pProcessTable);
81
cairo_surface_destroy (myData.pTopSurface);
82
CD_APPLET_RESET_DATA_END