mldonkey-devel
[Top][All Lists]
Advanced

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

[Mldonkey-devel] [PATCH] old mlgui patch


From: rgselk
Subject: [Mldonkey-devel] [PATCH] old mlgui patch
Date: Wed, 17 Dec 2003 05:38:03 -0800 (PST)

This patch makes the old mlgui compile again, run again and makes it 
usable in general again...


The patch on the Makefile is needed because otherwise the gui does not
build and start.

Autosizing is done to be able to view something without having to
manually resize everything. Auto sizing is done till the first time the
update method is called in gpattern.

The change in the Makefile certainly breaks the new gui...


Regards,
  rgselk.


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
Index: Makefile
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- Makefile    2003/12/16 20:32:59     1.1
+++ Makefile    2003/12/17 12:24:13
@@ -748,10 +748,7 @@
   $(SRC_GUI)/gui_messages.ml   $(SRC_GUI)/gui_global.ml \
   $(SRC_GUI)/gui_columns.ml \
   $(SRC_GUI)/gui_keys.ml \
-  $(SRC_GUI)/gui_options.ml \
-  $(SRC_PROGRESS)/gui_progress.ml \
-  $(SRC_GUI)/gui_misc.ml \
-  $(SRC_GUI)/gui_com.ml 
+  $(SRC_GUI)/gui_options.ml
 
 NEWGUI_SRCS=  \
   $(SRC_GUI)/gui_types.ml \
Index: src/gtk/gpattern/gpattern.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gpattern/gpattern.ml,v
retrieving revision 1.1
diff -u -r1.1 gpattern.ml
--- src/gtk/gpattern/gpattern.ml        2003/12/16 20:34:45     1.1
+++ src/gtk/gpattern/gpattern.ml        2003/12/17 12:24:14
@@ -64,6 +64,7 @@
     val mutable nfiltered = 0
     
     val mutable columns_width = ([] : (int * int) list)
+    val mutable first_update_done = false
 
     method box = wscroll#coerce
     method wlist = wlist
@@ -121,6 +122,7 @@
                       iter (n+1) q
                 in
                 iter 0 l;
+                if not first_update_done then wlist#columns_autosize ();
 (*                tooltips#set_tip ((wlist:int)#get_row row)#coerce ~text: 
"Tooltip";*)
                 match col_opt with
                   None -> ()
