diff options
author | George Lebl <jirka@5z.com> | 2003-06-03 18:13:37 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2003-06-03 18:13:37 +0000 |
commit | 009a8f3facf516ff14cf5f792aa326e19f207fbb (patch) | |
tree | 7d8345040cbe48f77b70f9177fab84881f281a75 /gui | |
parent | 4887903a779eddec35cbc712757edd33449d30f7 (diff) | |
download | gdm-009a8f3facf516ff14cf5f792aa326e19f207fbb.tar.gz |
whack subtype, though read it from "legacy" xml files into "type" (as long
Tue Jun 03 11:11:20 2003 George Lebl <jirka@5z.com>
* gui/greeter/greeter_item.[ch], gui/greeter/greeter_parser.c:
whack subtype, though read it from "legacy" xml files into "type"
(as long as type was "system"), also add a "config" stock label
if someone really wanted to do a config button. If the type
is now config, halt, reboot, suspend or chooser, automatically
check if SystemMenu is enabled, which avoids the whole subtype
nonsense.
* gui/greeter/greeter.dtd: Update for the above and also add the
stock labels for config and chooser
Diffstat (limited to 'gui')
-rw-r--r-- | gui/greeter/greeter.dtd | 3 | ||||
-rw-r--r-- | gui/greeter/greeter_item.c | 19 | ||||
-rw-r--r-- | gui/greeter/greeter_item.h | 3 | ||||
-rw-r--r-- | gui/greeter/greeter_parser.c | 16 |
4 files changed, 25 insertions, 16 deletions
diff --git a/gui/greeter/greeter.dtd b/gui/greeter/greeter.dtd index 8e4c68f5..05d5c1aa 100644 --- a/gui/greeter/greeter.dtd +++ b/gui/greeter/greeter.dtd @@ -43,7 +43,7 @@ file CDATA #IMPLIED > <!ATTLIST stock - type (language | session | system | disconnect | quit | caps-lock-warning | timed-label | welcome-label | username-label) #REQUIRED + type (language | session | system | disconnect | quit | caps-lock-warning | timed-label | welcome-label | username-label | config | chooser) #REQUIRED > <!ATTLIST box orientation (horizontal | vertical) "horizontal" @@ -57,7 +57,6 @@ <!ATTLIST show modes CDATA #IMPLIED type (config | chooser | system | halt | reboot | suspend | timed) #IMPLIED - subtype (halt | reboot | suspend) #IMPLIED > <!ATTLIST text xml:lang CDATA #IMPLIED diff --git a/gui/greeter/greeter_item.c b/gui/greeter/greeter_item.c index ad30d431..61745ffb 100644 --- a/gui/greeter/greeter_item.c +++ b/gui/greeter/greeter_item.c @@ -59,7 +59,6 @@ greeter_item_info_free (GreeterItemInfo *info) g_free (info->id); g_free (info->orig_text); g_free (info->show_type); - g_free (info->show_subtype); g_free (info); } @@ -231,17 +230,17 @@ greeter_item_is_visible (GreeterItemInfo *info) strcmp (info->show_type, "system") == 0) return FALSE; - if (GdmHalt == NULL && - info->show_subtype != NULL && - strcmp (info->show_subtype, "halt") == 0) + if (( ! GdmSystemMenu || GdmHalt == NULL) && + info->show_type != NULL && + strcmp (info->show_type, "halt") == 0) return FALSE; - if (GdmReboot == NULL && - info->show_subtype != NULL && - strcmp (info->show_subtype, "reboot") == 0) + if (( ! GdmSystemMenu || GdmReboot == NULL) && + info->show_type != NULL && + strcmp (info->show_type, "reboot") == 0) return FALSE; - if (GdmSuspend == NULL && - info->show_subtype != NULL && - strcmp (info->show_subtype, "suspend") == 0) + if (( ! GdmSystemMenu || GdmSuspend == NULL) && + info->show_type != NULL && + strcmp (info->show_type, "suspend") == 0) return FALSE; if (ve_string_empty (GdmTimedLogin) && diff --git a/gui/greeter/greeter_item.h b/gui/greeter/greeter_item.h index 588a1a8a..ba5bf5fa 100644 --- a/gui/greeter/greeter_item.h +++ b/gui/greeter/greeter_item.h @@ -60,8 +60,7 @@ struct _GreeterItemInfo { double y; GreeterItemShowModes show_modes; - char *show_type; /* timed, system, config */ - char *show_subtype; /* halt, suspend, reboot */ + char *show_type; /* timed, system, config, chooser, halt, suspend, reboot */ GreeterItemSizeType width_type; GreeterItemSizeType height_type; diff --git a/gui/greeter/greeter_parser.c b/gui/greeter/greeter_parser.c index e73435cc..8b3092e1 100644 --- a/gui/greeter/greeter_parser.c +++ b/gui/greeter/greeter_parser.c @@ -286,11 +286,18 @@ parse_show (xmlNodePtr node, xmlFree (prop); } + /* Note: subtype is deprecated, use type only */ prop = xmlGetProp (node, "subtype"); if (prop != NULL) { - g_free (info->show_subtype); - info->show_subtype = g_strdup (prop); + /* code for legacy uses of subtype only, are there any such + * themes out there? The Bluecurve was the one this was made + * for and bluecurve is NOT using it. */ + if (info->show_type == NULL || + strcmp (info->show_type, "system") == 0) { + g_free (info->show_type); + info->show_type = g_strdup (prop); + } xmlFree (prop); } @@ -942,6 +949,11 @@ parse_stock (xmlNodePtr node, g_free (*translated_text); *translated_text = g_strdup (_("_XDMCP Chooser")); } + else if (g_ascii_strcasecmp (prop, "config") == 0) + { + g_free (*translated_text); + *translated_text = g_strdup (_("_Configure")); + } else if (g_ascii_strcasecmp (prop, "caps-lock-warning") == 0) { g_free (*translated_text); |