From 9d89de79f93bcc9b4ebb9fe18f6e63996b83e795 Mon Sep 17 00:00:00 2001 From: Matt Gajownik Date: Mon, 6 Apr 2020 21:39:09 +1000 Subject: [PATCH] UI: Add button to Analyzer in the Log Reply window --- UI/data/locale/en-US.ini | 1 + UI/forms/OBSLogReply.ui | 7 +++++++ UI/window-log-reply.cpp | 14 ++++++++++++++ UI/window-log-reply.hpp | 1 + 4 files changed, 23 insertions(+) diff --git a/UI/data/locale/en-US.ini b/UI/data/locale/en-US.ini index c52ff833d..fd7d209d1 100644 --- a/UI/data/locale/en-US.ini +++ b/UI/data/locale/en-US.ini @@ -336,6 +336,7 @@ LogReturnDialog="Log Upload Successful" LogReturnDialog.Description="Your log file has been uploaded. You can now share the URL for debugging or support purposes." LogReturnDialog.Description.Crash="Your crash report has been uploaded. You can now share the URL for debugging purposes." LogReturnDialog.CopyURL="Copy URL" +LogReturnDialog.AnalyzeURL="Analyze" LogReturnDialog.ErrorUploadingLog="Error uploading log file" # remux dialog diff --git a/UI/forms/OBSLogReply.ui b/UI/forms/OBSLogReply.ui index 0eb477e10..6d4b7f430 100644 --- a/UI/forms/OBSLogReply.ui +++ b/UI/forms/OBSLogReply.ui @@ -40,6 +40,13 @@ + + + + LogReturnDialog.AnalyzeURL + + + diff --git a/UI/window-log-reply.cpp b/UI/window-log-reply.cpp index 6ff856872..099f85765 100644 --- a/UI/window-log-reply.cpp +++ b/UI/window-log-reply.cpp @@ -16,6 +16,9 @@ ******************************************************************************/ #include +#include +#include +#include #include "window-log-reply.hpp" #include "obs-app.hpp" @@ -26,6 +29,7 @@ OBSLogReply::OBSLogReply(QWidget *parent, const QString &url, const bool crash) ui->setupUi(this); ui->urlEdit->setText(url); if (crash) { + ui->analyzeURL->hide(); ui->description->setText( Str("LogReturnDialog.Description.Crash")); } @@ -38,3 +42,13 @@ void OBSLogReply::on_copyURL_clicked() QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(ui->urlEdit->text()); } + +void OBSLogReply::on_analyzeURL_clicked() +{ + QUrlQuery param; + param.addQueryItem("log_url", + QUrl::toPercentEncoding(ui->urlEdit->text())); + QUrl url("https://obsproject.com/tools/analyzer", QUrl::TolerantMode); + url.setQuery(param); + QDesktopServices::openUrl(url); +} diff --git a/UI/window-log-reply.hpp b/UI/window-log-reply.hpp index c0a9e272e..746d1f466 100644 --- a/UI/window-log-reply.hpp +++ b/UI/window-log-reply.hpp @@ -31,4 +31,5 @@ public: private slots: void on_copyURL_clicked(); + void on_analyzeURL_clicked(); };