]> git.lyx.org Git - lyx.git/blob - src/credits.C
update all .po files ot latestes pot
[lyx.git] / src / credits.C
1 /* This file is part of
2  * ====================================================== 
3  * 
4  *           LyX, The Document Processor
5  *       
6  *           Copyright 1995 Matthias Ettrich
7  *           Copyright 1995-2000 The LyX Team.
8  *
9  * ====================================================== */
10
11 #include <config.h>
12
13 #include FORMS_H_LOCATION
14 #include <cstdlib>
15
16 #include "credits.h"
17 #include "credits_form.h"
18
19 #include "LString.h"
20 #include "support/filetools.h"
21 #include "lyx_gui_misc.h" // CancelCloseBoxCB
22 #include "gettext.h"
23
24 extern string system_lyxdir;
25
26 /**** Forms and Objects ****/
27
28 static FD_form_credits *fd_form_credits = 0;
29
30 void CreditsOKCB(FL_OBJECT *, long) {
31       fl_hide_form(fd_form_credits->form_credits);
32       fl_free_form(fd_form_credits->form_credits);
33       fd_form_credits->form_credits = 0;
34 }
35
36 /*---------------------------------------*/
37 /* read credits from file and display them */
38 void ShowCredits()
39 {
40         /* generate the credits form if it doesn't exist */
41         if (!fd_form_credits || !fd_form_credits->form_credits) {
42                 
43                 /* read the credits into the browser */ 
44                 
45                 /* try file LYX_DIR/CREDITS */ 
46                 string real_file = AddName (system_lyxdir, "CREDITS");
47                 fd_form_credits = create_form_form_credits();
48                 fl_set_form_atclose(fd_form_credits->form_credits,
49                                     CancelCloseBoxCB, 0);
50
51                 if (!fl_load_browser(fd_form_credits->browser_credits, 
52                                      real_file.c_str())) {
53                         fl_add_browser_line(fd_form_credits->browser_credits,
54                                             _("ERROR: LyX wasn't able to read"
55                                             " CREDITS file"));
56                         fl_add_browser_line(fd_form_credits->browser_credits, "");
57                         fl_add_browser_line(fd_form_credits->browser_credits,
58                                             _("Please install correctly to estimate"
59                                             " the great"));
60                         fl_add_browser_line(fd_form_credits->browser_credits,
61                                             _("amount of work other people have done"
62                                             " for the LyX project."));
63                 }
64         }
65
66         if (fd_form_credits->form_credits->visible) {
67                 fl_raise_form(fd_form_credits->form_credits);
68         } else {
69                 fl_show_form(fd_form_credits->form_credits,
70                              FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER,
71                              _("Credits"));
72         }
73 }