]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/FormCopyright.C
99fdefc2e60cdf0ab1f91feda1ba513eda65120f
[lyx.git] / src / frontends / qt2 / FormCopyright.C
1 /***************************************************************************
2                           formcopyright.cpp  -  description
3                              -------------------
4     begin                : Thu Feb 3 2000
5     copyright            : (C) 2000 by Jürgen Vigna
6     email                : jug@sad.it
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #include <config.h>
19
20 #include "Dialogs.h"
21 #include "FormCopyright.h"
22 #include "FormCopyrightDialog.h"
23 #include "gettext.h"
24
25 FormCopyright::FormCopyright(LyXView *v, Dialogs *d)
26         : dialog_(0), lv_(v), d_(d), h_(0)
27 {
28         // let the dialog be shown
29         // This is a permanent connection so we won't bother
30         // storing a copy because we won't be disconnecting.
31         d->showCopyright.connect(slot(this, &FormCopyright::show));
32 }
33
34 FormCopyright::~FormCopyright()
35 {
36         delete dialog_;
37 }
38
39 void FormCopyright::show()
40 {
41         if (!dialog_)
42                 dialog_ = new FormCopyrightDialog(0, _("Copyright and Warranty"),
43                                                   false);
44         if (!dialog_->isVisible())
45                 h_ = d_->hideAll.connect(slot(this, &FormCopyright::hide));
46         dialog_->show();
47 }
48
49 void FormCopyright::hide()
50 {
51         dialog_->hide();
52         h_.disconnect();
53 }