window : GWindow.window;
view : Filetree.t;
vmcombo : GEdit.combo_box GEdit.text_combo;
+ refresh_button : GButton.button;
throbber : GMisc.image;
throbber_static : GdkPixbuf.pixbuf;
statusbar : GMisc.statusbar;
make_menubar window vbox ~packing:vbox#pack () in
(* Top toolbar. *)
- let vmcombo, throbber, throbber_static =
+ let vmcombo, refresh_button, throbber, throbber_static =
make_toolbar ~packing:vbox#pack () in
(* Main part of display is the file tree. *)
window = window;
view = view;
vmcombo = vmcombo;
+ refresh_button = refresh_button;
throbber = throbber; throbber_static = throbber_static;
statusbar = statusbar; statusbar_context = statusbar_context;
progress_bar = progress_bar
ignore (connect_none_item#connect#activate
~callback:(fun () -> connect_to ws None));
- (* VM combo box when changed by the user. *)
+ (* VM combo box when changed by the user.
+ * The refresh button acts like changing the VM combo too.
+ *)
let combo, (model, column) = ws.vmcombo in
ignore (
combo#connect#changed
| Some row -> open_domain ws (model#get ~row ~column)
)
);
+ ignore (
+ refresh_button#connect#clicked
+ ~callback:(
+ fun () ->
+ match combo#active_iter with
+ | None -> () (* nothing selected *)
+ | Some row -> open_domain ws (model#get ~row ~column)
+ )
+ );
(* Return the window_state struct. *)
ws
hbox#pack (mklabel "Guest: ");
let vmcombo = GEdit.combo_box_text ~packing:hbox#pack () in
+ (* Refresh button.
+ * http://stackoverflow.com/questions/2188659/stock-icons-not-shown-on-buttons
+ *)
+ let refresh_button =
+ let image = GMisc.image ~stock:`REFRESH () in
+ let b = GButton.button ~packing:hbox#pack () in
+ b#set_image (image :> GObj.widget);
+ b in
+
(* Throbber. *)
let static = Throbber.static () in
(*let animation = Throbber.animation () in*)
let throbber =
GMisc.image ~pixbuf:static ~packing:(hbox#pack ~from:`END) () in
- vmcombo, throbber, static
+ vmcombo, refresh_button, throbber, static
and make_filetree ~packing () =
let sw =