mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-02 13:27:14 -05:00
UI: Add log viewer window
This commit is contained in:
committed by
jp9000
parent
3107eda0d2
commit
040e445617
@@ -190,6 +190,9 @@ extern void RegisterRestreamAuth();
|
||||
OBSBasic::OBSBasic(QWidget *parent)
|
||||
: OBSMainWindow(parent), ui(new Ui::OBSBasic)
|
||||
{
|
||||
/* setup log viewer */
|
||||
logView = new OBSLogViewer();
|
||||
|
||||
qRegisterMetaTypeStreamOperators<SignalContainer<OBSScene>>(
|
||||
"SignalContainer<OBSScene>");
|
||||
|
||||
@@ -377,6 +380,7 @@ OBSBasic::OBSBasic(QWidget *parent)
|
||||
}
|
||||
|
||||
QPoint curSize(width(), height());
|
||||
|
||||
QPoint statsDockSize(statsDock->width(), statsDock->height());
|
||||
QPoint statsDockPos = curSize / 2 - statsDockSize / 2;
|
||||
QPoint newPos = curPos + statsDockPos;
|
||||
@@ -1926,6 +1930,9 @@ void OBSBasic::OnFirstLoad()
|
||||
#endif
|
||||
|
||||
Auth::Load();
|
||||
|
||||
if (logView && logView->ShowOnStartup())
|
||||
logView->show();
|
||||
}
|
||||
|
||||
void OBSBasic::DeferredSysTrayLoad(int requeueCount)
|
||||
@@ -2398,6 +2405,7 @@ OBSBasic::~OBSBasic()
|
||||
updateCheckThread->wait();
|
||||
|
||||
delete screenshotData;
|
||||
delete logView;
|
||||
delete multiviewProjectorMenu;
|
||||
delete previewProjector;
|
||||
delete studioProgramProjector;
|
||||
@@ -5183,18 +5191,7 @@ void OBSBasic::on_actionUploadLastLog_triggered()
|
||||
|
||||
void OBSBasic::on_actionViewCurrentLog_triggered()
|
||||
{
|
||||
char logDir[512];
|
||||
if (GetConfigPath(logDir, sizeof(logDir), "obs-studio/logs") <= 0)
|
||||
return;
|
||||
|
||||
const char *log = App()->GetCurrentLog();
|
||||
|
||||
string path = logDir;
|
||||
path += "/";
|
||||
path += log;
|
||||
|
||||
QUrl url = QUrl::fromLocalFile(QT_UTF8(path.c_str()));
|
||||
QDesktopServices::openUrl(url);
|
||||
logView->setVisible(!logView->isVisible());
|
||||
}
|
||||
|
||||
void OBSBasic::on_actionShowCrashLogs_triggered()
|
||||
|
||||
Reference in New Issue
Block a user