gossip r2708 - in trunk: . data/glade libgossip src



Author: mr
Date: Sat Jan 12 20:28:31 2008
New Revision: 2708
URL: http://svn.gnome.org/viewvc/gossip?rev=2708&view=rev

Log:
Fixes bug 400132, Use about-me information when creating accounts


Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/data/glade/main.glade
   trunk/libgossip/Makefile.am
   trunk/src/gossip-account-widget-jabber.c
   trunk/src/gossip-vcard-dialog.c

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sat Jan 12 20:28:31 2008
@@ -183,13 +183,41 @@
 
 if test "x$enable_gnome_keyring" = "xyes"; then
 	if test "x$have_gnome_keyring" != "xyes"; then
-		AC_MSG_ERROR([Couldn't find GNOME Keyring.])
+		AC_MSG_ERROR([Could not find GNOME Keyring.])
 	fi
 fi
 
 AM_CONDITIONAL(HAVE_GNOME_KEYRING, test x$have_gnome_keyring = xyes)
 
 dnl -----------------------------------------------------------
+dnl EBook (Evolution and GNOME about me)
+dnl -----------------------------------------------------------
+AC_ARG_ENABLE(ebook,
+              AS_HELP_STRING([--enable-ebook=@<:@no/yes/auto@:>@],
+                             [compile with ebook support]), ,
+              enable_ebook=auto)
+
+if test "x$enable_ebook" != "xno"; then
+        ebook_pkgconfig_tmp="libebook-1.2"
+   	PKG_CHECK_MODULES(EBOOK, $ebook_pkgconfig_tmp, have_ebook=yes, have_ebook=no)
+   	if test "x$have_ebook" = "xyes"; then
+      	   	AC_DEFINE(HAVE_EBOOK, 1, [libebook support])
+      		ebook_pkgconfig=$ebook_pkgconfig_tmp
+	fi
+else
+	have_ebook=no
+	ebook_pkgconfig=
+fi
+
+if test "x$enable_ebook" = "xyes"; then
+   	if test "x$have_ebook" != "xyes"; then
+      	   	AC_MSG_ERROR([Couldn't find libebook.])
+   	fi
+fi
+
+AM_CONDITIONAL(HAVE_EBOOK, test x$have_ebook = xyes)
+
+dnl -----------------------------------------------------------
 dnl ISO codes, used for aspell support
 dnl -----------------------------------------------------------
 AC_MSG_CHECKING([whether iso-codes exists and has iso-639 domain])
@@ -220,6 +248,7 @@
    $dbus_pkgconfig
    $gnome_vfs_pkgconfig
    $gnome_keyring_pkgconfig
+   $ebook_pkgconfig
 ])
 
 PKG_CHECK_MODULES(LIBLOUDERMOUTH, 
@@ -414,6 +443,7 @@
 echo "  Galago:        $have_galago"
 echo "  Notify:        $have_libnotify"
 echo "  GNOME Keyring: $have_gnome_keyring (only with GNOME)"
+echo "  EBook:         $have_ebook (only with GNOME)"
 echo "  XSS:           $have_xss (only with GNOME)"
 echo "  ASpell:        $have_aspell"
 echo

Modified: trunk/data/glade/main.glade
==============================================================================
--- trunk/data/glade/main.glade	(original)
+++ trunk/data/glade/main.glade	Sat Jan 12 20:28:31 2008
@@ -2377,6 +2377,210 @@
 	  </child>
 
 	  <child>
+	    <widget class="GtkVBox" id="vbox_ebook">
+	      <property name="visible">True</property>
+	      <property name="homogeneous">False</property>
+	      <property name="spacing">16</property>
+
+	      <child>
+		<widget class="GtkHSeparator" id="hseparator3">
+		  <property name="visible">True</property>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkTable" id="table_ebook">
+		  <property name="visible">True</property>
+		  <property name="n_rows">2</property>
+		  <property name="n_columns">3</property>
+		  <property name="homogeneous">False</property>
+		  <property name="row_spacing">12</property>
+		  <property name="column_spacing">12</property>
+
+		  <child>
+		    <widget class="GtkImage" id="image_ebook">
+		      <property name="visible">True</property>
+		      <property name="stock">gtk-dialog-info</property>
+		      <property name="icon_size">6</property>
+		      <property name="xalign">1</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkButton" id="button_ebook_retrieve">
+		      <property name="visible">True</property>
+		      <property name="can_default">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+
+		      <child>
+			<widget class="GtkAlignment" id="alignment34">
+			  <property name="visible">True</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xscale">0</property>
+			  <property name="yscale">0</property>
+			  <property name="top_padding">0</property>
+			  <property name="bottom_padding">0</property>
+			  <property name="left_padding">0</property>
+			  <property name="right_padding">0</property>
+
+			  <child>
+			    <widget class="GtkHBox" id="hbox194">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">2</property>
+
+			      <child>
+				<widget class="GtkImage" id="image901">
+				  <property name="visible">True</property>
+				  <property name="stock">gtk-convert</property>
+				  <property name="icon_size">4</property>
+				  <property name="xalign">0.5</property>
+				  <property name="yalign">0.5</property>
+				  <property name="xpad">0</property>
+				  <property name="ypad">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+
+			      <child>
+				<widget class="GtkLabel" id="label650">
+				  <property name="visible">True</property>
+				  <property name="label" translatable="yes">_Retrieve From Desktop</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+				  <property name="width_chars">-1</property>
+				  <property name="single_line_mode">False</property>
+				  <property name="angle">0</property>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
+			    </widget>
+			  </child>
+			</widget>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">2</property>
+		      <property name="right_attach">3</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="GtkLabel" id="label651">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Your desktop personal information can be used here to fill in the details below.
+Similarly, you can choose to set this information which is used by the email 
+client and other desktop applications. </property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">True</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">3</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="GtkCheckButton" id="checkbutton_ebook_sync">
+		      <property name="visible">True</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Synchroni_ze when saving</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">True</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="y_options"></property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="padding">0</property>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkHSeparator" id="hseparator2">
+		  <property name="visible">True</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>
+
+	  <child>
 	    <widget class="GtkVBox" id="vbox_details">
 	      <property name="visible">True</property>
 	      <property name="homogeneous">False</property>
@@ -2389,9 +2593,9 @@
 		  <property name="spacing">18</property>
 
 		  <child>
-		    <widget class="GtkTable" id="table">
+		    <widget class="GtkTable" id="table14">
 		      <property name="visible">True</property>
-		      <property name="n_rows">7</property>
+		      <property name="n_rows">5</property>
 		      <property name="n_columns">2</property>
 		      <property name="homogeneous">False</property>
 		      <property name="row_spacing">6</property>
@@ -2427,6 +2631,30 @@
 		      </child>
 
 		      <child>
+			<widget class="GtkEntry" id="entry_name">
+			  <property name="visible">True</property>
+			  <property name="tooltip" translatable="yes">This name will be used to identify you when new contacts lookup your details</property>
+			  <property name="can_focus">True</property>
+			  <property name="has_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">*</property>
+			  <property name="activates_default">False</property>
+			  <property name="width_chars">22</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">0</property>
+			  <property name="bottom_attach">1</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+
+		      <child>
 			<widget class="GtkLabel" id="label_nickname">
 			  <property name="visible">True</property>
 			  <property name="label" translatable="yes">_Nickname:</property>
@@ -2507,6 +2735,27 @@
 		      </child>
 
 		      <child>
+			<widget class="GtkEntry" id="entry_email">
+			  <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">*</property>
+			  <property name="activates_default">False</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">2</property>
+			  <property name="bottom_attach">3</property>
+			  <property name="y_options"></property>
+			</packing>
+		      </child>
+
+		      <child>
 			<widget class="GtkLabel" id="label_web_site">
 			  <property name="visible">True</property>
 			  <property name="label" translatable="yes">_Web site:</property>
@@ -2536,27 +2785,6 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkEntry" id="entry_email">
-			  <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">*</property>
-			  <property name="activates_default">False</property>
-			</widget>
-			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">2</property>
-			  <property name="top_attach">2</property>
-			  <property name="bottom_attach">3</property>
-			  <property name="y_options"></property>
-			</packing>
-		      </child>
-
-		      <child>
 			<widget class="GtkEntry" id="entry_web_site">
 			  <property name="visible">True</property>
 			  <property name="can_focus">True</property>
@@ -2578,42 +2806,18 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkEntry" id="entry_name">
-			  <property name="visible">True</property>
-			  <property name="tooltip" translatable="yes">This name will be used to identify you when new contacts lookup your details</property>
-			  <property name="can_focus">True</property>
-			  <property name="has_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">*</property>
-			  <property name="activates_default">False</property>
-			  <property name="width_chars">22</property>
-			</widget>
-			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">2</property>
-			  <property name="top_attach">0</property>
-			  <property name="bottom_attach">1</property>
-			  <property name="y_options"></property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkLabel" id="label_avatar">
+			<widget class="GtkLabel" id="label_birthday">
 			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">Avatar:</property>
+			  <property name="label" translatable="yes">_Birthday:</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</property>
+			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
-			  <property name="ypad">5</property>
+			  <property name="ypad">0</property>
 			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 			  <property name="width_chars">-1</property>
 			  <property name="single_line_mode">False</property>
@@ -2622,80 +2826,84 @@
 			<packing>
 			  <property name="left_attach">0</property>
 			  <property name="right_attach">1</property>
-			  <property name="top_attach">5</property>
-			  <property name="bottom_attach">6</property>
+			  <property name="top_attach">4</property>
+			  <property name="bottom_attach">5</property>
 			  <property name="x_options">fill</property>
-			  <property name="y_options">fill</property>
+			  <property name="y_options"></property>
 			</packing>
 		      </child>
 
 		      <child>
-			<widget class="GtkAlignment" id="alignment10">
+			<widget class="GtkHBox" id="hbox173">
 			  <property name="visible">True</property>
-			  <property name="xalign">0</property>
-			  <property name="yalign">0</property>
-			  <property name="xscale">0</property>
-			  <property name="yscale">0</property>
-			  <property name="top_padding">0</property>
-			  <property name="bottom_padding">0</property>
-			  <property name="left_padding">0</property>
-			  <property name="right_padding">0</property>
+			  <property name="homogeneous">False</property>
+			  <property name="spacing">6</property>
 
 			  <child>
-			    <widget class="GtkButton" id="button_image">
+			    <widget class="GtkEntry" id="entry_birthday">
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
-			      <property name="relief">GTK_RELIEF_NORMAL</property>
-			      <property name="focus_on_click">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">â</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>
+
+			  <child>
+			    <widget class="GtkHBox" id="hbox_birthday_placeholder">
+			      <property name="visible">True</property>
+			      <property name="homogeneous">False</property>
+			      <property name="spacing">0</property>
 
 			      <child>
 				<placeholder/>
 			      </child>
 			    </widget>
+			    <packing>
+			      <property name="padding">0</property>
+			      <property name="expand">True</property>
+			      <property name="fill">True</property>
+			    </packing>
 			  </child>
 			</widget>
 			<packing>
 			  <property name="left_attach">1</property>
 			  <property name="right_attach">2</property>
-			  <property name="top_attach">5</property>
-			  <property name="bottom_attach">6</property>
-			  <property name="x_options">fill</property>
-			  <property name="y_options">fill</property>
-			</packing>
-		      </child>
-
-		      <child>
-			<widget class="GtkLabel" id="label_birthday">
-			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">_Birthday:</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-			  <property name="width_chars">-1</property>
-			  <property name="single_line_mode">False</property>
-			  <property name="angle">0</property>
-			</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>
+			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">True</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkTable" id="table15">
+		      <property name="visible">True</property>
+		      <property name="n_rows">2</property>
+		      <property name="n_columns">2</property>
+		      <property name="homogeneous">False</property>
+		      <property name="row_spacing">6</property>
+		      <property name="column_spacing">12</property>
 
 		      <child>
 			<widget class="GtkScrolledWindow" id="scrolledwindow7">
-			  <property name="width_request">150</property>
-			  <property name="height_request">59</property>
+			  <property name="width_request">200</property>
 			  <property name="visible">True</property>
 			  <property name="can_focus">True</property>
 			  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
@@ -2726,8 +2934,8 @@
 			<packing>
 			  <property name="left_attach">1</property>
 			  <property name="right_attach">2</property>
-			  <property name="top_attach">6</property>
-			  <property name="bottom_attach">7</property>
+			  <property name="top_attach">0</property>
+			  <property name="bottom_attach">1</property>
 			  <property name="x_options">fill</property>
 			  <property name="y_options">fill</property>
 			</packing>
@@ -2755,43 +2963,25 @@
 			<packing>
 			  <property name="left_attach">0</property>
 			  <property name="right_attach">1</property>
-			  <property name="top_attach">6</property>
-			  <property name="bottom_attach">7</property>
+			  <property name="top_attach">0</property>
+			  <property name="bottom_attach">1</property>
+			  <property name="y_padding">5</property>
 			  <property name="x_options">fill</property>
-			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
 
 		      <child>
-			<widget class="GtkHBox" id="hbox173">
+			<widget class="GtkHBox" id="hbox193">
 			  <property name="visible">True</property>
 			  <property name="homogeneous">False</property>
-			  <property name="spacing">6</property>
+			  <property name="spacing">0</property>
 
 			  <child>
-			    <widget class="GtkEntry" id="entry_birthday">
+			    <widget class="GtkButton" id="button_image">
 			      <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">â</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>
-
-			  <child>
-			    <widget class="GtkHBox" id="box_birthday_placeholder">
-			      <property name="visible">True</property>
-			      <property name="homogeneous">False</property>
-			      <property name="spacing">0</property>
+			      <property name="relief">GTK_RELIEF_NORMAL</property>
+			      <property name="focus_on_click">True</property>
 
 			      <child>
 				<placeholder/>
@@ -2799,16 +2989,49 @@
 			    </widget>
 			    <packing>
 			      <property name="padding">0</property>
-			      <property name="expand">True</property>
-			      <property name="fill">True</property>
+			      <property name="expand">False</property>
+			      <property name="fill">False</property>
 			    </packing>
 			  </child>
+
+			  <child>
+			    <placeholder/>
+			  </child>
 			</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="top_attach">1</property>
+			  <property name="bottom_attach">2</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label_avatar">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">A_vatar:</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</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">5</property>
+			  <property name="mnemonic_widget">button_image</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">0</property>
+			  <property name="right_attach">1</property>
+			  <property name="top_attach">1</property>
+			  <property name="bottom_attach">2</property>
 			  <property name="x_options">fill</property>
 			  <property name="y_options">fill</property>
 			</packing>
@@ -2816,15 +3039,15 @@
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
-		      <property name="expand">False</property>
-		      <property name="fill">False</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>
+		  <property name="expand">True</property>
+		  <property name="fill">True</property>
 		</packing>
 	      </child>
 	    </widget>
@@ -7173,17 +7396,17 @@
       </child>
 
       <child>
-	<widget class="GtkHBox" id="hbox174">
+	<widget class="GtkHBox" id="hbox191">
 	  <property name="visible">True</property>
 	  <property name="homogeneous">False</property>
 	  <property name="spacing">2</property>
 
 	  <child>
-	    <widget class="GtkEntry" id="entry_password">
+	    <widget class="GtkEntry" id="entry_id">
 	      <property name="visible">True</property>
 	      <property name="can_focus">True</property>
 	      <property name="editable">True</property>
-	      <property name="visibility">False</property>
+	      <property name="visibility">True</property>
 	      <property name="max_length">0</property>
 	      <property name="text" translatable="yes"></property>
 	      <property name="has_frame">True</property>
@@ -7198,17 +7421,17 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkButton" id="button_forget">
+	    <widget class="GtkButton" id="button_ebook_retrieve">
 	      <property name="visible">True</property>
-	      <property name="tooltip" translatable="yes">Forget password and clear the entry.</property>
+	      <property name="tooltip" translatable="yes">Populate from your desktop personal details (set in the Evolution email client or the About Me application).</property>
 	      <property name="can_focus">True</property>
 	      <property name="relief">GTK_RELIEF_NORMAL</property>
 	      <property name="focus_on_click">True</property>
 
 	      <child>
-		<widget class="GtkImage" id="image834">
+		<widget class="GtkImage" id="image900">
 		  <property name="visible">True</property>
-		  <property name="stock">gtk-clear</property>
+		  <property name="stock">gtk-convert</property>
 		  <property name="icon_size">1</property>
 		  <property name="xalign">0.5</property>
 		  <property name="yalign">0.5</property>
@@ -7227,19 +7450,19 @@
 	<packing>
 	  <property name="left_attach">1</property>
 	  <property name="right_attach">2</property>
-	  <property name="top_attach">1</property>
-	  <property name="bottom_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">fill</property>
 	</packing>
       </child>
 
       <child>
-	<widget class="GtkButton" id="button_change_password">
+	<widget class="GtkButton" id="button_register">
 	  <property name="visible">True</property>
-	  <property name="sensitive">False</property>
+	  <property name="tooltip" translatable="yes">Register this account with the Jabber server. If this is a new account, you will need to click on this first before connecting.</property>
 	  <property name="can_focus">True</property>
-	  <property name="label" translatable="yes">C_hange</property>
+	  <property name="label" translatable="yes">R_egister</property>
 	  <property name="use_underline">True</property>
 	  <property name="relief">GTK_RELIEF_NORMAL</property>
 	  <property name="focus_on_click">True</property>
@@ -7247,39 +7470,81 @@
 	<packing>
 	  <property name="left_attach">2</property>
 	  <property name="right_attach">3</property>
-	  <property name="top_attach">1</property>
-	  <property name="bottom_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="GtkEntry" id="entry_id">
+	<widget class="GtkHBox" id="hbox174">
 	  <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">*</property>
-	  <property name="activates_default">False</property>
+	  <property name="homogeneous">False</property>
+	  <property name="spacing">2</property>
+
+	  <child>
+	    <widget class="GtkEntry" id="entry_password">
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="editable">True</property>
+	      <property name="visibility">False</property>
+	      <property name="max_length">0</property>
+	      <property name="text" translatable="yes"></property>
+	      <property name="has_frame">True</property>
+	      <property name="invisible_char">*</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>
+
+	  <child>
+	    <widget class="GtkButton" id="button_forget">
+	      <property name="visible">True</property>
+	      <property name="tooltip" translatable="yes">Forget password and clear the entry.</property>
+	      <property name="can_focus">True</property>
+	      <property name="relief">GTK_RELIEF_NORMAL</property>
+	      <property name="focus_on_click">True</property>
+
+	      <child>
+		<widget class="GtkImage" id="image834">
+		  <property name="visible">True</property>
+		  <property name="stock">gtk-clear</property>
+		  <property name="icon_size">1</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		</widget>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="padding">0</property>
+	      <property name="expand">False</property>
+	      <property name="fill">False</property>
+	    </packing>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="left_attach">1</property>
 	  <property name="right_attach">2</property>
-	  <property name="top_attach">0</property>
-	  <property name="bottom_attach">1</property>
-	  <property name="y_options"></property>
+	  <property name="top_attach">1</property>
+	  <property name="bottom_attach">2</property>
+	  <property name="x_options">fill</property>
+	  <property name="y_options">fill</property>
 	</packing>
       </child>
 
       <child>
-	<widget class="GtkButton" id="button_register">
+	<widget class="GtkButton" id="button_change_password">
 	  <property name="visible">True</property>
+	  <property name="sensitive">False</property>
 	  <property name="can_focus">True</property>
-	  <property name="label" translatable="yes">R_egister</property>
+	  <property name="label" translatable="yes">C_hange</property>
 	  <property name="use_underline">True</property>
 	  <property name="relief">GTK_RELIEF_NORMAL</property>
 	  <property name="focus_on_click">True</property>
@@ -7287,8 +7552,8 @@
 	<packing>
 	  <property name="left_attach">2</property>
 	  <property name="right_attach">3</property>
-	  <property name="top_attach">0</property>
-	  <property name="bottom_attach">1</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>

Modified: trunk/libgossip/Makefile.am
==============================================================================
--- trunk/libgossip/Makefile.am	(original)
+++ trunk/libgossip/Makefile.am	Sat Jan 12 20:28:31 2008
@@ -33,7 +33,14 @@
 libgossip_la_LDFLAGS = -lregex
 endif
 
+if HAVE_EBOOK
+ebook_sources =						\
+	gossip-ebook.h					\
+	gossip-ebook.c
+endif
+
 libgossip_la_SOURCES =             			\
+	$(ebook_sources)				\
 	gossip-account.c           			\
 	gossip-account.h           			\
 	gossip-account-manager.c   			\

Modified: trunk/src/gossip-account-widget-jabber.c
==============================================================================
--- trunk/src/gossip-account-widget-jabber.c	(original)
+++ trunk/src/gossip-account-widget-jabber.c	Sat Jan 12 20:28:31 2008
@@ -36,6 +36,10 @@
 #include <libgossip/gossip-account-manager.h>
 #include <libgossip/gossip-debug.h>
 
+#ifdef HAVE_EBOOK
+#include <libgossip/gossip-ebook.h>
+#endif
+
 #include "gossip-account-widget-jabber.h"
 #include "gossip-app.h"
 #include "gossip-glade.h"
@@ -54,6 +58,7 @@
 
 	GtkWidget     *vbox_settings;
 
+	GtkWidget     *button_ebook_retrieve;
 	GtkWidget     *button_register;
 
 	GtkWidget     *button_forget;
@@ -115,6 +120,10 @@
 									 GossipAccountWidgetJabber      *settings);
 static void     account_widget_jabber_button_register_clicked_cb        (GtkWidget                      *button,
 									 GossipAccountWidgetJabber      *settings);
+static void
+                account_widget_jabber_button_ebook_retrieve_clicked_cb  (GtkWidget                      *button,
+									 GossipAccountWidgetJabber      *settings);
+
 static void     account_widget_jabber_button_forget_clicked_cb          (GtkWidget                      *button,
 									 GossipAccountWidgetJabber      *settings);
 static void     account_widget_jabber_cp_entry_activate_cb              (GtkWidget                      *entry,
@@ -154,6 +163,7 @@
 				       "vbox_jabber_settings",
 				       NULL,
 				       "vbox_jabber_settings", &priv->vbox_settings,
+				       "button_ebook_retrieve", &priv->button_ebook_retrieve,
 				       "button_register", &priv->button_register,
 				       "button_forget", &priv->button_forget,
 				       "button_change_password", &priv->button_change_password,
@@ -172,6 +182,7 @@
 
 	gossip_glade_connect (glade, 
 			      settings,
+			      "button_ebook_retrieve", "clicked", account_widget_jabber_button_ebook_retrieve_clicked_cb,
 			      "button_register", "clicked", account_widget_jabber_button_register_clicked_cb,
 			      "button_forget", "clicked", account_widget_jabber_button_forget_clicked_cb,
 			      "button_change_password", "clicked", account_widget_jabber_button_change_password_clicked_cb,
@@ -185,6 +196,10 @@
 
 	g_object_unref (glade);
 
+#ifdef HAVE_EBOOK
+	gtk_widget_show (priv->button_ebook_retrieve);
+#endif
+
 	/* We do this manually so we can block it. */
 	g_signal_connect (priv->checkbutton_ssl, "toggled", 
 			  G_CALLBACK (account_widget_jabber_checkbutton_toggled_cb),
@@ -680,6 +695,24 @@
 }
 
 static void
+account_widget_jabber_button_ebook_retrieve_clicked_cb (GtkWidget                 *button,
+							GossipAccountWidgetJabber *settings)
+{
+#ifdef HAVE_EBOOK
+	GossipAccountWidgetJabberPriv *priv;
+	gchar                         *str;
+
+	priv = GET_PRIV (settings);
+
+	str = gossip_ebook_get_jabber_id ();
+	if (!G_STR_EMPTY (str)) {
+		gtk_entry_set_text (GTK_ENTRY (priv->entry_id), str);
+	}
+	g_free (str);
+#endif
+}
+
+static void
 account_widget_jabber_button_register_clicked_cb (GtkWidget                 *button,
 						  GossipAccountWidgetJabber *settings)
 {
@@ -924,6 +957,7 @@
 	const gchar                   *resource;
 	const gchar                   *server;
 	const gchar                   *password;
+	gchar                         *ebook_id = NULL;
 	gboolean                       use_ssl;
 	gboolean                       is_connected;
 
@@ -950,6 +984,12 @@
 		gtk_widget_set_sensitive (priv->checkbutton_ssl, FALSE);
 	}
 
+#ifdef HAVE_EBOOK
+	if (G_STR_EMPTY (id)) {
+		ebook_id = gossip_ebook_get_jabber_id ();
+	}
+#endif
+
 	g_signal_handlers_block_by_func (priv->entry_id, 
 					 account_widget_jabber_entry_changed_cb, 
 					 settings);

Modified: trunk/src/gossip-vcard-dialog.c
==============================================================================
--- trunk/src/gossip-vcard-dialog.c	(original)
+++ trunk/src/gossip-vcard-dialog.c	Sat Jan 12 20:28:31 2008
@@ -43,6 +43,10 @@
 #include <libgossip/gossip-account.h>
 #include <libgossip/gossip-debug.h>
 
+#ifdef HAVE_EBOOK
+#include <libgossip/gossip-ebook.h>
+#endif
+
 #include "gossip-account-chooser.h"
 #include "gossip-app.h"
 #include "gossip-glade.h"
@@ -67,6 +71,10 @@
 	GtkWidget *label_account;
 	GtkWidget *account_chooser;
 
+	GtkWidget *vbox_ebook;
+	GtkWidget *checkbutton_ebook_sync;
+	GtkWidget *button_ebook_retrieve;
+
 	GtkWidget *vbox_details;
 
 	GtkWidget *label_name;
@@ -103,43 +111,43 @@
 #endif
 } GossipVCardDialog;
 
-static void       vcard_dialog_create_avatar_chooser      (GossipVCardDialog *dialog);
-static void       vcard_dialog_avatar_chooser_response_cb (GtkWidget         *widget,
-							   gint               response,
-							   GossipVCardDialog *dialog);
-static void       vcard_dialog_avatar_clicked_cb          (GtkWidget         *button,
-							   GossipVCardDialog *dialog);
-static void       vcard_dialog_avatar_update_preview_cb   (GtkFileChooser    *chooser,
-							   GossipVCardDialog *dialog);
-static GtkWidget *vcard_dialog_birthday_button_popup_cb   (GossipPopupButton *popup_button,
-							   GossipVCardDialog *dialog);
-static void       vcard_dialog_birthday_button_popdown_cb (GossipPopupButton *popup_button,
-							   GtkWidget         *widget,
-							   gboolean           ok,
-							   GossipVCardDialog *dialog);
-static gboolean   vcard_dialog_birthday_parse_string      (const gchar       *str,
-							   gint              *year,
-							   gint              *month,
-							   gint              *day);
-static gchar *    vcard_dialog_birthday_string_to_server  (const gchar       *str);
-static gchar *    vcard_dialog_birthday_string_from_server(const gchar       *str);
-static void       vcard_dialog_set_account_to_last        (GossipVCardDialog *dialog);
-static void       vcard_dialog_lookup_start               (GossipVCardDialog *dialog);
-static void       vcard_dialog_lookup_stop                (GossipVCardDialog *dialog);
-static void       vcard_dialog_get_vcard_cb               (GossipResult       result,
-							   GossipVCard       *vcard,
-							   GossipVCardDialog *dialog);
-static void       vcard_dialog_set_vcard                  (GossipVCardDialog *dialog);
-static void       vcard_dialog_set_vcard_cb               (GossipResult       result,
-							   gpointer           user_data);
-static gboolean   vcard_dialog_timeout_cb                 (GossipVCardDialog *dialog);
-static void       vcard_dialog_account_changed_cb         (GtkWidget         *combo_box,
-							   GossipVCardDialog *dialog);
-static void       vcard_dialog_response_cb                (GtkDialog         *widget,
-							   gint               response,
-							   GossipVCardDialog *dialog);
-static void       vcard_dialog_destroy_cb                 (GtkWidget         *widget,
-							   GossipVCardDialog *dialog);
+static void       vcard_dialog_create_avatar_chooser       (GossipVCardDialog *dialog);
+static void       vcard_dialog_avatar_chooser_response_cb  (GtkWidget         *widget,
+							    gint               response,
+							    GossipVCardDialog *dialog);
+static void       vcard_dialog_button_image_clicked_cb     (GtkWidget         *button,
+							    GossipVCardDialog *dialog);
+static void       vcard_dialog_avatar_update_preview_cb    (GtkFileChooser    *chooser,
+							    GossipVCardDialog *dialog);
+static GtkWidget *vcard_dialog_birthday_button_popup_cb    (GossipPopupButton *popup_button,
+							    GossipVCardDialog *dialog);
+static void       vcard_dialog_birthday_button_popdown_cb  (GossipPopupButton *popup_button,
+							    GtkWidget         *widget,
+							    gboolean           ok,
+							    GossipVCardDialog *dialog);
+static gboolean   vcard_dialog_birthday_parse_string       (const gchar       *str,
+							    gint              *year,
+							    gint              *month,
+							    gint              *day);
+static gchar *    vcard_dialog_birthday_string_to_server   (const gchar       *str);
+static gchar *    vcard_dialog_birthday_string_from_server (const gchar       *str);
+static void       vcard_dialog_set_account_to_last         (GossipVCardDialog *dialog);
+static void       vcard_dialog_lookup_start                (GossipVCardDialog *dialog);
+static void       vcard_dialog_lookup_stop                 (GossipVCardDialog *dialog);
+static void       vcard_dialog_get_vcard_cb                (GossipResult       result,
+							    GossipVCard       *vcard,
+							    GossipVCardDialog *dialog);
+static void       vcard_dialog_set_vcard                   (GossipVCardDialog *dialog);
+static void       vcard_dialog_set_vcard_cb                (GossipResult       result,
+							    gpointer           user_data);
+static gboolean   vcard_dialog_timeout_cb                  (GossipVCardDialog *dialog);
+static void       vcard_dialog_account_changed_cb          (GtkWidget         *combo_box,
+							    GossipVCardDialog *dialog);
+static void       vcard_dialog_response_cb                 (GtkDialog         *widget,
+							    gint               response,
+							    GossipVCardDialog *dialog);
+static void       vcard_dialog_destroy_cb                  (GtkWidget         *widget,
+							    GossipVCardDialog *dialog);
 
 static GossipVCardDialog *dialog = NULL;
 
@@ -164,6 +172,8 @@
 						&max_width, &max_height,
 						&max_size,  &dialog->avatar_format);
 
+	gossip_debug (DEBUG_DOMAIN, "Avatar format is '%s'", dialog->avatar_format);
+
 	gossip_image_chooser_set_requirements (GOSSIP_IMAGE_CHOOSER (dialog->avatar_chooser),
 					       min_width, min_height,
 					       max_width, max_height,
@@ -209,8 +219,8 @@
 }
 
 static void
-vcard_dialog_avatar_clicked_cb (GtkWidget         *button,
-				GossipVCardDialog *dialog)
+vcard_dialog_button_image_clicked_cb (GtkWidget         *button,
+				      GossipVCardDialog *dialog)
 {
 	GtkWidget *chooser_dialog;
 	gchar     *path;
@@ -232,8 +242,8 @@
 
 	gtk_window_set_transient_for (GTK_WINDOW (chooser_dialog),
 				      GTK_WINDOW (dialog->dialog));
-
-	gtk_dialog_set_default_response (GTK_DIALOG (chooser_dialog), GTK_RESPONSE_ACCEPT);
+	gtk_dialog_set_default_response (GTK_DIALOG (chooser_dialog), 
+					 GTK_RESPONSE_ACCEPT);
 
 	path = NULL;
 	gossip_conf_get_string (gossip_conf_get (),
@@ -262,7 +272,61 @@
 	gtk_widget_show (chooser_dialog);
 }
 
+static void
+vcard_dialog_button_ebook_retrieve_clicked_cb (GtkWidget         *button,
+					       GossipVCardDialog *dialog)
+{
+#ifdef HAVE_EBOOK
+	GossipAvatar *avatar;
+	gchar        *str;
+
+	/* Name */
+	str = gossip_ebook_get_name ();
+	if (!G_STR_EMPTY (str)) {
+		gtk_entry_set_text (GTK_ENTRY (dialog->entry_name), str);
+	}
+	g_free (str);
+
+	/* Nickname */
+	str = gossip_ebook_get_nickname ();
+	if (!G_STR_EMPTY (str)) {
+		gtk_entry_set_text (GTK_ENTRY (dialog->entry_nickname), str);
+	}
+	g_free (str);
+
+	/* Email */
+	str = gossip_ebook_get_email ();
+	if (!G_STR_EMPTY (str)) {
+		gtk_entry_set_text (GTK_ENTRY (dialog->entry_email), str);
+	}
+	g_free (str);
+
+	/* Web Site */
+	str = gossip_ebook_get_website ();
+	if (!G_STR_EMPTY (str)) {
+		gtk_entry_set_text (GTK_ENTRY (dialog->entry_web_site), str);
+	}
+	g_free (str);
+
+	/* Birthday */
+	str = gossip_ebook_get_birthdate ();
+	if (!G_STR_EMPTY (str)) {
+		gtk_entry_set_text (GTK_ENTRY (dialog->entry_birthday), str);
+	}
+	g_free (str);
+
+	/* Avatar */
+	avatar = gossip_ebook_get_avatar ();
+	if (avatar) {
+		gossip_image_chooser_set_image_data (GOSSIP_IMAGE_CHOOSER (dialog->avatar_chooser),
+						     (gchar*) avatar->data, avatar->len);
+		gossip_avatar_unref (avatar);
+	}
+#endif
+}
+
 #ifdef HAVE_PLATFORM_X11
+
 static GdkPixbuf *
 vcard_dialog_scale_down_to_width (GdkPixbuf *pixbuf, gint wanted_width)
 {
@@ -285,6 +349,7 @@
 
 	return g_object_ref (pixbuf);
 }
+
 #endif
 
 static void
@@ -332,7 +397,6 @@
 #endif
 }
 
-
 static void
 vcard_dialog_birthday_cancel_clicked_cb (GtkWidget         *button,
 					 GossipPopupButton *popup_button)
@@ -476,21 +540,19 @@
 	gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END);
 	gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0);
 
