gdm r5833 - in trunk: . gui/simple-greeter
- From: halfline svn gnome org
- To: svn-commits-list gnome org
- Subject: gdm r5833 - in trunk: . gui/simple-greeter
- Date: Thu, 21 Feb 2008 04:48:32 +0000 (GMT)
Author: halfline
Date: Thu Feb 21 04:48:32 2008
New Revision: 5833
URL: http://svn.gnome.org/viewvc/gdm?rev=5833&view=rev
Log:
2008-02-20 Ray Strode <rstrode redhat com>
* gui/simple-greeter/gdm-greeter-panel.c
(gdm_greeter_panel_reset):
Set language and session to defaults when
reseting the user
* gui/simple-greeter/gdm-language-option-widget.c
(gdm_language_option_widget_init):
(gdm_language_option_widget_set_current_language_name):
* gui/simple-greeter/gdm-session-option-widget.c
(gdm_session_option_widget_init):
(gdm_session_option_widget_set_current_session_name):
Create "Last Language" and "Last Session" items
to go to when we don't know more specific values
for language and session. Make set_current_*_name (..., NULL)
revert to these values.
Modified:
trunk/ChangeLog
trunk/gui/simple-greeter/gdm-greeter-panel.c
trunk/gui/simple-greeter/gdm-language-option-widget.c
trunk/gui/simple-greeter/gdm-session-option-widget.c
Modified: trunk/gui/simple-greeter/gdm-greeter-panel.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-panel.c (original)
+++ trunk/gui/simple-greeter/gdm-greeter-panel.c Thu Feb 21 04:48:32 2008
@@ -572,6 +572,8 @@
void
gdm_greeter_panel_reset (GdmGreeterPanel *panel)
{
+ gdm_greeter_panel_set_language_name_hint (panel, NULL);
+ gdm_greeter_panel_set_session_name_hint (panel, NULL);
gdm_greeter_panel_hide_user_options (panel);
}
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 Thu Feb 21 04:48:32 2008
@@ -42,6 +42,8 @@
#define GDM_LANGUAGE_OPTION_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_LANGUAGE_OPTION_WIDGET, GdmLanguageOptionWidgetPrivate))
+#define GDM_LANGUAGE_OPTION_WIDGET_LAST_LANGUAGE "__previous"
+
struct GdmLanguageOptionWidgetPrivate
{
GtkWidget *dialog;
@@ -174,6 +176,14 @@
}
gdm_option_widget_add_item (GDM_OPTION_WIDGET (widget),
+ GDM_LANGUAGE_OPTION_WIDGET_LAST_LANGUAGE, _("Last language"),
+ _("Log in using the language that you "
+ "have used last time you logged in"),
+ GDM_OPTION_WIDGET_POSITION_TOP);
+ gdm_option_widget_set_active_item (GDM_OPTION_WIDGET (widget),
+ GDM_LANGUAGE_OPTION_WIDGET_LAST_LANGUAGE);
+
+ gdm_option_widget_add_item (GDM_OPTION_WIDGET (widget),
"__other", _("Other..."),
_("Choose a language from the "
"full list of available languages."),
@@ -247,8 +257,12 @@
gdm_language_option_widget_set_current_language_name (GdmLanguageOptionWidget *widget,
const char *lang_name)
{
- if (!gdm_option_widget_lookup_item (GDM_OPTION_WIDGET (widget), lang_name,
- NULL, NULL, NULL)) {
+ g_return_if_fail (GDM_IS_LANGUAGE_OPTION_WIDGET (widget));
+
+ if (lang_name == NULL) {
+ gdm_option_widget_set_active_item (GDM_OPTION_WIDGET (widget), GDM_LANGUAGE_OPTION_WIDGET_LAST_LANGUAGE);
+ } else if (!gdm_option_widget_lookup_item (GDM_OPTION_WIDGET (widget), lang_name,
+ NULL, NULL, NULL)) {
gdm_recent_option_widget_add_item (GDM_RECENT_OPTION_WIDGET (widget),
lang_name);
} else {
Modified: trunk/gui/simple-greeter/gdm-session-option-widget.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-session-option-widget.c (original)
+++ trunk/gui/simple-greeter/gdm-session-option-widget.c Thu Feb 21 04:48:32 2008
@@ -41,6 +41,8 @@
#define GDM_SESSION_OPTION_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_SESSION_OPTION_WIDGET, GdmSessionOptionWidgetPrivate))
+#define GDM_SESSION_OPTION_WIDGET_LAST_SESSION "__previous"
+
struct GdmSessionOptionWidgetPrivate
{
gpointer dummy;
@@ -106,11 +108,16 @@
{
char **session_ids;
int i;
- gboolean default_is_set;
session_ids = gdm_get_all_sessions ();
- default_is_set = FALSE;
+ gdm_option_widget_add_item (GDM_OPTION_WIDGET (widget),
+ GDM_SESSION_OPTION_WIDGET_LAST_SESSION,
+ _("Last session"),
+ _("Login with the same session as last time."),
+ GDM_OPTION_WIDGET_POSITION_TOP);
+ gdm_option_widget_set_active_item (GDM_OPTION_WIDGET (widget),
+ GDM_SESSION_OPTION_WIDGET_LAST_SESSION);
for (i = 0; session_ids[i] != NULL; i++) {
char *name;
@@ -124,13 +131,6 @@
gdm_option_widget_add_item (GDM_OPTION_WIDGET (widget),
session_ids[i], name, comment,
GDM_OPTION_WIDGET_POSITION_MIDDLE);
-
- if (!default_is_set) {
- gdm_option_widget_set_active_item (GDM_OPTION_WIDGET (widget),
- session_ids[i]);
- default_is_set = TRUE;
- }
-
g_free (name);
g_free (comment);
}
@@ -191,7 +191,10 @@
gdm_session_option_widget_set_current_session (GdmSessionOptionWidget *widget,
const char *session)
{
- if (gdm_option_widget_lookup_item (GDM_OPTION_WIDGET (widget), session,
+ if (session == NULL) {
+ gdm_option_widget_set_active_item (GDM_OPTION_WIDGET (widget),
+ GDM_SESSION_OPTION_WIDGET_LAST_SESSION);
+ } else if (gdm_option_widget_lookup_item (GDM_OPTION_WIDGET (widget), session,
NULL, NULL, NULL)) {
gdm_option_widget_set_active_item (GDM_OPTION_WIDGET (widget), session);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]