]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/matchbox-panel/matchbox-panel-0.9.1/no_time_support.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / matchbox-panel / matchbox-panel-0.9.1 / no_time_support.patch
1 Index: matchbox-panel-0.9.1/applets/mb-applet-battery.c
2 ===================================================================
3 --- matchbox-panel-0.9.1.orig/applets/mb-applet-battery.c       2005-02-16 14:29:16.000000000 +0000
4 +++ matchbox-panel-0.9.1/applets/mb-applet-battery.c    2005-02-16 16:45:55.000000000 +0000
5 @@ -273,24 +273,28 @@
6           mb_pixbuf_img_plot_pixel(pb, img_backing, x, y, r, g, b);
7      }
8  
9 -  /* Bubble alerts  */
10 -  if ((time_left_idx > 0) 
11 -      && !ac_power
12 -      && apm_vals[PERCENTAGE] > 0
13 -      /* && apm_vals[TIME_LEFT]  > 0 XXX Less strict */ 
14 -      && (apm_vals[TIME_LEFT] < time_left_alerts[time_left_idx]))
15 +  /*dont do this if time values arent supported by this bios*/
16 +  if (apm_vals[TIME_LEFT] > 0 )
17      {
18 -      char tray_msg[256];
19 -      sprintf(tray_msg, 
20 -             _("Battery power very low !\n\nTime Left: %.2i minutes"), 
21 -             time_left_alerts[time_left_idx]);
22 -      mb_tray_app_tray_send_message(app, tray_msg, 0);
23 -      time_left_idx--;
24 -    }
25 -  else if (time_left_idx < 4 
26 -          && apm_vals[TIME_LEFT] > time_left_alerts[time_left_idx+1])
27 -    {
28 -      time_left_idx++;
29 +    /* Bubble alerts  */
30 +    if ((time_left_idx > 0) 
31 +        && !ac_power
32 +       && apm_vals[PERCENTAGE] > 0
33 +        /* && apm_vals[TIME_LEFT]  > 0 XXX Less strict */ 
34 +        && (apm_vals[TIME_LEFT] < time_left_alerts[time_left_idx]))
35 +      {
36 +        char tray_msg[256];
37 +        sprintf(tray_msg, 
38 +               _("Battery power very low !\n\nTime Left: %.2i minutes"), 
39 +               time_left_alerts[time_left_idx]);
40 +        mb_tray_app_tray_send_message(app, tray_msg, 0);
41 +        time_left_idx--;
42 +      }
43 +    else if (time_left_idx < 4 
44 +            && apm_vals[TIME_LEFT] > time_left_alerts[time_left_idx+1])
45 +      {
46 +        time_left_idx++;
47 +      }
48      }
49  
50    mb_pixbuf_img_render_to_drawable(pb, img_backing, drw, 0, 0);
51 @@ -385,12 +389,20 @@
52         sprintf(tray_msg, _("AC Connected\nFully charged.\n"));
53      } else {
54        if (apm_vals[PERCENTAGE] > 0 
55 -         && apm_vals[PERCENTAGE] <= 100 
56 -         /* && apm_vals[TIME_LEFT] > 0 Less strict */)
57 -       {
58 -         sprintf(tray_msg, 
59 -                 _("Battery Power\nJuice %.2i %%\nTime left: %.2i mins\n"), apm_vals[PERCENTAGE], apm_vals[TIME_LEFT]);
60 -       }
61 +         && apm_vals[PERCENTAGE] <= 100 )
62 +        {
63 +         if (apm_vals[TIME_LEFT] > 0 )
64 +           {
65 +             sprintf(tray_msg, 
66 +                     _("Battery Power\nJuice %.2i %%\nTime left: %.2i mins\n"), apm_vals[PERCENTAGE], apm_vals[TIME_LEFT]);
67 +           }
68 +          else
69 +           {
70 +             sprintf(tray_msg, 
71 +                     _("Battery Power\nJuice %.2i %%\n"), apm_vals[PERCENTAGE]);
72 +           }
73 +
74 +        }
75        else sprintf(tray_msg, _("Battery Power\n Device read error.\n"));
76      }
77    mb_tray_app_tray_send_message(app, tray_msg, 5000);