-	button = gtk_button_new_with_label (GTK_STOCK_CANCEL);
+	button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
 	gtk_container_add (GTK_CONTAINER (bbox), button);
-	g_signal_connect (button,
-			  "clicked",
+	g_signal_connect (button, "clicked",
 			  G_CALLBACK (vcard_dialog_birthday_cancel_clicked_cb),
 			  popup_button);
 
-	button = gtk_button_new_with_label (GTK_STOCK_OK);
+	button = gtk_button_new_from_stock (GTK_STOCK_OK);
 	gtk_container_add (GTK_CONTAINER (bbox), button);
 	g_signal_connect (button, "clicked",
 			  G_CALLBACK (vcard_dialog_birthday_ok_clicked_cb),
 			  popup_button);
 
-	g_signal_connect (dialog->calendar,
-			  "day-selected-double-click",
+	g_signal_connect (dialog->calendar, "day-selected-double-click",
 			  G_CALLBACK (vcard_dialog_birthday_double_click_cb),
 			  popup_button);
 
@@ -520,6 +582,7 @@
 	GossipAccountChooser *account_chooser;
 
 	gtk_widget_set_sensitive (dialog->vbox_details, FALSE);
+	gtk_widget_set_sensitive (dialog->vbox_ebook, FALSE);
 	gtk_widget_set_sensitive (dialog->account_chooser, FALSE);
 	gtk_widget_set_sensitive (dialog->button_save, FALSE);
 
@@ -549,6 +612,7 @@
 	dialog->requesting_vcard = FALSE;
 
 	gtk_widget_set_sensitive (dialog->vbox_details, TRUE);
+	gtk_widget_set_sensitive (dialog->vbox_ebook, TRUE);
 	gtk_widget_set_sensitive (dialog->account_chooser, TRUE);
 	gtk_widget_set_sensitive (dialog->button_save, TRUE);
 
@@ -580,34 +644,40 @@
 		gossip_debug (DEBUG_DOMAIN, "Received VCard response was not good");
 		return;
 	}
-
+	
+	/* Retrieve the username */
 	str = gossip_vcard_get_name (vcard);
 	gtk_entry_set_text (GTK_ENTRY (dialog->entry_name), G_STR_EMPTY (str) ? "" : str);
 
+	/* Retrieve the nickname */
 	str = gossip_vcard_get_nickname (vcard);
 	gtk_entry_set_text (GTK_ENTRY (dialog->entry_nickname), G_STR_EMPTY (str) ? "" : str);
 
+	/* Retrieve the birthdate */
 	str = gossip_vcard_get_birthday (vcard);
 	if (str) {
 		gchar *date;
 
-		date = vcard_dialog_birthday_string_from_server (str);
+		date = vcard_dialog_birthday_string_from_server (str);	    
 		gtk_entry_set_text (GTK_ENTRY (dialog->entry_birthday), G_STR_EMPTY (date) ? "" : date);
 		g_free (date);
 	}
 
+	/* Retrieve the email address */
 	str = gossip_vcard_get_email (vcard);
 	gtk_entry_set_text (GTK_ENTRY (dialog->entry_email), G_STR_EMPTY (str) ? "" : str);
 
+	/* Retrieve website address */
 	str = gossip_vcard_get_url (vcard);
 	gtk_entry_set_text (GTK_ENTRY (dialog->entry_web_site), G_STR_EMPTY (str) ? "" : str);
-
+	
+	/* Retrieve user description */
 	str = gossip_vcard_get_description (vcard);
 	buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->textview_description));
 	gtk_text_buffer_set_text (buffer, G_STR_EMPTY (str) ? "" : str, -1);
 
