File: aboutmdlg.cpp

package info (click to toggle)
ponyprog 3.0.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,752 kB
  • sloc: cpp: 33,187; python: 981; sh: 507; makefile: 36
file content (107 lines) | stat: -rw-r--r-- 4,053 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//=========================================================================//
//                                                                         //
//  PonyProg - Serial Device Programmer                                    //
//                                                                         //
//  Copyright (C) 1997-2019   Claudio Lanconelli                           //
//                                                                         //
//  http://ponyprog.sourceforge.net                                        //
//                                                                         //
//-------------------------------------------------------------------------//
//                                                                         //
// 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 version2 of        //
// the License, or (at your option) any later version.                     //
//                                                                         //
// This program 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 (see LICENSE);     if not, write to the         //
// Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
//                                                                         //
//=========================================================================//


#include <QDebug>
#include <QCheckBox>
#include <QLabel>
#include <QPixmap>

#include "version.h"
#include "aboutmdlg.h"
#include "e2profil.h"

static const QString AUTHORWEB     = "http://www.LancOS.com";
static const QString COPYRIGHTYEAR = "1997-2019";
static const QString PORTERGQT     = "Eduard Kalinowski";
static const QString PORTERMAIL    = "eduard_kalinowski@yahoo.de";


AboutModalDialog::AboutModalDialog(QWidget *bw, const QString title)
	: QDialog(bw)
{
	qDebug() << "AboutModalDialog::AboutModalDialog()";

	setupUi(this);

	setWindowTitle(title);

	cmdw = static_cast<e2CmdWindow *>(bw);

	if (cmdw->getStyleSheet().length() > 0)
	{
		setStyleSheet(cmdw->getStyleSheet());
	}

	lblAbout0->setText(APP_NAME " - " + translate(STR_APPNAME_EXT)  + "<br>" + translate(STR_MSGVERSION) + "  " APP_VERSION "  " __DATE__);
	QString t = "Copyright (C) " + COPYRIGHTYEAR + "  by  <a href=\"" APP_EMAIL "\">" APP_AUTHOR "</a><br><br>" +
				"Porting to Qt4/Qt5 by <a href=\"" + PORTERMAIL + "\">" + PORTERGQT + "</a><br><br>" +
				translate(STR_APPDOWNLOAD1) + " " APP_NAME " " + translate(STR_APPDOWNLOAD2) + "<br>" +
				"<a href=\"" + AUTHORWEB + "\">" + AUTHORWEB + "</a>";

	if (translate(MSG_TRANSLATORNAME).length() > 0)
	{
		t += "<br><br>" + translate(MSG_TRANSLATORCREDITS) +  "<br>" +
			 translate(MSG_TRANSLATORNAME).replace("\n", "<br>");
	}
	lblAbout1->setText(t);

	chkSound->setChecked(E2Profile::GetSkipStartupDialog());
	chkSound->setText(translate(STR_LBLSKIPMSG));

	pushOk->setText(translate(STR_BTNOK));
	pushHelp->setText(translate(STR_BTNHELP));

	icoPonyProg->setPixmap(QPixmap(":/icons/ponyprog.png"));

	connect(pushOk, SIGNAL(clicked()), this, SLOT(accept()));
	connect(pushHelp, SIGNAL(clicked()), this, SLOT(onHelp()));

	connect(chkSound, SIGNAL(clicked(bool)), this, SLOT(onChkStart(bool)));

	adjustSize();
}


AboutModalDialog::~AboutModalDialog()
{
	qDebug() << "AboutModalDialog::~AboutModalDialog()";
}


void AboutModalDialog::onHelp()
{
	cmdw->CmdHelp();

	accept();
}


void AboutModalDialog::onChkStart(bool c)
{
	E2Profile::SetSkipStartupDialog(c);
}