]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormCopyright.C
Dekel's lyxrc.example; Angus's FormDocument; John's build-listerrors; POTFILES.in...
[lyx.git] / src / frontends / gnome / FormCopyright.C
1 /* This file is part of
2  * ====================================================== 
3  * 
4  *           LyX, The Document Processor
5  *       
6  *          Copyright 2000 The LyX Team.
7  *
8  * ====================================================== */
9
10 /* FormCopyright.C
11  * FormCopyright Interface Class Implementation
12  */
13
14 #include <config.h>
15 #include "Dialogs.h"
16 #include "FormCopyright.h"
17
18 FormCopyright::FormCopyright(LyXView * lv, Dialogs * d)
19         : dialog_(NULL), lv_(lv), d_(d), h_(0)
20 {
21         // let the dialog be shown
22         // This is a permanent connection so we won't bother
23         // storing a copy because we won't be disconnecting.
24         d->showCopyright.connect(slot(this, &FormCopyright::show));
25 }
26
27
28 FormCopyright::~FormCopyright()
29 {
30         if (dialog_!=NULL) hide();
31 }
32
33
34 void FormCopyright::show()
35 {
36         if(dialog_!=NULL) { // "About" box hasn't been closed, so just raise it
37                 Gdk_Window dialog_win(dialog_->get_window());
38                 dialog_win.show();
39                 dialog_win.raise();
40         }
41         else { // create new "About" dialog box
42                 vector<string> authors; //null. Authors are not listed in LyX copyright dialogbox.
43                 
44                 dialog_ = new Gnome::About(PACKAGE, VERSION,
45                                            "(C) 1995 by Matthias Ettrich, \n1995-2000 LyX Team",
46                                            authors,
47                                            "This program 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.\nLyX is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, MA 02139, USA.",
48                                            NULL);
49                 
50                 // it should be disconnected before deleting dialog_ in FormCopyright::hide()
51                 destroy_ = dialog_->destroy.connect(slot(this, &FormCopyright::hide));
52                 
53                 dialog_->show();
54                 
55                 h_ = d_->hideAll.connect(slot(this, &FormCopyright::hide));
56         }
57 }
58
59
60 void FormCopyright::hide()
61 {
62         if (dialog_!=NULL) {
63                 dialog_->hide();
64                 
65                 h_.disconnect();
66                 destroy_.disconnect();
67                 
68                 delete dialog_;
69                 dialog_ = NULL;
70         }
71 }