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/>.
21
** Login : <ctaf42@gmail.com>
22
** Started on Fri Nov 30 05:31:31 2007 GESTES Cedric
25
** Copyright (C) 2007 GESTES Cedric
26
** This program is free software; you can redistribute it and/or modify
27
** it under the terms of the GNU General Public License as published by
28
** the Free Software Foundation; either version 3 of the License, or
29
** (at your option) any later version.
31
** This program is distributed in the hope that it will be useful,
32
** but WITHOUT ANY WARRANTY; without even the implied warranty of
33
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
** GNU General Public License for more details.
36
** You should have received a copy of the GNU General Public License
37
** along with this program; if not, write to the Free Software
38
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
42
#include <cairo-dock.h>
44
#include "terminal-struct.h"
45
#include "terminal-init.h"
46
#include "terminal-widget.h"
47
#include "terminal-config.h"
51
static void set_color(GdkColor *color, double src[3]) {
52
color->red = (guint16)(src[0] * 65535.);
53
color->green = (guint16)(src[1] * 65535.);
54
color->blue = (guint16)(src[2]* 65535.);
57
CD_APPLET_GET_CONFIG_BEGIN
58
//0 means completely transparent and 65535 opaque
59
myConfig.transparency = (guint16) (CD_CONFIG_GET_DOUBLE_WITH_DEFAULT ("GUI", "terminal transparency", .84) * 65535); // 55000
61
double color_back[3] = {1., 1., 1.};
62
CD_CONFIG_GET_COLOR_RVB_WITH_DEFAULT ("GUI", "background color", color_back, color_back);
63
set_color(&myConfig.backcolor, color_back);
65
double color_fore[3] = {0., 0., 0.};
66
CD_CONFIG_GET_COLOR_RVB_WITH_DEFAULT ("GUI", "foreground color", color_fore, color_fore);
67
set_color(&myConfig.forecolor, color_fore);
69
myConfig.shortcut = CD_CONFIG_GET_STRING_WITH_DEFAULT ("GUI", "shortkey", "<Ctrl>F1");
70
myConfig.iNbRows = CD_CONFIG_GET_INTEGER_WITH_DEFAULT ("GUI", "nb lines", 25);
71
myConfig.iNbColumns = CD_CONFIG_GET_INTEGER_WITH_DEFAULT ("GUI", "nb columns", 70);
72
CD_APPLET_GET_CONFIG_END
75
CD_APPLET_RESET_CONFIG_BEGIN
76
if (myConfig.shortcut)
77
cd_keybinder_unbind(myConfig.shortcut, (CDBindkeyHandler)term_on_keybinding_pull);
78
g_free (myConfig.shortcut);
79
myConfig.shortcut = NULL;
80
CD_APPLET_RESET_CONFIG_END
83
CD_APPLET_RESET_DATA_BEGIN
86
cairo_dock_dialog_unreference (myData.dialog); // detruit aussi le widget interactif.
91
gtk_widget_destroy (myData.tab);
94
CD_APPLET_RESET_DATA_END