~ubuntu-branches/debian/sid/frama-c/sid

« back to all changes in this revision

Viewing changes to src/gui/about_dialog.ml

  • Committer: Bazaar Package Importer
  • Author(s): Mehdi Dogguy
  • Date: 2009-06-03 08:19:25 UTC
  • Revision ID: james.westby@ubuntu.com-20090603081925-kihvxvt0wy3zc4ar
Tags: upstream-20081201.dfsg
Import upstream version 20081201.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(**************************************************************************)
 
2
(*                                                                        *)
 
3
(*  This file is part of Frama-C.                                         *)
 
4
(*                                                                        *)
 
5
(*  Copyright (C) 2007-2008                                               *)
 
6
(*    CEA (Commissariat � l'�nergie Atomique)                             *)
 
7
(*                                                                        *)
 
8
(*  you can redistribute it and/or modify it under the terms of the GNU   *)
 
9
(*  Lesser General Public License as published by the Free Software       *)
 
10
(*  Foundation, version 2.1.                                              *)
 
11
(*                                                                        *)
 
12
(*  It is distributed in the hope that it will be useful,                 *)
 
13
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
 
14
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
 
15
(*  GNU Lesser General Public License for more details.                   *)
 
16
(*                                                                        *)
 
17
(*  See the GNU Lesser General Public License version 2.1                 *)
 
18
(*  for more details (enclosed in the file licenses/LGPLv2.1).            *)
 
19
(*                                                                        *)
 
20
(**************************************************************************)
 
21
 
 
22
let show () =
 
23
  let dialog = 
 
24
    GWindow.about_dialog 
 
25
      ~name:"ValViewer" 
 
26
      ~authors:["Patrick Baudin" ; 
 
27
                "Pascal Cuoq"; 
 
28
                "Jean-Christophe Filliâtre"; 
 
29
                "Claude Marché";
 
30
                "Benjamin Monate"; 
 
31
                "Yannick Moy";
 
32
                "Anne Pacalet";
 
33
                "Virgile Prévosto";
 
34
                "Julien Signoles";
 
35
               ]
 
36
      ~copyright:"Copyright: CEA for value analysis plugin and GUI\n\tCEA/INRIA for the Frama-C kernel\n\tINRIA for the Jessie plugin"
 
37
      ~license:"Frama-C kernel is under LGPL v2
 
38
Cil is under BSD
 
39
Ocamlgraph is under LGPL v2
 
40
Analysis plugins are LGPL v2.1"
 
41
      ~website:"http://frama-c.cea.fr/"
 
42
      ~website_label:"Questions and support"
 
43
      (* [JS 6 October 2008] the following line breaks compilation, of course.
 
44
         ~icon:*)
 
45
      ~version:(Version.version^" compiled on "^Version.date)
 
46
      ()
 
47
  in
 
48
(*  Buggy labgtk2 prevents this from working...*)
 
49
    ignore 
 
50
    (dialog#connect#response 
 
51
       ~callback:(fun _ -> try 
 
52
                    dialog#coerce#destroy ()
 
53
                    with Not_found -> ()));
 
54
  try 
 
55
  ignore (dialog#run ())
 
56
  with Not_found | Failure "dialog destroyed" -> (* raised because of a buggy lablgtk2 *)
 
57
    ()
 
58
 
 
59
(** Register this dialog in main window menu bar *)
 
60
let () = 
 
61
  Design.register_extension 
 
62
    (fun window -> 
 
63
       GAction.add_actions window#actions
 
64
         [GAction.add_action "About" ~stock:`ABOUT ~accel:"<control>A" 
 
65
            ~tooltip:"About"
 
66
            ~callback:(fun _-> show ());
 
67
          GAction.add_action "HelpMenu" ~label:"_Help";];
 
68
       let location = 
 
69
         "<ui><menubar name='MenuBar'>
 
70
          <menu action='HelpMenu'>
 
71
          <menuitem action='About'/>
 
72
          </menu>
 
73
          </menubar></ui>"
 
74
       in
 
75
       let _ = window#ui_manager#add_ui_from_string location in
 
76
       let help_item = window#ui_manager#get_widget "/MenuBar/HelpMenu" in
 
77
       let help_item =  GtkMenu.MenuItem.cast help_item#as_widget in
 
78
       GtkMenu.MenuItem.set_right_justified help_item true)