/[mldonkey]/mldonkey/src/gtk/newgui/gui_graph.ml
ViewVC logotype

Diff of /mldonkey/src/gtk/newgui/gui_graph.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by simon_mld, Mon Nov 17 21:12:51 2003 UTC revision 1.2 by spiralvoice, Fri Aug 26 21:10:43 2005 UTC
# Line 100  let set_uploads_pixmap_headers w h col1 Line 100  let set_uploads_pixmap_headers w h col1
100    uploads_pixmap_headers :=    uploads_pixmap_headers :=
101      Some (Array.concat [header;color_none;color1;color2])      Some (Array.concat [header;color_none;color1;color2])
102    
 let time_to_string time =  
   let days = time / 60 / 60 / 24 in  
   let rest = time - days * 60 * 60 * 24 in  
   let hours = rest / 60 / 60 in  
   let rest = rest - hours * 60 * 60 in  
   let minutes = rest / 60 in  
   let seconds = rest - minutes * 60 in  
     if days > 0  
     then Printf.sprintf " %dd " days  
     else if hours > 0  
     then Printf.sprintf " %d:%02d:%02d " hours minutes seconds  
     else Printf.sprintf " %d:%02d " minutes seconds  
   
103  let string_to_time s =  let string_to_time s =
104    let l = String.length s in    let l = String.length s in
105    try    try
# Line 272  let draw_downloads_graph _ = Line 259  let draw_downloads_graph _ =
259        grid_pixmap#line        grid_pixmap#line
260          ~x:0 ~y:(!height - a - 1) ~x:!width ~y:(!height - a - 1);          ~x:0 ~y:(!height - a - 1) ~x:!width ~y:(!height - a - 1);
261        grid_pixmap#string        grid_pixmap#string
262          (time_to_string (a * !download_timeout / 1000))          (Date.time_to_string_long (a * !download_timeout / 1000))
263           ~font:!font ~x:(a + 2) ~y:(!height - 2);           ~font:!font ~x:(a + 2) ~y:(!height - 2);
264        if a > 0 then        if a > 0 then
265          grid_pixmap#string          grid_pixmap#string
# Line 364  let draw_uploads_graph _ = Line 351  let draw_uploads_graph _ =
351        grid_pixmap#line        grid_pixmap#line
352          ~x:0 ~y:(!height - a - 1) ~x:!width ~y:(!height - a - 1);          ~x:0 ~y:(!height - a - 1) ~x:!width ~y:(!height - a - 1);
353        grid_pixmap#string        grid_pixmap#string
354          (time_to_string (a * !upload_timeout / 1000))          (Date.time_to_string_long (a * !upload_timeout / 1000))
355          ~font:!font ~x:(a + 2) ~y:(!height - 2);          ~font:!font ~x:(a + 2) ~y:(!height - 2);
356        if a > 0 then        if a > 0 then
357          grid_pixmap#string          grid_pixmap#string

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26