Index: src/connection.c
===================================================================
--- src/connection.c	(revisione 316)
+++ src/connection.c	(copia locale)
@@ -94,6 +94,18 @@
 	return TRUE;
 }
 
+static gboolean
+sync_clock (MyApp *app)
+{
+	if (gconf_client_get_bool (app->client,
+				CONFBASE"/sync_clock", NULL)) {
+		g_message ("Syncing phone clock");
+		phonemgr_listener_set_time (app->listener,
+					    time(NULL));
+	}
+	return TRUE;
+}
+
 static gpointer
 connect_phone_thread (gpointer data)
 {
@@ -183,6 +195,7 @@
 		case PHONEMGR_LISTENER_CONNECTED:
 			g_message ("Serial port connected");
 			phonemgr_object_emit_number_batteries_changed (app->object, 1);
+			sync_clock (app);
 			break;
 		case PHONEMGR_LISTENER_DISCONNECTING:
 			g_message ("Closing serial port connection");
Index: src/ui.c
===================================================================
--- src/ui.c	(revisione 316)
+++ src/ui.c	(copia locale)
@@ -120,7 +120,7 @@
 
 	boldify_label (ui, "alerting_label");
 	boldify_label (ui, "phone_connection_label");
-	boldify_label (ui, "error_handling_label");
+	boldify_label (ui, "automated_tasks_label");
 	bigger_label (ui, "new_message_label");
 	bigger_label (ui, "enter_message_label");
 
@@ -490,6 +490,10 @@
 				    G_OBJECT (glade_xml_get_widget (app->ui, "auto_retry")),
 				    "active");
 	gconf_bridge_bind_property (bridge,
+				    CONFBASE"/sync_clock",
+				    G_OBJECT (glade_xml_get_widget (app->ui, "sync_clock")),
+				    "active");
+	gconf_bridge_bind_property (bridge,
 				    CONFBASE"/popup_messages",
 				    G_OBJECT (glade_xml_get_widget (app->ui, "prefs_popup")),
 				    "active");
Index: data/phonemgr.glade
===================================================================
--- data/phonemgr.glade	(revisione 316)
+++ data/phonemgr.glade	(copia locale)
@@ -1283,15 +1283,15 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkVBox" id="errorframe">
+		<widget class="GtkVBox" id="automatedframe">
 		  <property name="visible">True</property>
 		  <property name="homogeneous">False</property>
 		  <property name="spacing">6</property>
 
 		  <child>
-		    <widget class="GtkLabel" id="error_handling_label">
+		    <widget class="GtkLabel" id="automated_tasks_label">
 		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Error Handling</property>
+		      <property name="label" translatable="yes">Automated Tasks</property>
 		      <property name="use_underline">False</property>
 		      <property name="use_markup">False</property>
 		      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -1306,7 +1306,7 @@
 		      <property name="single_line_mode">False</property>
 		      <property name="angle">0</property>
 		      <accessibility>
-			<atkrelation target="error_handling_box" type="label-for"/>
+			<atkrelation target="automated_tasks_box" type="label-for"/>
 		      </accessibility>
 		    </widget>
 		    <packing>
@@ -1329,12 +1329,12 @@
 		      <property name="right_padding">0</property>
 
 		      <child>
-			<widget class="GtkVBox" id="error_handling_box">
+			<widget class="GtkVBox" id="automated_tasks_box">
 			  <property name="visible">True</property>
 			  <property name="homogeneous">False</property>
 			  <property name="spacing">0</property>
 			  <accessibility>
-			    <atkrelation target="error_handling_label" type="labelled-by"/>
+			    <atkrelation target="automated_tasks_label" type="labelled-by"/>
 			  </accessibility>
 
 			  <child>
@@ -1356,6 +1356,20 @@
 			      <property name="fill">False</property>
 			    </packing>
 			  </child>
+			    <child>
+			      <widget class="GtkCheckButton" id="sync_clock">
+			        <property name="visible">True</property>
+			        <property name="can_focus">True</property>
+			        <property name="tooltip" translatable="yes">Synchronise phone's time and date with the computer's clock</property>
+			        <property name="label" translatable="yes">Synchronise phone's _time and date</property>
+			        <property name="use_underline">True</property>
+			        <property name="response_id">0</property>
+			        <property name="draw_indicator">True</property>
+			      </widget>
+			      <packing>
+			        <property name="position">1</property>
+			      </packing>
+			    </child>
 			</widget>
 		      </child>
 		    </widget>
Index: data/gnome-phone-manager.schemas.in
===================================================================
--- data/gnome-phone-manager.schemas.in	(revisione 316)
+++ data/gnome-phone-manager.schemas.in	(copia locale)
@@ -66,6 +66,20 @@
       </schema>
 
       <schema>
+        <key>/schemas/apps/gnome-phone-manager/sync_clock</key>
+	<applyto>/apps/gnome-phone-manager/sync_clock</applyto>
+	<owner>gnome-phone-manager</owner>
+	<type>bool</type>
+	<default>true</default>
+	<locale name="C">
+	  <short>Whether to synchronise the phone clock with the computer's</short>
+	  <long>
+	    Whether to synchronise the phone clock with the computer's.
+	  </long>
+	</locale>
+      </schema>
+
+      <schema>
         <key>/schemas/apps/gnome-phone-manager/popup_messages</key>
 	<applyto>/apps/gnome-phone-manager/popup_messages</applyto>
 	<owner>gnome-phone-manager</owner>
Index: libgsm/phonemgr-listener.c
===================================================================
--- libgsm/phonemgr-listener.c	(revisione 316)
+++ libgsm/phonemgr-listener.c	(copia locale)
@@ -1148,17 +1148,16 @@
 	PhoneMgrError perr;
 
 	g_return_if_fail (PHONEMGR_IS_LISTENER (l));
-	g_return_if_fail (l->connected == FALSE);
-	g_return_if_fail (l->phone_state == NULL);
+	g_return_if_fail (l->connected == TRUE);
+	g_return_if_fail (l->phone_state != NULL);
 
 	t = localtime(&time);
-	date.year = t->tm_year;
+	date.year = t->tm_year + 1900;
 	date.month = t->tm_mon + 1;
 	date.day = t->tm_mday;
 	date.hour = t->tm_hour;
 	date.minute = t->tm_min;
 	date.second = t->tm_sec;
-	free (t);
 
 	/* Lock the phone */
 	g_mutex_lock (l->mutex);
