mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...
Date: Sat, 23 Sep 2006 22:26:38 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       06/09/23 22:26:38

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonFile.ml commonFile.mli 
        src/daemon/driver: driverInteractive.ml 
        src/networks/donkey: donkeyInteractive.ml 
        src/networks/fileTP: fileTPInteractive.ml 
        src/networks/gnutella: gnutellaInteractive.ml 

Log message:
        patch #5417

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1021&r2=1.1022
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonFile.ml?cvsroot=mldonkey&r1=1.62&r2=1.63
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonFile.mli?cvsroot=mldonkey&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverInteractive.ml?cvsroot=mldonkey&r1=1.103&r2=1.104
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyInteractive.ml?cvsroot=mldonkey&r1=1.125&r2=1.126
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/fileTP/fileTPInteractive.ml?cvsroot=mldonkey&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/gnutella/gnutellaInteractive.ml?cvsroot=mldonkey&r1=1.64&r2=1.65

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1021
retrieving revision 1.1022
diff -u -b -r1.1021 -r1.1022
--- distrib/ChangeLog   23 Sep 2006 22:25:06 -0000      1.1021
+++ distrib/ChangeLog   23 Sep 2006 22:26:38 -0000      1.1022
@@ -15,6 +15,7 @@
 =========
 
 2006/09/24
+5417: Edonkey comments: Telnet support, UTF-8 output in HTML
 5416: Makefile.in: New variable $DEVFLAGSOPT for .cmx files (jave)
 5415: New command option: rem disc - remove all disconnected servers
 

