Changeset 3903
- Timestamp:
- 01/21/08 17:10:20 (5 years ago)
- Location:
- trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-memory
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
src/openmoko-panel-memory.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-memory/ChangeLog
r3895 r3903 1 2008-01-21 Chris Lord <chris@openedhand.com> 2 3 * src/openmoko-panel-memory.c: (update), (sim_full_cb), 4 (phone_full_cb), (mb_panel_applet_create): 5 Update to match new dbus API 6 1 7 2008-01-21 Chris Lord <chris@openedhand.com> 2 8 -
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-memory/src/openmoko-panel-memory.c
r3895 r3903 29 29 30 30 guint blink_idle; 31 32 gboolean sim_full; 33 gboolean phone_full; 31 34 } MemoryAppletData; 32 35 … … 41 44 42 45 static void 43 memory_full_cb (DBusGProxy *proxy, gboolean sim_full, gboolean phone_full, 44 MemoryAppletData *data) 46 update (MemoryAppletData *data) 45 47 { 46 if ( sim_full ||phone_full) {48 if (data->sim_full || data->phone_full) { 47 49 const gchar *message; 48 50 … … 53 55 } 54 56 55 if ( sim_full &&phone_full) {57 if (data->sim_full && data->phone_full) { 56 58 message = "Phone and SIM memory full"; 57 } else if ( sim_full) {59 } else if (data->sim_full) { 58 60 message = "SIM memory full"; 59 61 } else { … … 72 74 notify_notification_close (data->notification, NULL); 73 75 } 76 } 77 78 static void 79 sim_full_cb (DBusGProxy *proxy, gboolean full, MemoryAppletData *data) 80 { 81 data->sim_full = full; 82 update (data); 83 } 84 85 static void 86 phone_full_cb (DBusGProxy *proxy, gboolean full, MemoryAppletData *data) 87 { 88 data->phone_full = full; 89 update (data); 74 90 } 75 91 … … 94 110 "org.openmoko.PhoneKit.Sms"); 95 111 96 dbus_g_proxy_add_signal (data->sms_proxy, "MemoryFull", 97 G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_INVALID); 98 dbus_g_proxy_connect_signal (data->sms_proxy, "MemoryFull", 99 G_CALLBACK (memory_full_cb), data, NULL); 112 dbus_g_proxy_add_signal (data->sms_proxy, "SimMemoryState", 113 G_TYPE_BOOLEAN, G_TYPE_INVALID); 114 dbus_g_proxy_add_signal (data->sms_proxy, "PhoneMemoryState", 115 G_TYPE_BOOLEAN, G_TYPE_INVALID); 116 dbus_g_proxy_connect_signal (data->sms_proxy, "SimMemoryState", 117 G_CALLBACK (sim_full_cb), data, NULL); 118 dbus_g_proxy_connect_signal (data->sms_proxy, "PhoneMemoryState", 119 G_CALLBACK (phone_full_cb), data, NULL); 100 120 101 121 notify_init ("openmoko-panel-memory"); … … 110 130 moko_panel_applet_set_widget (data->applet, data->image); 111 131 132 if (!dbus_g_proxy_call (data->sms_proxy, "GetMemoryStatus", &error, 133 G_TYPE_INVALID, G_TYPE_BOOLEAN, &data->sim_full, 134 G_TYPE_BOOLEAN, &data->phone_full, G_TYPE_INVALID)) { 135 g_warning ("Error calling GetMemoryStatus: %s", error->message); 136 g_error_free (error); 137 } else { 138 update (data); 139 } 140 112 141 return GTK_WIDGET (data->applet); 113 142 }
Note: See TracChangeset
for help on using the changeset viewer.
