# # # patch "ui.ml" # from [fa3fc2636ed401ab869c6af1383eb65b9afdbca5] # to [91bf0c10d2a7892200c699f927f9bcbd76a2d486] # ============================================================ --- ui.ml fa3fc2636ed401ab869c6af1383eb65b9afdbca5 +++ ui.ml 91bf0c10d2a7892200c699f927f9bcbd76a2d486 @@ -261,8 +261,39 @@ end end +module About = struct + let authors = ["Olivier Andrieu "] + let comments = "Lets you visualize ancestry graphs from the Revision Control System monotone" + let copyright = "Copyright © 2004-2007 Olivier Andrieu" + let license = "\ +monotone-viz is free software; you can redistribute it +and/or modify it under the terms of the GNU General +Public License as published by the Free Software Foundation; +either version 2 of the License, or (at your option) +any later version." + let name = "monotone-viz" + let version = "1.0" + let website = "http://oandrieu.nerim.net/monotone-viz/" + let website_label = "monotone-viz website" + + let make ctrl = + let d = + GWindow.about_dialog + ~authors ~comments ~copyright + ~license ~logo:(Lazy.force Icon.monotone) + ~name ~version ~website ~website_label + ~parent:ctrl#get_toplevel () in + ignore (d#event#connect#delete (fun _ -> d#misc#hide () ; true)) ; + ignore (d#connect#response (fun _ -> d#misc#hide ())) ; + d + + let show ctrl = + let d = lazy (make ctrl) in + fun () -> (Lazy.force d)#present () +end + module Open = struct type t = [`OPEN|`CLOSE|`DELETE_EVENT] GWindow.file_chooser_dialog let make ctrl = @@ -372,6 +403,9 @@ let ui_info = "\ \ \ \ + \ + \ + \ \ \ " @@ -402,7 +436,9 @@ let make_groups () = add "Open" ~stock:`OPEN ~tooltip:"Open a database" ; add "Quit" ~stock:`QUIT ~tooltip:"Exit" ; add "Prefs" ~stock:`PREFERENCES ~tooltip:"Edit Preferences" ; - add "FindEntry" ~accel:"l" ] ; + add "FindEntry" ~accel:"l" ; + add "HelpMenu" ~label:"_Help" ; + add "About" ~stock:`ABOUT ] ; let g_db = GAction.action_group ~name:"db" () in GAction.add_actions g_db [ add "Close" ~stock:`CLOSE ~tooltip:"Close the database" ; @@ -587,6 +623,7 @@ let setup ({ manager = ui } as m) ctrl = action_connect "/menubar/FileMenu/Prefs" ctrl#show_prefs ; action_connect "/menubar/ViewMenu/Query" ctrl#show_search ; action_connect "/menubar/FileMenu/New" ctrl#show_view ; + action_connect "/menubar/HelpMenu/About" (About.show ctrl) ; action_connect "/popup/Certs" (fun () -> ctrl#display_certs (get_popup_data m).popup_id) ; action_connect "/popup_cert/Copy_cert"