Index: libempathy-gtk/empathy-account-widget-salut.glade
===================================================================
--- libempathy-gtk/empathy-account-widget-salut.glade	(revisione 0)
+++ libempathy-gtk/empathy-account-widget-salut.glade	(revisione 0)
@@ -0,0 +1,395 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
+
+<glade-interface>
+
+<widget class="GtkWindow" id="account_salut_settings">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">salut account settings</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">False</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="decorated">True</property>
+  <property name="skip_taskbar_hint">False</property>
+  <property name="skip_pager_hint">False</property>
+  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+  <property name="focus_on_map">True</property>
+  <property name="urgency_hint">False</property>
+
+  <child>
+    <widget class="GtkVBox" id="vbox_salut_settings">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">6</property>
+
+      <child>
+	<widget class="GtkTable" id="table_common_settings">
+	  <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">6</property>
+	  <property name="column_spacing">12</property>
+
+	  <child>
+	    <widget class="GtkLabel" id="label_nickname">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Nickname:</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="mnemonic_widget">entry_nickname</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">0</property>
+	      <property name="bottom_attach">1</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label_published">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">_Published Name:</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="mnemonic_widget">entry_published</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"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkEntry" id="entry_nickname">
+	      <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">3</property>
+	      <property name="top_attach">0</property>
+	      <property name="bottom_attach">1</property>
+	      <property name="y_options"></property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkEntry" id="entry_published">
+	      <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">3</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">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+
+      <child>
+	<widget class="GtkExpander" id="expander1">
+	  <property name="visible">True</property>
+	  <property name="can_focus">True</property>
+	  <property name="expanded">False</property>
+	  <property name="spacing">0</property>
+
+	  <child>
+	    <widget class="GtkTable" id="table_advanced_settings">
+	      <property name="visible">True</property>
+	      <property name="n_rows">4</property>
+	      <property name="n_columns">3</property>
+	      <property name="homogeneous">False</property>
+	      <property name="row_spacing">6</property>
+	      <property name="column_spacing">12</property>
+
+	      <child>
+		<widget class="GtkLabel" id="label_first_name">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">_First Name: </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="mnemonic_widget">entry_first_name</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">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label_last_name">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">_Last Name:</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="mnemonic_widget">entry_last_name</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"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label_email">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">_E-mail:</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="mnemonic_widget">entry_email</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">2</property>
+		  <property name="bottom_attach">3</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label_jid">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">_Jabber ID:</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="mnemonic_widget">entry_jid</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">3</property>
+		  <property name="bottom_attach">4</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkEntry" id="entry_first_name">
+		  <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">3</property>
+		  <property name="top_attach">0</property>
+		  <property name="bottom_attach">1</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkEntry" id="entry_last_name">
+		  <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">3</property>
+		  <property name="top_attach">1</property>
+		  <property name="bottom_attach">2</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </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">3</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_jid">
+		  <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">3</property>
+		  <property name="top_attach">3</property>
+		  <property name="bottom_attach">4</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+	    </widget>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label1">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">&lt;b&gt;Advanced&lt;/b&gt;</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.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="type">label_item</property>
+	    </packing>
+	  </child>
+	</widget>
+	<packing>
+	  <property name="padding">0</property>
+	  <property name="expand">False</property>
+	  <property name="fill">False</property>
+	</packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
+</glade-interface>
Index: libempathy-gtk/empathy-preferences.h
===================================================================
--- libempathy-gtk/empathy-preferences.h	(revisione 265)
+++ libempathy-gtk/empathy-preferences.h	(copia locale)
@@ -48,6 +48,7 @@ G_BEGIN_DECLS
 #define EMPATHY_PREFS_CONTACTS_SHOW_OFFLINE        EMPATHY_PREFS_PATH "/contacts/show_offline"
 #define EMPATHY_PREFS_CONTACTS_SORT_CRITERIUM      EMPATHY_PREFS_PATH "/contacts/sort_criterium"
 #define EMPATHY_PREFS_HINTS_CLOSE_MAIN_WINDOW      EMPATHY_PREFS_PATH "/hints/close_main_window"
