r1615 - trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src

zhiyong_sun at sita.openmoko.org zhiyong_sun at sita.openmoko.org
Mon Apr 2 09:51:15 CEST 2007


Author: zhiyong_sun
Date: 2007-04-02 09:51:12 +0200 (Mon, 02 Apr 2007)
New Revision: 1615

Modified:
   trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
   trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
Log:
whitespace changes

Modified: trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c
===================================================================
--- trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c	2007-04-02 07:33:07 UTC (rev 1614)
+++ trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/moko-gsm-conn.c	2007-04-02 07:51:12 UTC (rev 1615)
@@ -32,7 +32,7 @@
 static gboolean
 gsm_watcher_check (GSource * source)
 {
- if (GPfd.revents & (G_IO_IN | G_IO_PRI))
+  if (GPfd.revents & (G_IO_IN | G_IO_PRI))
   {
     return TRUE;
   }
@@ -68,51 +68,50 @@
 static int 
 sigq_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
 {
-	printf("EVENT: Signal Quality: %u\n", aux->u.signal.sigq.rssi);
-	gsm_q = aux->u.signal.sigq.rssi;
-	//FIXME: Call panel applet image change function here, instead of use g timeout function to check singal value
-	return 0;
+  printf("EVENT: Signal Quality: %u\n", aux->u.signal.sigq.rssi);
+  gsm_q = aux->u.signal.sigq.rssi;
+  //FIXME: Call panel applet image change function here, instead of use g timeout function to check singal value
+  return 0;
 }
 
 static int 
 netreg_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxdata *aux)
 {
   printf("EVENT: Netreg ");
-
-	switch (aux->u.netreg.state)
-	{
-	case 0:
-		printf("not searching for network ");
-		break;
-	case 1:
-		printf("registered (home network) ");
-		break;
-	case 2:
-		printf("searching for network ");
-		break;
-	case 3:
-		printf("registration denied ");
-		break;
-	case 5:
-		printf("registered (roaming) ");
-		break;
-	}
-
-	if (aux->u.netreg.lac)
-		printf("LocationAreaCode = 0x%04X ", aux->u.netreg.lac);
-	if (aux->u.netreg.ci)
-		printf("CellID = 0x%04X ", aux->u.netreg.ci);
-	
-	printf("\n");
-
-	return 0;
+  
+  switch (aux->u.netreg.state)
+  {
+    case 0:
+      printf("not searching for network ");
+      break;
+    case 1:
+      printf("registered (home network) ");
+      break;
+    case 2:
+      printf("searching for network ");
+      break;
+    case 3:
+      printf("registration denied ");
+      break;
+    case 5:
+      printf("registered (roaming) ");
+      break;
+  }
+  
+  if (aux->u.netreg.lac)
+    printf("LocationAreaCode = 0x%04X ", aux->u.netreg.lac);
+  if (aux->u.netreg.ci)
+    printf("CellID = 0x%04X ", aux->u.netreg.ci);
+  
+  printf("\n");
+  return 0;
 }
 
 static int
 gsm_connect_init()
 {
   lgsmh = lgsm_init(LGSMD_DEVICE_GSMD);	
-    
+  
   if (!lgsmh) 
   { 
     printf("Can't connect to gsmd\n");
@@ -150,7 +149,6 @@
 moko_panel_gprs_signal_quality()
 {
 //some code for only for test, since there have not any methord to check out gprs signal.
-  
   test ++;
   if (test > 11 || test < 0)
     test = 0;

Modified: trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
===================================================================
--- trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c	2007-04-02 07:33:07 UTC (rev 1614)
+++ trunk/src/target/OM-2007/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c	2007-04-02 07:51:12 UTC (rev 1615)
@@ -25,7 +25,7 @@
 typedef struct{
   GtkWidget *image;
   SignalStatus status;
-}MokoSignal;
+} MokoSignal;
 
 typedef struct {
   MokoSignal gsm;
@@ -55,9 +55,9 @@
 static void
 gsm_applet_free (GsmApplet *applet)
 {
-    g_source_remove (applet->timeout_id);
+  g_source_remove (applet->timeout_id);
 
-    g_slice_free (GsmApplet, applet);
+  g_slice_free (GsmApplet, applet);
 }
 
 static gboolean
@@ -99,29 +99,29 @@
 G_MODULE_EXPORT GtkWidget* 
 mb_panel_applet_create(const char* id, GtkOrientation orientation)
 {
-    MokoPanelApplet* mokoapplet = moko_panel_applet_new();
+  MokoPanelApplet* mokoapplet = moko_panel_applet_new();
 
-    GsmApplet *applet;
-    applet = g_slice_new (GsmApplet);
+  GsmApplet *applet;
+  applet = g_slice_new (GsmApplet);
    
-    g_object_weak_ref( G_OBJECT(mokoapplet), (GWeakNotify) gsm_applet_free, applet );
-    applet->timeout_id = g_timeout_add(2000, (GSourceFunc) timeout_cb, applet);
+  g_object_weak_ref( G_OBJECT(mokoapplet), (GWeakNotify) gsm_applet_free, applet );
+  applet->timeout_id = g_timeout_add(4000, (GSourceFunc) timeout_cb, applet);
 
-    applet->gsm.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage object
-    applet->gsm.status = UN_CONN;
-    applet->gprs.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage object
-    applet->gprs.status = UN_CONN;
+  applet->gsm.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage object
+  applet->gsm.status = UN_CONN;
+  applet->gprs.image = GTK_IMAGE(gtk_image_new ());//make an empty GtkImage object
+  applet->gprs.status = UN_CONN;
 
-    applet->hbox = gtk_hbox_new(FALSE, 0);
-    gtk_widget_show (applet->hbox);
+  applet->hbox = gtk_hbox_new(FALSE, 0);
+  gtk_widget_show (applet->hbox);
 
-    gtk_box_pack_start (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gprs.image), FALSE, FALSE, 2);
-    gtk_box_pack_end (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gsm.image), FALSE, FALSE, 2);
+  gtk_box_pack_start (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gprs.image), FALSE, FALSE, 2);
+  gtk_box_pack_end (GTK_BOX(applet->hbox), GTK_WIDGET(applet->gsm.image), FALSE, FALSE, 2);
 
-    moko_panel_applet_set_widget( GTK_CONTAINER(mokoapplet), applet->hbox );
-    gtk_widget_show_all( GTK_WIDGET(mokoapplet) );
+  moko_panel_applet_set_widget( GTK_CONTAINER(mokoapplet), applet->hbox );
+  gtk_widget_show_all( GTK_WIDGET(mokoapplet) );
 
-    gsm_watcher_install ();
+  gsm_watcher_install ();
 
-    return GTK_WIDGET(mokoapplet);
+  return GTK_WIDGET(mokoapplet);
 };





More information about the commitlog mailing list