~ubuntu-branches/ubuntu/oneiric/cairo-dock/oneiric-201110111206

« back to all changes in this revision

Viewing changes to src/cairo-dock-internal-dialogs.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lavergne, Matthieu Baerts (matttbe), Julien Lavergne
  • Date: 2009-10-04 16:33:52 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20091004163352-ttbbjfmpb8uzl8j4
Tags: 2.0.9-0ubuntu1
[ Matthieu Baerts (matttbe) ]
* New Upstream Version. (LP: #435587)
* Added apport hook in debian/apport
 - Add debian/apport
 - debian/cairo-dock-core.install: Added debian/apport/cairo-dock.py
* Use .desktop provided by upstream
 - Removed debian/*.desktop
 - debian/cairo-dock-core.install: install upstream desktop files. 

[ Julien Lavergne ]
* Adjust debian/changelog with Daniel Holbach suggestions.
* debian/patches/01_rename_cairo-dock-package-theme.patch: drop, 
  merged upstream.
* debian/patches/01-desktop-file-category.patch:
 - Remove Encoding field and set category to Utility.
* debian/patches/02-merge-changelog.patch:
 - Merge ChangeLog and ChangeLog-2.0.9.
* debian/apport: Remove commands with grep, python doesn't like it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
* Internal dialogs for Cairo-Dock
 
2
* This file is a part of the Cairo-Dock project
3
3
*
4
 
* Copyright : (C) 2009 by Fabrice Rey
5
 
* E-mail    : fabounet@users.berlios.de
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
6
6
*
7
7
* This program is free software; you can redistribute it and/or
8
8
* modify it under the terms of the GNU General Public License
13
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
15
* GNU General Public License for more details.
16
 
*   http://www.gnu.org/licenses/licenses.html#GPL
 
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/>.
17
18
*/
18
19
 
19
20
#include <string.h>
20
21
#include "cairo-dock-modules.h"
 
22
#include "cairo-dock-config.h"
21
23
#include "cairo-dock-dialogs.h"
22
24
#include "cairo-dock-internal-labels.h"
23
25
#include "cairo-dock-internal-background.h"
39
41
        double couleur_bulle[4] = {1.0, 1.0, 1.0, 0.7};
40
42
        cairo_dock_get_double_list_key_value (pKeyFile, "Dialogs", "background color", &bFlushConfFileNeeded, pDialogs->fDialogColor, 4, couleur_bulle, NULL, NULL);
41
43
 
42
 
        pDialogs->iDialogIconSize = cairo_dock_get_integer_key_value (pKeyFile, "Dialogs", "icon size", &bFlushConfFileNeeded, 48, NULL, NULL);
 
44
        pDialogs->iDialogIconSize = MAX (16, cairo_dock_get_integer_key_value (pKeyFile, "Dialogs", "icon size", &bFlushConfFileNeeded, 48, NULL, NULL));
43
45
 
44
46
        pDialogs->bHomogeneous = cairo_dock_get_boolean_key_value (pKeyFile, "Dialogs", "homogeneous text", &bFlushConfFileNeeded, TRUE, NULL, NULL);
45
47
        if (! pDialogs->bHomogeneous)
46
48
        {
47
 
                pDialogs->dialogTextDescription.cFont = cairo_dock_get_string_key_value (pKeyFile, "Dialogs", "message police", &bFlushConfFileNeeded, "sans", NULL, NULL);
 
49
                gchar *cFontDescription = cairo_dock_get_string_key_value (pKeyFile, "Dialogs", "message police", &bFlushConfFileNeeded, "sans 14", "Icons", NULL);
 
50
                
 
51
                PangoFontDescription *fd = pango_font_description_from_string (cFontDescription);
 
52
                pDialogs->dialogTextDescription.cFont = g_strdup (pango_font_description_get_family (fd));
 
53
                pDialogs->dialogTextDescription.iSize = pango_font_description_get_size (fd);
 
54
                if (!pango_font_description_get_size_is_absolute (fd))
 
55
                        pDialogs->dialogTextDescription.iSize /= PANGO_SCALE;
 
56
                if (pDialogs->dialogTextDescription.iSize == 0)
 
57
                        pDialogs->dialogTextDescription.iSize = 14;
 
58
                pDialogs->dialogTextDescription.iWeight = pango_font_description_get_weight (fd);
 
59
                pDialogs->dialogTextDescription.iStyle = pango_font_description_get_style (fd);
 
60
                
 
61
                if (g_key_file_has_key (pKeyFile, "Dialogs", "message size", NULL))
 
62
                {
 
63
                        pDialogs->dialogTextDescription.iSize = g_key_file_get_integer (pKeyFile, "Dialogs", "message size", NULL);
 
64
                        int iLabelWeight = g_key_file_get_integer (pKeyFile, "Dialogs", "message weight", NULL);
 
65
                        pDialogs->dialogTextDescription.iWeight = cairo_dock_get_pango_weight_from_1_9 (iLabelWeight);
 
66
                        gboolean bLabelStyleItalic = g_key_file_get_boolean (pKeyFile, "Dialogs", "message italic", NULL);
 
67
                        if (bLabelStyleItalic)
 
68
                                pDialogs->dialogTextDescription.iStyle = PANGO_STYLE_ITALIC;
 
69
                        else
 
70
                                pDialogs->dialogTextDescription.iStyle = PANGO_STYLE_NORMAL;
 
71
                        
 
72
                        pango_font_description_set_size (fd, pDialogs->dialogTextDescription.iSize * PANGO_SCALE);
 
73
                        pango_font_description_set_weight (fd, pDialogs->dialogTextDescription.iWeight);
 
74
                        pango_font_description_set_style (fd, pDialogs->dialogTextDescription.iStyle);
 
75
                        
 
76
                        g_free (cFontDescription);
 
77
                        cFontDescription = pango_font_description_to_string (fd);
 
78
                        g_key_file_set_string (pKeyFile, "Dialogs", "message police", cFontDescription);
 
79
                        bFlushConfFileNeeded = TRUE;
 
80
                }
 
81
                pango_font_description_free (fd);
 
82
                g_free (cFontDescription);
 
83
                /*pDialogs->dialogTextDescription.cFont = cairo_dock_get_string_key_value (pKeyFile, "Dialogs", "message police", &bFlushConfFileNeeded, "sans", NULL, NULL);
48
84
                pDialogs->dialogTextDescription.iSize = cairo_dock_get_integer_key_value (pKeyFile, "Dialogs", "message size", &bFlushConfFileNeeded, 14, NULL, NULL);
49
85
                int iLabelWeight = cairo_dock_get_integer_key_value (pKeyFile, "Dialogs", "message weight", &bFlushConfFileNeeded, 5, NULL, NULL);
50
 
                pDialogs->dialogTextDescription.iWeight = ((PANGO_WEIGHT_HEAVY - PANGO_WEIGHT_ULTRALIGHT) * iLabelWeight + 9 * PANGO_WEIGHT_ULTRALIGHT - PANGO_WEIGHT_HEAVY) / 8;  // on se ramene aux intervalles definit par Pango.
 
86
                pDialogs->dialogTextDescription.iWeight = cairo_dock_get_pango_weight_from_1_9 (iLabelWeight);  // on se ramene aux intervalles definit par Pango.
51
87
                if (cairo_dock_get_boolean_key_value (pKeyFile, "Dialogs", "message italic", &bFlushConfFileNeeded, FALSE, NULL, NULL))
52
88
                        pDialogs->dialogTextDescription.iStyle = PANGO_STYLE_ITALIC;
53
89
                else
54
 
                        pDialogs->dialogTextDescription.iStyle = PANGO_STYLE_NORMAL;
 
90
                        pDialogs->dialogTextDescription.iStyle = PANGO_STYLE_NORMAL;*/
55
91
                pDialogs->dialogTextDescription.bOutlined = cairo_dock_get_boolean_key_value (pKeyFile, "Dialogs", "outlined", &bFlushConfFileNeeded, FALSE, NULL, NULL);
 
92
                pDialogs->dialogTextDescription.iMargin = 0;
56
93
        }
57
94
        
58
95
        double couleur_dtext[3] = {0., 0., 0.};