[gnome-control-center] Remove libglade dependency on gnome-about-me



commit 872a2f0da7778145c024a98413d8615eb89c165f
Author: Robert Ancell <robert ancell gmail com>
Date:   Thu Jul 30 13:24:02 2009 +1000

    Remove libglade dependency on gnome-about-me

 capplets/about-me/Makefile.am                      |   10 +-
 capplets/about-me/gnome-about-me-fingerprint.c     |   52 +-
 capplets/about-me/gnome-about-me-fingerprint.glade |  378 ---
 capplets/about-me/gnome-about-me-fingerprint.h     |    4 +-
 capplets/about-me/gnome-about-me-fingerprint.ui    |  256 ++
 capplets/about-me/gnome-about-me-password.c        |   40 +-
 capplets/about-me/gnome-about-me-password.ui       |  316 ++
 capplets/about-me/gnome-about-me.c                 |   77 +-
 capplets/about-me/gnome-about-me.glade             | 3173 --------------------
 po/POTFILES.in                                     |    5 +-
 10 files changed, 650 insertions(+), 3661 deletions(-)
---
diff --git a/capplets/about-me/Makefile.am b/capplets/about-me/Makefile.am
index 4690b64..32ebdaa 100644
--- a/capplets/about-me/Makefile.am
+++ b/capplets/about-me/Makefile.am
@@ -3,7 +3,7 @@ SUBDIRS = icons
 # This is used in GNOMECC_CAPPLETS_CFLAGS
 cappletname = about-me
 
-glade_files = gnome-about-me.glade gnome-about-me-fingerprint.glade
+ui_files = gnome-about-me-dialog.ui gnome-about-me-password.ui gnome-about-me-fingerprint.ui
 Desktop_in_files = gnome-about-me.desktop.in
 
 gnome_about_me_SOURCES =	 	\
@@ -31,8 +31,8 @@ gnome_about_me_LDFLAGS = -export-dynamic
 desktopdir = $(datadir)/applications
 desktop_DATA = $(Desktop_in_files:.desktop.in=.desktop)
 
-gladedir   = $(pkgdatadir)/glade
-glade_DATA = $(glade_files)
+uidir   = $(pkgdatadir)/ui
+ui_DATA = $(ui_files)
 
 INCLUDES = \
 	$(GNOMECC_CAPPLETS_CFLAGS) \
@@ -40,7 +40,7 @@ INCLUDES = \
 	$(POLKIT_GNOME_CFLAGS) \
 	-DDATADIR="\"$(datadir)\"" \
 	-DGNOMECC_DATA_DIR="\"$(pkgdatadir)\"" \
-	-DGNOMECC_GLADE_DIR="\"$(gladedir)\"" \
+	-DGNOMECC_UI_DIR="\"$(uidir)\"" \
 	-DGNOMECC_PIXMAP_DIR="\"$(pkgdatadir)/pixmaps\"" \
 	-DGNOMELOCALEDIR="\"$(datadir)/locale\""
 
@@ -56,6 +56,6 @@ marshal.c: marshal.h
 endif # BUILD_ABOUTME
 
 CLEANFILES = $(GNOMECC_CAPPLETS_CLEANFILES) $(desktop_DATA) $(MARSHALFILES)
-EXTRA_DIST = $(glade_files) fprintd-marshal.list
+EXTRA_DIST = $(ui_files) fprintd-marshal.list
 
 -include $(top_srcdir)/git.mk
diff --git a/capplets/about-me/gnome-about-me-fingerprint.c b/capplets/about-me/gnome-about-me-fingerprint.c
index 48e1f4d..bb569bf 100644
--- a/capplets/about-me/gnome-about-me-fingerprint.c
+++ b/capplets/about-me/gnome-about-me-fingerprint.c
@@ -19,15 +19,17 @@
 
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
-#include <glade/glade.h>
 #include <dbus/dbus-glib-bindings.h>
 
 #include "fingerprint-strings.h"
 #include "capplet-util.h"
 
-/* This must match the number of images on the 2nd page in the glade file */
+/* This must match the number of images on the 2nd page in the UI file */
 #define MAX_ENROLL_STAGES 3
 
+#undef WID
+#define WID(s) GTK_WIDGET (gtk_builder_get_object (dialog, s))
+
 static DBusGProxy *manager = NULL;
 static DBusGConnection *connection = NULL;
 static gboolean is_disable = FALSE;
