The unified diff between revisions [f9bf0ab9..] and [23b40306..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'view.ml'
#
#
# patch "view.ml"
# from [c9832d10fa8c7df2b6169cf5a6535b48bff583ad]
# to [590a55ffdf7771966025cd399911f5761dd53658]
#
============================================================
--- view.ml c9832d10fa8c7df2b6169cf5a6535b48bff583ad
+++ view.ml 590a55ffdf7771966025cd399911f5761dd53658
@@ -44,7 +44,6 @@ type branch_selector = {
type branch_selector = {
combo : GEdit.combo_box GEdit.text_combo ;
mutable combo_signal : GtkSignal.id option ;
- sub : GButton.toggle_button ;
mutable branches : string array ;
select_signal : Viz_types.query Signal.t ;
}
@@ -329,9 +328,7 @@ module Branch_selector = struct
match combo#active with
| -1 -> raise Exit
| 0 -> ALL
- | i ->
- let b = s.branches.(i - 1) in
- if s.sub#active then COLLECTION b else BRANCH b
+ | i -> BRANCH s.branches.(i - 1)
end
with Exit -> ()
@@ -351,27 +348,22 @@ module Branch_selector = struct
combo#pack r ;
combo#add_attribute r "markup" column ;
(combo, store) in
- let checkb =
- GButton.check_button
- ~label:"Include sub-branches"
- ~active:false ~packing:hb#pack () in
let entry = GEdit.entry ~packing:(hb#pack ~from:`END) () in
begin
let tooltips = GData.tooltips () in
tooltips#set_tip
- ~text:"Find a node by its revision id, tag or date (YYYY-MM-DD)"
+ ~text:"Find a node by its revision id or tag"
entry#coerce
end ;
let lbl = GMisc.label ~text:"Find:" ~packing:(hb#pack ~from:`END) () in
let c =
{ combo = combo ; combo_signal = None ;
- sub = checkb ; branches = [||] ;
+ branches = [||] ;
select_signal = Signal.make () } in
begin
let callback () = select_branch c in
let (combo, _) = combo in
- c.combo_signal <- Some (combo#connect#changed ~callback) ;
- ignore (checkb#connect#toggled ~callback)
+ c.combo_signal <- Some (combo#connect#changed ~callback)
end ;
let f = { last_find = "", [] ; find_signal = Signal.make () ; find_entry = entry } in
ignore (entry#connect#activate (fun () ->
@@ -381,8 +373,6 @@ module Branch_selector = struct
let connect v f =
Signal.connect v.selector.select_signal f
- let get_display_sub_branches v = v.selector.sub#active
-
let clear { selector = s } =
s.branches <- [||] ;
with_inactive_combo s
@@ -394,7 +384,7 @@ module Branch_selector = struct
s.branches <- Array.of_list br ;
begin
let row = model#append () in
- model#set ~row ~column "<i>Everything</i>"
+ model#set ~row ~column "<i>HEAD</i>"
end ;
List.iter
(fun b ->
@@ -412,10 +402,13 @@ module Branch_selector = struct
let (combo, _) = s.combo in
combo#set_active
begin
- try 1 + array_index s.branches b
- with Not_found ->
- error_notice_f ~parent:s.sub "Could not find the branch '%s'" b ;
- -1
+ match b with
+ | None -> 0
+ | Some b ->
+ try 1 + array_index s.branches b
+ with Not_found ->
+ error_notice_f ~parent:(fst s.combo) "Could not find the branch '%s'" b ;
+ -1
end
let get_branch { selector = s } =
@@ -999,8 +992,6 @@ let make ~aa ~prefs ~packing =
| `NODE_SELECT id ->
Canvas.display_selection_marker v id ;
Info_Display.fetch_and_display_data v id
- | `NODE_SWITCH_BRANCH branch ->
- Branch_selector.set_branch v branch
| `CLEAR ->
Info_Display.clear_info v ;
KeyNav.clear v ;
@@ -1035,7 +1026,7 @@ let open_db v fname branch =
let db = Database.open_db fname in
v.db <- Some db ;
Branch_selector.populate v (Database.fetch_branches db) ;
- may (Branch_selector.set_branch v) branch ;
+ Branch_selector.set_branch v branch ;
Signal.emit v.event_signal `OPEN_DB
with Viz_types.Error msg ->
error_notice ~parent:v.canvas.w msg