5 let _s x
= _s "Gui_starter" x
6 let _b x
= _b "Gui_starter" x
8 let home_dir = (try Sys.getenv
"HOME" with _
-> ".")
9 let config_dir_basename =
10 if Autoconf.windows
then "mldonkey" else ".mldonkey"
11 let config_dir = Filename.concat
home_dir config_dir_basename
14 let filename = Filename.concat
config_dir "gui_starter_strings" in
15 Unix2.safe_mkdir
(Filename.dirname
filename);
16 set_strings_file
filename
19 ignore
(GMain.Main.init
());
20 let window = GWindow.window ~title
:(_s "MLdonkey GUI starter") ~border_width
:10
21 ~width
:300 ~height
:150 () in
22 let vbox_2 = GPack.vbox ~homogeneous
:false ~packing
: window#add
()in
24 GMisc.label ~text
: (_s "\n Start the GTK gui ? \n\nChange the 'ask_for_gui' option to false to remove this message.\n\n") ~justify
:`CENTER ~line_wrap
:true
25 ~xalign
:(-1.0) ~yalign
:(-1.0)
26 ~packing
:(vbox_2#pack ~expand
:true ~fill
:true) ()
29 GPack.hbox ~homogeneous
:true
30 ~packing
:(vbox_2#pack ~expand
:false ~fill
:true) ()
33 GButton.button ~packing
:(hbox_4#pack ~expand
:true ~fill
:true) ()
36 GMisc.label ~text
:(_s "YES") ~justify
:`CENTER ~line_wrap
:true ~xalign
:(-1.0)
37 ~yalign
:(-1.0) ~packing
:(wb_5#add
) ()
40 GButton.button ~packing
:(hbox_4#pack ~expand
:true ~fill
:true) ()
43 GMisc.label ~text
:(_s "NO") ~justify
:`CENTER ~line_wrap
:true ~xalign
:(-1.0)
44 ~yalign
:(-1.0) ~packing
:(wb_6#add
) ()
46 ignore
(window#connect#destroy ~callback
:GMain.Main.quit
);
47 ignore
(wb_5#connect#clicked ~callback
:
49 ignore
(Sys.command
(Printf.sprintf
"%s &" Sys.argv
.(1)));
52 ignore
(wb_6#connect#clicked ~callback
: