From 839d9e124ffcbca5397f0f95854cdeb1973f7cbc Mon Sep 17 00:00:00 2001 From: "rjones@thinkpad.home.annexia.org" Date: Fri, 18 Apr 2008 13:11:07 +0100 Subject: [PATCH] Fix icons in the connection dialog. --- virt-ctrl/vc_connection_dlg.ml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/virt-ctrl/vc_connection_dlg.ml b/virt-ctrl/vc_connection_dlg.ml index f072a1d..6eda989 100644 --- a/virt-ctrl/vc_connection_dlg.ml +++ b/virt-ctrl/vc_connection_dlg.ml @@ -100,7 +100,8 @@ let open_connection parent () = vbox#set_spacing 5; let cols = new GTree.column_list in - (*let col_icon = cols#add Gobject.Data.string in*) + (* http://plus.kaist.ac.kr/~shoh/ocaml/lablgtk2/treeview-tutorial/ch05s08.html *) + let col_icon = cols#add (Gobject.Data.gobject_by_name "GdkPixbuf") in let col_name = cols#add Gobject.Data.string in let model = GTree.list_store cols in @@ -110,21 +111,21 @@ let open_connection parent () = ~packing:(vbox#pack ~expand:true ~fill:true) () in icons#set_border_width 4; - (*icons#set_pixbuf_column col_icon;*) + icons#set_pixbuf_column col_icon; icons#set_text_column col_name; let refresh () = model#clear (); let services = !find_libvirtd_with_zeroconf () in - (*let pixbuf = !icon_16x16_devices_computer_png in*) + let pixbuf = !icon_32x32_devices_computer_png in List.iter ( fun (name, _) -> let row = model#append () in model#set ~row ~column:col_name name; - (*match pixbuf with - | None -> () - | Some pixbuf -> model#set ~row ~column:col_icon pixbuf*) + match pixbuf with + | None -> () + | Some pixbuf -> model#set ~row ~column:col_icon pixbuf ) services in refresh (); -- 1.8.3.1