UI: Add button to Analyzer in the Log Reply window

master
Matt Gajownik 2020-04-06 21:39:09 +10:00
parent c7eaee632a
commit 9d89de79f9
4 changed files with 23 additions and 0 deletions

View File

@ -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

View File

@ -40,6 +40,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="analyzeURL">
<property name="text">
<string>LogReturnDialog.AnalyzeURL</string>
</property>
</widget>
</item>
</layout>
</item>
<item>

View File

@ -16,6 +16,9 @@
******************************************************************************/
#include <QClipboard>
#include <QUrl>
#include <QUrlQuery>
#include <QDesktopServices>
#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);
}

View File

@ -31,4 +31,5 @@ public:
private slots:
void on_copyURL_clicked();
void on_analyzeURL_clicked();
};