Description: TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. . lightdm-gtk-greeter (2.0.1-2+lliurex2) xenial; urgency=medium . * Change language labels (fixed patch) Author: M.Angel Juan --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: https://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: Index: fuentes/src/lightdm-gtk-greeter.c =================================================================== --- fuentes.orig/src/lightdm-gtk-greeter.c +++ fuentes/src/lightdm-gtk-greeter.c @@ -300,7 +300,6 @@ struct SavedFocusData gpointer greeter_save_focus(GtkWidget* widget); void greeter_restore_focus(const gpointer saved_data); - static void read_monitor_configuration (const gchar *group, const gchar *name) { @@ -1026,7 +1025,6 @@ static gchar* get_language (void) { GList *menu_items, *menu_iter; - /* if the user manually selected a language, use it */ if (current_language){ if(g_strcmp0(current_language,gchar_valencian)!=0) @@ -1050,6 +1048,7 @@ get_language (void) return NULL; } + static void set_language (const gchar *language) { @@ -1065,7 +1064,7 @@ set_language (const gchar *language) current_language = g_strdup (language); return; } - + menu_items = gtk_container_get_children (GTK_CONTAINER (language_menu)); if (language) @@ -1084,11 +1083,14 @@ set_language (const gchar *language) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_iter->data), TRUE); g_free (current_language); current_language = g_strdup (language); - - if ( g_strcmp0(current_language,"ca_ES@valencia")==0) + if ( g_strcmp0(current_language,"ca_ES@valencia")==0){ gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),g_strdup_printf("%s",gchar_valencian)); - else - gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),current_language); + }else{ + if ( g_strcmp0(current_language,"default")==0) + gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),g_strdup_printf("%s","Default Language")); + else + gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),current_language); + } return; } } @@ -1105,6 +1107,12 @@ set_language (const gchar *language) } if (default_language && g_strcmp0 (default_language, language) != 0) set_language (default_language); + + if (language == NULL ){ + gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem), "Default Language"); + default_language=g_strdup_printf("%s","default"); + set_language("default"); + } /* If all else fails, just use the first language from the menu */ else { @@ -1128,6 +1136,9 @@ language_selected_cb (GtkMenuItem *menui if (g_strcmp0(language,gchar_valencian) == 0){ language = g_strdup_printf("%s","ca_ES@valencia"); } + if (g_strcmp0(language,"Default Language") == 0){ + language = g_strdup_printf("%s","default"); + } set_language (language); } } @@ -2037,7 +2048,8 @@ start_session (void) language = get_language (); if (language) - lightdm_greeter_set_language (greeter, language); + if (g_strcmp0(language,"default") != 0) + lightdm_greeter_set_language (greeter, language); g_free (language); session = get_session (); @@ -2206,12 +2218,7 @@ set_displayed_user (LightDMGreeter *gree set_user_image (username); user = lightdm_user_list_get_user_by_name (lightdm_user_list_get_instance (), username); if (user) - { - set_language (lightdm_user_get_language (user)); set_session (lightdm_user_get_session (user)); - } - else - set_language (lightdm_language_get_code (lightdm_get_language ())); gtk_widget_set_tooltip_text (GTK_WIDGET (user_combo), user_tooltip); start_authentication (username); g_free (user_tooltip); @@ -2916,7 +2923,17 @@ main (int argc, char **argv) { items = lightdm_get_languages (); GSList *languages = NULL; - for (item = items; item; item = item->next) + + gchar *dummy_label = g_strdup_printf ("%s", "Default Language"); + gchar *dummy_code = g_strdup_printf ("%s", "default"); + GtkWidget *radiomenuitem_dummy = gtk_radio_menu_item_new_with_label(languages,dummy_label); + g_object_set_data(G_OBJECT (radiomenuitem_dummy), LANGUAGE_DATA_CODE, (gpointer) dummy_code); + languages = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (radiomenuitem_dummy)); + g_signal_connect (G_OBJECT (radiomenuitem_dummy), "activate", G_CALLBACK (language_selected_cb), NULL); + gtk_menu_shell_append (GTK_MENU_SHELL (language_menu), radiomenuitem_dummy); + gtk_widget_show (GTK_WIDGET (radiomenuitem_dummy)); + + for (item = items; item; item = item->next) { LightDMLanguage *language = item->data; const gchar *country, *code;