Index: src/daemon/common/commonFile.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/daemon/common/commonFile.ml,v
retrieving revision 1.40
diff -u -w -r1.40 commonFile.ml
--- src/daemon/common/commonFile.ml	10 Oct 2005 16:22:24 -0000	1.40
+++ src/daemon/common/commonFile.ml	25 Oct 2005 01:46:47 -0000
@@ -557,7 +557,6 @@
   let n = impl.impl_file_ops.op_file_network in
   let buf = o.conn_buf in
   let srcs = file_all_sources file in
-  let active_srcs = file_active_sources file in
 
   if use_html_mods o then begin
 
Index: src/daemon/common/commonOptions.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/daemon/common/commonOptions.ml,v
retrieving revision 1.95
diff -u -w -r1.95 commonOptions.ml
--- src/daemon/common/commonOptions.ml	17 Oct 2005 15:25:45 -0000	1.95
+++ src/daemon/common/commonOptions.ml	25 Oct 2005 01:46:48 -0000
@@ -235,6 +235,8 @@
 
 let ip_list_option = list_option Ip.option
 
+let int_list_option = list_option int_option
+
 let allow_browse_share_option = define_option_class "Integer"
     (fun v ->
       match v with
@@ -260,6 +262,16 @@
   (fun s ->
       let list = String2.tokens s in
       List.map (fun ip -> Ip.of_string ip) list
+  );
+  Options.set_string_wrappers int_list_option
+    (fun list ->
+      List.fold_left (fun s i ->
+          Printf.sprintf "%s %s" (string_of_int i) s
+      ) "" (List.rev list)
+  )
+  (fun s ->
+      let list = String2.tokens s in
+      List.map (fun i -> int_of_string i) list
   )
 
 let is_not_spam = ref (fun _ -> true)
@@ -1307,6 +1319,10 @@
     ["minor_heap_size"] "Size of the minor heap in kB"
     int_option 32
 
+let relevant_queues = define_expert_option current_section ["relevant_queues"]
+    "The source queues to display in source lists (see 'sources' command)"
+    int_list_option [0;1;2;3;4;5;6;8;9;10]
+
 let min_reask_delay = define_expert_option current_section ["min_reask_delay"]
   "The minimal delay between two connections to the same client (in seconds)"
     int_option 600
Index: src/daemon/common/commonSources.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/daemon/common/commonSources.ml,v
retrieving revision 1.29
diff -u -w -r1.29 commonSources.ml
--- src/daemon/common/commonSources.ml	23 Oct 2005 16:04:53 -0000	1.29
+++ src/daemon/common/commonSources.ml	25 Oct 2005 01:46:50 -0000
@@ -1005,7 +1005,17 @@
           Queue.iter (fun (_,s) -> f s)  q
         done
 
-
+(*************************************************************************)
+(*                                                                       *)
+(*                         iter_relevant_sources                         *)
+(*                                                                       *)
+(*************************************************************************)
+      let iter_relevant_sources f m =
+        List.iter (fun i ->
+          if i < nqueues then
+            let q = m.manager_sources.(i) in
+            Queue.iter (fun (_,s) -> f s)  q
+        ) !!relevant_queues
 
 (*************************************************************************)
 (*                                                                       *)
Index: src/daemon/common/commonSources.mli
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/daemon/common/commonSources.mli,v
retrieving revision 1.8
diff -u -w -r1.8 commonSources.mli
--- src/daemon/common/commonSources.mli	21 Sep 2005 18:11:54 -0000	1.8
+++ src/daemon/common/commonSources.mli	25 Oct 2005 01:46:50 -0000
@@ -178,6 +178,7 @@
       val iter_all_sources : (source -> unit) -> file_sources_manager -> unit
       val iter_active_sources : (source -> unit) -> file_sources_manager -> unit
       val iter_qualified_sources : (source -> unit) -> file_sources_manager -> unit
+			val iter_relevant_sources : (source -> unit) -> file_sources_manager -> unit
 
       val set_brothers : file_sources_manager list -> unit
       val get_brothers : file_sources_manager -> string list      
Index: src/networks/donkey/donkeyInteractive.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/networks/donkey/donkeyInteractive.ml,v
retrieving revision 1.66
diff -u -w -r1.66 donkeyInteractive.ml
--- src/networks/donkey/donkeyInteractive.ml	23 Oct 2005 16:02:48 -0000	1.66
+++ src/networks/donkey/donkeyInteractive.ml	25 Oct 2005 01:46:51 -0000
@@ -1268,7 +1268,15 @@
   );
   file_ops.op_file_print_sources_html <- (fun file buf ->
 
-   if List.length (file_ops.op_file_all_sources file) > 0 then begin
+    let sources_list = ref [] in
+    DonkeySources.iter_relevant_sources (fun s ->
+      let s_uid = s.DonkeySources.source_uid in
+      let c = new_client s_uid in
+      sources_list := (s,c) :: !sources_list
+    ) file.file_sources;
+
+    if List.length !sources_list > 0 then 
+    begin
 
       let chunks =
       (match file.file_swarmer with
@@ -1276,7 +1284,6 @@
        Int64Swarmer.verified_bitmap swarmer)
       in
 
-
       html_mods_table_header buf "sourcesTable" "sources al" ([
           ( "1", "srh ac", "Client number (click to add as friend)", "Num" ) ;
           ( "0", "srh", "[A] = Active download from client", "A" ) ;
@@ -1314,24 +1321,16 @@
                   chunks );!fc ))) ]);
 
 
