2013-06-24 11:36:38 +00:00
|
|
|
#include "about.h"
|
2015-02-15 18:25:18 +00:00
|
|
|
#include "version.h"
|
2014-02-08 07:50:39 +00:00
|
|
|
#include <QDesktopServices>
|
|
|
|
#include <QUrl>
|
2014-04-25 15:54:01 +00:00
|
|
|
#include <QShortcut>
|
2013-06-24 11:36:38 +00:00
|
|
|
|
2014-02-12 14:06:13 +00:00
|
|
|
SubsurfaceAbout::SubsurfaceAbout(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
|
2013-06-24 11:36:38 +00:00
|
|
|
{
|
2013-10-03 18:54:25 +00:00
|
|
|
ui.setupUi(this);
|
2014-02-08 07:50:39 +00:00
|
|
|
|
|
|
|
setWindowModality(Qt::ApplicationModal);
|
2015-02-15 18:25:18 +00:00
|
|
|
QString versionString(subsurface_git_version());
|
2015-09-03 14:40:14 +00:00
|
|
|
QStringList readableVersions = QStringList() << "4.4.96" << "4.5 Beta 1" <<
|
|
|
|
"4.4.97" << "4.5 Beta 2" <<
|
|
|
|
"4.4.98" << "4.5 Beta 3";
|
2015-09-03 10:39:02 +00:00
|
|
|
if (readableVersions.contains(versionString))
|
|
|
|
versionString = readableVersions[readableVersions.indexOf(versionString) + 1];
|
2014-02-08 07:50:39 +00:00
|
|
|
|
2014-02-28 04:09:57 +00:00
|
|
|
ui.aboutLabel->setText(tr("<span style='font-size: 18pt; font-weight: bold;'>"
|
|
|
|
"Subsurface %1 </span><br><br>"
|
|
|
|
"Multi-platform divelog software<br>"
|
|
|
|
"<span style='font-size: 8pt'>"
|
2015-01-01 09:07:57 +00:00
|
|
|
"Linus Torvalds, Dirk Hohndel, Tomaz Canabrava, and others, 2011-2015"
|
2015-01-24 02:52:26 +00:00
|
|
|
"</span>").arg(versionString));
|
2014-04-25 15:54:01 +00:00
|
|
|
|
|
|
|
QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this);
|
|
|
|
connect(close, SIGNAL(activated()), this, SLOT(close()));
|
2014-04-25 17:21:12 +00:00
|
|
|
QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this);
|
|
|
|
connect(quit, SIGNAL(activated()), parent, SLOT(close()));
|
2013-06-24 11:36:38 +00:00
|
|
|
}
|
|
|
|
|
2014-02-08 07:50:39 +00:00
|
|
|
void SubsurfaceAbout::on_licenseButton_clicked()
|
2013-06-24 11:36:38 +00:00
|
|
|
{
|
|
|
|
QDesktopServices::openUrl(QUrl("http://www.gnu.org/licenses/gpl-2.0.txt"));
|
|
|
|
}
|
|
|
|
|
2014-02-08 07:50:39 +00:00
|
|
|
void SubsurfaceAbout::on_websiteButton_clicked()
|
2013-06-24 11:36:38 +00:00
|
|
|
{
|
2014-11-18 13:12:40 +00:00
|
|
|
QDesktopServices::openUrl(QUrl("http://subsurface-divelog.org"));
|
2013-06-24 11:36:38 +00:00
|
|
|
}
|