Changeset 3356


Ignore:
Timestamp:
11/04/07 23:14:13 (6 years ago)
Author:
mickey
Message:

openmoko-panel-battery: use g_timeout_add_seconds (needs glib >= 2.14 now)

Location:
trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-battery
Files:
2 edited

Legend:

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

    r3355 r3356  
     12007-11-05      Michael Lauer <mickey@openmoko.org> 
     2 
     3        * src/openmoko-panel-battery.c: Use g_timeout_add_seconds. 
     4        Note that we now require glib >= 2.14 
     5 
    162007-11-02      Michael Lauer <mickey@openmoko.org> 
    27 
  • trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-battery/src/openmoko-panel-battery.c

    r3355 r3356  
    1 /* vim: set sts=4 sw=4 expandtab: */ 
    21/*  openmoko-panel-battery.c 
    32 * 
     
    2625#include <gtk/gtklabel.h> 
    2726#include <dbus/dbus.h> 
    28  
     27#include <dbus/dbus-glib-lowlevel.h> 
    2928#include <apm.h> 
    3029#include <string.h> 
     
    104103{ 
    105104    char* icon; 
    106     static int last_status = -255; /* the status last time we checked */ 
     105    static int last_status = -123; /* the status last time we checked */ 
    107106 
    108107    apm_info info; 
     
    157156    local_time = localtime(&t); 
    158157 
     158    timeout( applet ); 
    159159    battery_applet_init_dbus( applet ); 
    160  
    161     /* should use g_timeout_add_seconds() here to save power, but it is only 
    162      * available in glib >= 2.14 
    163      */ 
    164     applet->timeout_id = g_timeout_add ( 10 * 1000, (GSourceFunc) timeout, applet); 
    165     moko_panel_applet_set_icon( applet->mokoapplet, icon ); // initial status = unknown 
     160    applet->timeout_id = g_timeout_add_seconds( 60, (GSourceFunc) timeout, applet); 
    166161    gtk_widget_show_all( GTK_WIDGET(mokoapplet) ); 
    167162    return GTK_WIDGET(mokoapplet); 
    168163} 
    169 22 
Note: See TracChangeset for help on using the changeset viewer.