+#define EMPATHY_PREFS_SALUT_ACCOUNT_CREATED	   EMPATHY_PREFS_PATH "/accounts/salut_created"
 
 GtkWidget * empathy_preferences_show (GtkWindow *parent);
 
Index: libempathy-gtk/empathy-account-widget-salut.c
===================================================================
--- libempathy-gtk/empathy-account-widget-salut.c	(revisione 0)
+++ libempathy-gtk/empathy-account-widget-salut.c	(revisione 0)
@@ -0,0 +1,208 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2007 Cosimo Cecchi <anarki@lilik.it>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Authors: Cosimo Cecchi <anarki@lilik.it>
+ */
+ 
+#include "config.h"
+
+#include <stdlib.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+
+#include <libmissioncontrol/mc-profile.h>
+
+#include <libempathy/empathy-utils.h>
+
+#include "empathy-account-widget-salut.h"
+#include "empathy-ui-utils.h"
+
+typedef struct {
+	McAccount *account;
+	
+	GtkWidget *vbox_settings;
+	GtkWidget *entry_nickname;
+	GtkWidget *entry_published;
+	GtkWidget *entry_first_name;
+	GtkWidget *entry_last_name;
+	GtkWidget *entry_email;
+	GtkWidget *entry_jid;
+} EmpathyAccountWidgetSalut;
+
+static gboolean	account_widget_salut_entry_focus_cb	(GtkWidget		   *widget,
+							 GdkEventFocus		   *event,
+							 EmpathyAccountWidgetSalut *settings);
+static void	account_widget_salut_destroy_cb		(GtkWidget                 *widget,
+							 EmpathyAccountWidgetSalut *settings);
+static void	account_widget_salut_setup		(EmpathyAccountWidgetSalut *settings);
+
+
+
+static gboolean
+account_widget_salut_entry_focus_cb (GtkWidget               *widget,
+				     GdkEventFocus           *event,
+				     EmpathyAccountWidgetSalut *settings)
+{
+	const gchar *param;
+	const gchar *str;
+	
+	if (widget == settings->entry_nickname) {
+		param = "nickname";
+	}
+	else if (widget == settings->entry_published) {
+		param = "published-name";
+	}
+	else if (widget == settings->entry_first_name) {
+		param = "first-name";
+	}
+	else if (widget == settings->entry_last_name) {
+		param = "last-name";
+	}
+	else if (widget == settings->entry_email) {
+		param = "email";
+	}
+	else if (widget == settings->entry_jid) {
+		param = "jid";
+	}
+	else {
+		return FALSE;
+	}
+	
+	str = gtk_entry_get_text (GTK_ENTRY (widget));
+	
+	if (G_STR_EMPTY (str)) {
+		gchar *value = NULL;
+
+		mc_account_get_param_string (settings->account, param, &value);
+		gtk_entry_set_text (GTK_ENTRY (widget), value ? value : "");
+		g_free (value);
+	} else {
+		mc_account_set_param_string (settings->account, param, str);
+	}
+
+	return FALSE;
+}
+
+static void
+account_widget_salut_destroy_cb (GtkWidget               *widget,
+			       EmpathyAccountWidgetSalut *settings)
+{
+	g_object_unref (settings->account);
+	g_free (settings);
+}
+
+static void
+account_widget_salut_setup (EmpathyAccountWidgetSalut *settings)
+{
+	gchar *nickname = NULL;
+	gchar *published_name = NULL;
+	gchar *first_name = NULL;
+	gchar *last_name = NULL;
+	gchar *email = NULL;
+	gchar *jid = NULL;
+
+	mc_account_get_param_string (settings->account, "nickname", &nickname);
+	mc_account_get_param_string (settings->account, "published-name", &published_name);
+	mc_account_get_param_string (settings->account, "first-name", &first_name);
+	mc_account_get_param_string (settings->account, "last-name", &last_name);
+	mc_account_get_param_string (settings->account, "email", &email);
+	mc_account_get_param_string (settings->account, "jid", &jid);
+	
+	if (!nickname) {
+		mc_account_set_param_string (settings->account, "nickname", "");
+		nickname = g_strdup ("");
+	}	
+	gtk_entry_set_text (GTK_ENTRY (settings->entry_nickname), nickname);
+	if (!published_name) {
+		mc_account_set_param_string (settings->account, "published-name", "");
+		published_name = g_strdup ("");
+	}
+	gtk_entry_set_text (GTK_ENTRY (settings->entry_published), published_name);
+	if (!first_name) {
+		mc_account_set_param_string (settings->account, "first-name", "");
+		first_name = g_strdup ("");
+	}
+	gtk_entry_set_text (GTK_ENTRY (settings->entry_first_name), first_name);
+	if (!last_name) {
+		mc_account_set_param_string (settings->account, "last-name", "");
+		last_name = g_strdup ("");
+	}
+	gtk_entry_set_text (GTK_ENTRY (settings->entry_last_name), last_name);
+	if (!email) {
+		mc_account_set_param_string (settings->account, "email", "");
+		email = g_strdup ("");
+	}
+	gtk_entry_set_text (GTK_ENTRY (settings->entry_email), email ? email : "");
+	if (!jid) {
+		mc_account_set_param_string (settings->account, "jid", "");
+		jid = g_strdup ("");
+	}
+	gtk_entry_set_text (GTK_ENTRY (settings->entry_jid), jid ? jid : "");
+
+	g_free (nickname);
+	g_free (published_name);
+	g_free (first_name);
+	g_free (last_name);
+	g_free (email);
+	g_free (jid);
+}
+
+
+GtkWidget *
+empathy_account_widget_salut_new (McAccount *account)
+{
+	EmpathyAccountWidgetSalut *settings;
+	GladeXML		  *glade;
+
+	settings = g_new0 (EmpathyAccountWidgetSalut, 1);
+	settings->account = g_object_ref (account);
+
+	glade = empathy_glade_get_file ("empathy-account-widget-salut.glade",
+					"vbox_salut_settings",
+					NULL,
+					"vbox_salut_settings", &settings->vbox_settings,
+					"entry_published", &settings->entry_published,
+					"entry_nickname", &settings->entry_nickname,
+					"entry_first_name", &settings->entry_first_name,
+					"entry_last_name", &settings->entry_last_name,
+					"entry_email", &settings->entry_email,
+					"entry_jid", &settings->entry_jid,
+					NULL);
+
+	account_widget_salut_setup (settings);
+
+	empathy_glade_connect (glade,
+			       settings,
+			       "vbox_salut_settings", "destroy", account_widget_salut_destroy_cb,
+			       "entry_nickname", "focus-out-event", account_widget_salut_entry_focus_cb,
+			       "entry_published", "focus-out-event", account_widget_salut_entry_focus_cb,
+			       "entry_first_name", "focus-out-event", account_widget_salut_entry_focus_cb,
+			       "entry_last_name", "focus-out-event", account_widget_salut_entry_focus_cb,
+			       "entry_email", "focus-out-event", account_widget_salut_entry_focus_cb,
+			       "entry_jid", "focus-out-event", account_widget_salut_entry_focus_cb,
+			      NULL);
+
+	g_object_unref (glade);
+
+	gtk_widget_show (settings->vbox_settings);
+
+	return settings->vbox_settings;
+}
Index: libempathy-gtk/empathy-account-widget-salut.h
===================================================================
--- libempathy-gtk/empathy-account-widget-salut.h	(revisione 0)
+++ libempathy-gtk/empathy-account-widget-salut.h	(revisione 0)
@@ -0,0 +1,34 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2007 Cosimo Cecchi <anarki@lilik.it>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ * 
+ * Authors: Cosimo Cecchi <anarki@lilik.it>
+ */
+
+#ifndef __EMPATHY_ACCOUNT_WIDGET_SALUT_H__
+#define __EMPATHY_ACCOUNT_WIDGET_SALUT_H__
+
+#include <libmissioncontrol/mc-account.h>
+
+G_BEGIN_DECLS
+
+GtkWidget *empathy_account_widget_salut_new (McAccount *account);
+
+G_END_DECLS
+
+#endif /* __EMPATHY_ACCOUNT_WIDGET_SALUT_H__ */
Index: libempathy-gtk/empathy-accounts-dialog.c
===================================================================
--- libempathy-gtk/empathy-accounts-dialog.c	(revisione 265)
+++ libempathy-gtk/empathy-accounts-dialog.c	(copia locale)
@@ -47,6 +47,7 @@
 #include "empathy-account-widget-generic.h"
 #include "empathy-account-widget-jabber.h"
 #include "empathy-account-widget-msn.h"
