mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-22 20:36:06 +08:00
[paparazzi center] update help dialogs
- use Gtk about dialog - GWindow.message_dialog instead of GToolbox.message_box to get markup (url links) and selectable version - unfortunately it somehow doesn't display the pprz icon anymore
This commit is contained in:
@@ -282,19 +282,47 @@ let () =
|
||||
ignore (gui#menu_item_fullscreen#connect#activate ~callback);
|
||||
|
||||
(* Help/About menu entry *)
|
||||
let callback = fun () ->
|
||||
ignore (GToolbox.message_box ~title:"About Paparazzi Center" ~icon:(GMisc.image ~pixbuf:paparazzi_pixbuf ())#coerce "Copyright (C) 2007-2008 ENAC, Pascal Brisset\nhttp://paparazziuav.org") in
|
||||
ignore (gui#menu_item_about#connect#activate ~callback);
|
||||
let aboutDialog = GWindow.about_dialog
|
||||
~name:"Paparazzi Center"
|
||||
~logo:paparazzi_pixbuf
|
||||
~authors:["Pascal Brisset"]
|
||||
~copyright:"Copyright (C) 2007-2008 ENAC, Pascal Brisset"
|
||||
~license:"GPLv2"
|
||||
~website:"http://paparazziuav.org"
|
||||
~website_label:"http://paparazziuav.org"
|
||||
(*~version:version_str*)
|
||||
~position:`CENTER_ON_PARENT
|
||||
~destroy_with_parent:true
|
||||
~parent:gui#window
|
||||
()
|
||||
in
|
||||
ignore (gui#menu_item_about#connect#activate ~callback:(fun () -> ignore (aboutDialog#run ()); aboutDialog#misc#hide ()));
|
||||
|
||||
let pprzInfoDialog (title,msg) =
|
||||
(* somehow doen't show the pprz icon, but the default info icon instead *)
|
||||
let dlg = GWindow.message_dialog
|
||||
~title:title
|
||||
~message:msg
|
||||
~icon:paparazzi_pixbuf
|
||||
~use_markup:true
|
||||
~modal:true
|
||||
~message_type:`INFO
|
||||
~position:`CENTER_ON_PARENT
|
||||
~destroy_with_parent:true
|
||||
~parent:gui#window
|
||||
~buttons:GWindow.Buttons.close () in
|
||||
let res = dlg#run () = `CLOSE in
|
||||
dlg#destroy ();
|
||||
res
|
||||
in
|
||||
|
||||
(* Help/Get Help menu entry *)
|
||||
let callback = fun () ->
|
||||
ignore (GToolbox.message_box ~title:"Getting Help with Paparazzi" ~icon:(GMisc.image ~pixbuf:paparazzi_pixbuf ())#coerce "The primary documentation for Paparazzi is on the wiki:\nhttps://wiki.paparazziuav.org\n\nCommunity-based support is through the paparazzi-devel mailing list:\nhttps://wiki.paparazziuav.org/wiki/Contact\n\nThe Paparazzi auto-generated developer documentation is found on:\nhttp://docs.paparazziuav.org/\n\nThe Paparazzi sourcecode can be found on GitHub:\nhttps://github.com/paparazzi/paparazzi\n\nIf you think you have found a bug or would like to make a feature request, feel\nfree to visit the Issues page found on GitHub (link found on the above webpage).") in
|
||||
ignore (gui#menu_item_get_help#connect#activate ~callback);
|
||||
let help_text = "Primary documentation: Paparazzi wiki:\n<a href='https://wiki.paparazziuav.org'>https://wiki.paparazziuav.org</a>\n\nCommunity-based support, mailing list: <a href='https://wiki.paparazziuav.org/wiki/Contact'>Contact</a>\n\nThe Paparazzi auto-generated developer documentation:\n<a href='http://docs.paparazziuav.org'>http://docs.paparazziuav.org</a>\n\nPaparazzi sourcecode and issue tracker:\n<a href='https://github.com/paparazzi/paparazzi'>https://github.com/paparazzi/paparazzi</a>" in
|
||||
ignore (gui#menu_item_get_help#connect#activate ~callback:(fun () -> ignore (pprzInfoDialog ("Getting Help with Paparazzi",help_text))));
|
||||
|
||||
(* Version *)
|
||||
let callback = fun () ->
|
||||
ignore (GToolbox.message_box ~title:"Paparazzi version" ~icon:(GMisc.image ~pixbuf:paparazzi_pixbuf ())#coerce ("Run version:\t" ^ version_str ^ "\nBuild version:\t" ^ build_str)) in
|
||||
ignore (gui#menu_item_version#connect#activate ~callback);
|
||||
let version_msg = ("Run version:\t" ^ version_str ^ "\nBuild version:\t" ^ build_str) in
|
||||
ignore (gui#menu_item_version#connect#activate ~callback:(fun () -> ignore (pprzInfoDialog ("Version",version_msg))));
|
||||
|
||||
(* Read preferences *)
|
||||
if Sys.file_exists Env.gconf_file then begin
|
||||
|
||||
Reference in New Issue
Block a user