phonemgr r337 - in trunk: . data libgsm src



Author: hadess
Date: Thu Feb  5 11:29:06 2009
New Revision: 337
URL: http://svn.gnome.org/viewvc/phonemgr?rev=337&view=rev

Log:
2009-02-05  Bastien Nocera  <hadess hadess net>

	* data/gnome-phone-manager.schemas.in:
	* data/phonemgr.glade:
	* libgsm/phonemgr-listener.c (phonemgr_listener_set_time):
	* src/connection.c (sync_clock), (on_status):
	* src/ui.c (get_ui), (ui_init): Patch from Daniele Forsi
	<dforsi gmail com> to allow setting the phone's time on
	connect (Closes: #456606)



Modified:
   trunk/ChangeLog
   trunk/data/gnome-phone-manager.schemas.in
   trunk/data/phonemgr.glade
   trunk/libgsm/phonemgr-listener.c
   trunk/src/connection.c
   trunk/src/ui.c

Modified: trunk/data/gnome-phone-manager.schemas.in
==============================================================================
--- trunk/data/gnome-phone-manager.schemas.in	(original)
+++ trunk/data/gnome-phone-manager.schemas.in	Thu Feb  5 11:29:06 2009
@@ -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>

Modified: trunk/data/phonemgr.glade
==============================================================================
--- trunk/data/phonemgr.glade	(original)
+++ trunk/data/phonemgr.glade	Thu Feb  5 11:29:06 2009
@@ -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>

Modified: trunk/libgsm/phonemgr-listener.c
==============================================================================
--- trunk/libgsm/phonemgr-listener.c	(original)
+++ trunk/libgsm/phonemgr-listener.c	Thu Feb  5 11:29:06 2009
@@ -1147,17 +1147,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 != FALSE);
+	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);

Modified: trunk/src/connection.c
==============================================================================
--- trunk/src/connection.c	(original)
+++ trunk/src/connection.c	Thu Feb  5 11:29:06 2009
@@ -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");

Modified: trunk/src/ui.c
==============================================================================
--- trunk/src/ui.c	(original)
+++ trunk/src/ui.c	Thu Feb  5 11:29:06 2009
@@ -121,7 +121,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");
 
@@ -459,6 +459,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");



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