+	/* Retrieve the users avatar */
 	avatar = gossip_vcard_get_avatar (vcard);
-
 	if (avatar) {
 		gossip_image_chooser_set_image_data (GOSSIP_IMAGE_CHOOSER (dialog->avatar_chooser),
 						     (gchar*) avatar->data, avatar->len);
@@ -622,6 +692,12 @@
 }
 
 static void
+vcard_dialog_set_vcard_finish (GossipVCardDialog *dialog)
+{
+	gtk_widget_set_sensitive (dialog->button_save, TRUE);
+}
+
+static void
 vcard_dialog_set_vcard_cb (GossipResult result,
 			   gpointer     user_data)
 {
@@ -631,86 +707,126 @@
 		return;
 	}
 
-	gtk_widget_destroy (dialog->dialog);
+ 	gtk_widget_destroy (dialog->dialog);
 }
 
 static void
 vcard_dialog_set_vcard (GossipVCardDialog *dialog)
 {
 	GossipVCard          *vcard;
-	GossipAccount        *account;
+	GossipAccount        *account = NULL;
 	GossipAccountChooser *account_chooser;
 	GossipJabber         *jabber;
 	GossipContact        *contact;
 	GError               *error = NULL;
 	GtkTextBuffer        *buffer;
 	GtkTextIter           iter_begin, iter_end;
-	gchar                *description;
-	const gchar          *str;
 	gchar                *avatar_data;
 	gsize                 avatar_size;
 	GossipAvatar         *avatar = NULL;
-	gchar                *birthday;
-
-	if (!gossip_app_is_connected ()) {
-		gossip_debug (DEBUG_DOMAIN, "Not connected, not setting VCard");
-		return;
-	}
-
-	vcard = gossip_vcard_new ();
-
-	str = gtk_entry_get_text (GTK_ENTRY (dialog->entry_name));
-	gossip_vcard_set_name (vcard, str);
-
-	str = gtk_entry_get_text (GTK_ENTRY (dialog->entry_nickname));
-	gossip_vcard_set_nickname (vcard, str);
-
-	str = gtk_entry_get_text (GTK_ENTRY (dialog->entry_birthday));
-	birthday = vcard_dialog_birthday_string_to_server (str);
-	if (birthday) {
-		gossip_vcard_set_birthday (vcard, birthday);
-		g_free (birthday);
-	}
+	const gchar          *name, *nickname, *birthday, *website, *email;
+	gchar                *description;
+	gchar                *birthday_formatted;
 
-	str = gtk_entry_get_text (GTK_ENTRY (dialog->entry_web_site));
-	gossip_vcard_set_url (vcard, str);
+	name = gtk_entry_get_text (GTK_ENTRY (dialog->entry_name));
+	nickname = gtk_entry_get_text (GTK_ENTRY (dialog->entry_nickname));
+	birthday = gtk_entry_get_text (GTK_ENTRY (dialog->entry_birthday));
+	website = gtk_entry_get_text (GTK_ENTRY (dialog->entry_web_site));
+	email = gtk_entry_get_text (GTK_ENTRY (dialog->entry_email));
 
-	str = gtk_entry_get_text (GTK_ENTRY (dialog->entry_email));
-	gossip_vcard_set_email (vcard, str);
+	birthday_formatted = vcard_dialog_birthday_string_to_server (birthday);
 
 	buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->textview_description));
 	gtk_text_buffer_get_bounds (buffer, &iter_begin, &iter_end);
 	description = gtk_text_buffer_get_text (buffer, &iter_begin, &iter_end, FALSE);
