|
@@ -6,6 +6,7 @@
|
|
#include <QPushButton>
|
|
#include <QPushButton>
|
|
#include <QCheckBox>
|
|
#include <QCheckBox>
|
|
#include <QLayout>
|
|
#include <QLayout>
|
|
|
|
+#include <QDesktopServices>
|
|
#include <string>
|
|
#include <string>
|
|
|
|
|
|
#include "log-viewer.hpp"
|
|
#include "log-viewer.hpp"
|
|
@@ -29,6 +30,9 @@ OBSLogViewer::OBSLogViewer(QWidget *parent) : QDialog(parent)
|
|
QPushButton *clearButton = new QPushButton(QTStr("Clear"));
|
|
QPushButton *clearButton = new QPushButton(QTStr("Clear"));
|
|
connect(clearButton, &QPushButton::clicked, this,
|
|
connect(clearButton, &QPushButton::clicked, this,
|
|
&OBSLogViewer::ClearText);
|
|
&OBSLogViewer::ClearText);
|
|
|
|
+ QPushButton *openButton = new QPushButton(QTStr("OpenFile"));
|
|
|
|
+ connect(openButton, &QPushButton::clicked, this,
|
|
|
|
+ &OBSLogViewer::OpenFile);
|
|
QPushButton *closeButton = new QPushButton(QTStr("Close"));
|
|
QPushButton *closeButton = new QPushButton(QTStr("Close"));
|
|
connect(closeButton, &QPushButton::clicked, this, &QDialog::hide);
|
|
connect(closeButton, &QPushButton::clicked, this, &QDialog::hide);
|
|
|
|
|
|
@@ -40,6 +44,7 @@ OBSLogViewer::OBSLogViewer(QWidget *parent) : QDialog(parent)
|
|
buttonLayout->addSpacing(10);
|
|
buttonLayout->addSpacing(10);
|
|
buttonLayout->addWidget(showStartup);
|
|
buttonLayout->addWidget(showStartup);
|
|
buttonLayout->addStretch();
|
|
buttonLayout->addStretch();
|
|
|
|
+ buttonLayout->addWidget(openButton);
|
|
buttonLayout->addWidget(clearButton);
|
|
buttonLayout->addWidget(clearButton);
|
|
buttonLayout->addWidget(closeButton);
|
|
buttonLayout->addWidget(closeButton);
|
|
buttonLayout->addSpacing(10);
|
|
buttonLayout->addSpacing(10);
|
|
@@ -145,3 +150,19 @@ void OBSLogViewer::ClearText()
|
|
{
|
|
{
|
|
textArea->clear();
|
|
textArea->clear();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+void OBSLogViewer::OpenFile()
|
|
|
|
+{
|
|
|
|
+ char logDir[512];
|
|
|
|
+ if (GetConfigPath(logDir, sizeof(logDir), "obs-studio/logs") <= 0)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ const char *log = App()->GetCurrentLog();
|
|
|
|
+
|
|
|
|
+ std::string path = logDir;
|
|
|
|
+ path += "/";
|
|
|
|
+ path += log;
|
|
|
|
+
|
|
|
|
+ QUrl url = QUrl::fromLocalFile(QT_UTF8(path.c_str()));
|
|
|
|
+ QDesktopServices::openUrl(url);
|
|
|
|
+}
|