r3256 - in trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm: . src
mickey at sita.openmoko.org
mickey at sita.openmoko.org
Tue Oct 23 12:35:03 CEST 2007
Author: mickey
Date: 2007-10-23 12:34:59 +0200 (Tue, 23 Oct 2007)
New Revision: 3256
Modified:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/ChangeLog
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
Log:
openmoko-panel-gsm: update the panel icon once we receive a connection event
Modified: trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/ChangeLog
===================================================================
--- trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/ChangeLog 2007-10-23 10:29:57 UTC (rev 3255)
+++ trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/ChangeLog 2007-10-23 10:34:59 UTC (rev 3256)
@@ -1,3 +1,8 @@
+2007-10-23 Michael Lauer <mickey at openmoko.org>
+
+ * src/openmoko-panel-gsm.c: (gsm_applet_network_registration_cb):
+ Update the icon as well, once we receive a connection event.
+
2007-10-16 Daniel Willmann <alphaone at openmoko.org>
* src/openmoko-panel-gsm.c: (gsm_applet_network_registration_cb):
Modified: trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c
===================================================================
--- trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c 2007-10-23 10:29:57 UTC (rev 3255)
+++ trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-gsm/src/openmoko-panel-gsm.c 2007-10-23 10:34:59 UTC (rev 3256)
@@ -33,6 +33,8 @@
MokoGsmdConnection* gsm;
} GsmApplet;
+static GsmApplet* theApplet = NULL;
+
static void
gsm_applet_free(GsmApplet *applet)
{
@@ -72,7 +74,7 @@
moko_panel_applet_set_icon( applet->mokoapplet, image );
- g_free (image);
+ g_free( image );
}
static void
@@ -81,16 +83,17 @@
int lac,
int cell)
{
- NotifyNotification* nn;
- static MokoGsmdConnectionNetregType prev_type = MOKO_GSMD_CONNECTION_NETREG_NONE;
+ NotifyNotification* nn;
+ static MokoGsmdConnectionNetregType prev_type = MOKO_GSMD_CONNECTION_NETREG_NONE;
- if ((type == MOKO_GSMD_CONNECTION_NETREG_HOME) || (type == MOKO_GSMD_CONNECTION_NETREG_ROAMING) &&
- ((prev_type != MOKO_GSMD_CONNECTION_NETREG_HOME)&&(prev_type != MOKO_GSMD_CONNECTION_NETREG_ROAMING)))
- {
- nn = notify_notification_new ("Connected to Network", NULL, NULL, NULL);
- notify_notification_show (nn, NULL);
- }
- prev_type = type;
+ if ( (type == MOKO_GSMD_CONNECTION_NETREG_HOME) || (type == MOKO_GSMD_CONNECTION_NETREG_ROAMING) &&
+ ( (prev_type != MOKO_GSMD_CONNECTION_NETREG_HOME) && (prev_type != MOKO_GSMD_CONNECTION_NETREG_ROAMING) ) )
+ {
+ gsm_applet_update_signal_strength( self, 0, theApplet );
+ nn = notify_notification_new ("Connected to GSM Network", NULL, NULL, NULL);
+ notify_notification_show (nn, NULL);
+ }
+ prev_type = type;
}
@@ -118,6 +121,7 @@
mb_panel_applet_create(const char* id, GtkOrientation orientation)
{
GsmApplet* applet = g_slice_new(GsmApplet);
+ theApplet = applet; // nasty global variable
MokoPanelApplet* mokoapplet = applet->mokoapplet = MOKO_PANEL_APPLET(moko_panel_applet_new());
notify_init ("GSM Applet");
More information about the commitlog
mailing list