gdm r6417 - in trunk: . gui/simple-greeter
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r6417 - in trunk: . gui/simple-greeter
- Date: Fri, 22 Aug 2008 20:02:31 +0000 (UTC)
Author: mccann
Date: Fri Aug 22 20:02:31 2008
New Revision: 6417
URL: http://svn.gnome.org/viewvc/gdm?rev=6417&view=rev
Log:
2008-08-22 William Jon McCann <jmccann redhat com>
* gui/simple-greeter/gdm-language-chooser-dialog.c
(gdm_language_chooser_dialog_init),
(gdm_language_chooser_dialog_new):
* gui/simple-greeter/gdm-language-chooser-widget.c
(language_has_font):
* gui/simple-greeter/gdm-layout-chooser-dialog.c
(gdm_layout_chooser_dialog_init), (gdm_layout_chooser_dialog_new):
Use updated icon names. Fix some code style.
Modified:
trunk/ChangeLog
trunk/gui/simple-greeter/gdm-language-chooser-dialog.c
trunk/gui/simple-greeter/gdm-language-chooser-widget.c
trunk/gui/simple-greeter/gdm-language-option-widget.c
trunk/gui/simple-greeter/gdm-layout-chooser-dialog.c
Modified: trunk/gui/simple-greeter/gdm-language-chooser-dialog.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-language-chooser-dialog.c (original)
+++ trunk/gui/simple-greeter/gdm-language-chooser-dialog.c Fri Aug 22 20:02:31 2008
@@ -189,7 +189,7 @@
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
- gtk_window_set_icon_name (GTK_WINDOW (dialog), "config-language");
+
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
gtk_container_set_border_width (GTK_CONTAINER (dialog->priv->chooser_widget), 5);
@@ -218,6 +218,7 @@
GObject *object;
object = g_object_new (GDM_TYPE_LANGUAGE_CHOOSER_DIALOG,
+ "icon-name", "preferences-desktop-locale",
"title", _("Languages"),
"border-width", 8,
"modal", TRUE,
Modified: trunk/gui/simple-greeter/gdm-language-chooser-widget.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-language-chooser-widget.c (original)
+++ trunk/gui/simple-greeter/gdm-language-chooser-widget.c Fri Aug 22 20:02:31 2008
@@ -104,87 +104,86 @@
char *normalized_name;
char *readable_language;
char *lang_tag;
- char *tagged;
+ char *tagged;
normalized_name = gdm_normalize_language_name (name);
- gdm_parse_language_name (name, &lang_tag, NULL, NULL, NULL);
+ gdm_parse_language_name (name, &lang_tag, NULL, NULL, NULL);
language = gdm_get_language_from_name (normalized_name, normalized_name);
readable_language = gdm_get_language_from_name (normalized_name, NULL);
- tagged = g_strdup_printf ("<span lang=\"%s\">%s</span>", lang_tag, language);
-
+ tagged = g_strdup_printf ("<span lang=\"%s\">%s</span>", lang_tag, language);
+
if (language != NULL) {
gdm_chooser_widget_add_item (GDM_CHOOSER_WIDGET (widget),
normalized_name,
NULL,
tagged,
- readable_language,
+ readable_language,
0,
FALSE,
FALSE);
g_free (language);
}
g_free (readable_language);
- g_free (tagged);
- g_free (lang_tag);
+ g_free (tagged);
+ g_free (lang_tag);
g_free (normalized_name);
}
static gboolean
language_has_font (const char *locale)
{
- const FcCharSet *charset;
- FcPattern *pattern;
- FcObjectSet *object_set;
- FcFontSet *font_set;
- char *language_code;
- gboolean is_displayable;
-
- is_displayable = FALSE;
- pattern = NULL;
- object_set = NULL;
- font_set = NULL;
-
- gdm_parse_language_name (locale, &language_code, NULL, NULL, NULL);
-
- charset = FcLangGetCharSet ((FcChar8 *) language_code);
- if (!charset)
- /* fontconfig does not know about this language */
- is_displayable = TRUE;
- else
- {
- /* see if any fonts support rendering it */
- pattern = FcPatternBuild (NULL, FC_LANG, FcTypeString, language_code, NULL);
+ const FcCharSet *charset;
+ FcPattern *pattern;
+ FcObjectSet *object_set;
+ FcFontSet *font_set;
+ char *language_code;
+ gboolean is_displayable;
+
+ is_displayable = FALSE;
+ pattern = NULL;
+ object_set = NULL;
+ font_set = NULL;
+
+ gdm_parse_language_name (locale, &language_code, NULL, NULL, NULL);
+
+ charset = FcLangGetCharSet ((FcChar8 *) language_code);
+ if (!charset) {
+ /* fontconfig does not know about this language */
+ is_displayable = TRUE;
+ } else {
+ /* see if any fonts support rendering it */
+ pattern = FcPatternBuild (NULL, FC_LANG, FcTypeString, language_code, NULL);
+
+ if (pattern == NULL)
+ goto done;
+
+ object_set = FcObjectSetCreate ();
+
+ if (object_set == NULL)
+ goto done;
- if (pattern == NULL)
- goto done;
+ font_set = FcFontList (NULL, pattern, object_set);
- object_set = FcObjectSetCreate ();
+ if (font_set == NULL)
+ goto done;
- if (object_set == NULL)
- goto done;
-
- font_set = FcFontList (NULL, pattern, object_set);
-
- if (font_set == NULL)
- goto done;
-
- is_displayable = (font_set->nfont > 0);
- }
+ is_displayable = (font_set->nfont > 0);
+ }
-done:
+ done:
- if (font_set != NULL)
- FcFontSetDestroy (font_set);
+ if (font_set != NULL)
+ FcFontSetDestroy (font_set);
- if (object_set != NULL)
- FcObjectSetDestroy (object_set);
+ if (object_set != NULL)
+ FcObjectSetDestroy (object_set);
- if (pattern != NULL)
- FcPatternDestroy (pattern);
+ if (pattern != NULL)
+ FcPatternDestroy (pattern);
- g_free (language_code);
- return is_displayable;
+ g_free (language_code);
+ return is_displayable;
}
static void
Modified: trunk/gui/simple-greeter/gdm-language-option-widget.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-language-option-widget.c (original)
+++ trunk/gui/simple-greeter/gdm-language-option-widget.c Fri Aug 22 20:02:31 2008
@@ -146,7 +146,7 @@
{
char *language;
char *readable_language;
- char *lang_tag;
+ char *lang_tag;
language = gdm_get_language_from_name (locale, locale);
@@ -155,12 +155,12 @@
}
readable_language = gdm_get_language_from_name (locale, NULL);
- gdm_parse_language_name (locale, &lang_tag, NULL, NULL, NULL);
+ gdm_parse_language_name (locale, &lang_tag, NULL, NULL, NULL);
*name = g_strdup_printf ("<span lang=\"%s\">%s</span>", lang_tag, language);
*comment = readable_language;
- g_free (language);
- g_free (lang_tag);
+ g_free (language);
+ g_free (lang_tag);
return TRUE;
}
Modified: trunk/gui/simple-greeter/gdm-layout-chooser-dialog.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-layout-chooser-dialog.c (original)
+++ trunk/gui/simple-greeter/gdm-layout-chooser-dialog.c Fri Aug 22 20:02:31 2008
@@ -98,7 +98,7 @@
static void
gdm_layout_chooser_dialog_response (GtkDialog *dialog,
- int response_id)
+ int response_id)
{
GdmLayoutChooserDialog *chooser_dialog;
@@ -178,7 +178,7 @@
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
- gtk_window_set_icon_name (GTK_WINDOW (dialog), "keyboard");
+
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
gtk_container_set_border_width (GTK_CONTAINER (dialog->priv->chooser_widget), 5);
@@ -207,6 +207,7 @@
GObject *object;
object = g_object_new (GDM_TYPE_LAYOUT_CHOOSER_DIALOG,
+ "icon-name", "preferences-desktop-keyboard",
"title", _("Keyboard layouts"),
"border-width", 8,
"modal", TRUE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]