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-rame.h"
26
#include "applet-config.h"
29
CD_APPLET_GET_CONFIG_BEGIN
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)
40
myConfig.cWatermarkImagePath = CD_CONFIG_GET_FILE_PATH ("Configuration", "watermark image", MY_APPLET_ICON_FILE);
42
myConfig.bShowFreeMemory = CD_CONFIG_GET_BOOLEAN ("Configuration", "show free");
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");
54
myConfig.iNbDisplayedProcesses = CD_CONFIG_GET_INTEGER ("Configuration", "top");
55
myConfig.bTopInPercent = CD_CONFIG_GET_BOOLEAN ("Configuration", "top in percent");
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;
62
myConfig.cSystemMonitorCommand = CD_CONFIG_GET_STRING ("Configuration", "sys monitor");
63
CD_APPLET_GET_CONFIG_END
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
74
CD_APPLET_RESET_DATA_BEGIN
75
cairo_dock_free_task (myData.pTask);
78
cairo_dock_free_gauge(myData.pGauge);
79
cairo_dock_free_graph (myData.pGraph);
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