1 /**************************************************************************/
2 /*  Copyright 2009 Tim Day                                                */
3 /*                                                                        */
4 /*  This file is part of Fracplanet                                       */
5 /*                                                                        */
6 /*  Fracplanet is free software: you can redistribute it and/or modify    */
7 /*  it under the terms of the GNU General Public License as published by  */
8 /*  the Free Software Foundation, either version 3 of the License, or     */
9 /*  (at your option) any later version.                                   */
10 /*                                                                        */
11 /*  Fracplanet is distributed in the hope that it will be useful,         */
12 /*  but WITHOUT ANY WARRANTY; without even the implied warranty of        */
13 /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         */
14 /*  GNU General Public License for more details.                          */
15 /*                                                                        */
16 /*  You should have received a copy of the GNU General Public License     */
17 /*  along with Fracplanet.  If not, see <http://www.gnu.org/licenses/>.   */
18 /**************************************************************************/
19 
20 #include "control_about.h"
21 
22 #include "license.h"
23 #include "dialog_documentation.h"
24 
ControlAbout(QApplication * app)25 ControlAbout::ControlAbout(QApplication* app)
26   :Control()
27 {
28   QLabel*const label0=new QLabel("\nFracplanet - version "+QString(stringify(FRACPLANET_VERSION)));
29   layout()->addWidget(label0);
30   label0->setAlignment(Qt::AlignHCenter|label0->alignment());
31   QFont label0_font(QApplication::font());
32   label0_font.setBold(true);
33   label0->setFont(label0_font);
34 
35   QLabel*const label1=new QLabel("by timday@timday.com\nhttp://fracplanet.sourceforge.net");
36   layout()->addWidget(label1);
37   label1->setAlignment(Qt::AlignHCenter|label0->alignment());
38   QFont label1_font(QApplication::font());
39   label1_font.setPointSize(std::max(2,label1_font.pointSize()-1));
40   label1->setFont(label1_font);
41 
42   DialogDocumentation*const dialog_docs=new DialogDocumentation(this);
43 
44   QPushButton*const button_docs=new QPushButton("Show documentation");
45   layout()->addWidget(button_docs);
46   connect(button_docs,SIGNAL(clicked()),dialog_docs,SLOT(show()));
47 
48   QLabel*const label2=new QLabel("Fracplanet License:");
49   layout()->addWidget(label2);
50   label2->setAlignment(Qt::AlignHCenter|label0->alignment());
51 
52   QTextEdit*const license=new QTextEdit();
53   layout()->addWidget(license);
54   license->setReadOnly(true);
55   license->setText(license_string);
56 
57   QPushButton*const button_about_qt=new QPushButton("About Qt");
58   layout()->addWidget(button_about_qt);
59   connect(button_about_qt,SIGNAL(clicked()),app,SLOT(aboutQt()));
60 }
61