Changeset 2857


Ignore:
Timestamp:
Nov 14, 2016, 6:27:38 PM (3 years ago)
Author:
mabarracus
Message:

Add default language option to use pam_environment sessions settings

Location:
lightdm-gtk-greeter/trunk/fuentes
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • lightdm-gtk-greeter/trunk/fuentes/debian/patches/series

    r2361 r2857  
    11clean-up-atspi.patch
    22valencian_labels
     3test_default
     4trad_cad_test_default
  • lightdm-gtk-greeter/trunk/fuentes/src/lightdm-gtk-greeter.c

    r2364 r2857  
    185185static void set_language (const gchar *language);
    186186void language_selected_cb (GtkMenuItem *menuitem, gpointer user_data);
    187 static const gchar* gchar_valencian = "Valencià";
    188187
    189188/* Screensaver values */
     
    10051004
    10061005        if (menu_iter)
    1007             gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_iter->data), TRUE);
     1006                gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_iter->data), TRUE);
    10081007    }
    10091008
     
    10291028
    10301029    /* if the user manually selected a language, use it */
    1031     if (current_language){
    1032         if(g_strcmp0(current_language,gchar_valencian)!=0)
    1033             return g_strdup (current_language);
    1034         else
    1035             return g_strdup_printf("%s","ca_ES@valencia");
    1036     }
     1030    if (current_language)
     1031        return g_strdup (current_language);
    10371032
    10381033    menu_items = gtk_container_get_children (GTK_CONTAINER (language_menu));
    10391034    for (menu_iter = menu_items; menu_iter != NULL; menu_iter = g_list_next (menu_iter))
    10401035    {
    1041         if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menu_iter->data))){
    1042             gchar *lang= g_object_get_data (G_OBJECT (menu_iter->data), LANGUAGE_DATA_CODE);
    1043             if (g_strcmp0(lang,gchar_valencian)!=0)
    1044                 return g_strdup (lang);
    1045             else
    1046                 return g_strdup_printf("%s","ca_ES@valencia");
    1047         }
     1036        if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menu_iter->data)))
     1037            return g_strdup (g_object_get_data (G_OBJECT (menu_iter->data), LANGUAGE_DATA_CODE));
    10481038    }
    10491039
     
    10561046    const gchar *default_language = NULL;
    10571047    GList *menu_items, *menu_iter;
    1058 
    1059     if ( g_strcmp0(language,gchar_valencian)==0)
    1060         language = g_strdup_printf("%s","ca_ES@valencia");
    10611048
    10621049    if (!gtk_widget_get_visible (language_menuitem))
     
    10761063            gboolean matched;
    10771064            s = g_strdup (g_object_get_data (G_OBJECT (menu_iter->data), LANGUAGE_DATA_CODE));
    1078             if ( g_strcmp0(s,gchar_valencian)==0)
    1079                 s = g_strdup_printf("%s","ca_ES@valencia");
    10801065            matched = g_strcmp0 (s, language) == 0;
    10811066            g_free (s);
     
    10851070                g_free (current_language);
    10861071                current_language = g_strdup (language);
    1087 
    1088                 if ( g_strcmp0(current_language,"ca_ES@valencia")==0)
    1089                     gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),g_strdup_printf("%s",gchar_valencian));
    1090                 else
    1091                     gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),current_language);
     1072                gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem),language);
    10921073                return;
    10931074            }
     
    10991080    {
    11001081        default_language = lightdm_language_get_code (lightdm_get_language ());
    1101         if ( g_strcmp0(default_language,"ca_ES@valencia")==0)
    1102             gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem), g_strdup_printf("%s",gchar_valencian));
    1103         else
    1104             gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem), default_language);
     1082        gtk_menu_item_set_label (GTK_MENU_ITEM (language_menuitem), default_language);
    11051083    }
    11061084    if (default_language && g_strcmp0 (default_language, language) != 0)
     
    11261104    {
    11271105       gchar *language = g_object_get_data (G_OBJECT (menuitem), LANGUAGE_DATA_CODE);
    1128        if (g_strcmp0(language,gchar_valencian) == 0){
    1129             language = g_strdup_printf("%s","ca_ES@valencia");
    1130        }
    11311106       set_language (language);
    11321107    }
     
    26402615
    26412616    /* LP: #1366534 */
    2642     #ifdef AT_SPI_COMMAND
    2643     spawn_line_pid (AT_SPI_COMMAND, G_SPAWN_SEARCH_PATH, NULL);
    2644     #else
    26452617    g_setenv ("NO_AT_BRIDGE", "1", TRUE);
    2646     #endif
    26472618
    26482619    /* Initialize i18n */
     
    27722743        g_free (value);
    27732744    }
     2745
     2746    #ifdef AT_SPI_COMMAND
     2747    spawn_line_pid (AT_SPI_COMMAND, G_SPAWN_SEARCH_PATH, NULL);
     2748    #endif
    27742749
    27752750    #ifdef INDICATOR_SERVICES_COMMAND
     
    29342909            if (modifier != NULL)
    29352910            {
    2936                 gchar *label_new;
    2937                 if (g_strcmp0(modifier+1,"valencia")!=0){
    2938                     label_new = g_strdup_printf ("%s [%s]", label, modifier+1);
    2939                 }else{
    2940                     label_new = g_strdup_printf ("%s", gchar_valencian);
    2941                 }
     2911                gchar *label_new = g_strdup_printf ("%s [%s]", label, modifier+1);
    29422912                g_free (label);
    29432913                label = label_new;
     
    29452915
    29462916            radiomenuitem = gtk_radio_menu_item_new_with_label (languages, label);
    2947             if (g_strcmp0(code,"ca_ES@valencia")==0)
    2948                 code = g_strdup_printf ("%s", gchar_valencian);
    29492917            g_object_set_data (G_OBJECT (radiomenuitem), LANGUAGE_DATA_CODE, (gpointer) code);
    29502918            languages = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (radiomenuitem));
Note: See TracChangeset for help on using the changeset viewer.