+#include "empathy-account-widget-salut.h"
 
 #define DEBUG_DOMAIN "AccountDialog"
 
@@ -287,6 +288,10 @@ accounts_dialog_update_account (EmpathyA
 			dialog ->settings_widget =
 				empathy_account_widget_msn_new (account);
 		}
+		else if (!empathy_strdiff (config_ui, "salut")) {
+			dialog->settings_widget =
+				empathy_account_widget_salut_new (account);
+		}
 		else {
 			dialog->settings_widget = 
 				empathy_account_widget_generic_new (account);
Index: libempathy-gtk/Makefile.am
===================================================================
--- libempathy-gtk/Makefile.am	(revisione 265)
+++ libempathy-gtk/Makefile.am	(copia locale)
@@ -44,7 +44,8 @@ libempathy_gtk_la_SOURCES =             
 	empathy-chatrooms-window.c		\
 	empathy-log-window.c			\
 	empathy-ui-utils.c			\
-	empathy-account-widget-msn.c
+	empathy-account-widget-msn.c           \
+	empathy-account-widget-salut.c
 
 # do not distribute generated files
 nodist_libempathy_gtk_la_SOURCES =\
@@ -113,7 +114,8 @@ glade_DATA = 					\
 	empathy-spell-dialog.glade		\
 	empathy-log-window.glade		\
 	empathy-chat.glade                     \
-	empathy-account-widget-msn.glade
+	empathy-account-widget-msn.glade                     \
+	empathy-account-widget-salut.glade
 
 empathy-gtk-enum-types.h: stamp-empathy-gtk-enum-types.h
 	@true
Index: src/empathy.c
===================================================================
--- src/empathy.c	(revisione 265)
+++ src/empathy.c	(copia locale)
@@ -45,11 +45,15 @@
 #include <libempathy/empathy-tp-chat.h>
 #include <libempathy/empathy-tp-chatroom.h>
 #include <libempathy/empathy-idle.h>
+#include <libempathy/empathy-conf.h>
+#include <libempathy-gtk/empathy-preferences.h>
 #include <libempathy-gtk/empathy-main-window.h>
 #include <libempathy-gtk/empathy-status-icon.h>
 #include <libempathy-gtk/empathy-private-chat.h>
 #include <libempathy-gtk/empathy-group-chat.h>
 
+#include <libebook/e-book.h>
+
 #define DEBUG_DOMAIN "EmpathyMain"
 
 #define BUS_NAME "org.gnome.Empathy.Chat"
@@ -147,6 +151,82 @@ new_channel_cb (EmpathyChandler *chandle
 	g_object_unref (account);
 }
 
+static McProfile*
+salut_installed ()
+{
+	GList *profiles, *l;
+	const gchar *name;
+	
+	profiles = mc_profiles_list ();
+	for (l = profiles; l; l = l->next) {
+		McProfile  *profile;
+		McProtocol *protocol;
+
+		profile = l->data;
+		protocol = mc_profile_get_protocol (profile);
+		if (!protocol) {
+			continue;
+		}
+		g_object_unref (protocol);
+
+		name = mc_profile_get_unique_name (profile);
+		if (!empathy_strdiff (name, "salut")) {
+			mc_profiles_free_list (profiles);
+			return profile;
+		}
+	}
+	
+	mc_profiles_free_list (profiles);
+	return NULL;
+}
+
+static void
+create_salut_account_with_about_me (McProfile* profile)
+{
+	McAccount *account;
+	gchar *nickname, *published_name, *email, *jid, *last_name, *first_name;
+	EBook *book;
+	EContact *contact;
+	
+	account = mc_account_create (profile);
+
+	mc_account_set_display_name (account, "Local Network");
+	
+	e_book_get_self (&contact, &book, NULL);
+	
+	nickname = (!g_str_equal ((gchar *) e_contact_get (contact, E_CONTACT_NICKNAME),
+				 "nickname") ?
+		    (gchar *) e_contact_get (contact, E_CONTACT_NICKNAME) :
+		    (gchar *) g_get_user_name());
+	
+	published_name = (e_contact_get (contact, E_CONTACT_FULL_NAME) ?
+			  (gchar *) e_contact_get (contact, E_CONTACT_FULL_NAME) :
+			  (gchar *) g_get_real_name());
+	
+	email = (e_contact_get (contact, E_CONTACT_EMAIL_1) ?
+		 (gchar *) e_contact_get (contact, E_CONTACT_EMAIL_1) :
+		 "");
+	
+	jid = (e_contact_get (contact, E_CONTACT_IM_JABBER_HOME_1) ?
+	       (gchar *) e_contact_get (contact, E_CONTACT_IM_JABBER_HOME_1) :
+	       "");
+	
+	first_name = (e_contact_get (contact, E_CONTACT_GIVEN_NAME) ?
+		      (gchar *) e_contact_get (contact, E_CONTACT_GIVEN_NAME) :
+		      "");
+	
+	last_name = (e_contact_get (contact, E_CONTACT_FAMILY_NAME) ?
+		     (gchar *) e_contact_get (contact, E_CONTACT_FAMILY_NAME) :
+		     "");
+	
+	mc_account_set_param_string (account, "nickname", nickname);
+	mc_account_set_param_string (account, "published-name", published_name);
+	mc_account_set_param_string (account, "email", email);
+	mc_account_set_param_string (account, "jid", jid);
+	mc_account_set_param_string (account, "first-name", first_name);
+	mc_account_set_param_string (account, "last-name", last_name);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -158,6 +238,7 @@ main (int argc, char *argv[])
 	EmpathyChandler   *chandler;
 	GnomeProgram      *program;
 	gboolean           no_connect = FALSE;
+	gboolean	   salut_created;
 	GOptionContext    *context;
 	GOptionEntry       options[] = {
 		{ "no-connect", 'n',
@@ -208,6 +289,20 @@ main (int argc, char *argv[])
 	if (!no_connect) {
 		start_mission_control (idle);
 	}
+	
+	if (empathy_conf_get_bool (empathy_conf_get(),
+				   EMPATHY_PREFS_SALUT_ACCOUNT_CREATED,
+				   &salut_created))
+	{
+		McProfile *profile;
+		profile = salut_installed ();
+		if (salut_created == FALSE && profile != NULL) {
+			empathy_conf_set_bool (empathy_conf_get (),
+					       EMPATHY_PREFS_SALUT_ACCOUNT_CREATED,
+					       TRUE);
+			create_salut_account_with_about_me (profile);
+		}
+	}
 
 	/* Setting up UI */
 	window = empathy_main_window_show ();
Index: configure.ac
===================================================================
--- configure.ac	(revisione 265)
+++ configure.ac	(copia locale)
@@ -96,6 +96,7 @@ PKG_CHECK_MODULES(EMPATHY,
    gtk+-2.0 >= $GTK_REQUIRED
    libglade-2.0 >= $LIBGLADE_REQUIRED
    libgnomeui-2.0
+   libebook-1.2
 ])
 
 dnl -----------------------------------------------------------
Index: data/empathy.schemas.in
===================================================================
--- data/empathy.schemas.in	(revisione 265)
+++ data/empathy.schemas.in	(copia locale)
@@ -245,6 +245,21 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/empathy/accounts/salut_created</key>
+      <applyto>/apps/empathy/accounts/salut_created</applyto>
+      <owner>empathy</owner>
+      <type>book</type>
+      <default>false</default>
+      <locale name="C">
+        <short>Checks if Salut account is created</short>
+	<long>
+	Whether or not the Salut account has been created on the first
+      empathy run.
+        </long>
+      </locale>
+    </schema>
+
   </schemalist>  
 </gconfschemafile>
 
