PageRenderTime 150ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 1ms

/desktop-widgets/about.cpp

https://github.com/dirkhh/subsurface
C++ | 41 lines | 33 code | 7 blank | 1 comment | 0 complexity | 9f536e5953eed493532af7ebfb64606c MD5 | raw file
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include "desktop-widgets/about.h"
  3. #include "core/version.h"
  4. #include <QDesktopServices>
  5. #include <QUrl>
  6. #include <QShortcut>
  7. SubsurfaceAbout::SubsurfaceAbout(QWidget *parent) : QDialog(parent, QFlag(0))
  8. {
  9. ui.setupUi(this);
  10. setWindowModality(Qt::ApplicationModal);
  11. QString versionString(subsurface_git_version());
  12. ui.aboutLabel->setText(tr("<span style='font-size: 18pt; font-weight: bold;'>"
  13. "Subsurface %1 </span><br><br>"
  14. "Multi-platform divelog software<br>"
  15. "<span style='font-size: 8pt'>"
  16. "Linus Torvalds, Dirk Hohndel, Tomaz Canabrava, Berthold Stoeger, and others, 2011-2022"
  17. "</span>").arg(versionString));
  18. QShortcut *close = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_W), this);
  19. connect(close, SIGNAL(activated()), this, SLOT(close()));
  20. QShortcut *quit = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
  21. connect(quit, SIGNAL(activated()), parent, SLOT(close()));
  22. }
  23. void SubsurfaceAbout::on_licenseButton_clicked()
  24. {
  25. QDesktopServices::openUrl(QUrl("http://www.gnu.org/licenses/gpl-2.0.txt"));
  26. }
  27. void SubsurfaceAbout::on_websiteButton_clicked()
  28. {
  29. QDesktopServices::openUrl(QUrl("http://subsurface-divelog.org"));
  30. }
  31. void SubsurfaceAbout::on_creditButton_clicked()
  32. {
  33. QDesktopServices::openUrl(QUrl("http://subsurface-divelog.org/misc/credits"));
  34. }