Qt: Implement GitHub Repository/Issue Tracker links

This commit is contained in:
Connor McLaughlin 2020-01-24 14:51:59 +10:00
parent 1ed187fd57
commit 2276975d62
1 changed files with 20 additions and 2 deletions

View File

@ -6,6 +6,8 @@
#include "qthostinterface.h" #include "qthostinterface.h"
#include "qtsettingsinterface.h" #include "qtsettingsinterface.h"
#include "settingsdialog.h" #include "settingsdialog.h"
#include <QtCore/QUrl>
#include <QtGui/QDesktopServices>
#include <QtWidgets/QFileDialog> #include <QtWidgets/QFileDialog>
#include <QtWidgets/QMessageBox> #include <QtWidgets/QMessageBox>
#include <cmath> #include <cmath>
@ -171,9 +173,25 @@ void MainWindow::onStartBiosActionTriggered()
m_host_interface->bootSystem(QString(), QString()); m_host_interface->bootSystem(QString(), QString());
} }
void MainWindow::onGitHubRepositoryActionTriggered() {} static void OpenURL(QWidget* parent, const char* url)
{
const QUrl qurl(QUrl::fromEncoded(QByteArray(url, std::strlen(url))));
if (!QDesktopServices::openUrl(qurl))
{
QMessageBox::critical(parent, QObject::tr("Failed to open URL"),
QObject::tr("Failed to open URL.\n\nThe URL was: %1").arg(qurl.toString()));
}
}
void MainWindow::onIssueTrackerActionTriggered() {} void MainWindow::onGitHubRepositoryActionTriggered()
{
OpenURL(this, "https://github.com/stenzek/duckstation/");
}
void MainWindow::onIssueTrackerActionTriggered()
{
OpenURL(this, "https://github.com/stenzek/duckstation/issues");
}
void MainWindow::onAboutActionTriggered() {} void MainWindow::onAboutActionTriggered() {}