Lines 98-112
let icon =
Link Here
|
98 |
p |
98 |
p |
99 |
|
99 |
|
100 |
let leftPtrWatch = |
100 |
let leftPtrWatch = |
101 |
lazy |
101 |
lazy (Gdk.Cursor.create `WATCH) |
102 |
(let bitmap = |
|
|
103 |
Gdk.Bitmap.create_from_data |
104 |
~width:32 ~height:32 Pixmaps.left_ptr_watch |
105 |
in |
106 |
let color = |
107 |
Gdk.Color.alloc ~colormap:(Gdk.Color.get_system_colormap ()) `BLACK in |
108 |
Gdk.Cursor.create_from_pixmap |
109 |
(bitmap :> Gdk.pixmap) ~mask:bitmap ~fg:color ~bg:color ~x:2 ~y:2) |
110 |
|
102 |
|
111 |
let make_busy w = |
103 |
let make_busy w = |
112 |
if Util.osType <> `Win32 then |
104 |
if Util.osType <> `Win32 then |
Lines 311-318
let primaryText msg =
Link Here
|
311 |
chosen, false if the second button is chosen. *) |
303 |
chosen, false if the second button is chosen. *) |
312 |
let twoBox ?(kind=`DIALOG_WARNING) ~parent ~title ~astock ~bstock message = |
304 |
let twoBox ?(kind=`DIALOG_WARNING) ~parent ~title ~astock ~bstock message = |
313 |
let t = |
305 |
let t = |
314 |
GWindow.dialog ~parent ~border_width:6 ~modal:true ~no_separator:true |
306 |
GWindow.dialog ~parent ~border_width:6 ~modal:true |
315 |
~allow_grow:false () in |
307 |
~resizable:false () in |
316 |
t#vbox#set_spacing 12; |
308 |
t#vbox#set_spacing 12; |
317 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
309 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
318 |
ignore (GMisc.image ~stock:kind ~icon_size:`DIALOG |
310 |
ignore (GMisc.image ~stock:kind ~icon_size:`DIALOG |
Lines 358-364
let warnBox ~parent title message =
Link Here
|
358 |
(* In batch mode, just pop up a window and go ahead *) |
350 |
(* In batch mode, just pop up a window and go ahead *) |
359 |
let t = |
351 |
let t = |
360 |
GWindow.dialog ~parent |
352 |
GWindow.dialog ~parent |
361 |
~border_width:6 ~modal:true ~no_separator:true ~allow_grow:false () in |
353 |
~border_width:6 ~modal:true ~resizable:false () in |
362 |
t#vbox#set_spacing 12; |
354 |
t#vbox#set_spacing 12; |
363 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
355 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
364 |
ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG |
356 |
ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG |
Lines 418-437
class ['a] gMenuFactory
Link Here
|
418 |
item |
410 |
item |
419 |
method add_image_item ?(image : GObj.widget option) |
411 |
method add_image_item ?(image : GObj.widget option) |
420 |
?modi ?key ?callback ?stock ?name label = |
412 |
?modi ?key ?callback ?stock ?name label = |
|
|
413 |
(* GTK 3 does not provide image menu items (there is a way to |
414 |
manually create a workaround but that does not work with |
415 |
lablgtk. Let's create a regular menu item instead. *) |
421 |
let item = |
416 |
let item = |
422 |
GMenu.image_menu_item ~use_mnemonic:true ?image ~label ?stock () in |
417 |
GMenu.menu_item ~use_mnemonic:true ~label () in |
423 |
match stock with |
418 |
match stock with |
424 |
| None -> |
419 |
| None -> |
425 |
self#bind ?modi ?key ?callback label ?name |
420 |
self#bind ?modi ?key ?callback label ?name item; |
426 |
(item : GMenu.image_menu_item :> GMenu.menu_item); |
|
|
427 |
item |
421 |
item |
428 |
| Some s -> |
422 |
| Some s -> |
429 |
try |
423 |
try |
430 |
let st = GtkStock.Item.lookup s in |
424 |
let st = GtkStock.Item.lookup s in |
431 |
self#bind |
425 |
self#bind |
432 |
?modi ?key:(if st.GtkStock.keyval=0 then key else None) |
426 |
?modi ?key:(if st.GtkStock.keyval=0 then key else None) |
433 |
?callback label ?name |
427 |
?callback label ?name item; |
434 |
(item : GMenu.image_menu_item :> GMenu.menu_item); |
|
|
435 |
item |
428 |
item |
436 |
with Not_found -> item |
429 |
with Not_found -> item |
437 |
|
430 |
|
Lines 454-460
end
Link Here
|
454 |
HIGHER-LEVEL WIDGETS |
447 |
HIGHER-LEVEL WIDGETS |
455 |
***********************************************************************) |
448 |
***********************************************************************) |
456 |
|
449 |
|
457 |
class stats width height = |
450 |
(*class stats width height = |
458 |
let pixmap = GDraw.pixmap ~width ~height () in |
451 |
let pixmap = GDraw.pixmap ~width ~height () in |
459 |
let area = |
452 |
let area = |
460 |
pixmap#set_foreground `WHITE; |
453 |
pixmap#set_foreground `WHITE; |
Lines 527-533
class stats width height =
Link Here
|
527 |
area#misc#draw None |
520 |
area#misc#draw None |
528 |
end |
521 |
end |
529 |
end |
522 |
end |
530 |
|
523 |
*) |
531 |
let clientWritten = ref 0. |
524 |
let clientWritten = ref 0. |
532 |
let serverWritten = ref 0. |
525 |
let serverWritten = ref 0. |
533 |
let emitRate2 = ref 0. |
526 |
let emitRate2 = ref 0. |
Lines 570-579
let statistics () =
Link Here
|
570 |
ignore (t_dismiss#connect#clicked ~callback:dismiss); |
563 |
ignore (t_dismiss#connect#clicked ~callback:dismiss); |
571 |
ignore (t#event#connect#delete ~callback:(fun _ -> dismiss (); true)); |
564 |
ignore (t#event#connect#delete ~callback:(fun _ -> dismiss (); true)); |
572 |
|
565 |
|
573 |
let emission = new stats 320 50 in |
566 |
(* let emission = new stats 320 50 in |
574 |
t#vbox#pack ~expand:false ~padding:4 (emission :> GObj.widget); |
567 |
t#vbox#pack ~expand:false ~padding:4 (emission :> GObj.widget); |
575 |
let reception = new stats 320 50 in |
568 |
let reception = new stats 320 50 in |
576 |
t#vbox#pack ~expand:false ~padding:4 (reception :> GObj.widget); |
569 |
t#vbox#pack ~expand:false ~padding:4 (reception :> GObj.widget);*) |
577 |
|
570 |
|
578 |
let cols = new GTree.column_list in |
571 |
let cols = new GTree.column_list in |
579 |
let c_1 = cols#add Gobject.Data.string in |
572 |
let c_1 = cols#add Gobject.Data.string in |
Lines 597-603
let statistics () =
Link Here
|
597 |
ignore (lst#set receive_row c_1 "Data received"); |
590 |
ignore (lst#set receive_row c_1 "Data received"); |
598 |
let data_row = lst#append () in |
591 |
let data_row = lst#append () in |
599 |
ignore (lst#set data_row c_1 "File data written"); |
592 |
ignore (lst#set data_row c_1 "File data written"); |
600 |
|
593 |
(* |
601 |
ignore (t#event#connect#map (fun _ -> |
594 |
ignore (t#event#connect#map (fun _ -> |
602 |
emission#activate true; |
595 |
emission#activate true; |
603 |
reception#activate true; |
596 |
reception#activate true; |
Lines 605-611
let statistics () =
Link Here
|
605 |
ignore (t#event#connect#unmap (fun _ -> |
598 |
ignore (t#event#connect#unmap (fun _ -> |
606 |
emission#activate false; |
599 |
emission#activate false; |
607 |
reception#activate false; |
600 |
reception#activate false; |
608 |
false)); |
601 |
false));*) |
609 |
|
602 |
|
610 |
let delay = 0.5 in |
603 |
let delay = 0.5 in |
611 |
let a = 0.5 in |
604 |
let a = 0.5 in |
Lines 639-652
let statistics () =
Link Here
|
639 |
emitRate2 := |
632 |
emitRate2 := |
640 |
b *. !emitRate2 +. |
633 |
b *. !emitRate2 +. |
641 |
(1. -. b) *. (!Remote.emittedBytes -. !emittedBytes) /. delay; |
634 |
(1. -. b) *. (!Remote.emittedBytes -. !emittedBytes) /. delay; |
642 |
emission#push !emitRate; |
635 |
(* emission#push !emitRate;*) |
643 |
receiveRate := |
636 |
receiveRate := |
644 |
a *. !receiveRate +. |
637 |
a *. !receiveRate +. |
645 |
(1. -. a) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; |
638 |
(1. -. a) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; |
646 |
receiveRate2 := |
639 |
receiveRate2 := |
647 |
b *. !receiveRate2 +. |
640 |
b *. !receiveRate2 +. |
648 |
(1. -. b) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; |
641 |
(1. -. b) *. (!Remote.receivedBytes -. !receivedBytes) /. delay; |
649 |
reception#push !receiveRate; |
642 |
(* reception#push !receiveRate;*) |
650 |
emittedBytes := !Remote.emittedBytes; |
643 |
emittedBytes := !Remote.emittedBytes; |
651 |
receivedBytes := !Remote.receivedBytes; |
644 |
receivedBytes := !Remote.receivedBytes; |
652 |
if !stopCounter > 0 then decr stopCounter; |
645 |
if !stopCounter > 0 then decr stopCounter; |
Lines 669-689
let statistics () =
Link Here
|
669 |
let stopStats () = stopCounter := 10 in |
662 |
let stopStats () = stopCounter := 10 in |
670 |
(t, startStats, stopStats) |
663 |
(t, startStats, stopStats) |
671 |
|
664 |
|
672 |
(****) |
|
|
673 |
|
674 |
(* Standard file dialog *) |
675 |
let file_dialog ~parent ~title ~callback ?filename () = |
676 |
let sel = GWindow.file_selection ~parent ~title ~modal:true ?filename () in |
677 |
ignore (sel#cancel_button#connect#clicked ~callback:sel#destroy); |
678 |
ignore (sel#ok_button#connect#clicked ~callback: |
679 |
(fun () -> |
680 |
let name = sel#filename in |
681 |
sel#destroy (); |
682 |
callback name)); |
683 |
sel#show (); |
684 |
ignore (sel#connect#destroy ~callback:GMain.Main.quit); |
685 |
GMain.Main.main () |
686 |
|
687 |
(* ------ *) |
665 |
(* ------ *) |
688 |
|
666 |
|
689 |
let fatalError message = |
667 |
let fatalError message = |
Lines 691-697
let fatalError message =
Link Here
|
691 |
let title = "Fatal error" in |
669 |
let title = "Fatal error" in |
692 |
let t = |
670 |
let t = |
693 |
GWindow.dialog ~parent:(toplevelWindow ()) |
671 |
GWindow.dialog ~parent:(toplevelWindow ()) |
694 |
~border_width:6 ~modal:true ~no_separator:true ~allow_grow:false () in |
672 |
~border_width:6 ~modal:true ~resizable:false () in |
695 |
t#vbox#set_spacing 12; |
673 |
t#vbox#set_spacing 12; |
696 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
674 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
697 |
ignore (GMisc.image ~stock:`DIALOG_ERROR ~icon_size:`DIALOG |
675 |
ignore (GMisc.image ~stock:`DIALOG_ERROR ~icon_size:`DIALOG |
Lines 714-720
let tryAgainOrQuit = fatalError
Link Here
|
714 |
|
692 |
|
715 |
let getFirstRoot () = |
693 |
let getFirstRoot () = |
716 |
let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" |
694 |
let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" |
717 |
~modal:true ~allow_grow:true () in |
695 |
~modal:true ~resizable:true () in |
718 |
t#misc#grab_focus (); |
696 |
t#misc#grab_focus (); |
719 |
|
697 |
|
720 |
let hb = GPack.hbox |
698 |
let hb = GPack.hbox |
Lines 728-739
let getFirstRoot () =
Link Here
|
728 |
ignore (GMisc.label ~text:"Dir:" ~packing:(f1#pack ~expand:false) ()); |
706 |
ignore (GMisc.label ~text:"Dir:" ~packing:(f1#pack ~expand:false) ()); |
729 |
let fileE = GEdit.entry ~packing:f1#add () in |
707 |
let fileE = GEdit.entry ~packing:f1#add () in |
730 |
fileE#misc#grab_focus (); |
708 |
fileE#misc#grab_focus (); |
731 |
let browseCommand() = |
709 |
let b = GFile.chooser_button ~action:`SELECT_FOLDER |
732 |
file_dialog ~parent:t ~title:"Select a local directory" |
710 |
~title:"Select a local directory" |
733 |
~callback:fileE#set_text ~filename:fileE#text () in |
711 |
~packing:(f1#pack ~expand:false) () in |
734 |
let b = GButton.button ~label:"Browse" |
712 |
ignore (b#connect#selection_changed ~callback:(fun () -> |
735 |
~packing:(f1#pack ~expand:false) () in |
713 |
if not fileE#is_focus then |
736 |
ignore (b#connect#clicked ~callback:browseCommand); |
714 |
fileE#set_text (match b#filename with None -> "" | Some s -> s))); |
|
|
715 |
ignore (fileE#connect#changed ~callback:(fun () -> |
716 |
if fileE#is_focus then ignore (b#set_filename fileE#text))); |
737 |
|
717 |
|
738 |
let f3 = t#action_area in |
718 |
let f3 = t#action_area in |
739 |
let result = ref None in |
719 |
let result = ref None in |
Lines 758-764
let getFirstRoot () =
Link Here
|
758 |
|
738 |
|
759 |
let getSecondRoot () = |
739 |
let getSecondRoot () = |
760 |
let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" |
740 |
let t = GWindow.dialog ~parent:(toplevelWindow ()) ~title:"Root selection" |
761 |
~modal:true ~allow_grow:true () in |
741 |
~modal:true ~resizable:true () in |
762 |
t#misc#grab_focus (); |
742 |
t#misc#grab_focus (); |
763 |
|
743 |
|
764 |
let message = "Please enter the second directory you want to synchronize." in |
744 |
let message = "Please enter the second directory you want to synchronize." in |
Lines 781-792
let getSecondRoot () =
Link Here
|
781 |
ignore (GMisc.label ~text:"Directory:" ~packing:(f1#pack ~expand:false) ()); |
761 |
ignore (GMisc.label ~text:"Directory:" ~packing:(f1#pack ~expand:false) ()); |
782 |
let fileE = GEdit.entry ~packing:f1#add () in |
762 |
let fileE = GEdit.entry ~packing:f1#add () in |
783 |
fileE#misc#grab_focus (); |
763 |
fileE#misc#grab_focus (); |
784 |
let browseCommand() = |
764 |
let b = GFile.chooser_button ~action:`SELECT_FOLDER |
785 |
file_dialog ~parent:t ~title:"Select a local directory" |
765 |
~title:"Select a local directory" |
786 |
~callback:fileE#set_text ~filename:fileE#text () in |
766 |
~packing:(f1#pack ~expand:false) () in |
787 |
let b = GButton.button ~label:"Browse" |
767 |
ignore (b#connect#selection_changed ~callback:(fun () -> |
788 |
~packing:(f1#pack ~expand:false) () in |
768 |
if not fileE#is_focus then |
789 |
ignore (b#connect#clicked ~callback:browseCommand); |
769 |
fileE#set_text (match b#filename with None -> "" | Some s -> s))); |
|
|
770 |
ignore (fileE#connect#changed ~callback:(fun () -> |
771 |
if fileE#is_focus then ignore (b#set_filename fileE#text))); |
790 |
|
772 |
|
791 |
let f0 = GPack.hbox ~spacing:4 ~packing:f#add () in |
773 |
let f0 = GPack.hbox ~spacing:4 ~packing:f#add () in |
792 |
let localB = GButton.radio_button ~packing:(f0#pack ~expand:false) |
774 |
let localB = GButton.radio_button ~packing:(f0#pack ~expand:false) |
Lines 889-895
let getPassword rootName msg =
Link Here
|
889 |
let t = |
871 |
let t = |
890 |
GWindow.dialog ~parent:(toplevelWindow ()) |
872 |
GWindow.dialog ~parent:(toplevelWindow ()) |
891 |
~title:"Unison: SSH connection" ~position:`CENTER |
873 |
~title:"Unison: SSH connection" ~position:`CENTER |
892 |
~no_separator:true ~modal:true ~allow_grow:false ~border_width:6 () in |
874 |
~modal:true ~resizable:false ~border_width:6 () in |
893 |
t#misc#grab_focus (); |
875 |
t#misc#grab_focus (); |
894 |
|
876 |
|
895 |
t#vbox#set_spacing 12; |
877 |
t#vbox#set_spacing 12; |
Lines 1081-1087
let createProfile parent =
Link Here
|
1081 |
GMisc.label |
1063 |
GMisc.label |
1082 |
~xpad:12 ~ypad:12 |
1064 |
~xpad:12 ~ypad:12 |
1083 |
~text:"Welcome to the Unison Profile Creation Assistant.\n\n\ |
1065 |
~text:"Welcome to the Unison Profile Creation Assistant.\n\n\ |
1084 |
Click \"Forward\" to begin." |
1066 |
Click \"Next\" to begin." |
1085 |
() in |
1067 |
() in |
1086 |
ignore |
1068 |
ignore |
1087 |
(assistant#append_page |
1069 |
(assistant#append_page |
Lines 1598-1604
let defaultValue t =
Link Here
|
1598 |
let editPreference parent nm ty vl = |
1580 |
let editPreference parent nm ty vl = |
1599 |
let t = |
1581 |
let t = |
1600 |
GWindow.dialog ~parent ~border_width:12 |
1582 |
GWindow.dialog ~parent ~border_width:12 |
1601 |
~no_separator:true ~title:"Edit the Preference" |
1583 |
~title:"Edit the Preference" |
1602 |
~modal:true () in |
1584 |
~modal:true () in |
1603 |
let vb = t#vbox in |
1585 |
let vb = t#vbox in |
1604 |
vb#set_spacing 6; |
1586 |
vb#set_spacing 6; |
Lines 1949-1955
let documentPreference ~compact ~packing
Link Here
|
1949 |
let addPreference parent = |
1931 |
let addPreference parent = |
1950 |
let t = |
1932 |
let t = |
1951 |
GWindow.dialog ~parent ~border_width:12 |
1933 |
GWindow.dialog ~parent ~border_width:12 |
1952 |
~no_separator:true ~title:"Add a Preference" |
1934 |
~title:"Add a Preference" |
1953 |
~modal:true () in |
1935 |
~modal:true () in |
1954 |
let vb = t#vbox in |
1936 |
let vb = t#vbox in |
1955 |
(* vb#set_spacing 18;*) |
1937 |
(* vb#set_spacing 18;*) |
Lines 2051-2057
let addPreference parent =
Link Here
|
2051 |
let editProfile parent name = |
2033 |
let editProfile parent name = |
2052 |
let t = |
2034 |
let t = |
2053 |
GWindow.dialog ~parent ~border_width:12 |
2035 |
GWindow.dialog ~parent ~border_width:12 |
2054 |
~no_separator:true ~title:(Format.sprintf "%s - Profile Editor" name) |
2036 |
~title:(Format.sprintf "%s - Profile Editor" name) |
2055 |
~modal:true () in |
2037 |
~modal:true () in |
2056 |
let vb = t#vbox in |
2038 |
let vb = t#vbox in |
2057 |
(* t#vbox#set_spacing 18;*) |
2039 |
(* t#vbox#set_spacing 18;*) |
Lines 2302-2308
let getProfile quit =
Link Here
|
2302 |
(* Build the dialog *) |
2284 |
(* Build the dialog *) |
2303 |
let t = |
2285 |
let t = |
2304 |
GWindow.dialog ~parent:(toplevelWindow ()) ~border_width:12 |
2286 |
GWindow.dialog ~parent:(toplevelWindow ()) ~border_width:12 |
2305 |
~no_separator:true ~title:"Profile Selection" |
2287 |
~title:"Profile Selection" |
2306 |
~modal:true () in |
2288 |
~modal:true () in |
2307 |
t#set_default_width 550; |
2289 |
t#set_default_width 550; |
2308 |
|
2290 |
|
Lines 2482-2499
let documentation sect =
Link Here
|
2482 |
|
2464 |
|
2483 |
let (name, docstr) = Safelist.assoc sect Strings.docs in |
2465 |
let (name, docstr) = Safelist.assoc sect Strings.docs in |
2484 |
let hb = GPack.hbox ~packing:(t#vbox#pack ~expand:false ~padding:2) () in |
2466 |
let hb = GPack.hbox ~packing:(t#vbox#pack ~expand:false ~padding:2) () in |
2485 |
let optionmenu = |
|
|
2486 |
GMenu.option_menu ~packing:(hb#pack ~expand:true ~fill:false) () in |
2487 |
|
2467 |
|
2488 |
let t_text = |
2468 |
let t_text = |
2489 |
new scrolled_text ~editable:false |
2469 |
new scrolled_text ~editable:false |
2490 |
~width:80 ~height:20 ~packing:t#vbox#add () |
2470 |
~width:80 ~height:20 ~packing:(t#vbox#pack ~expand:true) () |
2491 |
in |
2471 |
in |
2492 |
t_text#insert docstr; |
2472 |
t_text#insert docstr; |
2493 |
|
2473 |
|
|
|
2474 |
let menuBar = |
2475 |
GMenu.menu_bar ~border_width:0 |
2476 |
~packing:(hb#pack ~expand:true ~fill:false) () in |
2477 |
let mi = GMenu.menu_item ~label:"Topics" () in |
2478 |
menuBar#insert mi 0; |
2479 |
|
2494 |
let sect_idx = ref 0 in |
2480 |
let sect_idx = ref 0 in |
2495 |
let idx = ref 0 in |
2481 |
let idx = ref 0 in |
2496 |
let menu = GMenu.menu () in |
2482 |
let menu = GMenu.menu ~packing:(mi#set_submenu) () in |
2497 |
let addDocSection (shortname, (name, docstr)) = |
2483 |
let addDocSection (shortname, (name, docstr)) = |
2498 |
if shortname <> "" && name <> "" then begin |
2484 |
if shortname <> "" && name <> "" then begin |
2499 |
if shortname = sect then sect_idx := !idx; |
2485 |
if shortname = sect then sect_idx := !idx; |
Lines 2504-2511
let documentation sect =
Link Here
|
2504 |
end |
2490 |
end |
2505 |
in |
2491 |
in |
2506 |
Safelist.iter addDocSection Strings.docs; |
2492 |
Safelist.iter addDocSection Strings.docs; |
2507 |
optionmenu#set_menu menu; |
|
|
2508 |
optionmenu#set_history !sect_idx; |
2509 |
|
2493 |
|
2510 |
t#show () |
2494 |
t#show () |
2511 |
|
2495 |
|
Lines 2532-2539
let messageBox ~title ?(action = fun t -
Link Here
|
2532 |
let twoBoxAdvanced |
2516 |
let twoBoxAdvanced |
2533 |
~parent ~title ~message ~longtext ~advLabel ~astock ~bstock = |
2517 |
~parent ~title ~message ~longtext ~advLabel ~astock ~bstock = |
2534 |
let t = |
2518 |
let t = |
2535 |
GWindow.dialog ~parent ~border_width:6 ~modal:true ~no_separator:true |
2519 |
GWindow.dialog ~parent ~border_width:6 ~modal:true |
2536 |
~allow_grow:false () in |
2520 |
~resizable:false () in |
2537 |
t#vbox#set_spacing 12; |
2521 |
t#vbox#set_spacing 12; |
2538 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
2522 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
2539 |
ignore (GMisc.image ~stock:`DIALOG_QUESTION ~icon_size:`DIALOG |
2523 |
ignore (GMisc.image ~stock:`DIALOG_QUESTION ~icon_size:`DIALOG |
Lines 2565-2572
let twoBoxAdvanced
Link Here
|
2565 |
|
2549 |
|
2566 |
let summaryBox ~parent ~title ~message ~f = |
2550 |
let summaryBox ~parent ~title ~message ~f = |
2567 |
let t = |
2551 |
let t = |
2568 |
GWindow.dialog ~parent ~border_width:6 ~modal:true ~no_separator:true |
2552 |
GWindow.dialog ~parent ~border_width:6 ~modal:true |
2569 |
~allow_grow:false ~focus_on_map:false () in |
2553 |
~resizable:false ~focus_on_map:false () in |
2570 |
t#vbox#set_spacing 12; |
2554 |
t#vbox#set_spacing 12; |
2571 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
2555 |
let h1 = GPack.hbox ~border_width:6 ~spacing:12 ~packing:t#vbox#pack () in |
2572 |
ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG |
2556 |
ignore (GMisc.image ~stock:`DIALOG_INFO ~icon_size:`DIALOG |
Lines 2695-2707
let createToplevelWindow () =
Link Here
|
2695 |
Action bar |
2679 |
Action bar |
2696 |
*********************************************************************) |
2680 |
*********************************************************************) |
2697 |
let actionBar = |
2681 |
let actionBar = |
2698 |
let hb = GBin.handle_box ~packing:(toplevelVBox#pack ~expand:false) () in |
|
|
2699 |
GButton.toolbar ~style:`BOTH |
2682 |
GButton.toolbar ~style:`BOTH |
2700 |
(* 2003-0519 (stse): how to set space size in gtk 2.0? *) |
2683 |
(* 2003-0519 (stse): how to set space size in gtk 2.0? *) |
2701 |
(* Answer from Jacques Garrigue: this can only be done in |
2684 |
(* Answer from Jacques Garrigue: this can only be done in |
2702 |
the user's.gtkrc, not programmatically *) |
2685 |
the user's.gtkrc, not programmatically *) |
2703 |
~orientation:`HORIZONTAL ~tooltips:true (* ~space_size:10 *) |
2686 |
~orientation:`HORIZONTAL (* ~space_size:10 *) |
2704 |
~packing:(hb#add) () in |
2687 |
~packing:(toplevelVBox#pack ~expand:false) () in |
2705 |
|
2688 |
|
2706 |
(********************************************************************* |
2689 |
(********************************************************************* |
2707 |
Create the main window |
2690 |
Create the main window |
Lines 2937-2942
let createToplevelWindow () =
Link Here
|
2937 |
GRange.progress_bar ~packing:(statusHBox#pack ~expand:false) () in |
2920 |
GRange.progress_bar ~packing:(statusHBox#pack ~expand:false) () in |
2938 |
|
2921 |
|
2939 |
progressBar#misc#set_size_chars ~height:1 ~width:28 (); |
2922 |
progressBar#misc#set_size_chars ~height:1 ~width:28 (); |
|
|
2923 |
progressBar#set_show_text true; |
2940 |
progressBar#set_pulse_step 0.02; |
2924 |
progressBar#set_pulse_step 0.02; |
2941 |
let progressBarPulse = ref false in |
2925 |
let progressBarPulse = ref false in |
2942 |
|
2926 |
|
Lines 3646-3652
lst_store#set ~row ~column:c_path path;
Link Here
|
3646 |
~title:"Synchronization summary" ~message ~f: |
3630 |
~title:"Synchronization summary" ~message ~f: |
3647 |
(fun t -> |
3631 |
(fun t -> |
3648 |
let bullet = "\xe2\x80\xa2 " in |
3632 |
let bullet = "\xe2\x80\xa2 " in |
3649 |
let layout = t#misc#pango_context#create_layout in |
3633 |
let layout = Pango.Layout.create t#misc#pango_context#as_context in |
3650 |
Pango.Layout.set_text layout bullet; |
3634 |
Pango.Layout.set_text layout bullet; |
3651 |
let (n, _) = Pango.Layout.get_pixel_size layout in |
3635 |
let (n, _) = Pango.Layout.get_pixel_size layout in |
3652 |
let path = |
3636 |
let path = |
Lines 3738-3772
lst_store#set ~row ~column:c_path path;
Link Here
|
3738 |
let questionAction _ = doAction (fun _ diff -> diff.direction <- Conflict "") in |
3722 |
let questionAction _ = doAction (fun _ diff -> diff.direction <- Conflict "") in |
3739 |
let mergeAction _ = doAction (fun _ diff -> diff.direction <- Merge) in |
3723 |
let mergeAction _ = doAction (fun _ diff -> diff.direction <- Merge) in |
3740 |
|
3724 |
|
|
|
3725 |
let insert_button (toolbar : #GButton.toolbar) ~stock ~text ~tooltip ~callback () = |
3726 |
let b = GButton.tool_button ~stock ~label:text ~packing:toolbar#insert () in |
3727 |
ignore (b#connect#clicked ~callback); |
3728 |
b#misc#set_tooltip_text tooltip; |
3729 |
b |
3730 |
in |
3731 |
|
3741 |
(* actionBar#insert_space ();*) |
3732 |
(* actionBar#insert_space ();*) |
3742 |
grAdd grAction |
3733 |
grAdd grAction |
3743 |
(actionBar#insert_button |
3734 |
(insert_button actionBar |
3744 |
(* ~icon:((GMisc.pixmap rightArrowBlack ())#coerce)*) |
3735 |
~stock:`GO_FORWARD |
3745 |
~icon:((GMisc.image ~stock:`GO_FORWARD ())#coerce) |
|
|
3746 |
~text:"Left to Right" |
3736 |
~text:"Left to Right" |
3747 |
~tooltip:"Propagate selected items\n\ |
3737 |
~tooltip:"Propagate selected items\n\ |
3748 |
from the left replica to the right one" |
3738 |
from the left replica to the right one" |
3749 |
~callback:rightAction ()); |
3739 |
~callback:rightAction ()); |
3750 |
(* actionBar#insert_space ();*) |
3740 |
(* actionBar#insert_space ();*) |
3751 |
grAdd grAction |
3741 |
grAdd grAction |
3752 |
(actionBar#insert_button ~text:"Skip" |
3742 |
(insert_button actionBar ~text:"Skip" |
3753 |
~icon:((GMisc.image ~stock:`NO ())#coerce) |
3743 |
~stock:`NO |
3754 |
~tooltip:"Skip selected items" |
3744 |
~tooltip:"Skip selected items" |
3755 |
~callback:questionAction ()); |
3745 |
~callback:questionAction ()); |
3756 |
(* actionBar#insert_space ();*) |
3746 |
(* actionBar#insert_space ();*) |
3757 |
grAdd grAction |
3747 |
grAdd grAction |
3758 |
(actionBar#insert_button |
3748 |
(insert_button actionBar |
3759 |
(* ~icon:((GMisc.pixmap leftArrowBlack ())#coerce)*) |
3749 |
~stock:`GO_BACK |
3760 |
~icon:((GMisc.image ~stock:`GO_BACK ())#coerce) |
|
|
3761 |
~text:"Right to Left" |
3750 |
~text:"Right to Left" |
3762 |
~tooltip:"Propagate selected items\n\ |
3751 |
~tooltip:"Propagate selected items\n\ |
3763 |
from the right replica to the left one" |
3752 |
from the right replica to the left one" |
3764 |
~callback:leftAction ()); |
3753 |
~callback:leftAction ()); |
3765 |
(* actionBar#insert_space ();*) |
3754 |
(* actionBar#insert_space ();*) |
3766 |
grAdd grAction |
3755 |
grAdd grAction |
3767 |
(actionBar#insert_button |
3756 |
(insert_button actionBar |
3768 |
(* ~icon:((GMisc.pixmap mergeLogoBlack())#coerce)*) |
3757 |
~stock:`ADD |
3769 |
~icon:((GMisc.image ~stock:`ADD ())#coerce) |
|
|
3770 |
~text:"Merge" |
3758 |
~text:"Merge" |
3771 |
~tooltip:"Merge selected files" |
3759 |
~tooltip:"Merge selected files" |
3772 |
~callback:mergeAction ()); |
3760 |
~callback:mergeAction ()); |
Lines 3800-3808
lst_store#set ~row ~column:c_path path;
Link Here
|
3800 |
| None -> |
3788 |
| None -> |
3801 |
() in |
3789 |
() in |
3802 |
|
3790 |
|
3803 |
actionBar#insert_space (); |
3791 |
actionBar#insert (GButton.separator_tool_item ()); |
3804 |
grAdd grDiff (actionBar#insert_button ~text:"Diff" |
3792 |
grAdd grDiff (insert_button actionBar ~text:"Diff" |
3805 |
~icon:((GMisc.image ~stock:`DIALOG_INFO ())#coerce) |
3793 |
~stock:`DIALOG_INFO |
3806 |
~tooltip:"Compare the two files at each replica" |
3794 |
~tooltip:"Compare the two files at each replica" |
3807 |
~callback:diffCmd ()); |
3795 |
~callback:diffCmd ()); |
3808 |
|
3796 |
|
Lines 3810-3817
lst_store#set ~row ~column:c_path path;
Link Here
|
3810 |
Detail button |
3798 |
Detail button |
3811 |
*********************************************************************) |
3799 |
*********************************************************************) |
3812 |
(* actionBar#insert_space ();*) |
3800 |
(* actionBar#insert_space ();*) |
3813 |
grAdd grDetail (actionBar#insert_button ~text:"Details" |
3801 |
grAdd grDetail (insert_button actionBar ~text:"Details" |
3814 |
~icon:((GMisc.image ~stock:`INFO ())#coerce) |
3802 |
~stock:`INFO |
3815 |
~tooltip:"Show detailed information about\n\ |
3803 |
~tooltip:"Show detailed information about\n\ |
3816 |
an item, when available" |
3804 |
an item, when available" |
3817 |
~callback:showDetCommand ()); |
3805 |
~callback:showDetCommand ()); |
Lines 3829-3839
lst_store#set ~row ~column:c_path path;
Link Here
|
3829 |
(********************************************************************* |
3817 |
(********************************************************************* |
3830 |
go button |
3818 |
go button |
3831 |
*********************************************************************) |
3819 |
*********************************************************************) |
3832 |
actionBar#insert_space (); |
3820 |
actionBar#insert (GButton.separator_tool_item ()); |
3833 |
grAdd grGo |
3821 |
grAdd grGo |
3834 |
(actionBar#insert_button ~text:"Go" |
3822 |
(insert_button actionBar ~text:"Go" |
3835 |
(* tooltip:"Go with displayed actions" *) |
3823 |
(* tooltip:"Go with displayed actions" *) |
3836 |
~icon:((GMisc.image ~stock:`EXECUTE ())#coerce) |
3824 |
~stock:`EXECUTE |
3837 |
~tooltip:"Perform the synchronization" |
3825 |
~tooltip:"Perform the synchronization" |
3838 |
~callback:(fun () -> |
3826 |
~callback:(fun () -> |
3839 |
getLock synchronize) ()); |
3827 |
getLock synchronize) ()); |
Lines 3882-3903
lst_store#set ~row ~column:c_path path;
Link Here
|
3882 |
in |
3870 |
in |
3883 |
(* actionBar#insert_space ();*) |
3871 |
(* actionBar#insert_space ();*) |
3884 |
grAdd grRescan |
3872 |
grAdd grRescan |
3885 |
(actionBar#insert_button ~text:"Rescan" |
3873 |
(insert_button actionBar ~text:"Rescan" |
3886 |
~icon:((GMisc.image ~stock:`REFRESH ())#coerce) |
3874 |
~stock:`REFRESH |
3887 |
~tooltip:"Check for updates" |
3875 |
~tooltip:"Check for updates" |
3888 |
~callback: (fun () -> reloadProfile(); detectCmd()) ()); |
3876 |
~callback: (fun () -> reloadProfile(); detectCmd()) ()); |
3889 |
|
3877 |
|
3890 |
(********************************************************************* |
3878 |
(********************************************************************* |
3891 |
Profile change button |
3879 |
Profile change button |
3892 |
*********************************************************************) |
3880 |
*********************************************************************) |
3893 |
actionBar#insert_space (); |
3881 |
actionBar#insert (GButton.separator_tool_item ()); |
3894 |
let profileChange _ = |
3882 |
let profileChange _ = |
3895 |
match getProfile false with |
3883 |
match getProfile false with |
3896 |
None -> () |
3884 |
None -> () |
3897 |
| Some p -> clearMainWindow (); loadProfile p false; detectCmd () |
3885 |
| Some p -> clearMainWindow (); loadProfile p false; detectCmd () |
3898 |
in |
3886 |
in |
3899 |
grAdd grRescan (actionBar#insert_button ~text:"Change Profile" |
3887 |
grAdd grRescan (insert_button actionBar ~text:"Change Profile" |
3900 |
~icon:((GMisc.image ~stock:`OPEN ())#coerce) |
3888 |
~stock:`OPEN |
3901 |
~tooltip:"Select a different profile" |
3889 |
~tooltip:"Select a different profile" |
3902 |
~callback:profileChange ()); |
3890 |
~callback:profileChange ()); |
3903 |
|
3891 |
|
Lines 4154-4164
lst_store#set ~row ~column:c_path path;
Link Here
|
4154 |
let (expertMenu, _) = add_submenu "Expert" in |
4142 |
let (expertMenu, _) = add_submenu "Expert" in |
4155 |
|
4143 |
|
4156 |
let addDebugToggle modname = |
4144 |
let addDebugToggle modname = |
4157 |
let cm = |
4145 |
ignore (expertMenu#add_check_item ~active:(Trace.enabled modname) |
4158 |
expertMenu#add_check_item ~active:(Trace.enabled modname) |
4146 |
~callback:(fun b -> Trace.enable modname b) |
4159 |
~callback:(fun b -> Trace.enable modname b) |
4147 |
("Debug '" ^ modname ^ "'")) in |
4160 |
("Debug '" ^ modname ^ "'") in |
|
|
4161 |
cm#set_show_toggle true in |
4162 |
|
4148 |
|
4163 |
addDebugToggle "all"; |
4149 |
addDebugToggle "all"; |
4164 |
addDebugToggle "verbose"; |
4150 |
addDebugToggle "verbose"; |