+ gviz#connect_href (fun button_ev attrs ->
+ let time = GdkEvent.Button.time button_ev in
+ let uri = List.assoc "href" attrs in
+ gviz_uri <- UriManager.uri_of_string uri;
+ match GdkEvent.Button.button button_ev with
+ | button when button = left_button -> self#load (`Uri gviz_uri)
+ | button when button = right_button ->
+ dep_contextual_menu#popup ~button ~time
+ | _ -> ());
+ connect_menu_item win#depGraphMenuItem (fun () ->
+ match self#currentCicUri with
+ | Some uri -> self#load (`Metadata (`Deps (`Fwd, uri)))
+ | None -> ());
+ connect_menu_item win#invDepGraphMenuItem (fun () ->
+ match self#currentCicUri with
+ | Some uri -> self#load (`Metadata (`Deps (`Back, uri)))
+ | None -> ());
+ connect_menu_item win#hBugsTutorsMenuItem (fun () ->
+ self#load (`HBugs `Tutors));
+ connect_menu_item win#browserUrlMenuItem (fun () ->
+ win#browserUri#entry#misc#grab_focus ());
+
+ (* fill dep graph contextual menu *)
+ let go_menu_item =
+ GMenu.image_menu_item ~label:"Browse it"
+ ~packing:dep_contextual_menu#append () in
+ let expand_menu_item =
+ GMenu.image_menu_item ~label:"Expand"
+ ~packing:dep_contextual_menu#append () in
+ let collapse_menu_item =
+ GMenu.image_menu_item ~label:"Collapse"
+ ~packing:dep_contextual_menu#append () in
+ dep_contextual_menu#append (go_menu_item :> GMenu.menu_item);
+ dep_contextual_menu#append (expand_menu_item :> GMenu.menu_item);
+ dep_contextual_menu#append (collapse_menu_item :> GMenu.menu_item);
+ connect_menu_item go_menu_item (fun () -> self#load (`Uri gviz_uri));
+ connect_menu_item expand_menu_item (fun () ->
+ MetadataDeps.DepGraph.expand gviz_uri gviz_graph;
+ self#redraw_gviz ~center_on:gviz_uri ());
+ connect_menu_item collapse_menu_item (fun () ->
+ MetadataDeps.DepGraph.collapse gviz_uri gviz_graph;
+ self#redraw_gviz ~center_on:gviz_uri ());
+