Changeset 3903


Ignore:
Timestamp:
01/21/08 17:10:20 (5 years ago)
Author:
chris
Message:
  • src/openmoko-panel-memory.c: (update), (sim_full_cb), (phone_full_cb), (mb_panel_applet_create): Update to match new dbus API
Location:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-memory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-memory/ChangeLog

    r3895 r3903  
     12008-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 
    172008-01-21  Chris Lord  <chris@openedhand.com> 
    28 
  • trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-memory/src/openmoko-panel-memory.c

    r3895 r3903  
    2929         
    3030        guint blink_idle; 
     31         
     32        gboolean sim_full; 
     33        gboolean phone_full; 
    3134} MemoryAppletData; 
    3235 
     
    4144 
    4245static void 
    43 memory_full_cb (DBusGProxy *proxy, gboolean sim_full, gboolean phone_full, 
    44                 MemoryAppletData *data) 
     46update (MemoryAppletData *data) 
    4547{ 
    46         if (sim_full || phone_full) { 
     48        if (data->sim_full || data->phone_full) { 
    4749                const gchar *message; 
    4850                 
     
    5355                } 
    5456                 
    55                 if (sim_full && phone_full) { 
     57                if (data->sim_full && data->phone_full) { 
    5658                        message = "Phone and SIM memory full"; 
    57                 } else if (sim_full) { 
     59                } else if (data->sim_full) { 
    5860                        message = "SIM memory full"; 
    5961                } else { 
     
    7274                notify_notification_close (data->notification, NULL); 
    7375        } 
     76} 
     77 
     78static void 
     79sim_full_cb (DBusGProxy *proxy, gboolean full, MemoryAppletData *data) 
     80{ 
     81        data->sim_full = full; 
     82        update (data); 
     83} 
     84 
     85static void 
     86phone_full_cb (DBusGProxy *proxy, gboolean full, MemoryAppletData *data) 
     87{ 
     88        data->phone_full = full; 
     89        update (data); 
    7490} 
    7591 
     
    94110                "org.openmoko.PhoneKit.Sms"); 
    95111         
    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); 
    100120         
    101121        notify_init ("openmoko-panel-memory"); 
     
    110130        moko_panel_applet_set_widget (data->applet, data->image); 
    111131         
     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         
    112141        return GTK_WIDGET (data->applet); 
    113142} 
Note: See TracChangeset for help on using the changeset viewer.