]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/FormCopyright.C
major GUII cleanup + Baruchs patch + Angus's patch + removed a couple of generated...
[lyx.git] / src / frontends / kde / 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 "FormCopyright.h"
19 #include "formcopyrightdialog.h"
20 #include "Dialogs.h"
21
22 FormCopyright::FormCopyright(LyXFunc *c, Dialogs *d)
23         : dialog_(0), lf_(c), d_(d), h_(0)
24 {
25         // let the dialog be shown
26         // This is a permanent connection so we won't bother
27         // storing a copy because we won't be disconnecting.
28         d->showCopyright.connect(slot(this, &FormCopyright::show));
29         dialog_ = 0;
30 }
31
32 FormCopyright::~FormCopyright()
33 {
34         delete dialog_;
35 }
36
37 void FormCopyright::show()
38 {
39         if (!dialog_)
40                 dialog_ = new FormCopyrightDialog(0, "Copyright and Warranty",
41                                                   false);
42         if (!dialog_->isVisible())
43                 h_ = d_->hideAll.connect(slot(this, &FormCopyright::hide));
44         dialog_->show();
45 }
46
47 void FormCopyright::hide()
48 {
49         dialog_->hide();
50         h_.disconnect();
51 }