-	gossip_vcard_set_description (vcard, description);
-	g_free (description);
 
 	gossip_image_chooser_get_image_data (GOSSIP_IMAGE_CHOOSER (dialog->avatar_chooser),
 					     &avatar_data, &avatar_size);
 	if (avatar_data) {
 		avatar = gossip_avatar_new (avatar_data, avatar_size, dialog->avatar_format);
-		gossip_vcard_set_avatar (vcard, avatar);
 	}
 
-	/* NOTE: if account is NULL, all accounts will get the same vcard */
-	account_chooser = GOSSIP_ACCOUNT_CHOOSER (dialog->account_chooser);
-	account = gossip_account_chooser_get_account (account_chooser);
+#ifdef HAVE_EBOOK 
+	/* Set EDS data */
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->checkbutton_ebook_sync))) {
+		gossip_ebook_set_name (name);
+		gossip_ebook_set_nickname (nickname);
+		
+		/* FIXME: Finish, currently not supported */
+#if 0
+		if (birthday_formatted) {
+			gossip_ebook_set_birthday (birthday_formatted);
+		}
+#endif
+		
+		gossip_ebook_set_website (website);
+		gossip_ebook_set_email (email);
+		
+		/* FIXME: Finish, currently not supported */
+#if 0
+		gossip_ebook_set_description (description);
+#endif
+		
+		if (avatar) {
+			gossip_ebook_set_avatar (avatar);
+		}
+	} else {
+		gossip_debug (DEBUG_DOMAIN, "Not saving to EDS");
+	}
+#endif	
 
