gdm r5796 - in trunk: . common gui/simple-greeter



Author: mccann
Date: Tue Feb 19 00:43:25 2008
New Revision: 5796
URL: http://svn.gnome.org/viewvc/gdm?rev=5796&view=rev

Log:
2008-02-18  William Jon McCann  <jmccann redhat com>

	* common/gdm-address.c:
	* gui/simple-greeter/gdm-greeter-login-window.c: (load_theme):
	* gui/simple-greeter/gdm-simple-greeter.schemas.in:
	Allow the login window icon to be changed via gconf.



Modified:
   trunk/ChangeLog
   trunk/common/gdm-address.c
   trunk/gui/simple-greeter/gdm-greeter-login-window.c
   trunk/gui/simple-greeter/gdm-simple-greeter.schemas.in

Modified: trunk/common/gdm-address.c
==============================================================================
--- trunk/common/gdm-address.c	(original)
+++ trunk/common/gdm-address.c	Tue Feb 19 00:43:25 2008
@@ -38,7 +38,6 @@
 #include <net/if.h>
 
 #ifndef G_OS_WIN32
-#include <sys/socket.h>
 #include <sys/select.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>

Modified: trunk/gui/simple-greeter/gdm-greeter-login-window.c
==============================================================================
--- trunk/gui/simple-greeter/gdm-greeter-login-window.c	(original)
+++ trunk/gui/simple-greeter/gdm-greeter-login-window.c	Tue Feb 19 00:43:25 2008
@@ -49,6 +49,7 @@
 #include <gtk/gtk.h>
 
 #include <glade/glade-xml.h>
+#include <gconf/gconf-client.h>
 
 #define DBUS_API_SUBJECT_TO_CHANGE
 #include <dbus/dbus-glib.h>
@@ -77,7 +78,9 @@
 #define CK_SEAT_INTERFACE    "org.freedesktop.ConsoleKit.Seat"
 #define CK_SESSION_INTERFACE "org.freedesktop.ConsoleKit.Session"
 
-#define GLADE_XML_FILE "gdm-greeter-login-window.glade"
+#define GLADE_XML_FILE       "gdm-greeter-login-window.glade"
+
+#define LOGO_KEY             "/apps/gdm/simple-greeter/logo-icon-name"
 
 #define GDM_GREETER_LOGIN_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_GREETER_LOGIN_WINDOW, GdmGreeterLoginWindowPrivate))
 
@@ -962,6 +965,7 @@
         GtkWidget *entry;
         GtkWidget *button;
         GtkWidget *box;
+        GtkWidget *image;
 
         glade_set_custom_handler ((GladeXMLCustomWidgetHandler) custom_widget_constructor,
                                   login_window);
@@ -971,6 +975,29 @@
 
         g_assert (login_window->priv->xml != NULL);
 
+        image = glade_xml_get_widget (login_window->priv->xml, "logo-image");
+        if (image != NULL) {
+                GConfClient *client;
+                char        *icon_name;
+                GError      *error;
+
+                client = gconf_client_get_default ();
+                error = NULL;
+                icon_name = gconf_client_get_string (client, LOGO_KEY, &error);
+                if (error != NULL) {
+                        g_debug ("GdmGreeterLoginWindow: unable to get logo icon name: %s", error->message);
+                        g_error_free (error);
+                }
+                g_object_unref (client);
+                g_debug ("GdmGreeterLoginWindow: Got greeter logo '%s'", icon_name);
+                if (icon_name != NULL) {
+                        gtk_image_set_from_icon_name (GTK_IMAGE (image),
+                                                      icon_name,
+                                                      GTK_ICON_SIZE_DIALOG);
+                        g_free (icon_name);
+                }
+        }
+
         box = glade_xml_get_widget (login_window->priv->xml, "window-box");
         gtk_container_add (GTK_CONTAINER (login_window), box);
 

Modified: trunk/gui/simple-greeter/gdm-simple-greeter.schemas.in
==============================================================================
--- trunk/gui/simple-greeter/gdm-simple-greeter.schemas.in	(original)
+++ trunk/gui/simple-greeter/gdm-simple-greeter.schemas.in	Tue Feb 19 00:43:25 2008
@@ -2,6 +2,17 @@
   <schemalist>
 
     <schema>
+      <key>/schemas/apps/gdm/simple-greeter/logo-icon-name</key>
+      <applyto>/apps/gdm/simple-greeter/logo-icon-name</applyto>
+      <owner>gdm-simple-greeter</owner>
+      <type>string</type>
+      <default>computer</default>
+      <locale name="C">
+        <short>Icon name to use for greeter logo</short>
+        <long>Set to the themed icon name to use for the greeter logo.</long>
+      </locale>
+    </schema>
+    <schema>
       <key>/schemas/apps/gdm/simple-greeter/accessibility/screen_keyboard_enabled</key>
       <applyto>/apps/gdm/simple-greeter/accessibility/screen_keyboard_enabled</applyto>
       <owner>gdm-simple-greeter</owner>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]