| 
									
										
										
										
											2017-04-27 20:26:05 +02:00
										 |  |  | // SPDX-License-Identifier: GPL-2.0
 | 
					
						
							| 
									
										
										
										
											2016-04-04 22:02:03 -07:00
										 |  |  | #include "desktop-widgets/about.h"
 | 
					
						
							|  |  |  | #include "core/version.h"
 | 
					
						
							| 
									
										
										
										
											2014-02-08 08:50:39 +01:00
										 |  |  | #include <QDesktopServices>
 | 
					
						
							|  |  |  | #include <QUrl>
 | 
					
						
							| 
									
										
										
										
											2014-04-25 17:54:01 +02:00
										 |  |  | #include <QShortcut>
 | 
					
						
							| 
									
										
										
										
											2013-06-24 14:36:38 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-12 06:06:13 -08:00
										 |  |  | SubsurfaceAbout::SubsurfaceAbout(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) | 
					
						
							| 
									
										
										
										
											2013-06-24 14:36:38 +03:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2013-10-03 11:54:25 -07:00
										 |  |  | 	ui.setupUi(this); | 
					
						
							| 
									
										
										
										
											2014-02-08 08:50:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	setWindowModality(Qt::ApplicationModal); | 
					
						
							| 
									
										
										
										
											2015-02-15 20:25:18 +02:00
										 |  |  | 	QString versionString(subsurface_git_version()); | 
					
						
							| 
									
										
										
										
											2016-11-02 05:12:10 -07:00
										 |  |  | 	QStringList readableVersions = QStringList() << "4.5.95" << "4.6 Beta 0" << | 
					
						
							|  |  |  | 							"4.5.96" << "4.6 Beta 1" << | 
					
						
							|  |  |  | 							"4.5.97" << "4.6 Beta 2"; | 
					
						
							| 
									
										
										
										
											2015-09-03 03:39:02 -07:00
										 |  |  | 	if (readableVersions.contains(versionString)) | 
					
						
							|  |  |  | 		versionString = readableVersions[readableVersions.indexOf(versionString) + 1]; | 
					
						
							| 
									
										
										
										
											2014-02-08 08:50:39 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-27 20:09:57 -08: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'>" | 
					
						
							| 
									
										
										
										
											2019-01-02 19:00:03 +02:00
										 |  |  | 				  "Linus Torvalds, Dirk Hohndel, Tomaz Canabrava, and others, 2011-2019" | 
					
						
							| 
									
										
										
										
											2015-01-24 14:52:26 +12:00
										 |  |  | 				  "</span>").arg(versionString)); | 
					
						
							| 
									
										
										
										
											2014-04-25 17:54:01 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_W), this); | 
					
						
							|  |  |  | 	connect(close, SIGNAL(activated()), this, SLOT(close())); | 
					
						
							| 
									
										
										
										
											2014-04-25 10:21:12 -07:00
										 |  |  | 	QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this); | 
					
						
							|  |  |  | 	connect(quit, SIGNAL(activated()), parent, SLOT(close())); | 
					
						
							| 
									
										
										
										
											2013-06-24 14:36:38 +03:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-08 08:50:39 +01:00
										 |  |  | void SubsurfaceAbout::on_licenseButton_clicked() | 
					
						
							| 
									
										
										
										
											2013-06-24 14:36:38 +03:00
										 |  |  | { | 
					
						
							|  |  |  | 	QDesktopServices::openUrl(QUrl("http://www.gnu.org/licenses/gpl-2.0.txt")); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-08 08:50:39 +01:00
										 |  |  | void SubsurfaceAbout::on_websiteButton_clicked() | 
					
						
							| 
									
										
										
										
											2013-06-24 14:36:38 +03:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2014-11-18 13:12:40 +00:00
										 |  |  | 	QDesktopServices::openUrl(QUrl("http://subsurface-divelog.org")); | 
					
						
							| 
									
										
										
										
											2013-06-24 14:36:38 +03:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2017-02-18 16:22:09 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | void SubsurfaceAbout::on_creditButton_clicked() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	QDesktopServices::openUrl(QUrl("http://subsurface-divelog.org/misc/credits")); | 
					
						
							|  |  |  | } |