Lines 100-114
let icon =
Link Here
|
100 |
p |
100 |
p |
101 |
|
101 |
|
102 |
let leftPtrWatch = |
102 |
let leftPtrWatch = |
103 |
lazy |
103 |
lazy (Gdk.Cursor.create `WATCH) |
104 |
(let bitmap = |
|
|
105 |
Gdk.Bitmap.create_from_data |
106 |
~width:32 ~height:32 Pixmaps.left_ptr_watch |
107 |
in |
108 |
let color = |
109 |
Gdk.Color.alloc ~colormap:(Gdk.Color.get_system_colormap ()) `BLACK in |
110 |
Gdk.Cursor.create_from_pixmap |
111 |
(bitmap :> Gdk.pixmap) ~mask:bitmap ~fg:color ~bg:color ~x:2 ~y:2) |
112 |
|
104 |
|
113 |
let make_busy w = |
105 |
let make_busy w = |
114 |
if Util.osType <> `Win32 then |
106 |
if Util.osType <> `Win32 then |
Lines 306-313
let primaryText msg =
Link Here
|
306 |
chosen, false if the second button is chosen. *) |
298 |
chosen, false if the second button is chosen. *) |
307 |
let twoBox ?(kind=`DIALOG_WARNING) ~parent ~title ~astock ~bstock message = |
299 |
let twoBox ?(kind=`DIALOG_WARNING) ~parent ~title ~astock ~bstock message = |
308 |
let t = |
300 |
let t = |
309 |
GWindow.dialog ~parent ~border_width:6 ~modal:true ~no_separator:true |
301 |
GWindow.dialog ~parent ~border_width:6 ~modal:true |
310 |
~allow_grow:false () in |
302 |
~resizable:false () in |
311 |
t#vbox#set_spacing 12; |
303 |
t#vbox#set_spacing 12; |
312 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
304 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
313 |
ignore (GMisc.image ~stock:kind ~icon_size:`DIALOG |
305 |
ignore (GMisc.image ~stock:kind ~icon_size:`DIALOG |
Lines 353-359
let warnBox ~parent title message =
Link Here
|
353 |
(* In batch mode, just pop up a window and go ahead *) |
345 |
(* In batch mode, just pop up a window and go ahead *) |
354 |
let t = |
346 |
let t = |
355 |
GWindow.dialog ~parent |
347 |
GWindow.dialog ~parent |
356 |
~border_width:6 ~modal:true ~no_separator:true ~allow_grow:false () in |
348 |
~border_width:6 ~modal:true ~resizable:false () in |
357 |
t#vbox#set_spacing 12; |
349 |
t#vbox#set_spacing 12; |
358 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
350 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
359 |
ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG |
351 |
ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG |
Lines 413-432
class ['a] gMenuFactory
Link Here
|
413 |
item |
405 |
item |
414 |
method add_image_item ?(image : GObj.widget option) |
406 |
method add_image_item ?(image : GObj.widget option) |
415 |
?modi ?key ?callback ?stock ?name label = |
407 |
?modi ?key ?callback ?stock ?name label = |
|
|
408 |
(* GTK 3 does not provide image menu items (there is a way to |
409 |
manually create a workaround but that does not work with |
410 |
lablgtk. Let's create a regular menu item instead. *) |
416 |
let item = |
411 |
let item = |
417 |
GMenu.image_menu_item ~use_mnemonic:true ?image ~label ?stock () in |
412 |
GMenu.menu_item ~use_mnemonic:true ~label () in |
418 |
match stock with |
413 |
match stock with |
419 |
| None -> |
414 |
| None -> |
420 |
self#bind ?modi ?key ?callback label ?name |
415 |
self#bind ?modi ?key ?callback label ?name item; |
421 |
(item : GMenu.image_menu_item :> GMenu.menu_item); |
|
|
422 |
item |
416 |
item |
423 |
| Some s -> |
417 |
| Some s -> |
424 |
try |
418 |
try |
425 |
let st = GtkStock.Item.lookup s in |
419 |
let st = GtkStock.Item.lookup s in |
426 |
self#bind |
420 |
self#bind |
427 |
?modi ?key:(if st.GtkStock.keyval=0 then key else None) |
421 |
?modi ?key:(if st.GtkStock.keyval=0 then key else None) |
428 |
?callback label ?name |
422 |
?callback label ?name item; |
429 |
(item : GMenu.image_menu_item :> GMenu.menu_item); |
|
|
430 |
item |
423 |
item |
431 |
with Not_found -> item |
424 |
with Not_found -> item |
432 |
|
425 |
|
Lines 449-455
end
Link Here
|
449 |
HIGHER-LEVEL WIDGETS |
442 |
HIGHER-LEVEL WIDGETS |
450 |
***********************************************************************) |
443 |
***********************************************************************) |
451 |
|
444 |
|
452 |
class stats width height = |
445 |
(*class stats width height = |
453 |
let pixmap = GDraw.pixmap ~width ~height () in |
446 |
let pixmap = GDraw.pixmap ~width ~height () in |
454 |
let area = |
447 |
let area = |
455 |
pixmap#set_foreground `WHITE; |
448 |
pixmap#set_foreground `WHITE; |
Lines 522-528
class stats width height =
Link Here
|
522 |
area#misc#draw None |
515 |
area#misc#draw None |
523 |
end |
516 |
end |
524 |
end |
517 |
end |
525 |
|
518 |
*) |
526 |
let clientWritten = ref 0. |
519 |
let clientWritten = ref 0. |
527 |
let serverWritten = ref 0. |
520 |
let serverWritten = ref 0. |
528 |
let emitRate2 = ref 0. |
521 |
let emitRate2 = ref 0. |
Lines 565-574
let statistics () =
Link Here
|
565 |
ignore (t_dismiss#connect#clicked ~callback:dismiss); |
558 |
ignore (t_dismiss#connect#clicked ~callback:dismiss); |
566 |
ignore (t#event#connect#delete ~callback:(fun _ -> dismiss (); true)); |
559 |
ignore (t#event#connect#delete ~callback:(fun _ -> dismiss (); true)); |
567 |
|
560 |
|
568 |
let emission = new stats 320 50 in |
561 |
(* let emission = new stats 320 50 in |
569 |
t#vbox#pack ~expand:false ~padding:4 (emission :> GObj.widget); |
562 |
t#vbox#pack ~expand:false ~padding:4 (emission :> GObj.widget); |
570 |
let reception = new stats 320 50 in |
563 |
let reception = new stats 320 50 in |
571 |
t#vbox#pack ~expand:false ~padding:4 (reception :> GObj.widget); |
564 |
t#vbox#pack ~expand:false ~padding:4 (reception :> GObj.widget);*) |
572 |
|
565 |
|
573 |
let cols = new GTree.column_list in |
566 |
let cols = new GTree.column_list in |
574 |
let c_1 = cols#add Gobject.Data.string in |
567 |
let c_1 = cols#add Gobject.Data.string in |
Lines 592-598
let statistics () =
Link Here
|
592 |
ignore (lst#set receive_row c_1 "Data received"); |
585 |
ignore (lst#set receive_row c_1 "Data received"); |
593 |
let data_row = lst#append () in |
586 |
let data_row = lst#append () in |
594 |
ignore (lst#set data_row c_1 "File data written"); |
587 |
ignore (lst#set data_row c_1 "File data written"); |
595 |
|
588 |
(* |
596 |
ignore (t#event#connect#map ~callback:(fun _ -> |
589 |
ignore (t#event#connect#map ~callback:(fun _ -> |
597 |
emission#activate true; |
590 |
emission#activate true; |
598 |
reception#activate true; |
591 |
reception#activate true; |
Lines 600-606
let statistics () =
Link Here
|
600 |
ignore (t#event#connect#unmap ~callback:(fun _ -> |
593 |
ignore (t#event#connect#unmap ~callback:(fun _ -> |
601 |
emission#activate false; |
594 |
emission#activate false; |
602 |
reception#activate false; |
595 |
reception#activate false; |
603 |
false)); |
596 |
false));*) |
604 |
|
597 |
|
605 |
let delay = 0.5 in |
598 |
let delay = 0.5 in |
606 |
let a = 0.5 in |
599 |
let a = 0.5 in |
Lines 634-647
let statistics () =
Link Here
|
634 |
emitRate2 := |
627 |
emitRate2 := |
635 |
b *. !emitRate2 +. |
628 |
b *. !emitRate2 +. |
636 |
(1. -. b) *. (!Remote.emittedBytes -. !emittedBytes) /. delay; |
629 |
(1. -. b) *. (!Remote.emittedBytes -. !emittedBytes) /. delay; |
637 |
emission#push !emitRate; |
630 |
(* emission#push !emitRate;*) |
638 |
receiveRate := |
631 |
receiveRate := |
639 |
a *. !receiveRate +. |
632 |
a *. !receiveRate +. |
640 |
(1. -. a) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; |
633 |
(1. -. a) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; |
641 |
receiveRate2 := |
634 |
receiveRate2 := |
642 |
b *. !receiveRate2 +. |
635 |
b *. !receiveRate2 +. |
643 |
(1. -. b) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; |
636 |
(1. -. b) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; |
644 |
reception#push !receiveRate; |
637 |
(* reception#push !receiveRate;*) |
645 |
emittedBytes := !Remote.emittedBytes; |
638 |
emittedBytes := !Remote.emittedBytes; |
646 |
receivedBytes := !Remote.receivedBytes; |
639 |
receivedBytes := !Remote.receivedBytes; |
647 |
if !stopCounter > 0 then decr stopCounter; |
640 |
if !stopCounter > 0 then decr stopCounter; |
Lines 664-684
let statistics () =
Link Here
|
664 |
let stopStats () = stopCounter := 10 in |
657 |
let stopStats () = stopCounter := 10 in |
665 |
(t, startStats, stopStats) |
658 |
(t, startStats, stopStats) |
666 |
|
659 |
|
667 |
(****) |
|
|
668 |
|
669 |
(* Standard file dialog *) |
670 |
let file_dialog ~parent ~title ~callback ?filename () = |
671 |
let sel = GWindow.file_selection ~parent ~title ~modal:true ?filename () in |
672 |
ignore (sel#cancel_button#connect#clicked ~callback:sel#destroy); |
673 |
ignore (sel#ok_button#connect#clicked ~callback: |
674 |
(fun () -> |
675 |
let name = sel#filename in |
676 |
sel#destroy (); |
677 |
callback name)); |
678 |
sel#show (); |
679 |
ignore (sel#connect#destroy ~callback:GMain.Main.quit); |
680 |
GMain.Main.main () |
681 |
|
682 |
(* ------ *) |
660 |
(* ------ *) |
683 |
|
661 |
|
684 |
let fatalError message = |
662 |
let fatalError message = |
Lines 688-694
let fatalError message =
Link Here
|
688 |
let title = "Fatal error" in |
666 |
let title = "Fatal error" in |
689 |
let t = |
667 |
let t = |
690 |
GWindow.dialog ~parent:(toplevelWindow ()) |
668 |
GWindow.dialog ~parent:(toplevelWindow ()) |
691 |
~border_width:6 ~modal:true ~no_separator:true ~allow_grow:false () in |
669 |
~border_width:6 ~modal:true ~resizable:false () in |
692 |
t#vbox#set_spacing 12; |
670 |
t#vbox#set_spacing 12; |
693 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
671 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
694 |
ignore (GMisc.image ~stock:`DIALOG_ERROR ~icon_size:`DIALOG |
672 |
ignore (GMisc.image ~stock:`DIALOG_ERROR ~icon_size:`DIALOG |
Lines 711-717
let tryAgainOrQuit = fatalError
Link Here
|
711 |
|
689 |
|
712 |
let getFirstRoot () = |
690 |
let getFirstRoot () = |
713 |
let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" |
691 |
let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" |
714 |
~modal:true ~allow_grow:true () in |
692 |
~modal:true ~resizable:true () in |
715 |
t#misc#grab_focus (); |
693 |
t#misc#grab_focus (); |
716 |
|
694 |
|
717 |
let hb = GPack.hbox |
695 |
let hb = GPack.hbox |
Lines 725-736
let getFirstRoot () =
Link Here
|
725 |
ignore (GMisc.label ~text:"Dir:" ~packing:(f1#pack ~expand:false) ()); |
703 |
ignore (GMisc.label ~text:"Dir:" ~packing:(f1#pack ~expand:false) ()); |
726 |
let fileE = GEdit.entry ~packing:f1#add () in |
704 |
let fileE = GEdit.entry ~packing:f1#add () in |
727 |
fileE#misc#grab_focus (); |
705 |
fileE#misc#grab_focus (); |
728 |
let browseCommand() = |
706 |
let b = GFile.chooser_button ~action:`SELECT_FOLDER |
729 |
file_dialog ~parent:t ~title:"Select a local directory" |
707 |
~title:"Select a local directory" |
730 |
~callback:fileE#set_text ~filename:fileE#text () in |
708 |
~packing:(f1#pack ~expand:false) () in |
731 |
let b = GButton.button ~label:"Browse" |
709 |
ignore (b#connect#selection_changed ~callback:(fun () -> |
732 |
~packing:(f1#pack ~expand:false) () in |
710 |
if not fileE#is_focus then |
733 |
ignore (b#connect#clicked ~callback:browseCommand); |
711 |
fileE#set_text (match b#filename with None -> "" | Some s -> s))); |
|
|
712 |
ignore (fileE#connect#changed ~callback:(fun () -> |
713 |
if fileE#is_focus then ignore (b#set_filename fileE#text))); |
734 |
|
714 |
|
735 |
let f3 = t#action_area in |
715 |
let f3 = t#action_area in |
736 |
let result = ref None in |
716 |
let result = ref None in |
Lines 755-761
let getFirstRoot () =
Link Here
|
755 |
|
735 |
|
756 |
let getSecondRoot () = |
736 |
let getSecondRoot () = |
757 |
let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" |
737 |
let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" |
758 |
~modal:true ~allow_grow:true () in |
738 |
~modal:true ~resizable:true () in |
759 |
t#misc#grab_focus (); |
739 |
t#misc#grab_focus (); |
760 |
|
740 |
|
761 |
let message = "Please enter the second directory you want to synchronize." in |
741 |
let message = "Please enter the second directory you want to synchronize." in |
Lines 778-789
let getSecondRoot () =
Link Here
|
778 |
ignore (GMisc.label ~text:"Directory:" ~packing:(f1#pack ~expand:false) ()); |
758 |
ignore (GMisc.label ~text:"Directory:" ~packing:(f1#pack ~expand:false) ()); |
779 |
let fileE = GEdit.entry ~packing:f1#add () in |
759 |
let fileE = GEdit.entry ~packing:f1#add () in |
780 |
fileE#misc#grab_focus (); |
760 |
fileE#misc#grab_focus (); |
781 |
let browseCommand() = |
761 |
let b = GFile.chooser_button ~action:`SELECT_FOLDER |
782 |
file_dialog ~parent:t ~title:"Select a local directory" |
762 |
~title:"Select a local directory" |
783 |
~callback:fileE#set_text ~filename:fileE#text () in |
763 |
~packing:(f1#pack ~expand:false) () in |
784 |
let b = GButton.button ~label:"Browse" |
764 |
ignore (b#connect#selection_changed ~callback:(fun () -> |
785 |
~packing:(f1#pack ~expand:false) () in |
765 |
if not fileE#is_focus then |
786 |
ignore (b#connect#clicked ~callback:browseCommand); |
766 |
fileE#set_text (match b#filename with None -> "" | Some s -> s))); |
|
|
767 |
ignore (fileE#connect#changed ~callback:(fun () -> |
768 |
if fileE#is_focus then ignore (b#set_filename fileE#text))); |
787 |
|
769 |
|
788 |
let f0 = GPack.hbox ~spacing:4 ~packing:f#add () in |
770 |
let f0 = GPack.hbox ~spacing:4 ~packing:f#add () in |
789 |
let localB = GButton.radio_button ~packing:(f0#pack ~expand:false) |
771 |
let localB = GButton.radio_button ~packing:(f0#pack ~expand:false) |
Lines 886-892
let getPassword rootName msg =
Link Here
|
886 |
let t = |
868 |
let t = |
887 |
GWindow.dialog ~parent:(toplevelWindow ()) |
869 |
GWindow.dialog ~parent:(toplevelWindow ()) |
888 |
~title:"Unison: SSH connection" ~position:`CENTER |
870 |
~title:"Unison: SSH connection" ~position:`CENTER |
889 |
~no_separator:true ~modal:true ~allow_grow:false ~border_width:6 () in |
871 |
~modal:true ~resizable:false ~border_width:6 () in |
890 |
t#misc#grab_focus (); |
872 |
t#misc#grab_focus (); |
891 |
|
873 |
|
892 |
t#vbox#set_spacing 12; |
874 |
t#vbox#set_spacing 12; |
Lines 1078-1084
let createProfile parent =
Link Here
|
1078 |
GMisc.label |
1060 |
GMisc.label |
1079 |
~xpad:12 ~ypad:12 |
1061 |
~xpad:12 ~ypad:12 |
1080 |
~text:"Welcome to the Unison Profile Creation Assistant.\n\n\ |
1062 |
~text:"Welcome to the Unison Profile Creation Assistant.\n\n\ |
1081 |
Click \"Forward\" to begin." |
1063 |
Click \"Next\" to begin." |
1082 |
() in |
1064 |
() in |
1083 |
ignore |
1065 |
ignore |
1084 |
(assistant#append_page |
1066 |
(assistant#append_page |
Lines 1595-1601
let defaultValue t =
Link Here
|
1595 |
let editPreference parent nm ty vl = |
1577 |
let editPreference parent nm ty vl = |
1596 |
let t = |
1578 |
let t = |
1597 |
GWindow.dialog ~parent ~border_width:12 |
1579 |
GWindow.dialog ~parent ~border_width:12 |
1598 |
~no_separator:true ~title:"Edit the Preference" |
1580 |
~title:"Edit the Preference" |
1599 |
~modal:true () in |
1581 |
~modal:true () in |
1600 |
let vb = t#vbox in |
1582 |
let vb = t#vbox in |
1601 |
vb#set_spacing 6; |
1583 |
vb#set_spacing 6; |
Lines 1946-1952
let documentPreference ~compact ~packing =
Link Here
|
1946 |
let addPreference parent = |
1928 |
let addPreference parent = |
1947 |
let t = |
1929 |
let t = |
1948 |
GWindow.dialog ~parent ~border_width:12 |
1930 |
GWindow.dialog ~parent ~border_width:12 |
1949 |
~no_separator:true ~title:"Add a Preference" |
1931 |
~title:"Add a Preference" |
1950 |
~modal:true () in |
1932 |
~modal:true () in |
1951 |
let vb = t#vbox in |
1933 |
let vb = t#vbox in |
1952 |
(* vb#set_spacing 18;*) |
1934 |
(* vb#set_spacing 18;*) |
Lines 2048-2054
let addPreference parent =
Link Here
|
2048 |
let editProfile parent name = |
2030 |
let editProfile parent name = |
2049 |
let t = |
2031 |
let t = |
2050 |
GWindow.dialog ~parent ~border_width:12 |
2032 |
GWindow.dialog ~parent ~border_width:12 |
2051 |
~no_separator:true ~title:(Format.sprintf "%s - Profile Editor" name) |
2033 |
~title:(Format.sprintf "%s - Profile Editor" name) |
2052 |
~modal:true () in |
2034 |
~modal:true () in |
2053 |
let vb = t#vbox in |
2035 |
let vb = t#vbox in |
2054 |
(* t#vbox#set_spacing 18;*) |
2036 |
(* t#vbox#set_spacing 18;*) |
Lines 2299-2305
let getProfile quit =
Link Here
|
2299 |
(* Build the dialog *) |
2281 |
(* Build the dialog *) |
2300 |
let t = |
2282 |
let t = |
2301 |
GWindow.dialog ~parent:(toplevelWindow ()) ~border_width:12 |
2283 |
GWindow.dialog ~parent:(toplevelWindow ()) ~border_width:12 |
2302 |
~no_separator:true ~title:"Profile Selection" |
2284 |
~title:"Profile Selection" |
2303 |
~modal:true () in |
2285 |
~modal:true () in |
2304 |
t#set_default_width 550; |
2286 |
t#set_default_width 550; |
2305 |
|
2287 |
|
Lines 2479-2496
let documentation sect =
Link Here
|
2479 |
|
2461 |
|
2480 |
let (name, docstr) = Safelist.assoc sect Strings.docs in |
2462 |
let (name, docstr) = Safelist.assoc sect Strings.docs in |
2481 |
let hb = GPack.hbox ~packing:(t#vbox#pack ~expand:false ~padding:2) () in |
2463 |
let hb = GPack.hbox ~packing:(t#vbox#pack ~expand:false ~padding:2) () in |
2482 |
let optionmenu = |
|
|
2483 |
GMenu.option_menu ~packing:(hb#pack ~expand:true ~fill:false) () in |
2484 |
|
2464 |
|
2485 |
let t_text = |
2465 |
let t_text = |
2486 |
new scrolled_text ~editable:false |
2466 |
new scrolled_text ~editable:false |
2487 |
~width:80 ~height:20 ~packing:t#vbox#add () |
2467 |
~width:80 ~height:20 ~packing:(t#vbox#pack ~expand:true) () |
2488 |
in |
2468 |
in |
2489 |
t_text#insert docstr; |
2469 |
t_text#insert docstr; |
2490 |
|
2470 |
|
|
|
2471 |
let menuBar = |
2472 |
GMenu.menu_bar ~border_width:0 |
2473 |
~packing:(hb#pack ~expand:true ~fill:false) () in |
2474 |
let mi = GMenu.menu_item ~label:"Topics" () in |
2475 |
menuBar#insert mi 0; |
2476 |
|
2491 |
let sect_idx = ref 0 in |
2477 |
let sect_idx = ref 0 in |
2492 |
let idx = ref 0 in |
2478 |
let idx = ref 0 in |
2493 |
let menu = GMenu.menu () in |
2479 |
let menu = GMenu.menu ~packing:(mi#set_submenu) () in |
2494 |
let addDocSection (shortname, (name, docstr)) = |
2480 |
let addDocSection (shortname, (name, docstr)) = |
2495 |
if shortname <> "" && name <> "" then begin |
2481 |
if shortname <> "" && name <> "" then begin |
2496 |
if shortname = sect then sect_idx := !idx; |
2482 |
if shortname = sect then sect_idx := !idx; |
Lines 2501-2508
let documentation sect =
Link Here
|
2501 |
end |
2487 |
end |
2502 |
in |
2488 |
in |
2503 |
Safelist.iter addDocSection Strings.docs; |
2489 |
Safelist.iter addDocSection Strings.docs; |
2504 |
optionmenu#set_menu menu; |
|
|
2505 |
optionmenu#set_history !sect_idx; |
2506 |
|
2490 |
|
2507 |
t#show () |
2491 |
t#show () |
2508 |
|
2492 |
|
Lines 2529-2536
let messageBox ~title ?(action = fun t -> t#destroy) message =
Link Here
|
2529 |
let twoBoxAdvanced |
2513 |
let twoBoxAdvanced |
2530 |
~parent ~title ~message ~longtext ~advLabel ~astock ~bstock = |
2514 |
~parent ~title ~message ~longtext ~advLabel ~astock ~bstock = |
2531 |
let t = |
2515 |
let t = |
2532 |
GWindow.dialog ~parent ~border_width:6 ~modal:true ~no_separator:true |
2516 |
GWindow.dialog ~parent ~border_width:6 ~modal:true |
2533 |
~allow_grow:false () in |
2517 |
~resizable:false () in |
2534 |
t#vbox#set_spacing 12; |
2518 |
t#vbox#set_spacing 12; |
2535 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
2519 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
2536 |
ignore (GMisc.image ~stock:`DIALOG_QUESTION ~icon_size:`DIALOG |
2520 |
ignore (GMisc.image ~stock:`DIALOG_QUESTION ~icon_size:`DIALOG |
Lines 2562-2569
let twoBoxAdvanced
Link Here
|
2562 |
|
2546 |
|
2563 |
let summaryBox ~parent ~title ~message ~f = |
2547 |
let summaryBox ~parent ~title ~message ~f = |
2564 |
let t = |
2548 |
let t = |
2565 |
GWindow.dialog ~parent ~border_width:6 ~modal:true ~no_separator:true |
2549 |
GWindow.dialog ~parent ~border_width:6 ~modal:true |
2566 |
~allow_grow:false ~focus_on_map:false () in |
2550 |
~resizable:false ~focus_on_map:false () in |
2567 |
t#vbox#set_spacing 12; |
2551 |
t#vbox#set_spacing 12; |
2568 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
2552 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
2569 |
ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG |
2553 |
ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG |
Lines 2692-2704
let createToplevelWindow () =
Link Here
|
2692 |
Action bar |
2676 |
Action bar |
2693 |
*********************************************************************) |
2677 |
*********************************************************************) |
2694 |
let actionBar = |
2678 |
let actionBar = |
2695 |
let hb = GBin.handle_box ~packing:(toplevelVBox#pack ~expand:false) () in |
|
|
2696 |
GButton.toolbar ~style:`BOTH |
2679 |
GButton.toolbar ~style:`BOTH |
2697 |
(* 2003-0519 (stse): how to set space size in gtk 2.0? *) |
2680 |
(* 2003-0519 (stse): how to set space size in gtk 2.0? *) |
2698 |
(* Answer from Jacques Garrigue: this can only be done in |
2681 |
(* Answer from Jacques Garrigue: this can only be done in |
2699 |
the user's.gtkrc, not programmatically *) |
2682 |
the user's.gtkrc, not programmatically *) |
2700 |
~orientation:`HORIZONTAL ~tooltips:true (* ~space_size:10 *) |
2683 |
~orientation:`HORIZONTAL (* ~space_size:10 *) |
2701 |
~packing:(hb#add) () in |
2684 |
~packing:(toplevelVBox#pack ~expand:false) () in |
2702 |
|
2685 |
|
2703 |
(********************************************************************* |
2686 |
(********************************************************************* |
2704 |
Create the main window |
2687 |
Create the main window |
Lines 2949-2954
let createToplevelWindow () =
Link Here
|
2949 |
GRange.progress_bar ~packing:(statusHBox#pack ~expand:false) () in |
2932 |
GRange.progress_bar ~packing:(statusHBox#pack ~expand:false) () in |
2950 |
|
2933 |
|
2951 |
progressBar#misc#set_size_chars ~height:1 ~width:28 (); |
2934 |
progressBar#misc#set_size_chars ~height:1 ~width:28 (); |
|
|
2935 |
progressBar#set_show_text true; |
2952 |
progressBar#set_pulse_step 0.02; |
2936 |
progressBar#set_pulse_step 0.02; |
2953 |
let progressBarPulse = ref false in |
2937 |
let progressBarPulse = ref false in |
2954 |
|
2938 |
|
Lines 3624-3630
let createToplevelWindow () =
Link Here
|
3624 |
~title:"Synchronization summary" ~message ~f: |
3608 |
~title:"Synchronization summary" ~message ~f: |
3625 |
(fun t -> |
3609 |
(fun t -> |
3626 |
let bullet = "\xe2\x80\xa2 " in |
3610 |
let bullet = "\xe2\x80\xa2 " in |
3627 |
let layout = t#misc#pango_context#create_layout in |
3611 |
let layout = Pango.Layout.create t#misc#pango_context#as_context in |
3628 |
Pango.Layout.set_text layout bullet; |
3612 |
Pango.Layout.set_text layout bullet; |
3629 |
let (n, _) = Pango.Layout.get_pixel_size layout in |
3613 |
let (n, _) = Pango.Layout.get_pixel_size layout in |
3630 |
let path = |
3614 |
let path = |
Lines 3690-3724
let createToplevelWindow () =
Link Here
|
3690 |
let questionAction _ = doAction (fun _ diff -> diff.direction <- Conflict "") in |
3674 |
let questionAction _ = doAction (fun _ diff -> diff.direction <- Conflict "") in |
3691 |
let mergeAction _ = doAction (fun _ diff -> diff.direction <- Merge) in |
3675 |
let mergeAction _ = doAction (fun _ diff -> diff.direction <- Merge) in |
3692 |
|
3676 |
|
|
|
3677 |
let insert_button (toolbar : #GButton.toolbar) ~stock ~text ~tooltip ~callback () = |
3678 |
let b = GButton.tool_button ~stock ~label:text ~packing:toolbar#insert () in |
3679 |
ignore (b#connect#clicked ~callback); |
3680 |
b#misc#set_tooltip_text tooltip; |
3681 |
b |
3682 |
in |
3683 |
|
3693 |
(* actionBar#insert_space ();*) |
3684 |
(* actionBar#insert_space ();*) |
3694 |
grAdd grAction |
3685 |
grAdd grAction |
3695 |
(actionBar#insert_button |
3686 |
(insert_button actionBar |
3696 |
(* ~icon:((GMisc.pixmap rightArrowBlack ())#coerce)*) |
3687 |
~stock:`GO_FORWARD |
3697 |
~icon:((GMisc.image ~stock:`GO_FORWARD ())#coerce) |
|
|
3698 |
~text:"Left to Right" |
3688 |
~text:"Left to Right" |
3699 |
~tooltip:"Propagate selected items\n\ |
3689 |
~tooltip:"Propagate selected items\n\ |
3700 |
from the left replica to the right one" |
3690 |
from the left replica to the right one" |
3701 |
~callback:rightAction ()); |
3691 |
~callback:rightAction ()); |
3702 |
(* actionBar#insert_space ();*) |
3692 |
(* actionBar#insert_space ();*) |
3703 |
grAdd grAction |
3693 |
grAdd grAction |
3704 |
(actionBar#insert_button ~text:"Skip" |
3694 |
(insert_button actionBar ~text:"Skip" |
3705 |
~icon:((GMisc.image ~stock:`NO ())#coerce) |
3695 |
~stock:`NO |
3706 |
~tooltip:"Skip selected items" |
3696 |
~tooltip:"Skip selected items" |
3707 |
~callback:questionAction ()); |
3697 |
~callback:questionAction ()); |
3708 |
(* actionBar#insert_space ();*) |
3698 |
(* actionBar#insert_space ();*) |
3709 |
grAdd grAction |
3699 |
grAdd grAction |
3710 |
(actionBar#insert_button |
3700 |
(insert_button actionBar |
3711 |
(* ~icon:((GMisc.pixmap leftArrowBlack ())#coerce)*) |
3701 |
~stock:`GO_BACK |
3712 |
~icon:((GMisc.image ~stock:`GO_BACK ())#coerce) |
|
|
3713 |
~text:"Right to Left" |
3702 |
~text:"Right to Left" |
3714 |
~tooltip:"Propagate selected items\n\ |
3703 |
~tooltip:"Propagate selected items\n\ |
3715 |
from the right replica to the left one" |
3704 |
from the right replica to the left one" |
3716 |
~callback:leftAction ()); |
3705 |
~callback:leftAction ()); |
3717 |
(* actionBar#insert_space ();*) |
3706 |
(* actionBar#insert_space ();*) |
3718 |
grAdd grAction |
3707 |
grAdd grAction |
3719 |
(actionBar#insert_button |
3708 |
(insert_button actionBar |
3720 |
(* ~icon:((GMisc.pixmap mergeLogoBlack())#coerce)*) |
3709 |
~stock:`ADD |
3721 |
~icon:((GMisc.image ~stock:`ADD ())#coerce) |
|
|
3722 |
~text:"Merge" |
3710 |
~text:"Merge" |
3723 |
~tooltip:"Merge selected files" |
3711 |
~tooltip:"Merge selected files" |
3724 |
~callback:mergeAction ()); |
3712 |
~callback:mergeAction ()); |
Lines 3751-3759
let createToplevelWindow () =
Link Here
|
3751 |
| None -> |
3739 |
| None -> |
3752 |
() in |
3740 |
() in |
3753 |
|
3741 |
|
3754 |
actionBar#insert_space (); |
3742 |
actionBar#insert (GButton.separator_tool_item ()); |
3755 |
grAdd grDiff (actionBar#insert_button ~text:"Diff" |
3743 |
grAdd grDiff (insert_button actionBar ~text:"Diff" |
3756 |
~icon:((GMisc.image ~stock:`DIALOG_INFO ())#coerce) |
3744 |
~stock:`DIALOG_INFO |
3757 |
~tooltip:"Compare the two files at each replica" |
3745 |
~tooltip:"Compare the two files at each replica" |
3758 |
~callback:diffCmd ()); |
3746 |
~callback:diffCmd ()); |
3759 |
|
3747 |
|
Lines 3761-3768
let createToplevelWindow () =
Link Here
|
3761 |
Detail button |
3749 |
Detail button |
3762 |
*********************************************************************) |
3750 |
*********************************************************************) |
3763 |
(* actionBar#insert_space ();*) |
3751 |
(* actionBar#insert_space ();*) |
3764 |
grAdd grDetail (actionBar#insert_button ~text:"Details" |
3752 |
grAdd grDetail (insert_button actionBar ~text:"Details" |
3765 |
~icon:((GMisc.image ~stock:`INFO ())#coerce) |
3753 |
~stock:`INFO |
3766 |
~tooltip:"Show detailed information about\n\ |
3754 |
~tooltip:"Show detailed information about\n\ |
3767 |
an item, when available" |
3755 |
an item, when available" |
3768 |
~callback:showDetCommand ()); |
3756 |
~callback:showDetCommand ()); |
Lines 3780-3790
let createToplevelWindow () =
Link Here
|
3780 |
(********************************************************************* |
3768 |
(********************************************************************* |
3781 |
go button |
3769 |
go button |
3782 |
*********************************************************************) |
3770 |
*********************************************************************) |
3783 |
actionBar#insert_space (); |
3771 |
actionBar#insert (GButton.separator_tool_item ()); |
3784 |
grAdd grGo |
3772 |
grAdd grGo |
3785 |
(actionBar#insert_button ~text:"Go" |
3773 |
(insert_button actionBar ~text:"Go" |
3786 |
(* tooltip:"Go with displayed actions" *) |
3774 |
(* tooltip:"Go with displayed actions" *) |
3787 |
~icon:((GMisc.image ~stock:`EXECUTE ())#coerce) |
3775 |
~stock:`EXECUTE |
3788 |
~tooltip:"Perform the synchronization" |
3776 |
~tooltip:"Perform the synchronization" |
3789 |
~callback:(fun () -> |
3777 |
~callback:(fun () -> |
3790 |
getLock synchronize) ()); |
3778 |
getLock synchronize) ()); |
Lines 3843-3864
let createToplevelWindow () =
Link Here
|
3843 |
in |
3831 |
in |
3844 |
(* actionBar#insert_space ();*) |
3832 |
(* actionBar#insert_space ();*) |
3845 |
grAdd grRescan |
3833 |
grAdd grRescan |
3846 |
(actionBar#insert_button ~text:"Rescan" |
3834 |
(insert_button actionBar ~text:"Rescan" |
3847 |
~icon:((GMisc.image ~stock:`REFRESH ())#coerce) |
3835 |
~stock:`REFRESH |
3848 |
~tooltip:"Check for updates" |
3836 |
~tooltip:"Check for updates" |
3849 |
~callback: (fun () -> reloadProfile(); detectCmd()) ()); |
3837 |
~callback: (fun () -> reloadProfile(); detectCmd()) ()); |
3850 |
|
3838 |
|
3851 |
(********************************************************************* |
3839 |
(********************************************************************* |
3852 |
Profile change button |
3840 |
Profile change button |
3853 |
*********************************************************************) |
3841 |
*********************************************************************) |
3854 |
actionBar#insert_space (); |
3842 |
actionBar#insert (GButton.separator_tool_item ()); |
3855 |
let profileChange _ = |
3843 |
let profileChange _ = |
3856 |
match getProfile false with |
3844 |
match getProfile false with |
3857 |
None -> () |
3845 |
None -> () |
3858 |
| Some p -> clearMainWindow (); loadProfile p false; detectCmd () |
3846 |
| Some p -> clearMainWindow (); loadProfile p false; detectCmd () |
3859 |
in |
3847 |
in |
3860 |
grAdd grRescan (actionBar#insert_button ~text:"Change Profile" |
3848 |
grAdd grRescan (insert_button actionBar ~text:"Change Profile" |
3861 |
~icon:((GMisc.image ~stock:`OPEN ())#coerce) |
3849 |
~stock:`OPEN |
3862 |
~tooltip:"Select a different profile" |
3850 |
~tooltip:"Select a different profile" |
3863 |
~callback:profileChange ()); |
3851 |
~callback:profileChange ()); |
3864 |
|
3852 |
|
Lines 4120-4130
let createToplevelWindow () =
Link Here
|
4120 |
let (expertMenu, _) = add_submenu "Expert" in |
4108 |
let (expertMenu, _) = add_submenu "Expert" in |
4121 |
|
4109 |
|
4122 |
let addDebugToggle modname = |
4110 |
let addDebugToggle modname = |
4123 |
let cm = |
4111 |
ignore (expertMenu#add_check_item ~active:(Trace.enabled modname) |
4124 |
expertMenu#add_check_item ~active:(Trace.enabled modname) |
4112 |
~callback:(fun b -> Trace.enable modname b) |
4125 |
~callback:(fun b -> Trace.enable modname b) |
4113 |
("Debug '" ^ modname ^ "'")) in |
4126 |
("Debug '" ^ modname ^ "'") in |
|
|
4127 |
cm#set_show_toggle true in |
4128 |
|
4114 |
|
4129 |
addDebugToggle "all"; |
4115 |
addDebugToggle "all"; |
4130 |
addDebugToggle "verbose"; |
4116 |
addDebugToggle "verbose"; |