]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormCopyright.C
Remove unneeded files, we have switched to use the libglade and there is no
[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 "gettext.h"
16 #include "Dialogs.h"
17 #include "FormCopyright.h"
18
19 FormCopyright::FormCopyright(LyXView * lv, Dialogs * d)
20         : dialog_(0), lv_(lv), d_(d), h_(0)
21 {
22         // let the dialog be shown
23         // This is a permanent connection so we won't bother
24         // storing a copy because we won't be disconnecting.
25         d->showCopyright.connect(slot(this, &FormCopyright::show));
26 }
27
28
29 FormCopyright::~FormCopyright()
30 {
31         if (dialog_!=0) hide();
32 }
33
34
35 void FormCopyright::show()
36 {
37         if(dialog_!=0) { // "About" box hasn't been closed, so just raise it
38                 Gdk_Window dialog_win(dialog_->get_window());
39                 dialog_win.show();
40                 dialog_win.raise();
41         }
42         else { // create new "About" dialog box
43                 vector<string> authors; //0. Authors are not listed in LyX copyright dialogbox.
44                 
45                 dialog_ = new Gnome::About(PACKAGE, VERSION,
46                                            _("(C) 1995 by Matthias Ettrich, \n1995-2000 LyX Team"),
47                                            authors,
48                                            _("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."),
49                                            0);
50                 
51                 // it should be disconnected before deleting dialog_ in FormCopyright::hide()
52                 destroy_ = dialog_->destroy.connect(slot(this, &FormCopyright::hide));
53                 
54                 dialog_->show();
55                 
56                 h_ = d_->hideAll.connect(slot(this, &FormCopyright::hide));
57         }
58 }
59
60
61 void FormCopyright::hide()
62 {
63         if (dialog_!=0) {
64                 dialog_->hide();
65                 
66                 h_.disconnect();
67                 destroy_.disconnect();
68                 
69                 delete dialog_;
70                 dialog_ = 0;
71         }
72 }