@@ -139,7 +141,7 @@
           None -> 
             ignore (wlist#append []) ; wlist#rows - 1
         | Some p -> 
-            ignore (wlist#insert ~row: p []) ; p
+            ignore (wlist#insert ~row: p []) ; if not first_update_done then 
wlist#columns_autosize () ; p
       in
       self#update_row d r
     
@@ -151,6 +153,10 @@
       for i = 0 to nitems - 1 do
         self#insert items.(i);
       done;
+      if not first_update_done then begin
+        wlist#columns_autosize ();
+        first_update_done <- true;
+      end;
       (* self#wlist#columns_autosize (); *)
       wlist#thaw ()
     
Index: src/gtk/gui/gui_cdget.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gui/gui_cdget.ml,v
retrieving revision 1.1
diff -u -r1.1 gui_cdget.ml
--- src/gtk/gui/gui_cdget.ml    2003/12/16 20:34:46     1.1
+++ src/gtk/gui/gui_cdget.ml    2003/12/17 12:24:14
@@ -42,7 +42,7 @@
 module M = Gui_messages
 
 
-let mldonkey_cache = Filename.concat config_dir "cache" 
+let mldonkey_cache = Filename.concat CommonOptions.config_dir "cache" 
   
 let file_from_url url = 
   try
Index: src/gtk/gui/gui_downloads.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gui/gui_downloads.ml,v
retrieving revision 1.1
diff -u -r1.1 gui_downloads.ml
--- src/gtk/gui/gui_downloads.ml        2003/12/16 20:34:46     1.1
+++ src/gtk/gui/gui_downloads.ml        2003/12/17 12:24:14
@@ -213,6 +213,7 @@
     
     method column_menu  i = 
       [
+        `I ("Autosize", fun _ -> self#wlist#columns_autosize ());
         `I ("Sort", self#resort_column i);
         `I ("Remove Column",
           (fun _ -> 
@@ -790,8 +791,10 @@
               match last_displayed_file with
                 Some file ->
                     let n = view_availability + 1 in
+(*
                     lprintf "view_availability %d/%d\n" n
                       (List.length file.file_availability);
+*)
                     view_availability <- (if
                       n > List.length file.file_availability 
                     then 0 else n);
@@ -1049,7 +1052,9 @@
 
 class pane_downloads () =
   let wl_status = GMisc.label ~text: "" ~show: true () in
-  let client_info_box = GPack.vbox ~homogeneous:false () in
+  let scroll_box = GPack.vbox () in
+  let scroll = GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC 
~placement:`TOP_LEFT ~packing:scroll_box#add () in
+  let client_info_box = GPack.vbox ~packing:scroll#add_with_viewport () in
   let locs = new Gui_friends.box_list client_info_box false in
   let dled = new box_downloaded wl_status () in
   let dls = new box_downloads locs wl_status () in
@@ -1129,7 +1134,7 @@
 
       
       clients_wpane#add1 locs#coerce;
-      clients_wpane#add2 client_info_box#coerce;
+      clients_wpane#add2 scroll_box#coerce;
       downloaded_frame#add dled#coerce; 
       downloads_frame#add dls#coerce ;
       if !!Gui_options.downloads_up then  begin
Index: src/gtk/gui/gui_friends.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gui/gui_friends.ml,v
retrieving revision 1.1
diff -u -r1.1 gui_friends.ml
--- src/gtk/gui/gui_friends.ml  2003/12/16 20:34:46     1.1
+++ src/gtk/gui/gui_friends.ml  2003/12/17 12:24:14
@@ -58,10 +58,11 @@
   | BlackListedHost -> gettext M.black_listed, Some !!O.color_not_connected
       
 let string_color_of_client friend_tab c =
-  match c.client_files with
-    Some _ when friend_tab -> 
-      gettext M.o_col_files_listed, Some !!O.color_downloading 
-  | _ -> string_color_of_state c.client_state
+  let msg, col = string_color_of_state c.client_state in
+  match c.client_files, col with
+    Some _, None -> gettext M.o_col_files_listed, Some !!O.color_files_listed
+  | Some _, _ -> (String.concat ", " [msg; gettext M.o_col_files_listed]), col
+  | _, _ -> msg, col
 
 let shorten maxlen s =
   let len = String.length s in
@@ -129,6 +130,7 @@
       
     method column_menu  i = 
       [
+        `I ("Autosize", fun _ -> GToolbox.autosize_clist self#wlist);
         `I ("Sort", self#resort_column i);
         `I ("Remove Column",
           (fun _ -> 
Index: src/gtk/gui/gui_options.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gui/gui_options.ml,v
retrieving revision 1.1
diff -u -r1.1 gui_options.ml
--- src/gtk/gui/gui_options.ml  2003/12/16 20:34:46     1.1
+++ src/gtk/gui/gui_options.ml  2003/12/17 12:24:14
@@ -31,9 +31,9 @@
 module M = Gui_messages
 module C = Gui_columns
 
-let _ = Unix2.safe_mkdir config_dir
+let _ = Unix2.safe_mkdir CommonOptions.config_dir
 let mldonkey_gui_ini = create_options_file 
-    (Filename.concat config_dir "mldonkey_gui.ini")
+    (Filename.concat CommonOptions.config_dir "mldonkey_gui.ini")
   
 module KeyOption = struct
     
Index: src/gtk/gui/gui_results.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gui/gui_results.ml,v
retrieving revision 1.1
diff -u -r1.1 gui_results.ml
--- src/gtk/gui/gui_results.ml  2003/12/16 20:34:46     1.1
+++ src/gtk/gui/gui_results.ml  2003/12/17 12:24:14
@@ -63,6 +63,7 @@
         
     method column_menu  i = 
       [
+        `I ("Autosize", fun _ -> self#wlist#columns_autosize ());
         `I ("Sort", self#resort_column i);
         `I ("Remove Column",
           (fun _ -> 
Index: src/gtk/gui/gui_rooms.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gui/gui_rooms.ml,v
retrieving revision 1.1
diff -u -r1.1 gui_rooms.ml
--- src/gtk/gui/gui_rooms.ml    2003/12/16 20:34:46     1.1
+++ src/gtk/gui/gui_rooms.ml    2003/12/17 12:24:14
@@ -59,6 +59,7 @@
       
     method column_menu  i = 
       [
+        `I ("Autosize", fun _ -> self#wlist#columns_autosize ());
         `I ("Sort", self#resort_column i);
         `I ("Remove Column",
           (fun _ -> 
Index: src/gtk/gui/gui_servers.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gui/gui_servers.ml,v
retrieving revision 1.1
diff -u -r1.1 gui_servers.ml
--- src/gtk/gui/gui_servers.ml  2003/12/16 20:34:46     1.1
+++ src/gtk/gui/gui_servers.ml  2003/12/17 12:24:14
@@ -114,6 +114,7 @@
     
     method column_menu  i = 
       [
+        `I ("Autosize", fun _ -> self#wlist#columns_autosize ());
         `I ("Sort", self#resort_column i);
         `I ("Remove Column",
           (fun _ -> 
Index: src/gtk/gui/gui_uploads.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gui/gui_uploads.ml,v
retrieving revision 1.1
diff -u -r1.1 gui_uploads.ml
--- src/gtk/gui/gui_uploads.ml  2003/12/16 20:34:46     1.1
+++ src/gtk/gui/gui_uploads.ml  2003/12/17 12:24:14
@@ -54,6 +54,7 @@
     
     method column_menu  i = 
       [
+        `I ("Autosize", fun _ -> self#wlist#columns_autosize ());
         `I ("Sort", self#resort_column i);
         `I ("Remove Column",
           (fun _ -> 
Index: src/gtk/gui/gui_users.ml
===================================================================
RCS file: /cvsroot/mldonkey/mldonkey/src/gtk/gui/gui_users.ml,v
retrieving revision 1.1
diff -u -r1.1 gui_users.ml
--- src/gtk/gui/gui_users.ml    2003/12/16 20:34:46     1.1
+++ src/gtk/gui/gui_users.ml    2003/12/17 12:24:14
@@ -46,6 +46,7 @@
     
     method column_menu  i = 
       [
+        `I ("Autosize", fun _ -> self#wlist#columns_autosize ());
         `I ("Sort", self#resort_column i);
         `I ("Remove Column",
           (fun _ -> 

reply via email to

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