-	gossip_session_set_vcard (gossip_app_get_session (),
-				  account,
-				  vcard,
-				  (GossipCallback) vcard_dialog_set_vcard_cb,
-				  NULL, &error);
-
-	jabber = gossip_session_get_protocol (gossip_app_get_session (),
-					      account);
-	contact = gossip_jabber_get_own_contact (jabber);
-	gossip_contact_set_avatar (GOSSIP_CONTACT (contact), avatar);
+	/* Set VCard */
+	if (gossip_app_is_connected ()) {
+		vcard = gossip_vcard_new ();
+		
+		gossip_vcard_set_name (vcard, name);
+		gossip_vcard_set_nickname (vcard, nickname);
+		
+		if (birthday_formatted) {
+			gossip_vcard_set_birthday (vcard, birthday_formatted);
+		}
+		
+		gossip_vcard_set_url (vcard, website);
+		gossip_vcard_set_email (vcard, email);
+		gossip_vcard_set_description (vcard, description);
+		
+		if (avatar) {
+			gossip_vcard_set_avatar (vcard, avatar);
+		}
+		
+		/* Save VCard
+		 *
+		 * NOTE: if account is NULL, all accounts will get the same vcard 
+		 */
+		account_chooser = GOSSIP_ACCOUNT_CHOOSER (dialog->account_chooser);
+		account = gossip_account_chooser_get_account (account_chooser);
+		
+		gossip_session_set_vcard (gossip_app_get_session (),
+					  account,
+					  vcard,
+					  (GossipCallback) vcard_dialog_set_vcard_cb,
+					  NULL, &error);
+		
+		jabber = gossip_session_get_protocol (gossip_app_get_session (),
+						      account);
+		contact = gossip_jabber_get_own_contact (jabber);
+		gossip_contact_set_avatar (GOSSIP_CONTACT (contact), avatar);
+	} else {
+		gossip_debug (DEBUG_DOMAIN, "Not connected, not setting VCard");
+		vcard_dialog_set_vcard_finish (dialog);
+	}
+
+	/* Clean up */
+	g_free (birthday_formatted);
+	g_free (description);
 
 	if (avatar) {
 		gossip_avatar_unref (avatar);
 	}
 
