From: rjones@thinkpad.home.annexia.org Date: Fri, 18 Apr 2008 12:11:07 +0000 (+0100) Subject: Fix icons in the connection dialog. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;ds=sidebyside;h=839d9e124ffcbca5397f0f95854cdeb1973f7cbc;p=virt-ctrl.git Fix icons in the connection dialog. --- 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 ();