2013-06-24 11:36:38 +00:00
|
|
|
#include "about.h"
|
2013-07-15 18:12:13 +00:00
|
|
|
#include "version.h"
|
2013-06-24 11:36:38 +00:00
|
|
|
#include <QDebug>
|
|
|
|
#include <QDialogButtonBox>
|
|
|
|
#include <QNetworkReply>
|
|
|
|
#include <qdesktopservices.h>
|
|
|
|
|
|
|
|
SubsurfaceAbout *SubsurfaceAbout::instance()
|
|
|
|
{
|
|
|
|
static SubsurfaceAbout *self = new SubsurfaceAbout();
|
2013-06-28 12:20:42 +00:00
|
|
|
self->setAttribute(Qt::WA_QuitOnClose, false);
|
2013-06-24 11:36:38 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
SubsurfaceAbout::SubsurfaceAbout(QWidget* parent, Qt::WindowFlags f)
|
|
|
|
{
|
2013-10-03 18:54:25 +00:00
|
|
|
ui.setupUi(this);
|
|
|
|
ui.aboutLabel->setText(tr("<span style='font-size: 18pt; font-weight: bold;'>" \
|
2013-06-24 11:36:38 +00:00
|
|
|
"Subsurface " VERSION_STRING "</span><br><br>" \
|
|
|
|
"Multi-platform divelog software in C<br>" \
|
|
|
|
"<span style='font-size: 8pt'>Linus Torvalds, Dirk Hohndel, and others, 2011, 2012, 2013</span>"));
|
|
|
|
licenseButton = new QPushButton(tr("&License"));
|
|
|
|
websiteButton = new QPushButton(tr("&Website"));
|
2013-10-03 18:54:25 +00:00
|
|
|
ui.buttonBox->addButton(licenseButton, QDialogButtonBox::ActionRole);
|
|
|
|
ui.buttonBox->addButton(websiteButton, QDialogButtonBox::ActionRole);
|
2013-06-24 11:36:38 +00:00
|
|
|
connect(licenseButton, SIGNAL(clicked(bool)), this, SLOT(licenseClicked()));
|
|
|
|
connect(websiteButton, SIGNAL(clicked(bool)), this, SLOT(websiteClicked()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void SubsurfaceAbout::licenseClicked(void)
|
|
|
|
{
|
|
|
|
QDesktopServices::openUrl(QUrl("http://www.gnu.org/licenses/gpl-2.0.txt"));
|
|
|
|
}
|
|
|
|
|
|
|
|
void SubsurfaceAbout::websiteClicked(void)
|
|
|
|
{
|
|
|
|
QDesktopServices::openUrl(QUrl("http://subsurface.hohndel.org"));
|
|
|
|
}
|