浏览代码

UI: Add button to Analyzer in the Log Reply window

Matt Gajownik 5 年之前
父节点
当前提交
9d89de79f9
共有 4 个文件被更改,包括 23 次插入0 次删除
  1. 1 0
      UI/data/locale/en-US.ini
  2. 7 0
      UI/forms/OBSLogReply.ui
  3. 14 0
      UI/window-log-reply.cpp
  4. 1 0
      UI/window-log-reply.hpp

+ 1 - 0
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

+ 7 - 0
UI/forms/OBSLogReply.ui

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

+ 14 - 0
UI/window-log-reply.cpp

@@ -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);
+}

+ 1 - 0
UI/window-log-reply.hpp

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