-	g_object_unref (account);
+	if (account) {
+		g_object_unref (account);
+	}
 }
 
 static gboolean
@@ -787,7 +903,9 @@
 {
 	vcard_dialog_lookup_stop (dialog);
 
+	g_free (dialog->avatar_format);
 	g_free (dialog);
+
 	dialog = NULL;
 }
 
@@ -811,6 +929,9 @@
 				       "vcard_dialog", &dialog->dialog,
 				       "hbox_account", &dialog->hbox_account,
 				       "label_account", &dialog->label_account,
+				       "vbox_ebook", &dialog->vbox_ebook,
+				       "checkbutton_ebook_sync", &dialog->checkbutton_ebook_sync,
+				       "button_ebook_retrieve", &dialog->button_ebook_retrieve,
 				       "vbox_details", &dialog->vbox_details,
 				       "label_name", &dialog->label_name,
 				       "label_nickname", &dialog->label_nickname,
@@ -822,7 +943,7 @@
 				       "entry_web_site", &dialog->entry_web_site,
 				       "entry_email", &dialog->entry_email,
 				       "entry_birthday", &dialog->entry_birthday,
-				       "box_birthday_placeholder", &birthday_placeholder,
+				       "hbox_birthday_placeholder", &birthday_placeholder,
 				       "textview_description", &dialog->textview_description,
 				       "button_cancel", &dialog->button_cancel,
 				       "button_save", &dialog->button_save,
