diff options
author | George Lebl <jirka@5z.com> | 2003-06-05 20:29:49 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2003-06-05 20:29:49 +0000 |
commit | 5c03cb271dbcaae689436170d4423828d5ad074e (patch) | |
tree | 2ebdfa6795d73decbc7b426c9c7af944cfab1c72 | |
parent | c7d46c7a95851a5cb4b0b31828ae100b4166f1ee (diff) | |
download | gdm-5c03cb271dbcaae689436170d4423828d5ad074e.tar.gz |
Use the Welcome label in the greeter (as long as the stock welcome string
Thu Jun 05 13:26:09 2003 George Lebl <jirka@5z.com>
* config/gdm.conf.in, daemon/gdm.h, gui/gdmlogin.c,
gui/gdmsetup.(c|glade), gui/greeter/greeter_item.c,
gui/greeter/greeter_pareser.c, gui/greeter/greeter.c
gui/greeter/greeter_configuration.h: Use the Welcome label in
the greeter (as long as the stock welcome string was used),
Add RemoteWelcome for XDMCP sessions. Change default of Welcome
to just plain "Welcome". Move the welcome string setup to the
main property page in the setup since it now affects both greeters.
* gui/gdmsetup.(c|glade): the first page of the properties needed
some size group love
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | config/gdm.conf.in | 7 | ||||
-rw-r--r-- | daemon/gdm.h | 3 | ||||
-rw-r--r-- | gui/gdmlogin.c | 36 | ||||
-rw-r--r-- | gui/gdmsetup-strings.c | 14 | ||||
-rw-r--r-- | gui/gdmsetup.c | 40 | ||||
-rw-r--r-- | gui/gdmsetup.glade | 332 | ||||
-rw-r--r-- | gui/greeter/greeter.c | 46 | ||||
-rw-r--r-- | gui/greeter/greeter_configuration.h | 1 | ||||
-rw-r--r-- | gui/greeter/greeter_item.c | 6 | ||||
-rw-r--r-- | gui/greeter/greeter_parser.c | 14 |
11 files changed, 373 insertions, 140 deletions
@@ -1,3 +1,17 @@ +Thu Jun 05 13:26:09 2003 George Lebl <jirka@5z.com> + + * config/gdm.conf.in, daemon/gdm.h, gui/gdmlogin.c, + gui/gdmsetup.(c|glade), gui/greeter/greeter_item.c, + gui/greeter/greeter_pareser.c, gui/greeter/greeter.c + gui/greeter/greeter_configuration.h: Use the Welcome label in + the greeter (as long as the stock welcome string was used), + Add RemoteWelcome for XDMCP sessions. Change default of Welcome + to just plain "Welcome". Move the welcome string setup to the + main property page in the setup since it now affects both greeters. + + * gui/gdmsetup.(c|glade): the first page of the properties needed + some size group love + Thu Jun 05 11:37:19 2003 George Lebl <jirka@5z.com> * daemon/xdmcp.c, daemon/auth.c, daemon/display.c, daemon/errorgui.c, diff --git a/config/gdm.conf.in b/config/gdm.conf.in index 325ac1a8..c11bab5b 100644 --- a/config/gdm.conf.in +++ b/config/gdm.conf.in @@ -224,7 +224,12 @@ ChooserButton=true # and wish to have this translated you can have entries such as # Welcome[cs]=Vitejte na %n # Just make sure the string is in utf-8 -Welcome=Welcome to %n +# Welcome is for all console logins and RemoteWelcome is for remote logins +# (through XDMCP). +# The default entries that are shipped are translated inside genius and +# are as follows: +Welcome=Welcome +RemoteWelcome=Welcome to %n # Don't allow user to move the standard greeter window. Only makes sense # if TitleBar is on LockPosition=false diff --git a/daemon/gdm.h b/daemon/gdm.h index e3d35888..8e5fbf54 100644 --- a/daemon/gdm.h +++ b/daemon/gdm.h @@ -220,7 +220,8 @@ enum { #define GDM_KEY_CONFIG_AVAILABLE "greeter/ConfigAvailable=true" #define GDM_KEY_CHOOSER_BUTTON "greeter/ChooserButton=true" #define GDM_KEY_TITLE_BAR "greeter/TitleBar=true" -#define GDM_KEY_WELCOME "greeter/Welcome=Welcome to %n" +#define GDM_KEY_WELCOME "greeter/Welcome=Welcome" +#define GDM_KEY_REMOTEWELCOME "greeter/RemoteWelcome=Welcome to %n" #define GDM_KEY_XINERAMASCREEN "greeter/XineramaScreen=0" #define GDM_KEY_BACKGROUNDPROG "greeter/BackgroundProgram=" #define GDM_KEY_RUNBACKGROUNDPROGALWAYS "greeter/RunBackgroundProgramAlways=false" diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c index 3a16125e..829a0ab5 100644 --- a/gui/gdmlogin.c +++ b/gui/gdmlogin.c @@ -53,6 +53,7 @@ /* set the DOING_GDM_DEVELOPMENT env variable if you aren't running * within the protocol */ static gboolean DOING_GDM_DEVELOPMENT = FALSE; +static char *greeter_Welcome_key = GDM_KEY_WELCOME; typedef struct _GdmLoginUser GdmLoginUser; struct _GdmLoginUser { @@ -590,14 +591,6 @@ gdm_parse_enriched_string (const char *pre, const gchar *s, const char *post) display = g_strdup (g_getenv ("DISPLAY")); - if (display == NULL) { - char *buffer; - buffer = g_strdup_printf (_("%sWelcome to %s%s"), - pre, hostname, post); - g_free (hostname); - return buffer; - } - uname (&name); if (strlen (s) > 2048) { @@ -605,7 +598,7 @@ gdm_parse_enriched_string (const char *pre, const gchar *s, const char *post) syslog (LOG_ERR, _("gdm_parse_enriched_string: String too long!")); g_free (display); buffer = g_strdup_printf (_("%sWelcome to %s%s"), - pre, hostname, post); + pre, name.nodename, post); g_free (hostname); return buffer; } @@ -639,7 +632,7 @@ gdm_parse_enriched_string (const char *pre, const gchar *s, const char *post) break; case 'd': - g_string_append (str, display); + g_string_append (str, ve_sure_string (display)); break; case 's': @@ -850,10 +843,17 @@ gdm_login_parse_config (void) VeConfig *config; if (stat (GDM_CONFIG_FILE, &unused) == -1) { - syslog (LOG_ERR, _("gdm_login_parse_config: No configuration file: %s. Using defaults."), GDM_CONFIG_FILE); + syslog (LOG_ERR, _("%s: No configuration file: %s. Using defaults."), + "gdm_login_parse_config", GDM_CONFIG_FILE); used_defaults = TRUE; } + if (ve_string_empty (g_getenv ("GDM_IS_LOCAL"))) { + greeter_Welcome_key = GDM_KEY_REMOTEWELCOME; + } else { + greeter_Welcome_key = GDM_KEY_WELCOME; + } + config = ve_config_get (GDM_CONFIG_FILE); GdmAllowRoot = ve_config_get_bool (config, GDM_KEY_ALLOWROOT); @@ -879,9 +879,12 @@ gdm_login_parse_config (void) GdmTitleBar = ve_config_get_bool (config, GDM_KEY_TITLE_BAR); GdmLocaleFile = ve_config_get_string (config, GDM_KEY_LOCFILE); GdmSessionDir = ve_config_get_string (config, GDM_KEY_SESSDIR); - GdmWelcome = ve_config_get_translated_string (config, GDM_KEY_WELCOME); + GdmWelcome = ve_config_get_translated_string (config, greeter_Welcome_key); /* A hack! */ - if (strcmp (ve_sure_string (GdmWelcome), "Welcome to %n") == 0) { + if (strcmp (ve_sure_string (GdmWelcome), "Welcome") == 0) { + g_free (GdmWelcome); + GdmWelcome = g_strdup (_("Welcome")); + } else if (strcmp (ve_sure_string (GdmWelcome), "Welcome to %n") == 0) { g_free (GdmWelcome); GdmWelcome = g_strdup (_("Welcome to %n")); } @@ -3986,9 +3989,12 @@ gdm_reread_config (int sig, gpointer data) g_free (str); } - str = ve_config_get_translated_string (config, GDM_KEY_WELCOME); + str = ve_config_get_translated_string (config, greeter_Welcome_key); /* A hack */ - if (strcmp (ve_sure_string (str), "Welcome to %n") == 0) { + if (strcmp (ve_sure_string (str), "Welcome") == 0) { + g_free (str); + str = g_strdup (_("Welcome")); + } else if (strcmp (ve_sure_string (str), "Welcome to %n") == 0) { g_free (str); str = g_strdup (_("Welcome to %n")); } diff --git a/gui/gdmsetup-strings.c b/gui/gdmsetup-strings.c index be2ed9ed..c8c32b84 100644 --- a/gui/gdmsetup-strings.c +++ b/gui/gdmsetup-strings.c @@ -9,28 +9,32 @@ gchar *s = N_("<b>Greeter</b>"); gchar *s = N_(" "); gchar *s = N_("L_ocal: "); gchar *s = N_("_Remote: "); -gchar *s = N_("Always use 24 hour cloc_k format"); +gchar *s = N_("_Welcome string: "); +gchar *s = N_("Re_mote welcome string: "); gchar *s = N_("Standard greeter"); gchar *s = N_("Graphical greeter"); gchar *s = N_("Standard greeter"); gchar *s = N_("Graphical greeter"); +gchar *s = N_("String to be shown in the greeter as welcome. You can insert %n in here and it will be replaced by the name of your computer."); +gchar *s = N_("*"); +gchar *s = N_("String to be shown in the greeter for people logging in remotely with XDMCP. You can insert %n in here and it will be replaced by the name of your computer."); +gchar *s = N_("*"); +gchar *s = N_("Always use 24 hour cloc_k format"); gchar *s = N_("<b>Automatic Login</b>"); gchar *s = N_(" "); -gchar *s = N_("_Login a user automatically on first bootup"); gchar *s = N_("_Automatic login username:"); gchar *s = N_("*"); +gchar *s = N_("_Login a user automatically on first bootup"); gchar *s = N_("<b>Timed Login</b>"); gchar *s = N_(" "); -gchar *s = N_("Login a user automa_tically after a specified number of seconds"); gchar *s = N_("Timed login us_ername:"); gchar *s = N_("_Seconds before login:"); gchar *s = N_("*"); +gchar *s = N_("Login a user automa_tically after a specified number of seconds"); gchar *s = N_("General"); gchar *s = N_("<b>Logo</b>"); gchar *s = N_(" "); gchar *s = N_("*"); -gchar *s = N_("_Welcome string: "); -gchar *s = N_("*"); gchar *s = N_("<b>Miscellaneous</b>"); gchar *s = N_(" "); gchar *s = N_("Show choosable user images (_face browser)"); diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c index 34371d71..738696b6 100644 --- a/gui/gdmsetup.c +++ b/gui/gdmsetup.c @@ -1912,9 +1912,17 @@ dialog_response (GtkWidget *dlg, int response, gpointer data) } static void +add_to_size_group (GtkSizeGroup *sg, const char *wid) +{ + GtkWidget *w = glade_helper_get (xml, wid, GTK_TYPE_WIDGET); + gtk_size_group_add_widget (sg, w); +} + +static void setup_gui (void) { GtkWidget *dialog; + GtkSizeGroup *sg; xml = glade_helper_load ("gdmsetup.glade", "setup_dialog", @@ -1931,6 +1939,34 @@ setup_gui (void) setup_greeter_backselect (); setup_graphical_themes (); + sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + add_to_size_group (sg, "local_greeter"); + add_to_size_group (sg, "remote_greeter"); + add_to_size_group (sg, "welcome"); + add_to_size_group (sg, "remote_welcome"); + add_to_size_group (sg, "autologin_combo"); + add_to_size_group (sg, "timedlogin_combo"); + add_to_size_group (sg, "timedlogin_seconds"); + + sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + add_to_size_group (sg, "local_greeter_label"); + add_to_size_group (sg, "remote_greeter_label"); + add_to_size_group (sg, "welcome_label"); + add_to_size_group (sg, "remote_welcome_label"); + add_to_size_group (sg, "autologin_label"); + add_to_size_group (sg, "timed_login_label"); + add_to_size_group (sg, "timedlogin_seconds_label"); + + sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + add_to_size_group (sg, "greeter_table"); + add_to_size_group (sg, "autologin_table"); + add_to_size_group (sg, "timed_login_table"); + + sg = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); + add_to_size_group (sg, "sg_use_24_clock"); + add_to_size_group (sg, "autologin"); + add_to_size_group (sg, "timedlogin"); + setup_user_combo ("autologin_combo", GDM_KEY_AUTOMATICLOGIN); setup_user_combo ("timedlogin_combo", @@ -2026,8 +2062,10 @@ setup_gui (void) setup_greeter_color ("sg_backcolor", GDM_KEY_BACKGROUNDCOLOR); - setup_greeter_untranslate_entry ("sg_welcome", + setup_greeter_untranslate_entry ("welcome", GDM_KEY_WELCOME); + setup_greeter_untranslate_entry ("remote_welcome", + GDM_KEY_REMOTEWELCOME); } static gboolean diff --git a/gui/gdmsetup.glade b/gui/gdmsetup.glade index 48744359..d6f940c6 100644 --- a/gui/gdmsetup.glade +++ b/gui/gdmsetup.glade @@ -129,9 +129,9 @@ </child> <child> - <widget class="GtkTable" id="table2"> + <widget class="GtkTable" id="greeter_table"> <property name="visible">True</property> - <property name="n_rows">3</property> + <property name="n_rows">5</property> <property name="n_columns">2</property> <property name="homogeneous">False</property> <property name="row_spacing">6</property> @@ -151,6 +151,9 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">local_greeter</property> + <accessibility> + <atkrelation target="local_greeter" type="label-for"/> + </accessibility> </widget> <packing> <property name="left_attach">0</property> @@ -176,6 +179,9 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">remote_greeter</property> + <accessibility> + <atkrelation target="remote_greeter" type="label-for"/> + </accessibility> </widget> <packing> <property name="left_attach">0</property> @@ -188,21 +194,56 @@ </child> <child> - <widget class="GtkCheckButton" id="sg_use_24_clock"> + <widget class="GtkLabel" id="welcome_label"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Always use 24 hour cloc_k format</property> + <property name="label" translatable="yes">_Welcome string: </property> <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">welcome</property> + <accessibility> + <atkrelation target="welcome" type="label-for"/> + </accessibility> </widget> <packing> <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="remote_welcome_label"> + <property name="visible">True</property> + <property name="label" translatable="yes">Re_mote welcome string: </property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="mnemonic_widget">remote_welcome</property> + <accessibility> + <atkrelation target="remote_welcome" type="label-for"/> + </accessibility> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> <property name="x_options">fill</property> <property name="y_options"></property> </packing> @@ -213,6 +254,9 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="history">0</property> + <accessibility> + <atkrelation target="local_greeter_label" type="labelled-by"/> + </accessibility> <child> <widget class="GtkMenu" id="menu1"> @@ -240,6 +284,7 @@ <property name="right_attach">2</property> <property name="top_attach">0</property> <property name="bottom_attach">1</property> + <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> @@ -249,6 +294,9 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="history">0</property> + <accessibility> + <atkrelation target="remote_greeter_label" type="labelled-by"/> + </accessibility> <child> <widget class="GtkMenu" id="menu2"> @@ -276,6 +324,80 @@ <property name="right_attach">2</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="welcome"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">String to be shown in the greeter as welcome. You can insert %n in here and it will be replaced by the name of your computer.</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + <accessibility> + <atkrelation target="welcome_label" type="labelled-by"/> + </accessibility> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="remote_welcome"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">String to be shown in the greeter for people logging in remotely with XDMCP. You can insert %n in here and it will be replaced by the name of your computer.</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char" translatable="yes">*</property> + <property name="activates_default">False</property> + <accessibility> + <atkrelation target="remote_welcome_label" type="labelled-by"/> + </accessibility> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="sg_use_24_clock"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Always use 24 hour cloc_k format</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> @@ -356,7 +478,7 @@ </child> <child> - <widget class="GtkTable" id="table4"> + <widget class="GtkTable" id="autologin_table"> <property name="visible">True</property> <property name="n_rows">2</property> <property name="n_columns">2</property> @@ -365,28 +487,7 @@ <property name="column_spacing">12</property> <child> - <widget class="GtkCheckButton" id="autologin"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Login a user automatically on first bootup</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label19"> + <widget class="GtkLabel" id="autologin_label"> <property name="visible">True</property> <property name="label" translatable="yes">_Automatic login username:</property> <property name="use_underline">True</property> @@ -399,6 +500,10 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">autologin_entry</property> + <accessibility> + <atkrelation target="autologin_entry" type="label-for"/> + <atkrelation target="autologin_combo" type="label-for"/> + </accessibility> </widget> <packing> <property name="left_attach">0</property> @@ -418,6 +523,9 @@ <property name="case_sensitive">False</property> <property name="enable_arrow_keys">True</property> <property name="enable_arrows_always">False</property> + <accessibility> + <atkrelation target="autologin_label" type="labelled-by"/> + </accessibility> <child internal-child="entry"> <widget class="GtkEntry" id="autologin_entry"> @@ -430,6 +538,9 @@ <property name="has_frame">True</property> <property name="invisible_char" translatable="yes">*</property> <property name="activates_default">False</property> + <accessibility> + <atkrelation target="autologin_label" type="labelled-by"/> + </accessibility> </widget> </child> @@ -445,6 +556,28 @@ <property name="right_attach">2</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="autologin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">_Login a user automatically on first bootup</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> @@ -525,7 +658,7 @@ </child> <child> - <widget class="GtkTable" id="table5"> + <widget class="GtkTable" id="timed_login_table"> <property name="visible">True</property> <property name="n_rows">3</property> <property name="n_columns">2</property> @@ -534,27 +667,6 @@ <property name="column_spacing">12</property> <child> - <widget class="GtkCheckButton" id="timedlogin"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Login a user automa_tically after a specified number of seconds</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> <widget class="GtkLabel" id="timed_login_label"> <property name="visible">True</property> <property name="label" translatable="yes">Timed login us_ername:</property> @@ -568,6 +680,10 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">timedlogin_entry</property> + <accessibility> + <atkrelation target="timedlogin_entry" type="label-for"/> + <atkrelation target="timedlogin_combo" type="label-for"/> + </accessibility> </widget> <packing> <property name="left_attach">0</property> @@ -593,6 +709,9 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">timedlogin_seconds</property> + <accessibility> + <atkrelation target="timedlogin_seconds" type="label-for"/> + </accessibility> </widget> <packing> <property name="left_attach">0</property> @@ -615,6 +734,9 @@ <property name="snap_to_ticks">False</property> <property name="wrap">False</property> <property name="adjustment">1 0 100 1 10 10</property> + <accessibility> + <atkrelation target="timedlogin_seconds_label" type="labelled-by"/> + </accessibility> </widget> <packing> <property name="left_attach">1</property> @@ -634,6 +756,9 @@ <property name="case_sensitive">False</property> <property name="enable_arrow_keys">True</property> <property name="enable_arrows_always">False</property> + <accessibility> + <atkrelation target="timed_login_label" type="labelled-by"/> + </accessibility> <child internal-child="entry"> <widget class="GtkEntry" id="timedlogin_entry"> @@ -646,6 +771,9 @@ <property name="has_frame">True</property> <property name="invisible_char" translatable="yes">*</property> <property name="activates_default">False</property> + <accessibility> + <atkrelation target="timed_login_label" type="labelled-by"/> + </accessibility> </widget> </child> @@ -661,6 +789,28 @@ <property name="right_attach">2</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="timedlogin"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Login a user automa_tically after a specified number of seconds</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> @@ -812,60 +962,6 @@ <property name="fill">True</property> </packing> </child> - - <child> - <widget class="GtkHBox" id="hbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkLabel" id="sg_welcome_label"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Welcome string: </property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">sg_welcome</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="sg_welcome"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> </widget> <packing> <property name="padding">0</property> @@ -1215,6 +1311,9 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">sg_backcolor</property> + <accessibility> + <atkrelation target="sg_backcolor" type="label-for"/> + </accessibility> </widget> <packing> <property name="padding">0</property> @@ -1230,6 +1329,9 @@ <property name="dither">True</property> <property name="use_alpha">False</property> <property name="title" translatable="yes">Pick a color</property> + <accessibility> + <atkrelation target="sg_backcolor_label" type="labelled-by"/> + </accessibility> </widget> <packing> <property name="padding">0</property> @@ -1889,6 +1991,9 @@ widget</property> <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">retry_delay</property> + <accessibility> + <atkrelation target="retry_delay" type="label-for"/> + </accessibility> </widget> <packing> <property name="padding">0</property> @@ -1908,6 +2013,9 @@ widget</property> <property name="snap_to_ticks">False</property> <property name="wrap">False</property> <property name="adjustment">1 0 100 1 10 10</property> + <accessibility> + <atkrelation target="retry_delay_label" type="labelled-by"/> + </accessibility> </widget> <packing> <property name="padding">0</property> @@ -1925,7 +2033,7 @@ widget</property> </widget> <packing> <property name="padding">0</property> - <property name="expand">True</property> + <property name="expand">False</property> <property name="fill">True</property> </packing> </child> diff --git a/gui/greeter/greeter.c b/gui/greeter/greeter.c index acc2f5b9..94390dbc 100644 --- a/gui/greeter/greeter.c +++ b/gui/greeter/greeter.c @@ -30,6 +30,7 @@ #include "greeter_system.h" gboolean DOING_GDM_DEVELOPMENT = FALSE; +static char *greeter_Welcome_key = GDM_KEY_WELCOME; GtkWidget *window; GtkWidget *canvas; @@ -64,12 +65,16 @@ gchar *GdmExclude; int GdmMinimalUID; gboolean GdmAllowRoot; gboolean GdmAllowRemoteRoot; +gchar *GdmWelcome; gboolean GdmUseCirclesInEntry = FALSE; static gboolean used_defaults = FALSE; gint greeter_current_delay = 0; +/* FIXME: hack */ +GreeterItemInfo *welcome_string_info = NULL; + extern gboolean session_dir_whacked_out; gboolean greeter_probably_login_prompt = FALSE; @@ -81,10 +86,17 @@ greeter_parse_config (void) if (!g_file_test (GDM_CONFIG_FILE, G_FILE_TEST_EXISTS)) { - syslog (LOG_ERR, _("greeter_parse_config: No configuration file: %s. Using defaults."), GDM_CONFIG_FILE); + syslog (LOG_ERR, _("%s: No configuration file: %s. Using defaults."), + "greeter_parse_config", GDM_CONFIG_FILE); used_defaults = TRUE; } + if (ve_string_empty (g_getenv ("GDM_IS_LOCAL"))) { + greeter_Welcome_key = GDM_KEY_REMOTEWELCOME; + } else { + greeter_Welcome_key = GDM_KEY_WELCOME; + } + config = ve_config_get (GDM_CONFIG_FILE); GdmGraphicalTheme = ve_config_get_string (config, GDM_KEY_GRAPHICAL_THEME); @@ -120,6 +132,16 @@ greeter_parse_config (void) GdmConfigurator = ve_config_get_string (config, GDM_KEY_CONFIGURATOR); GdmGtkRC = ve_config_get_string (config, GDM_KEY_GTKRC); + GdmWelcome = ve_config_get_translated_string (config, greeter_Welcome_key); + /* A hack! */ + if (strcmp (ve_sure_string (GdmWelcome), "Welcome") == 0) { + g_free (GdmWelcome); + GdmWelcome = g_strdup (_("Welcome")); + } else if (strcmp (ve_sure_string (GdmWelcome), "Welcome to %n") == 0) { + g_free (GdmWelcome); + GdmWelcome = g_strdup (_("Welcome to %n")); + } + GdmTimedLoginEnable = ve_config_get_bool (config, GDM_KEY_TIMED_LOGIN_ENABLE); GdmExclude = ve_config_get_string (config, GDM_KEY_EXCLUDE); GdmMinimalUID = ve_config_get_int (config, GDM_KEY_MINIMALUID); @@ -831,6 +853,7 @@ greeter_reread_config (int sig, gpointer data) { VeConfig *config = ve_config_get (GDM_CONFIG_FILE); char *theme, *theme_dir; + char *str; theme = ve_config_get_string (config, GDM_KEY_GRAPHICAL_THEME); if (ve_string_empty (theme)) { @@ -919,6 +942,27 @@ greeter_reread_config (int sig, gpointer data) greeter_item_clock_update (); } + str = ve_config_get_translated_string (config, greeter_Welcome_key); + /* A hack */ + if (strcmp (ve_sure_string (str), "Welcome") == 0) { + g_free (str); + str = g_strdup (_("Welcome")); + } else if (strcmp (ve_sure_string (str), "Welcome to %n") == 0) { + g_free (str); + str = g_strdup (_("Welcome to %n")); + } + if (strcmp (ve_sure_string (str), ve_sure_string (GdmWelcome)) != 0) { + g_free (GdmWelcome); + GdmWelcome = str; + if (welcome_string_info != NULL) { + g_free (welcome_string_info->orig_text); + welcome_string_info->orig_text = g_strdup (str); + greeter_item_update_text (welcome_string_info); + } + } else { + g_free (str); + } + g_free (theme); g_free (theme_dir); diff --git a/gui/greeter/greeter_configuration.h b/gui/greeter/greeter_configuration.h index f35e2e6c..f885db7e 100644 --- a/gui/greeter/greeter_configuration.h +++ b/gui/greeter/greeter_configuration.h @@ -28,6 +28,7 @@ extern gchar *GdmExclude; extern int GdmMinimalUID; extern gboolean GdmAllowRoot; extern gboolean GdmAllowRemoteRoot; +extern gchar *GdmWelcome; extern gboolean GDM_IS_LOCAL; extern gboolean DOING_GDM_DEVELOPMENT; diff --git a/gui/greeter/greeter_item.c b/gui/greeter/greeter_item.c index 61745ffb..a424e9a2 100644 --- a/gui/greeter/greeter_item.c +++ b/gui/greeter/greeter_item.c @@ -6,6 +6,7 @@ #include <stdlib.h> #include <time.h> #include <unistd.h> +#include <sys/utsname.h> #include "greeter_item.h" #include "greeter_configuration.h" @@ -110,6 +111,7 @@ greeter_item_expand_text (const char *text) int r; int underline = -1; char buf[256]; + struct utsname name; str = g_string_sized_new (strlen (text)); @@ -125,6 +127,10 @@ greeter_item_expand_text (const char *text) case '%': g_string_append (str, "%"); break; + case 'n': + uname (&name); + g_string_append (str, name.nodename); + break; case 'h': buf[sizeof(buf) - 1] = '\0'; r = gethostname (buf, sizeof(buf) - 1); diff --git a/gui/greeter/greeter_parser.c b/gui/greeter/greeter_parser.c index 2b39f6e3..a15ed873 100644 --- a/gui/greeter/greeter_parser.c +++ b/gui/greeter/greeter_parser.c @@ -12,9 +12,13 @@ #include <vicious.h> +#include "greeter_configuration.h" #include "greeter_parser.h" #include "greeter_events.h" +/* FIXME: hack */ +extern GreeterItemInfo *welcome_string_info; + static char *file_search_path = NULL; GHashTable *item_hash = NULL; @@ -910,6 +914,7 @@ parse_translated_text (xmlNodePtr node, * with translation score */ static gboolean parse_stock (xmlNodePtr node, + GreeterItemInfo *info, char **translated_text, gint *translation_score, GError **error) @@ -964,12 +969,13 @@ parse_stock (xmlNodePtr node, g_free (*translated_text); *translated_text = g_strdup (_("User %s will login in %d seconds")); } - /* FIXME: this should be the welcome string but wait until - * we can break strings again */ else if (g_ascii_strcasecmp (prop, "welcome-label") == 0) { + /* FIXME: hack */ + welcome_string_info = info; + g_free (*translated_text); - *translated_text = g_strdup (_("Welcome to %h")); + *translated_text = g_strdup (GdmWelcome); } /* FIXME: is this actually needed? */ else if (g_ascii_strcasecmp (prop, "username-label") == 0) @@ -1043,7 +1049,7 @@ parse_label (xmlNodePtr node, else if (child->type == XML_ELEMENT_NODE && strcmp (child->name, "stock") == 0) { - if (!parse_stock (child, &translated_text, &translation_score, error)) + if (!parse_stock (child, info, &translated_text, &translation_score, error)) return FALSE; } else if (strcmp (child->name, "show") == 0) |