@@ -43,8 +45,7 @@ typedef struct {
 	GtkWidget *disable;
 
 	GtkWidget *ass;
-	GladeXML *dialog_page1;
-	GladeXML *dialog_page2;
+	GtkBuilder *dialog;
 
 	DBusGProxy *device;
 	gboolean is_swipe;
@@ -208,7 +209,7 @@ delete_fingerprints (void)
 }
 
 static void
-delete_fingerprints_question (GladeXML *dialog, GtkWidget *enable, GtkWidget *disable)
+delete_fingerprints_question (GtkBuilder *dialog, GtkWidget *enable, GtkWidget *disable)
 {
 	GtkWidget *question;
 	GtkWidget *button;
@@ -254,8 +255,7 @@ enroll_data_destroy (EnrollData *data)
 	case STATE_NONE:
 		g_free (data->name);
 		g_object_unref (data->device);
-		g_object_unref (data->dialog_page1);
-		g_object_unref (data->dialog_page2);
+		g_object_unref (data->dialog);
 		gtk_widget_destroy (data->ass);
 
 		g_free (data);
@@ -263,7 +263,7 @@ enroll_data_destroy (EnrollData *data)
 }
 
 static const char *
-selected_finger (GladeXML *dialog)
+selected_finger (GtkBuilder *dialog)
 {
 	int index;
 
@@ -304,13 +304,13 @@ selected_finger (GladeXML *dialog)
 static void
 finger_radio_button_toggled (GtkToggleButton *button, EnrollData *data)
 {
-	data->finger = selected_finger (data->dialog_page1);
+	data->finger = selected_finger (data->dialog);
 }
 
 static void
 finger_combobox_changed (GtkComboBox *combobox, EnrollData *data)
 {
-	data->finger = selected_finger (data->dialog_page1);
+	data->finger = selected_finger (data->dialog);
 }
 
 static void
@@ -328,7 +328,7 @@ assistant_cancelled (GtkAssistant *ass, EnrollData *data)
 static void
 enroll_result (GObject *object, const char *result, gboolean done, EnrollData *data)
 {
-	GladeXML *dialog = data->dialog_page2;
+	GtkBuilder *dialog = data->dialog;
 	char *msg;
 
 	if (g_str_equal (result, "enroll-completed") || g_str_equal (result, "enroll-stage-passed")) {
@@ -376,7 +376,7 @@ assistant_prepare (GtkAssistant *ass, GtkWidget *page, EnrollData *data)
 	if (g_str_equal (name, "enroll")) {
 		DBusGProxy *p;
 		GError *error = NULL;
-		GladeXML *dialog = data->dialog_page2;
+		GtkBuilder *dialog = data->dialog;
 		char *path;
 		guint i;
 		GValue value = { 0, };
@@ -488,7 +488,7 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
 {
 	DBusGProxy *device, *p;
 	GHashTable *props;
-	GladeXML *dialog;
+	GtkBuilder *dialog;
 	EnrollData *data;
 	GtkWidget *ass;
 	char *msg;
@@ -532,7 +532,11 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
 	}
 	g_object_unref (p);
 
-	ass = gtk_assistant_new ();
+	dialog = gtk_builder_new ();
+	gtk_builder_add_from_file (dialog, GNOMECC_UI_DIR "/gnome-about-me-fingerprint.ui", NULL);
+	data->dialog = dialog;
+
+	ass = WID ("assistant");
 	gtk_window_set_title (GTK_WINDOW (ass), _("Enable Fingerprint Login"));
 	gtk_window_set_transient_for (GTK_WINDOW (ass), parent);
 	gtk_window_set_position (GTK_WINDOW (ass), GTK_WIN_POS_CENTER_ON_PARENT);
@@ -544,13 +548,6 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
 			  G_CALLBACK (assistant_prepare), data);
 
 	/* Page 1 */
-	dialog = glade_xml_new (GNOMECC_GLADE_DIR "/gnome-about-me-fingerprint.glade",
-				"page1", NULL);
-	data->dialog_page1 = dialog;
-
-	gtk_assistant_append_page (GTK_ASSISTANT (ass), WID("page1"));
-	gtk_assistant_set_page_title (GTK_ASSISTANT (ass), WID("page1"), _("Select finger"));
-	gtk_assistant_set_page_type (GTK_ASSISTANT (ass), WID("page1"), GTK_ASSISTANT_PAGE_CONTENT);
 	gtk_combo_box_set_active (GTK_COMBO_BOX (WID ("finger_combobox")), 0);
 
 	g_signal_connect (G_OBJECT (WID ("radiobutton1")), "toggled",
@@ -578,15 +575,10 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
 	gtk_assistant_set_page_complete (GTK_ASSISTANT (ass), WID("page1"), TRUE);
 
 	/* Page 2 */
-	dialog = glade_xml_new (GNOMECC_GLADE_DIR "/gnome-about-me-fingerprint.glade",
-				"page2", NULL);
-	data->dialog_page2 = dialog;
-	gtk_assistant_append_page (GTK_ASSISTANT (ass), WID("page2"));
 	if (data->is_swipe != FALSE)
 		gtk_assistant_set_page_title (GTK_ASSISTANT (ass), WID("page2"), _("Swipe finger on reader"));
 	else
 		gtk_assistant_set_page_title (GTK_ASSISTANT (ass), WID("page2"), _("Place finger on reader"));
-	gtk_assistant_set_page_type (GTK_ASSISTANT (ass), WID("page2"), GTK_ASSISTANT_PAGE_CONTENT);
 
 	g_object_set_data (G_OBJECT (WID("page2")), "name", "enroll");
 
@@ -595,12 +587,6 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
 	g_free (msg);
 
 	/* Page 3 */
-	dialog = glade_xml_new (GNOMECC_GLADE_DIR "/gnome-about-me-fingerprint.glade",
-				"page3", NULL);
-	gtk_assistant_append_page (GTK_ASSISTANT (ass), WID("page3"));
-	gtk_assistant_set_page_title (GTK_ASSISTANT (ass), WID("page3"), _("Done!"));
-	gtk_assistant_set_page_type (GTK_ASSISTANT (ass), WID("page3"), GTK_ASSISTANT_PAGE_SUMMARY);
-
 	g_object_set_data (G_OBJECT (WID("page3")), "name", "summary");
 
 	data->ass = ass;
@@ -608,7 +594,7 @@ enroll_fingerprints (GtkWindow *parent, GtkWidget *enable, GtkWidget *disable)
 }
 
 void
-fingerprint_button_clicked (GladeXML *dialog,
+fingerprint_button_clicked (GtkBuilder *dialog,
 			    GtkWidget *enable,
 			    GtkWidget *disable)
 {
diff --git a/capplets/about-me/gnome-about-me-fingerprint.h b/capplets/about-me/gnome-about-me-fingerprint.h
index e33e57a..ea0e75c 100644
--- a/capplets/about-me/gnome-about-me-fingerprint.h
+++ b/capplets/about-me/gnome-about-me-fingerprint.h
@@ -17,11 +17,11 @@
  * 02111-1307, USA.
  */
 
-#include <glade/glade.h>
+#include <gtk/gtk.h>
 
 void set_fingerprint_label (GtkWidget *enable,
 			    GtkWidget *disable);
-void fingerprint_button_clicked (GladeXML *dialog,
+void fingerprint_button_clicked (GtkBuilder *dialog,
 				 GtkWidget *enable,
 				 GtkWidget *disable);
 
diff --git a/capplets/about-me/gnome-about-me-fingerprint.ui b/capplets/about-me/gnome-about-me-fingerprint.ui
new file mode 100644
index 0000000..d94a5e8
--- /dev/null
+++ b/capplets/about-me/gnome-about-me-fingerprint.ui
@@ -0,0 +1,256 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkListStore" id="model1">
+    <columns>
+      <!-- column-name gchararray -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Left thumb</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Left middle finger</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Left ring finger</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Left little finger</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Right thumb</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Right middle finger</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Right ring finger</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Right little finger</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkAssistant" id="assistant">
+    <property name="border_width">12</property>
+    <property name="title" translatable="yes">Enable Fingerprint Login</property>
+    <child>
+      <placeholder/>
+    </child>
+    <child>
+      <object class="GtkVBox" id="page1">
+        <property name="visible">True</property>
+        <property name="border_width">12</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child>
+          <object class="GtkHBox" id="hbox74">
+            <property name="visible">True</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkImage" id="image">
+                <property name="visible">True</property>
+                <property name="stock">gtk-dialog-info</property>
+                <property name="icon-size">6</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="intro-label">
+                <property name="visible">True</property>
+                <property name="label">To enable fingerprint login, you need to save one of your fingerprints, using the Acme Foobar 5000.</property>
+                <property name="wrap">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkVBox" id="vbox70">
+            <property name="visible">True</property>
+            <property name="orientation">vertical</property>
+            <child>
+              <object class="GtkRadioButton" id="radiobutton1">
+                <property name="label" translatable="yes">Right index finger</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkRadioButton" id="radiobutton2">
+                <property name="label" translatable="yes">Left index finger</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">radiobutton1</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox77">
+                <property name="visible">True</property>
+                <child>
+                  <object class="GtkRadioButton" id="radiobutton3">
+                    <property name="label" translatable="yes">Other finger: </property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="group">radiobutton1</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkComboBox" id="finger_combobox">
+                    <property name="visible">True</property>
+                    <property name="sensitive">False</property>
+                    <property name="model">model1</property>
+                    <child>
+                      <object class="GtkCellRendererText" id="renderer1"/>
+                      <attributes>
+                        <attribute name="text">0</attribute>
+                      </attributes>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="title" translatable="yes">Select finger</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkVBox" id="page2">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkLabel" id="enroll-label">
+            <property name="visible">True</property>
+            <property name="label">In order to save your fingerprints, you need to swipe your thumb on the "Acme foobar" device.</property>
+            <property name="wrap">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="enroll_hbox">
+            <property name="visible">True</property>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <object class="GtkImage" id="image1">
+                <property name="visible">True</property>
+                <property name="stock">gtk-no</property>
+                <property name="icon-size">6</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="image2">
+                <property name="visible">True</property>
+                <property name="stock">gtk-no</property>
+                <property name="icon-size">6</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="image3">
+                <property name="visible">True</property>
+                <property name="stock">gtk-no</property>
+                <property name="icon-size">6</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="status-label">
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="title">Swipe finger on reader</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkLabel" id="page3">
+        <property name="visible">True</property>
+        <property name="label" translatable="yes">Your fingerprint was successfully saved. You should now be able to log in using your fingerprint reader.</property>
+        <property name="wrap">True</property>
+      </object>
+      <packing>
+        <property name="page_type">summary</property>
+        <property name="title" translatable="yes">Done!</property>
+      </packing>
+    </child>
+  </object>
+</interface>
diff --git a/capplets/about-me/gnome-about-me-password.c b/capplets/about-me/gnome-about-me-password.c
index 53f6af0..aa405ac 100644
--- a/capplets/about-me/gnome-about-me-password.c
+++ b/capplets/about-me/gnome-about-me-password.c
@@ -31,7 +31,6 @@
 #include <gdk/gdkkeysyms.h>
 #include <pwd.h>
 #include <stdlib.h>
-#include <glade/glade.h>
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
@@ -45,6 +44,9 @@
 #include "capplet-util.h"
 #include "eel-alert-dialog.h"
 
+#undef WID
+#define WID(s) GTK_WIDGET (gtk_builder_get_object (dialog, s))
+
 /* Passwd states */
 typedef enum {
 	PASSWD_STATE_NONE,		/* Passwd is not asking for anything */
@@ -55,7 +57,7 @@ typedef enum {
 } PasswdState;
 
 typedef struct {
-	GladeXML  *xml;
+	GtkBuilder  *ui;
 
 	/* Commonly used widgets */
 	GtkEntry *current_password;
@@ -428,7 +430,7 @@ io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswordDialog *pdi
 	GError		*error = NULL;
 
 	gchar		*msg = NULL;		/* Status error message */
-	GladeXML	*dialog;
+	GtkBuilder	*dialog;
 
 	gboolean	reinit = FALSE;
 
@@ -437,7 +439,7 @@ io_watch_stdout (GIOChannel *source, GIOCondition condition, PasswordDialog *pdi
 		str = g_string_new ("");
 	}
 
-	dialog = pdialog->xml;
+	dialog = pdialog->ui;
 
 	if (g_io_channel_read_chars (source, buf, BUFSIZE, &bytes_read, &error) != G_IO_STATUS_NORMAL) {
 		g_warning ("IO Channel read error: %s", error->message);
@@ -661,12 +663,12 @@ update_password (PasswordDialog *pdialog)
 static void
 passdlg_set_busy (PasswordDialog *pdialog, gboolean busy)
 {
-	GladeXML   *dialog;
+	GtkBuilder *dialog;
 	GtkWidget  *toplevel;
 	GdkCursor  *cursor = NULL;
 	GdkDisplay *display;
 
-	dialog = pdialog->xml;
+	dialog = pdialog->ui;
 
 	/* Set cursor */
 	toplevel = WID ("change-password");
@@ -738,9 +740,9 @@ passdlg_error_dialog (GtkWindow *parent, const gchar *title,
 static void
 passdlg_set_auth_state (PasswordDialog *pdialog, gboolean state)
 {
-	GladeXML	*dialog;
+	GtkBuilder *dialog;
 
-	dialog = pdialog->xml;
+	dialog = pdialog->ui;
 
 	/* Widgets which require a not-authenticated state to be accessible */
 	g_object_set (pdialog->current_password, "sensitive", !state, NULL);
@@ -813,8 +815,7 @@ passdlg_spawn_passwd (PasswordDialog *pdialog)
 
 	/* Spawn backend */
 	if (!spawn_passwd (pdialog, &error)) {
-		GtkWidget *parent = glade_xml_get_widget (pdialog->xml,
-							  "change-password");
+		GtkWidget *parent = GTK_WIDGET (gtk_builder_get_object (pdialog->ui, "change-password"));
 
 		/* translators: Unable to launch <program>: <error message> */
 		details = g_strdup_printf (_("Unable to launch %s: %s"),
@@ -865,11 +866,11 @@ passdlg_authenticate (GtkButton *button, PasswordDialog *pdialog)
 static guint
 passdlg_validate_passwords (PasswordDialog *pdialog)
 {
-	GladeXML		*dialog;
+	GtkBuilder	*dialog;
 	const gchar	*new_password, *retyped_password;
 	glong			nlen, rlen;
 
-	dialog = pdialog->xml;
+	dialog = pdialog->ui;
 
 	new_password = gtk_entry_get_text (pdialog->new_password);
 	retyped_password = gtk_entry_get_text (pdialog->retyped_password);
@@ -902,11 +903,11 @@ passdlg_validate_passwords (PasswordDialog *pdialog)
 static guint
 passdlg_refresh_password_state (PasswordDialog *pdialog)
 {
-	GladeXML	*dialog;
+	GtkBuilder *dialog;
 	guint		ret;
 	gboolean	valid = FALSE;
 
-	dialog = pdialog->xml;
+	dialog = pdialog->ui;
 
 	ret = passdlg_validate_passwords (pdialog);
 
@@ -1008,13 +1009,14 @@ passdlg_activate (GtkEntry *entry, GtkWidget *w)
 static void
 passdlg_init (PasswordDialog *pdialog, GtkWindow *parent)
 {
-	GladeXML		*dialog;
+	GtkBuilder		*dialog;
 	GtkWidget		*wpassdlg;
 	GtkAccelGroup	*group;
 
 	/* Initialize dialog */
-	dialog = glade_xml_new (GNOMECC_GLADE_DIR "/gnome-about-me.glade", "change-password", NULL);
-	pdialog->xml = dialog;
+	dialog = gtk_builder_new ();
+    gtk_builder_add_from_file (dialog, GNOMECC_UI_DIR "/gnome-about-me-password.ui", NULL);
+	pdialog->ui = dialog;
 
 	wpassdlg = WID ("change-password");
 	capplet_set_icon (wpassdlg, "user-info");
@@ -1098,7 +1100,7 @@ void
 gnome_about_me_password (GtkWindow *parent)
 {
 	PasswordDialog	*pdialog;
-	GladeXML		*dialog;
+	GtkBuilder		*dialog;
 	GtkWidget		*wpassdlg;
 
 	gint			result;
@@ -1108,7 +1110,7 @@ gnome_about_me_password (GtkWindow *parent)
 	pdialog = g_new0 (PasswordDialog, 1);
 	passdlg_init (pdialog, parent);
 
-	dialog = pdialog->xml;
+	dialog = pdialog->ui;
 	wpassdlg = WID ("change-password");
 
 	/* Go! */
diff --git a/capplets/about-me/gnome-about-me-password.ui b/capplets/about-me/gnome-about-me-password.ui
new file mode 100644
index 0000000..4978383
--- /dev/null
+++ b/capplets/about-me/gnome-about-me-password.ui
@@ -0,0 +1,316 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkDialog" id="change-password">
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Change password</property>
+    <property name="resizable">False</property>
+    <property name="type_hint">dialog</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">6</property>
+        <child>
+          <object class="GtkHBox" id="container-hbox">
+            <property name="visible">True</property>
+            <property name="border_width">6</property>
+            <property name="spacing">12</property>
+            <child>
+              <object class="GtkImage" id="dialog-image">
+                <property name="visible">True</property>
+                <property name="yalign">0</property>
+                <property name="icon_name">gtk-dialog-authentication</property>
+                <property name="icon-size">6</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="main-vbox">
+                <property name="visible">True</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkLabel" id="header-label">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">&lt;span size="larger" weight="bold"&gt;Change your password&lt;/span&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="description-label">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="yalign">0</property>
+                    <property name="label" translatable="yes">To change your password, enter your current password in the field below and click &lt;b&gt;Authenticate&lt;/b&gt;.
+After you have authenticated, enter your new password, retype it for verification and click &lt;b&gt;Change password&lt;/b&gt;.</property>
+                    <property name="use_markup">True</property>
+                    <property name="wrap">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkHBox" id="entry-hbox">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkVBox" id="entry-labels-vbox">
+                        <property name="visible">True</property>
+                        <property name="orientation">vertical</property>
+                        <property name="spacing">6</property>
+                        <property name="homogeneous">True</property>
+                        <child>
+                          <object class="GtkLabel" id="current-password-label">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Current _password:</property>
+                            <property name="use_underline">True</property>
+                            <property name="mnemonic_widget">current-password</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="new-password-label">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">_New password:</property>
+                            <property name="use_underline">True</property>
+                            <property name="mnemonic_widget">new-password</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="retyped-password-label">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">_Retype new password:</property>
+                            <property name="use_underline">True</property>
+                            <property name="mnemonic_widget">retyped-password</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkVBox" id="entry-vbox">
+                        <property name="visible">True</property>
+                        <property name="orientation">vertical</property>
+                        <property name="spacing">6</property>
+                        <property name="homogeneous">True</property>
+                        <child>
+                          <object class="GtkHBox" id="auth-hbox">
+                            <property name="visible">True</property>
+                            <property name="spacing">6</property>
+                            <child>
+                              <object class="GtkEntry" id="current-password">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="visibility">False</property>
+                              </object>
+                              <packing>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkButton" id="authenticate-button">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <child>
+                                  <object class="GtkAlignment" id="alignment1">
+                                    <property name="visible">True</property>
+                                    <property name="xscale">0</property>
+                                    <property name="yscale">0</property>
+                                    <child>
+                                      <object class="GtkHBox" id="hbox73">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">2</property>
+                                        <child>
+                                          <object class="GtkImage" id="image2">
+                                            <property name="visible">True</property>
+                                            <property name="stock">gtk-apply</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">0</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkLabel" id="label1070">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">_Authenticate</property>
+                                            <property name="use_underline">True</property>
+                                          </object>
+                                          <packing>
+                                            <property name="expand">False</property>
+                                            <property name="fill">False</property>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">1</property>
+                              </packing>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkEntry" id="new-password">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                            <property name="visibility">False</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkEntry" id="retyped-password">
+                            <property name="visible">True</property>
+                            <property name="sensitive">False</property>
+                            <property name="can_focus">True</property>
+                            <property name="visibility">False</property>
+                            <property name="activates_default">True</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">2</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="status-label">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">Please type your password again in the &lt;b&gt;Retype new password&lt;/b&gt; field.</property>
+                    <property name="use_markup">True</property>
+                    <property name="justify">center</property>
+                    <property name="wrap">True</property>
+                  </object>
+                  <packing>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action-area">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="cancel-button">
+                <property name="label">gtk-close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="change-password-button">
+                <property name="label" translatable="yes">Change pa_ssword</property>
+                <property name="visible">True</property>
+                <property name="sensitive">False</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-7">cancel-button</action-widget>
+      <action-widget response="-5">change-password-button</action-widget>
+    </action-widgets>
+  </object>
+</interface>
diff --git a/capplets/about-me/gnome-about-me.c b/capplets/about-me/gnome-about-me.c
index 211514d..3f35c9c 100644
--- a/capplets/about-me/gnome-about-me.c
+++ b/capplets/about-me/gnome-about-me.c
@@ -27,7 +27,6 @@
 #include <pwd.h>
 #include <gio/gio.h>
 #include <gconf/gconf-client.h>
-#include <glade/glade.h>
 #include <pwd.h>
 #include <unistd.h>
 #include <libebook/e-book.h>
@@ -52,13 +51,17 @@
 
 #define EMAIL_SLOTS 4
 
+#undef WID
+#define WID(s) GTK_WIDGET (gtk_builder_get_object (dialog, s))
+
 typedef struct {
 	EContact 	*contact;
 	EBook    	*book;
 
-	GladeXML 	*dialog;
+	GtkBuilder 	*dialog;
 	GtkWidget	*enable_fingerprint_button;
 	GtkWidget	*disable_fingerprint_button;
+	GtkWidget   *image_chooser;
 
 	GdkScreen    	*screen;
 	GtkIconTheme 	*theme;
@@ -303,7 +306,7 @@ about_me_focus_out (GtkWidget *widget, GdkEventFocus *event, GnomeAboutMe *me)
 	const gchar *wid;
 	gint i;
 
-	wid = glade_get_widget_name (widget);
+	wid = gtk_widget_get_name (widget);
 
 	if (wid == NULL)
 		return FALSE;
@@ -493,7 +496,7 @@ about_me_setup_email (GnomeAboutMe *me)
 /**
  * about_me_load_string_field:
  *
- * wid: glade widget name
+ * wid: UI widget name
  * cid: id of the field (EDS id)
  * aid: position in the array WidToCid
  **/
@@ -501,8 +504,8 @@ about_me_setup_email (GnomeAboutMe *me)
 static void
 about_me_load_string_field (GnomeAboutMe *me, const gchar *wid, guint cid, guint aid)
 {
-	GtkWidget *widget;
-	GladeXML  *dialog;
+	GtkWidget   *widget;
+	GtkBuilder  *dialog;
 	const gchar *str;
 
 	dialog = me->dialog;
@@ -541,22 +544,19 @@ about_me_load_string_field (GnomeAboutMe *me, const gchar *wid, guint cid, guint
 static void
 about_me_load_photo (GnomeAboutMe *me, EContact *contact)
 {
-	GtkWidget     *widget;
-	GladeXML      *dialog;
+	GtkBuilder    *dialog;
 	EContactPhoto *photo;
 
 	dialog = me->dialog;
 
-	widget = WID ("image-chooser");
-
 	if (me->person)
-		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (widget), me->person);
+		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), me->person);
 
 	photo = e_contact_get (contact, E_CONTACT_PHOTO);
 
 	if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) {
 		me->have_image = TRUE;
-		e_image_chooser_set_image_data (E_IMAGE_CHOOSER (widget),
+		e_image_chooser_set_image_data (E_IMAGE_CHOOSER (me->image_chooser),
 						(char *) photo->data.inlined.data, photo->data.inlined.length);
 		e_contact_photo_free (photo);
 	} else {
@@ -567,8 +567,7 @@ about_me_load_photo (GnomeAboutMe *me, EContact *contact)
 static void
 about_me_update_photo (GnomeAboutMe *me)
 {
-	GtkWidget     *widget;
-	GladeXML      *dialog;
+	GtkBuilder    *dialog;
 	EContactPhoto *photo;
 	gchar         *file;
 	GError        *error;
@@ -586,8 +585,7 @@ about_me_update_photo (GnomeAboutMe *me)
 		gboolean do_scale = FALSE;
 		float scale;
 
-		widget = WID ("image-chooser");
-		e_image_chooser_get_image_data (E_IMAGE_CHOOSER (widget), (char **) &data, &length);
+		e_image_chooser_get_image_data (E_IMAGE_CHOOSER (me->image_chooser), (char **) &data, &length);
 
 		/* Before updating the image in EDS scale it to a reasonable size
 		   so that the user doesn't get an application that does not respond
@@ -689,19 +687,6 @@ about_me_load_info (GnomeAboutMe *me)
 			       me->disable_fingerprint_button);
 }
 
-GtkWidget *
-eab_create_image_chooser_widget (gchar *name,
-				 gchar *string1, gchar *string2,
-				 gint int1, gint int2)
-{
-	GtkWidget *w = NULL;
-
-	w = e_image_chooser_new ();
-	gtk_widget_show_all (w);
-
-	return w;
-}
-
 static void
 about_me_update_preview (GtkFileChooser *chooser,
 			 GnomeAboutMe   *me)
@@ -762,15 +747,13 @@ about_me_image_clicked_cb (GtkWidget *button, GnomeAboutMe *me)
 {
 	GtkFileChooser *chooser_dialog;
 	gint response;
-	GtkWidget *image_chooser;
-	GladeXML *dialog;
-	GtkWidget *image;
+	GtkBuilder *dialog;
+	GtkWidget  *image;
 	const gchar *chooser_dir = DATADIR"/pixmaps/faces";
 	const gchar *pics_dir;
 	GtkFileFilter *filter;
 
 	dialog = me->dialog;
-	image_chooser = WID ("image-chooser");
 
 	chooser_dialog = GTK_FILE_CHOOSER (
 			 gtk_file_chooser_dialog_new (_("Select Image"), GTK_WINDOW (WID ("about-me-dialog")),
@@ -820,13 +803,13 @@ about_me_image_clicked_cb (GtkWidget *button, GnomeAboutMe *me)
 		me->have_image = TRUE;
 		me->image_changed = TRUE;
 
-		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (image_chooser), filename);
+		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), filename);
 		g_free (filename);
 		about_me_update_photo (me);
 	} else if (response == GTK_RESPONSE_NO) {
 		me->have_image = FALSE;
 		me->image_changed = TRUE;
-		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (image_chooser), me->person);
+		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), me->person);
 		about_me_update_photo (me);
 	}
 
@@ -847,9 +830,7 @@ static void
 about_me_icon_theme_changed (GtkWindow    *window,
 			     GtkIconTheme *theme)
 {
-	GtkWidget   *widget;
 	GtkIconInfo *icon;
-	GladeXML    *dialog;
 
 	icon = gtk_icon_theme_lookup_icon (me->theme, "stock_person", 80, 0);
 	if (icon == NULL) {
@@ -860,12 +841,8 @@ about_me_icon_theme_changed (GtkWindow    *window,
 
 	gtk_icon_info_free (icon);
 
-	if (me->have_image) {
-		dialog = me->dialog;
-
-		widget = WID ("image-chooser");
-		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (widget), me->person);
-	}
+	if (me->have_image)
+		e_image_chooser_set_from_file (E_IMAGE_CHOOSER (me->image_chooser), me->person);
 }
 
 static void
@@ -887,7 +864,7 @@ about_me_button_clicked_cb (GtkDialog *dialog, gint response_id, GnomeAboutMe *m
 static void
 about_me_passwd_clicked_cb (GtkWidget *button, GnomeAboutMe *me)
 {
-	GladeXML *dialog;
+	GtkBuilder *dialog;
 
 	dialog = me->dialog;
 	gnome_about_me_password (GTK_WINDOW (WID ("about-me-dialog")));
@@ -907,7 +884,7 @@ about_me_setup_dialog (void)
 	GtkWidget    *widget;
 	GtkWidget    *main_dialog;
 	GtkIconInfo  *icon;
-	GladeXML     *dialog;
+	GtkBuilder   *dialog;
 	GError 	     *error = NULL;
 	GList        *chain;
 
@@ -917,8 +894,11 @@ about_me_setup_dialog (void)
 
 	me = g_new0 (GnomeAboutMe, 1);
 
-	dialog = glade_xml_new (GNOMECC_GLADE_DIR "/gnome-about-me.glade",
-				"about-me-dialog", NULL);
+	dialog = gtk_builder_new ();
+	gtk_builder_add_from_file (dialog, GNOMECC_UI_DIR "/gnome-about-me-dialog.ui", NULL);
+    
+	me->image_chooser = e_image_chooser_new ();
+	gtk_container_add (GTK_CONTAINER (WID ("button-image")), me->image_chooser);
 
 	if (dialog == NULL) {
 		about_me_destroy (me);
@@ -1053,8 +1033,7 @@ about_me_setup_dialog (void)
 	g_signal_connect (me->disable_fingerprint_button, "clicked",
 			  G_CALLBACK (about_me_fingerprint_button_clicked_cb), me);
 
-	widget = WID ("image-chooser");
-	g_signal_connect (widget, "changed",
+	g_signal_connect (me->image_chooser, "changed",
 			  G_CALLBACK (about_me_image_changed_cb), me);
 
 	/* Address tab: set up the focus chains */
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 5300902..a4f6855 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -5,11 +5,12 @@ capplets/about-me/eel-alert-dialog.c
 capplets/about-me/e-image-chooser.c
 capplets/about-me/fingerprint-strings.h
 capplets/about-me/gnome-about-me.c
+capplets/about-me/gnome-about-me-dialog.ui
 capplets/about-me/gnome-about-me.desktop.in.in
 capplets/about-me/gnome-about-me-fingerprint.c
-capplets/about-me/gnome-about-me-fingerprint.glade
-capplets/about-me/gnome-about-me.glade
+capplets/about-me/gnome-about-me-fingerprint.ui
 capplets/about-me/gnome-about-me-password.c
+capplets/about-me/gnome-about-me-password.ui
 [type: gettext/glade]capplets/accessibility/at-properties/at-enable-dialog.ui
 capplets/accessibility/at-properties/at-properties.desktop.in.in
 capplets/accessibility/at-properties/main.c



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