Index: src/daemon/common/commonFile.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonFile.ml,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- src/daemon/common/commonFile.ml     23 Sep 2006 20:29:46 -0000      1.62
+++ src/daemon/common/commonFile.ml     23 Sep 2006 22:26:38 -0000      1.63
@@ -90,6 +90,7 @@
     mutable op_file_active_sources : ('a -> client list);
     mutable op_file_comment : ('a -> string);
     mutable op_file_set_priority : ('a -> int -> unit);
+    mutable op_file_print_plain : ('a -> Buffer.t -> unit);
     mutable op_file_print_html : ('a -> Buffer.t -> unit);
     mutable op_file_print_sources_html : ('a -> Buffer.t -> unit);
     mutable op_file_files : ('a -> 'a file_impl -> file list);    
@@ -204,12 +205,6 @@
   let file = as_file_impl file in
   file.impl_file_ops.op_file_to_option file.impl_file_val
 
-  (*
-let file_print (file : file) buf =
-  let file = as_file_impl file in
-  file.impl_file_ops.op_file_print file.impl_file_val buf
-    *)
-
 let file_save_as (file : file) name =
   let file = as_file_impl file in
   file.impl_file_ops.op_file_save_as file.impl_file_val name
@@ -435,6 +430,10 @@
   let impl = as_file_impl file in
   impl.impl_file_ops.op_file_print_html impl.impl_file_val buf
 
+let file_print_plain file buf =
+  let impl = as_file_impl file in
+  impl.impl_file_ops.op_file_print_plain impl.impl_file_val buf
+
 let file_find num =
   H.find files_by_num (as_file {
     dummy_file_impl   with impl_file_num = num
@@ -841,7 +840,8 @@
           None -> ()
         | Some filename ->
             Printf.bprintf buf "Probable name: %s\n" filename);
-      List.iter (fun name -> Printf.bprintf buf "    (%s)\n" name) 
info.G.file_names
+      List.iter (fun name -> Printf.bprintf buf "    (%s)\n" name) 
info.G.file_names;
+      file_print_plain file buf
     end;
 
   (try
@@ -1011,6 +1011,7 @@
       op_file_active_sources = (fun _ -> fni network "file_active_sources");
       op_file_comment = (fun _ -> ni_ok network "file_comment"; "");
       op_file_set_priority = (fun _ _ -> ni_ok network "file_set_priority");
+      op_file_print_plain = (fun _ _ -> ni_ok network "file_print_plain");
       op_file_print_html = (fun _ _ -> ni_ok network "file_print_html");
       op_file_print_sources_html = (fun _ _ -> fni network 
"file_print_sources_html");
       op_file_debug = (fun _ -> "");
@@ -1053,6 +1054,8 @@
         lprintf_nl "op_file_all_sources";
       if c.op_file_active_sources == cc.op_file_active_sources then
         lprintf_nl "op_file_active_sources";
+      if c.op_file_print_plain == cc.op_file_print_plain then
+        lprintf_nl "op_file_print_plain";
       if c.op_file_print_html == cc.op_file_print_html then
         lprintf_nl "op_file_print_html";
       if c.op_file_print_sources_html == cc.op_file_print_sources_html then

Index: src/daemon/common/commonFile.mli
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonFile.mli,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- src/daemon/common/commonFile.mli    23 Sep 2006 20:29:46 -0000      1.22
+++ src/daemon/common/commonFile.mli    23 Sep 2006 22:26:38 -0000      1.23
@@ -57,6 +57,7 @@
   mutable op_file_active_sources : 'a -> CommonTypes.client list;
   mutable op_file_comment : 'a -> string;
   mutable op_file_set_priority : 'a -> int -> unit;
+    mutable op_file_print_plain: 'a -> Buffer.t -> unit;
     mutable op_file_print_html: 'a -> Buffer.t -> unit;
     mutable op_file_print_sources_html : 'a -> Buffer.t -> unit;
     mutable op_file_files : ('a -> 'a file_impl -> CommonTypes.file list);    

Index: src/daemon/driver/driverInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverInteractive.ml,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -b -r1.103 -r1.104
--- src/daemon/driver/driverInteractive.ml      23 Sep 2006 20:29:47 -0000      
1.103
+++ src/daemon/driver/driverInteractive.ml      23 Sep 2006 22:26:38 -0000      
1.104
@@ -718,10 +718,15 @@
       (if file.file_comments = [] then "" else
                            begin
            let num_comments = number_of_comments file in
-           let buf1 = Buffer.create (100 * num_comments) in
+           let buf1 = Buffer.create (!!max_comment_length * num_comments) in
            Printf.bprintf buf1 "<br><br>Comments(%d):<br>" (num_comments);
-           (* What if there are 100 comments? big tooltip... *)
-           List.iter (fun (_,_,_,s) -> Printf.bprintf buf1 "%s<br>" 
(Http_server.html_real_escaped s)) file.file_comments;
+          let comments =
+            if List.length file.file_comments > 5 then
+              fst (List2.cut 5 file.file_comments) @ [Ip.null, "", 0, (_s 
"MLDonkey note: click file for more comments")]
+            else
+              file.file_comments
+          in
+           List.iter (fun (_,_,_,s) -> Printf.bprintf buf1 "%s<br>" 
(Http_server.html_real_escaped (Charset.to_utf8 s))) comments;
                              Buffer.contents buf1
                            end)
 
@@ -944,6 +949,7 @@
           |] else
           [|
             "$nNum";
+           "Comm";
             "File";
             "    %";
             "    Done";
@@ -988,6 +994,7 @@
                     file.file_num
                       (if downloading file then "PAUSE" else "RESUME")
                   else ""));
+             (Printf.sprintf "%4d" (number_of_comments file));
               (short_name file);
               (Printf.sprintf "%3.1f" (percent file));
               (if !!improved_telnet then (print_human_readable file 
file.file_downloaded)

Index: src/networks/donkey/donkeyInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyInteractive.ml,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -b -r1.125 -r1.126
--- src/networks/donkey/donkeyInteractive.ml    23 Sep 2006 20:29:47 -0000      
1.125
+++ src/networks/donkey/donkeyInteractive.ml    23 Sep 2006 22:26:38 -0000      
1.126
@@ -1213,6 +1213,13 @@
       ) file.file_sources;
       !list
   );
+  file_ops.op_file_print_plain <- (fun file buf ->
+    let cntr = ref 0 in
+    List.iter (fun (ip, n, r, c) ->
+      incr cntr;
+      Printf.bprintf buf
+       "Comment %d: Rating(%d): %s (%s/%s)\n" !cntr r (Charset.to_utf8 c) n 
(Ip.to_string ip)) file.file_comments
+  );
   file_ops.op_file_print_html <- (fun file buf ->
 
      let tr () =
@@ -1228,12 +1235,12 @@
 
       let cntr = ref 0 in
       List.iter (fun (ip, n, r, c) -> 
+        incr cntr;
         tr ();
         html_mods_td buf [
           ("Comment", "sr br", Printf.sprintf "Comment %d" !cntr);
-          ("User rating and comment", "sr", Printf.sprintf "Rating(%d): %s 
(%s/%s)" r c n (Ip.to_string ip));
+          ("User rating and comment", "sr", Printf.sprintf "Rating(%d): %s 
(%s/%s)" r (Charset.to_utf8 c) n (Ip.to_string ip));
         ];
-        incr cntr;
       ) file.file_comments;
 
       tr ();

Index: src/networks/fileTP/fileTPInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/fileTP/fileTPInteractive.ml,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- src/networks/fileTP/fileTPInteractive.ml    19 Sep 2006 17:07:43 -0000      
1.47
+++ src/networks/fileTP/fileTPInteractive.ml    23 Sep 2006 22:26:38 -0000      
1.48
@@ -417,6 +417,7 @@
   );
   file_ops.op_file_resume <- (fun file -> ());
   file_ops.op_file_print_html <- (fun file buf -> ());
+  file_ops.op_file_print_plain <- (fun file buf -> ());
   network.op_network_close_search <- (fun s -> ());
   network.op_network_forget_search <- (fun s -> ());
   network.op_network_connect_servers <- (fun s -> ());

Index: src/networks/gnutella/gnutellaInteractive.ml
===================================================================
RCS file: 
/sources/mldonkey/mldonkey/src/networks/gnutella/gnutellaInteractive.ml,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- src/networks/gnutella/gnutellaInteractive.ml        19 Sep 2006 17:07:43 
-0000      1.64
+++ src/networks/gnutella/gnutellaInteractive.ml        23 Sep 2006 22:26:38 
-0000      1.65
@@ -289,6 +289,7 @@
   
 let _ =
   file_ops.op_file_print_html <- (fun file buf -> ());
+  file_ops.op_file_print_plain <- (fun file buf -> ());
   file_ops.op_file_cancel <- (fun file ->
       CommonSwarming.remove_swarmer file.file_swarmer;
       file.file_swarmer <- None;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]