@@ -833,7 +954,8 @@
 			      dialog,
 			      "vcard_dialog", "destroy", vcard_dialog_destroy_cb,
 			      "vcard_dialog", "response", vcard_dialog_response_cb,
-			      "button_image", "clicked", vcard_dialog_avatar_clicked_cb,
+			      "button_image", "clicked", vcard_dialog_button_image_clicked_cb,
+			      "button_ebook_retrieve", "clicked", vcard_dialog_button_ebook_retrieve_clicked_cb,
 			      NULL);
 
 	g_object_add_weak_pointer (G_OBJECT (dialog->dialog), (gpointer) &dialog);
@@ -848,13 +970,21 @@
 				       "label_birthday",
 				       "label_avatar",
 				       "label_description",
+#ifdef HAVE_EBOOK
+				       "image_ebook",
+#endif 
 				       NULL);
 
 	g_object_unref (glade);
 
+#ifdef HAVE_EBOOK
+	gtk_widget_show (dialog->vbox_ebook);
+#endif 
+
 	/* Birthday chooser */
 	dialog->button_birthday = gossip_popup_button_new (_("Change"));
-	gtk_box_pack_start (GTK_BOX (birthday_placeholder), dialog->button_birthday, 0, FALSE, FALSE);
+	gtk_box_pack_start (GTK_BOX (birthday_placeholder), 
+			    dialog->button_birthday, 0, FALSE, FALSE);
 	gtk_widget_show (dialog->button_birthday);
 
 	g_signal_connect (dialog->button_birthday,



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