From 9626711a6c6a4da4fb73fd6b81e1023710ee1266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B5ivo=20Leedj=C3=A4rv?= <69477666+tleedjarv@users.noreply.github.com> Date: Wed, 14 Jul 2021 15:39:42 +0200 Subject: [PATCH] uigtk2: Compile with lablgtk3 Just the minimal changes to make uigtk2 compile with lablgtk3. Main changes: * Replaced custom busy mouse pointer (pixmaps no more) with stock busy pointer * Removed `no_separator` from all windows and dialogs (removed in GTK) * Replaced `allow_grow` (removed in GTK) with `resizable` for all windows and dialogs * Replaced `image_menu_item` (removed in GTK) with `menu_item` * Replaced `GWindow.file_selection` dialog for getting roots with `GFile.chooser_button` * Replaced `option_menu` (removed in GTK) in documentation window with regular `menu_bar` (just a workaround) * Replaced toolbar `insert_button` (removed in GTK) with new toolbar API (`GButton.tool_button` and friends) Limitations: * Statistics window is currently lacking diagram graphics (pixmaps no more) * `set_size_chars` seems to be broken, making sizes of many widgets incorrect --- .github/workflows/CICD.yml | 2 +- src/Makefile.OCaml | 10 +- src/dune | 2 +- src/pixmaps.ml | 17 ---- src/uigtk2.ml | 194 +++++++++++++++++-------------------- unison.opam | 3 +- 6 files changed, 99 insertions(+), 129 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 740f6ecf6..691016a00 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -143,7 +143,7 @@ jobs: - name: lablgtk install ## [2020-09] non-working/unavailable for MSVC or musl OCaml variants ; also, non-working for 32bit OCaml variant (see [GH:garrigue/lablgtk#64](https://github.com/garrigue/lablgtk/issues/64)) if: ${{ ! ( contains(matrix.job.ocaml-version, '+msvc') || contains(matrix.job.ocaml-version, '+musl') || contains(matrix.job.ocaml-version, '+32bit') ) }} - run: opam depext --install --verbose --yes lablgtk + run: opam depext --install --verbose --yes lablgtk3 && opam install ocamlfind - shell: bash run: | diff --git a/src/Makefile.OCaml b/src/Makefile.OCaml index 821ce8a6d..2a4afba53 100644 --- a/src/Makefile.OCaml +++ b/src/Makefile.OCaml @@ -73,7 +73,7 @@ OCAMLLIBDIR=$(shell ocamlc -v | tail -1 | sed -e 's/.* //g' | tr '\\' '/' | tr - # This should be set to an appropriate value automatically, depending # on whether the lablgtk library is available LABLGTKLIB=$(OCAMLLIBDIR)/lablgtk -LABLGTK2LIB=$(OCAMLLIBDIR)/lablgtk2 +LABLGTK2LIB=$(OCAMLLIBDIR)/lablgtk3 ##BCP [3/2007]: Removed temporarily, since the OSX UI is not working well ## at the moment and we don't want to confuse people by building it by default ifeq ($(OSARCH),osx) @@ -82,7 +82,7 @@ else ifeq ($(wildcard $(LABLGTK2LIB)),$(LABLGTK2LIB)) UISTYLE=gtk2 else - LABLGTK2LIB=$(abspath $(OCAMLLIBDIR)/../lablgtk2) + LABLGTK2LIB=$(abspath $(OCAMLLIBDIR)/../lablgtk3) ifeq ($(wildcard $(LABLGTK2LIB)),$(LABLGTK2LIB)) UISTYLE=gtk2 else @@ -294,12 +294,12 @@ OCAMLFIND := $(shell command -v ocamlfind 2> /dev/null) ifeq ($(UISTYLE), gtk2) ifndef OCAMLFIND - CAMLFLAGS+=-I +lablgtk2 + CAMLFLAGS+=-I +lablgtk3 else - CAMLFLAGS+=$(shell $(OCAMLFIND) query -i-format lablgtk2 ) + CAMLFLAGS+=$(shell $(OCAMLFIND) query -i-format lablgtk3 ) endif OCAMLOBJS+=pixmaps.cmo uigtk2.cmo linkgtk2.cmo - OCAMLLIBS+=lablgtk.cma + OCAMLLIBS+=lablgtk3.cma endif ######################################################################## diff --git a/src/dune b/src/dune index e5cd45a92..cdc4404fe 100644 --- a/src/dune +++ b/src/dune @@ -26,4 +26,4 @@ (public_name unison-gtk2) (flags :standard -w -3-6-9-27-32-52) (modules linkgtk2 uigtk2) - (libraries threads unison_lib lablgtk2)) + (libraries threads unison_lib lablgtk3)) diff --git a/src/pixmaps.ml b/src/pixmaps.ml index 857995ffd..1eeb21351 100644 --- a/src/pixmaps.ml +++ b/src/pixmaps.ml @@ -251,23 +251,6 @@ let copyBAblack_asym = [| "............................" |] -(***********************************************************************) -(* Busy-Interactive mous pointer *) -(***********************************************************************) - -let left_ptr_watch = "\ -\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\ -\x0c\x00\x00\x00\x1c\x00\x00\x00\x3c\x00\x00\x00\ -\x7c\x00\x00\x00\xfc\x00\x00\x00\xfc\x01\x00\x00\ -\xfc\x3b\x00\x00\x7c\x38\x00\x00\x6c\x54\x00\x00\ -\xc4\xdc\x00\x00\xc0\x44\x00\x00\x80\x39\x00\x00\ -\x80\x39\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x00\x00\x00" - (***********************************************************************) (* Unison icon *) diff --git a/src/uigtk2.ml b/src/uigtk2.ml index f13c85224..e09e0275a 100644 --- a/src/uigtk2.ml +++ b/src/uigtk2.ml @@ -100,15 +100,7 @@ let icon = p let leftPtrWatch = - lazy - (let bitmap = - Gdk.Bitmap.create_from_data - ~width:32 ~height:32 Pixmaps.left_ptr_watch - in - let color = - Gdk.Color.alloc ~colormap:(Gdk.Color.get_system_colormap ()) `BLACK in - Gdk.Cursor.create_from_pixmap - (bitmap :> Gdk.pixmap) ~mask:bitmap ~fg:color ~bg:color ~x:2 ~y:2) + lazy (Gdk.Cursor.create `WATCH) let make_busy w = if Util.osType <> `Win32 then @@ -306,8 +298,8 @@ let primaryText msg = chosen, false if the second button is chosen. *) let twoBox ?(kind=`DIALOG_WARNING) ~parent ~title ~astock ~bstock message = let t = - GWindow.dialog ~parent ~border_width:6 ~modal:true ~no_separator:true - ~allow_grow:false () in + GWindow.dialog ~parent ~border_width:6 ~modal:true + ~resizable:false () in t#vbox#set_spacing 12; let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in ignore (GMisc.image ~stock:kind ~icon_size:`DIALOG @@ -353,7 +345,7 @@ let warnBox ~parent title message = (* In batch mode, just pop up a window and go ahead *) let t = GWindow.dialog ~parent - ~border_width:6 ~modal:true ~no_separator:true ~allow_grow:false () in + ~border_width:6 ~modal:true ~resizable:false () in t#vbox#set_spacing 12; let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG @@ -413,20 +405,21 @@ class ['a] gMenuFactory item method add_image_item ?(image : GObj.widget option) ?modi ?key ?callback ?stock ?name label = + (* GTK 3 does not provide image menu items (there is a way to + manually create a workaround but that does not work with + lablgtk. Let's create a regular menu item instead. *) let item = - GMenu.image_menu_item ~use_mnemonic:true ?image ~label ?stock () in + GMenu.menu_item ~use_mnemonic:true ~label () in match stock with | None -> - self#bind ?modi ?key ?callback label ?name - (item : GMenu.image_menu_item :> GMenu.menu_item); + self#bind ?modi ?key ?callback label ?name item; item | Some s -> try let st = GtkStock.Item.lookup s in self#bind ?modi ?key:(if st.GtkStock.keyval=0 then key else None) - ?callback label ?name - (item : GMenu.image_menu_item :> GMenu.menu_item); + ?callback label ?name item; item with Not_found -> item @@ -449,7 +442,7 @@ end HIGHER-LEVEL WIDGETS ***********************************************************************) -class stats width height = +(*class stats width height = let pixmap = GDraw.pixmap ~width ~height () in let area = pixmap#set_foreground `WHITE; @@ -522,7 +515,7 @@ class stats width height = area#misc#draw None end end - +*) let clientWritten = ref 0. let serverWritten = ref 0. let emitRate2 = ref 0. @@ -565,10 +558,10 @@ let statistics () = ignore (t_dismiss#connect#clicked ~callback:dismiss); ignore (t#event#connect#delete ~callback:(fun _ -> dismiss (); true)); - let emission = new stats 320 50 in +(* let emission = new stats 320 50 in t#vbox#pack ~expand:false ~padding:4 (emission :> GObj.widget); let reception = new stats 320 50 in - t#vbox#pack ~expand:false ~padding:4 (reception :> GObj.widget); + t#vbox#pack ~expand:false ~padding:4 (reception :> GObj.widget);*) let cols = new GTree.column_list in let c_1 = cols#add Gobject.Data.string in @@ -592,7 +585,7 @@ let statistics () = ignore (lst#set receive_row c_1 "Data received"); let data_row = lst#append () in ignore (lst#set data_row c_1 "File data written"); - +(* ignore (t#event#connect#map ~callback:(fun _ -> emission#activate true; reception#activate true; @@ -600,7 +593,7 @@ let statistics () = ignore (t#event#connect#unmap ~callback:(fun _ -> emission#activate false; reception#activate false; - false)); + false));*) let delay = 0.5 in let a = 0.5 in @@ -634,14 +627,14 @@ let statistics () = emitRate2 := b *. !emitRate2 +. (1. -. b) *. (!Remote.emittedBytes -. !emittedBytes) /. delay; - emission#push !emitRate; +(* emission#push !emitRate;*) receiveRate := a *. !receiveRate +. (1. -. a) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; receiveRate2 := b *. !receiveRate2 +. (1. -. b) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; - reception#push !receiveRate; +(* reception#push !receiveRate;*) emittedBytes := !Remote.emittedBytes; receivedBytes := !Remote.receivedBytes; if !stopCounter > 0 then decr stopCounter; @@ -664,21 +657,6 @@ let statistics () = let stopStats () = stopCounter := 10 in (t, startStats, stopStats) -(****) - -(* Standard file dialog *) -let file_dialog ~parent ~title ~callback ?filename () = - let sel = GWindow.file_selection ~parent ~title ~modal:true ?filename () in - ignore (sel#cancel_button#connect#clicked ~callback:sel#destroy); - ignore (sel#ok_button#connect#clicked ~callback: - (fun () -> - let name = sel#filename in - sel#destroy (); - callback name)); - sel#show (); - ignore (sel#connect#destroy ~callback:GMain.Main.quit); - GMain.Main.main () - (* ------ *) let fatalError message = @@ -688,7 +666,7 @@ let fatalError message = let title = "Fatal error" in let t = GWindow.dialog ~parent:(toplevelWindow ()) - ~border_width:6 ~modal:true ~no_separator:true ~allow_grow:false () in + ~border_width:6 ~modal:true ~resizable:false () in t#vbox#set_spacing 12; let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in ignore (GMisc.image ~stock:`DIALOG_ERROR ~icon_size:`DIALOG @@ -711,7 +689,7 @@ let tryAgainOrQuit = fatalError let getFirstRoot () = let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" - ~modal:true ~allow_grow:true () in + ~modal:true ~resizable:true () in t#misc#grab_focus (); let hb = GPack.hbox @@ -725,12 +703,14 @@ let getFirstRoot () = ignore (GMisc.label ~text:"Dir:" ~packing:(f1#pack ~expand:false) ()); let fileE = GEdit.entry ~packing:f1#add () in fileE#misc#grab_focus (); - let browseCommand() = - file_dialog ~parent:t ~title:"Select a local directory" - ~callback:fileE#set_text ~filename:fileE#text () in - let b = GButton.button ~label:"Browse" - ~packing:(f1#pack ~expand:false) () in - ignore (b#connect#clicked ~callback:browseCommand); + let b = GFile.chooser_button ~action:`SELECT_FOLDER + ~title:"Select a local directory" + ~packing:(f1#pack ~expand:false) () in + ignore (b#connect#selection_changed ~callback:(fun () -> + if not fileE#is_focus then + fileE#set_text (match b#filename with None -> "" | Some s -> s))); + ignore (fileE#connect#changed ~callback:(fun () -> + if fileE#is_focus then ignore (b#set_filename fileE#text))); let f3 = t#action_area in let result = ref None in @@ -755,7 +735,7 @@ let getFirstRoot () = let getSecondRoot () = let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" - ~modal:true ~allow_grow:true () in + ~modal:true ~resizable:true () in t#misc#grab_focus (); let message = "Please enter the second directory you want to synchronize." in @@ -778,12 +758,14 @@ let getSecondRoot () = ignore (GMisc.label ~text:"Directory:" ~packing:(f1#pack ~expand:false) ()); let fileE = GEdit.entry ~packing:f1#add () in fileE#misc#grab_focus (); - let browseCommand() = - file_dialog ~parent:t ~title:"Select a local directory" - ~callback:fileE#set_text ~filename:fileE#text () in - let b = GButton.button ~label:"Browse" - ~packing:(f1#pack ~expand:false) () in - ignore (b#connect#clicked ~callback:browseCommand); + let b = GFile.chooser_button ~action:`SELECT_FOLDER + ~title:"Select a local directory" + ~packing:(f1#pack ~expand:false) () in + ignore (b#connect#selection_changed ~callback:(fun () -> + if not fileE#is_focus then + fileE#set_text (match b#filename with None -> "" | Some s -> s))); + ignore (fileE#connect#changed ~callback:(fun () -> + if fileE#is_focus then ignore (b#set_filename fileE#text))); let f0 = GPack.hbox ~spacing:4 ~packing:f#add () in let localB = GButton.radio_button ~packing:(f0#pack ~expand:false) @@ -886,7 +868,7 @@ let getPassword rootName msg = let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Unison: SSH connection" ~position:`CENTER - ~no_separator:true ~modal:true ~allow_grow:false ~border_width:6 () in + ~modal:true ~resizable:false ~border_width:6 () in t#misc#grab_focus (); t#vbox#set_spacing 12; @@ -1078,7 +1060,7 @@ let createProfile parent = GMisc.label ~xpad:12 ~ypad:12 ~text:"Welcome to the Unison Profile Creation Assistant.\n\n\ - Click \"Forward\" to begin." + Click \"Next\" to begin." () in ignore (assistant#append_page @@ -1595,7 +1577,7 @@ let defaultValue t = let editPreference parent nm ty vl = let t = GWindow.dialog ~parent ~border_width:12 - ~no_separator:true ~title:"Edit the Preference" + ~title:"Edit the Preference" ~modal:true () in let vb = t#vbox in vb#set_spacing 6; @@ -1946,7 +1928,7 @@ let documentPreference ~compact ~packing = let addPreference parent = let t = GWindow.dialog ~parent ~border_width:12 - ~no_separator:true ~title:"Add a Preference" + ~title:"Add a Preference" ~modal:true () in let vb = t#vbox in (* vb#set_spacing 18;*) @@ -2048,7 +2030,7 @@ let addPreference parent = let editProfile parent name = let t = GWindow.dialog ~parent ~border_width:12 - ~no_separator:true ~title:(Format.sprintf "%s - Profile Editor" name) + ~title:(Format.sprintf "%s - Profile Editor" name) ~modal:true () in let vb = t#vbox in (* t#vbox#set_spacing 18;*) @@ -2299,7 +2281,7 @@ let getProfile quit = (* Build the dialog *) let t = GWindow.dialog ~parent:(toplevelWindow ()) ~border_width:12 - ~no_separator:true ~title:"Profile Selection" + ~title:"Profile Selection" ~modal:true () in t#set_default_width 550; @@ -2479,18 +2461,22 @@ let documentation sect = let (name, docstr) = Safelist.assoc sect Strings.docs in let hb = GPack.hbox ~packing:(t#vbox#pack ~expand:false ~padding:2) () in - let optionmenu = - GMenu.option_menu ~packing:(hb#pack ~expand:true ~fill:false) () in let t_text = new scrolled_text ~editable:false - ~width:80 ~height:20 ~packing:t#vbox#add () + ~width:80 ~height:20 ~packing:(t#vbox#pack ~expand:true) () in t_text#insert docstr; + let menuBar = + GMenu.menu_bar ~border_width:0 + ~packing:(hb#pack ~expand:true ~fill:false) () in + let mi = GMenu.menu_item ~label:"Topics" () in + menuBar#insert mi 0; + let sect_idx = ref 0 in let idx = ref 0 in - let menu = GMenu.menu () in + let menu = GMenu.menu ~packing:(mi#set_submenu) () in let addDocSection (shortname, (name, docstr)) = if shortname <> "" && name <> "" then begin if shortname = sect then sect_idx := !idx; @@ -2501,8 +2487,6 @@ let documentation sect = end in Safelist.iter addDocSection Strings.docs; - optionmenu#set_menu menu; - optionmenu#set_history !sect_idx; t#show () @@ -2529,8 +2513,8 @@ let messageBox ~title ?(action = fun t -> t#destroy) message = let twoBoxAdvanced ~parent ~title ~message ~longtext ~advLabel ~astock ~bstock = let t = - GWindow.dialog ~parent ~border_width:6 ~modal:true ~no_separator:true - ~allow_grow:false () in + GWindow.dialog ~parent ~border_width:6 ~modal:true + ~resizable:false () in t#vbox#set_spacing 12; let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in ignore (GMisc.image ~stock:`DIALOG_QUESTION ~icon_size:`DIALOG @@ -2562,8 +2546,8 @@ let twoBoxAdvanced let summaryBox ~parent ~title ~message ~f = let t = - GWindow.dialog ~parent ~border_width:6 ~modal:true ~no_separator:true - ~allow_grow:false ~focus_on_map:false () in + GWindow.dialog ~parent ~border_width:6 ~modal:true + ~resizable:false ~focus_on_map:false () in t#vbox#set_spacing 12; let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG @@ -2692,13 +2676,12 @@ let createToplevelWindow () = Action bar *********************************************************************) let actionBar = - let hb = GBin.handle_box ~packing:(toplevelVBox#pack ~expand:false) () in GButton.toolbar ~style:`BOTH (* 2003-0519 (stse): how to set space size in gtk 2.0? *) (* Answer from Jacques Garrigue: this can only be done in the user's.gtkrc, not programmatically *) - ~orientation:`HORIZONTAL ~tooltips:true (* ~space_size:10 *) - ~packing:(hb#add) () in + ~orientation:`HORIZONTAL (* ~space_size:10 *) + ~packing:(toplevelVBox#pack ~expand:false) () in (********************************************************************* Create the main window @@ -2949,6 +2932,7 @@ let createToplevelWindow () = GRange.progress_bar ~packing:(statusHBox#pack ~expand:false) () in progressBar#misc#set_size_chars ~height:1 ~width:28 (); + progressBar#set_show_text true; progressBar#set_pulse_step 0.02; let progressBarPulse = ref false in @@ -3624,7 +3608,7 @@ let createToplevelWindow () = ~title:"Synchronization summary" ~message ~f: (fun t -> let bullet = "\xe2\x80\xa2 " in - let layout = t#misc#pango_context#create_layout in + let layout = Pango.Layout.create t#misc#pango_context#as_context in Pango.Layout.set_text layout bullet; let (n, _) = Pango.Layout.get_pixel_size layout in let path = @@ -3690,35 +3674,39 @@ let createToplevelWindow () = let questionAction _ = doAction (fun _ diff -> diff.direction <- Conflict "") in let mergeAction _ = doAction (fun _ diff -> diff.direction <- Merge) in + let insert_button (toolbar : #GButton.toolbar) ~stock ~text ~tooltip ~callback () = + let b = GButton.tool_button ~stock ~label:text ~packing:toolbar#insert () in + ignore (b#connect#clicked ~callback); + b#misc#set_tooltip_text tooltip; + b + in + (* actionBar#insert_space ();*) grAdd grAction - (actionBar#insert_button -(* ~icon:((GMisc.pixmap rightArrowBlack ())#coerce)*) - ~icon:((GMisc.image ~stock:`GO_FORWARD ())#coerce) + (insert_button actionBar + ~stock:`GO_FORWARD ~text:"Left to Right" ~tooltip:"Propagate selected items\n\ from the left replica to the right one" ~callback:rightAction ()); (* actionBar#insert_space ();*) grAdd grAction - (actionBar#insert_button ~text:"Skip" - ~icon:((GMisc.image ~stock:`NO ())#coerce) + (insert_button actionBar ~text:"Skip" + ~stock:`NO ~tooltip:"Skip selected items" ~callback:questionAction ()); (* actionBar#insert_space ();*) grAdd grAction - (actionBar#insert_button -(* ~icon:((GMisc.pixmap leftArrowBlack ())#coerce)*) - ~icon:((GMisc.image ~stock:`GO_BACK ())#coerce) + (insert_button actionBar + ~stock:`GO_BACK ~text:"Right to Left" ~tooltip:"Propagate selected items\n\ from the right replica to the left one" ~callback:leftAction ()); (* actionBar#insert_space ();*) grAdd grAction - (actionBar#insert_button -(* ~icon:((GMisc.pixmap mergeLogoBlack())#coerce)*) - ~icon:((GMisc.image ~stock:`ADD ())#coerce) + (insert_button actionBar + ~stock:`ADD ~text:"Merge" ~tooltip:"Merge selected files" ~callback:mergeAction ()); @@ -3751,9 +3739,9 @@ let createToplevelWindow () = | None -> () in - actionBar#insert_space (); - grAdd grDiff (actionBar#insert_button ~text:"Diff" - ~icon:((GMisc.image ~stock:`DIALOG_INFO ())#coerce) + actionBar#insert (GButton.separator_tool_item ()); + grAdd grDiff (insert_button actionBar ~text:"Diff" + ~stock:`DIALOG_INFO ~tooltip:"Compare the two files at each replica" ~callback:diffCmd ()); @@ -3761,8 +3749,8 @@ let createToplevelWindow () = Detail button *********************************************************************) (* actionBar#insert_space ();*) - grAdd grDetail (actionBar#insert_button ~text:"Details" - ~icon:((GMisc.image ~stock:`INFO ())#coerce) + grAdd grDetail (insert_button actionBar ~text:"Details" + ~stock:`INFO ~tooltip:"Show detailed information about\n\ an item, when available" ~callback:showDetCommand ()); @@ -3780,11 +3768,11 @@ let createToplevelWindow () = (********************************************************************* go button *********************************************************************) - actionBar#insert_space (); + actionBar#insert (GButton.separator_tool_item ()); grAdd grGo - (actionBar#insert_button ~text:"Go" + (insert_button actionBar ~text:"Go" (* tooltip:"Go with displayed actions" *) - ~icon:((GMisc.image ~stock:`EXECUTE ())#coerce) + ~stock:`EXECUTE ~tooltip:"Perform the synchronization" ~callback:(fun () -> getLock synchronize) ()); @@ -3843,22 +3831,22 @@ let createToplevelWindow () = in (* actionBar#insert_space ();*) grAdd grRescan - (actionBar#insert_button ~text:"Rescan" - ~icon:((GMisc.image ~stock:`REFRESH ())#coerce) + (insert_button actionBar ~text:"Rescan" + ~stock:`REFRESH ~tooltip:"Check for updates" ~callback: (fun () -> reloadProfile(); detectCmd()) ()); (********************************************************************* Profile change button *********************************************************************) - actionBar#insert_space (); + actionBar#insert (GButton.separator_tool_item ()); let profileChange _ = match getProfile false with None -> () | Some p -> clearMainWindow (); loadProfile p false; detectCmd () in - grAdd grRescan (actionBar#insert_button ~text:"Change Profile" - ~icon:((GMisc.image ~stock:`OPEN ())#coerce) + grAdd grRescan (insert_button actionBar ~text:"Change Profile" + ~stock:`OPEN ~tooltip:"Select a different profile" ~callback:profileChange ()); @@ -4120,11 +4108,9 @@ let createToplevelWindow () = let (expertMenu, _) = add_submenu "Expert" in let addDebugToggle modname = - let cm = - expertMenu#add_check_item ~active:(Trace.enabled modname) - ~callback:(fun b -> Trace.enable modname b) - ("Debug '" ^ modname ^ "'") in - cm#set_show_toggle true in + ignore (expertMenu#add_check_item ~active:(Trace.enabled modname) + ~callback:(fun b -> Trace.enable modname b) + ("Debug '" ^ modname ^ "'")) in addDebugToggle "all"; addDebugToggle "verbose"; diff --git a/unison.opam b/unison.opam index 172c81d29..df2ef5315 100644 --- a/unison.opam +++ b/unison.opam @@ -12,8 +12,9 @@ dev-repo: "git://github.com/bcpierce00/unison.git" build: ["dune" "build" "-p" name "-j" jobs] depends: [ "ocaml" {>= "4.03"} + "ocamlfind" {build} "dune" {>= "2.3"} - "lablgtk" {>= "2.18.6"} + "lablgtk3" {>= "3.1.0"} ] synopsis: "File-synchronization tool for Unix and Windows" description: """