-      let counter = ref 0 in
-      DonkeySources.iter_all_sources (fun s ->
-          let s_uid = s.DonkeySources.source_uid in
-          let c = new_client s_uid in
-          let c1 = (as_client c) in
-          incr counter;
-
+      html_mods_cntr_init();
+      List.iter (fun (s,c) ->
+        let ac = as_client c in
         try
-          let i = (client_info (as_client c)) in
-
-
-          Printf.bprintf buf "\\<tr onMouseOver=\\\"mOvr(this);\\\"
-        onMouseOut=\\\"mOut(this);\\\" class=\\\"%s\\\"\\>"
-           (if (!counter mod 2 == 0) then "dl-1" else "dl-2");
+          let i = client_info ac in
 
+          Printf.bprintf buf "\\<tr onMouseOver=\\\"mOvr(this);\\\" onMouseOut=\\\"mOut(this);\\\" class=\\\"dl-%d\\\"\\>"
+            (html_mods_cntr());
 
-          Printf.bprintf buf "\\<td title=\\\"Add as Friend\\\" class=\\\"srb ar\\\"
-    onClick=\\\"parent.fstatus.location.href='submit?q=friend_add+%d'\\\"\\>%d\\</TD\\>"
+          Printf.bprintf buf "\\<td title=\\\"Add as Friend\\\" class=\\\"srb ar\\\" onClick=\\\"parent.fstatus.location.href='submit?q=friend_add+%d'\\\"\\>%d\\</TD\\>"
             (client_num c) (client_num c);
 
           let req_queue, req_score, req_min = 
@@ -1347,7 +1346,7 @@
 
           html_mods_td buf ([
             ("", "sr", (match c.client_download with
-                  None -> Printf.sprintf ""
+                  None -> ""
                 | Some _ -> Printf.sprintf "%s" (
                       let qfiles = c.client_file_queue in
                       let (qfile, qchunks,_) =  List.hd qfiles in
@@ -1358,14 +1357,15 @@
             (String.escaped c.client_name, "sr", client_short_name c.client_name);
             (brand_to_string c.client_brand, "sr", gbrand_to_string c.client_brand);
             ("", "sr", c.client_emule_proto.emule_release);
+
             ] @
             (if !!emule_mods_count then [(brand_mod_to_string c.client_mod_brand, "sr", gbrand_mod_to_string c.client_mod_brand)] else [])
             @ [
-              ("", "sr", (if DonkeySources.source_brand c.client_source
-                  then "T" else "F"));
+
+            ("", "sr", (if DonkeySources.source_brand c.client_source then "T" else "F"));
             ("", "sr", (match c.client_kind with
-                  | Direct_address (ip,port) -> Printf.sprintf "D"
-                  | _ -> Printf.sprintf "I"
+                  | Direct_address (ip,port) -> "D"
+                  | _ -> "I"
                 ));
             ("", "sr", (match c.client_sui_verified with
                   | None -> "N"
@@ -1382,7 +1382,7 @@
             ("", "sr ar", req_score);
             ("", "sr ar", req_queue);
             ("", "sr ar br", req_min);
-            ("", "sr ar", (if client_has_a_slot (as_client c) then "T" else "F"));
+            ("", "sr ar", (if client_has_a_slot ac then "T" else "F"));
             ("", "sr ar br", (if c.client_banned then "T" else "F"));
             ("", "sr ar", Printf.sprintf "%d" c.client_requests_sent);
             ("", "sr ar", Printf.sprintf "%d" c.client_requests_received);
@@ -1412,7 +1412,8 @@
            Printf.bprintf buf "\\</tr\\>";
         with _ -> ()
 
-      ) file.file_sources;
+      ) (List.sort (fun (s1,c1) (s2,c2) -> compare (client_num c1) (client_num c2)) !sources_list);
+
 
     Printf.bprintf buf "\\</table\\>\\</div\\>\\<br\\>";
 
