/[mldonkey]/mldonkey/src/gtk/gui/gui_downloads.ml
ViewVC logotype

Diff of /mldonkey/src/gtk/gui/gui_downloads.ml

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

revision 1.7 by spiralvoice, Sun Mar 20 01:41:29 2005 UTC revision 1.8 by spiralvoice, Fri Aug 26 21:10:43 2005 UTC
# Line 161  let string_of_format format = Line 161  let string_of_format format =
161          tag.M.tracknum tag.M.title          tag.M.tracknum tag.M.title
162    | _ -> (gettext M.unknown)    | _ -> (gettext M.unknown)
163    
 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  
   
164  let max_eta = 1000.0 *. 60.0 *. 60.0 *. 24.0  let max_eta = 1000.0 *. 60.0 *. 60.0 *. 24.0
165            
166  let calc_file_eta f =  let calc_file_eta f =
# Line 316  class box columns sel_mode () = Line 303  class box columns sel_mode () =
303        | Col_file_network -> Gui_global.network_name f.file_network        | Col_file_network -> Gui_global.network_name f.file_network
304        | Col_file_age ->        | Col_file_age ->
305            let age = (BasicSocket.last_time ()) - f.file_age in            let age = (BasicSocket.last_time ()) - f.file_age in
306            time_to_string age            Date.time_to_string_long age
307        | Col_file_last_seen ->        | Col_file_last_seen ->
308            if f.file_last_seen > 0            if f.file_last_seen > 0
309            then let last = (BasicSocket.last_time ())            then let last = (BasicSocket.last_time ())
310                - f.file_last_seen in                - f.file_last_seen in
311              time_to_string last              Date.time_to_string_long last
312            else Printf.sprintf "---"            else Printf.sprintf "---"
313        | Col_file_eta ->        | Col_file_eta ->
314            let eta = calc_file_eta f in            let eta = calc_file_eta f in
315            if eta >= 1000 * 60 * 60 * 24 then            if eta >= 1000 * 60 * 60 * 24 then
316              Printf.sprintf "---"              Printf.sprintf "---"
317            else time_to_string eta            else Date.time_to_string_long eta
318        | Col_file_priority ->        | Col_file_priority ->
319            Printf.sprintf "%3d" f.file_priority            Printf.sprintf "%3d" f.file_priority
320            

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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