Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
695f3c1f
O
Obs Studio
项目概览
小白菜888
/
Obs Studio
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Obs Studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
695f3c1f
编写于
6月 24, 2020
作者:
J
Jim
提交者:
GitHub
6月 24, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2662 from WizardCM/log-dialog
Enhance Log dialog with description and Analyze button
上级
924580db
9d89de79
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
75 addition
and
10 deletion
+75
-10
UI/data/locale/en-US.ini
UI/data/locale/en-US.ini
+3
-0
UI/forms/OBSLogReply.ui
UI/forms/OBSLogReply.ui
+14
-0
UI/window-basic-main.cpp
UI/window-basic-main.cpp
+33
-7
UI/window-basic-main.hpp
UI/window-basic-main.hpp
+3
-1
UI/window-log-reply.cpp
UI/window-log-reply.cpp
+20
-1
UI/window-log-reply.hpp
UI/window-log-reply.hpp
+2
-1
未找到文件。
UI/data/locale/en-US.ini
浏览文件 @
695f3c1f
...
...
@@ -330,7 +330,10 @@ Output.BadPath.Text="The configured file output path is invalid. Please check yo
# log upload dialog text and messages
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
...
...
UI/forms/OBSLogReply.ui
浏览文件 @
695f3c1f
...
...
@@ -14,6 +14,13 @@
<string>
LogReturnDialog
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"description"
>
<property
name=
"text"
>
<string>
LogReturnDialog.Description
</string>
</property>
</widget>
</item>
<item>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
...
...
@@ -33,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>
...
...
UI/window-basic-main.cpp
浏览文件 @
695f3c1f
...
...
@@ -5035,7 +5035,7 @@ static BPtr<char> ReadLogFile(const char *subdir, const char *log)
return
file
;
}
void
OBSBasic
::
UploadLog
(
const
char
*
subdir
,
const
char
*
file
)
void
OBSBasic
::
UploadLog
(
const
char
*
subdir
,
const
char
*
file
,
const
bool
crash
)
{
BPtr
<
char
>
fileString
{
ReadLogFile
(
subdir
,
file
)};
...
...
@@ -5046,6 +5046,7 @@ void OBSBasic::UploadLog(const char *subdir, const char *file)
return
;
ui
->
menuLogFiles
->
setEnabled
(
false
);
ui
->
menuCrashLogs
->
setEnabled
(
false
);
stringstream
ss
;
ss
<<
"OBS "
<<
App
()
->
GetVersionString
()
<<
" log file uploaded at "
...
...
@@ -5061,8 +5062,13 @@ void OBSBasic::UploadLog(const char *subdir, const char *file)
"text/plain"
,
ss
.
str
().
c_str
());
logUploadThread
.
reset
(
thread
);
connect
(
thread
,
&
RemoteTextThread
::
Result
,
this
,
&
OBSBasic
::
logUploadFinished
);
if
(
crash
)
{
connect
(
thread
,
&
RemoteTextThread
::
Result
,
this
,
&
OBSBasic
::
crashUploadFinished
);
}
else
{
connect
(
thread
,
&
RemoteTextThread
::
Result
,
this
,
&
OBSBasic
::
logUploadFinished
);
}
logUploadThread
->
start
();
}
...
...
@@ -5078,12 +5084,12 @@ void OBSBasic::on_actionShowLogs_triggered()
void
OBSBasic
::
on_actionUploadCurrentLog_triggered
()
{
UploadLog
(
"obs-studio/logs"
,
App
()
->
GetCurrentLog
());
UploadLog
(
"obs-studio/logs"
,
App
()
->
GetCurrentLog
()
,
false
);
}
void
OBSBasic
::
on_actionUploadLastLog_triggered
()
{
UploadLog
(
"obs-studio/logs"
,
App
()
->
GetLastLog
());
UploadLog
(
"obs-studio/logs"
,
App
()
->
GetLastLog
()
,
false
);
}
void
OBSBasic
::
on_actionViewCurrentLog_triggered
()
...
...
@@ -5114,7 +5120,7 @@ void OBSBasic::on_actionShowCrashLogs_triggered()
void
OBSBasic
::
on_actionUploadLastCrashLog_triggered
()
{
UploadLog
(
"obs-studio/crashes"
,
App
()
->
GetLastCrashLog
());
UploadLog
(
"obs-studio/crashes"
,
App
()
->
GetLastCrashLog
()
,
true
);
}
void
OBSBasic
::
on_actionCheckForUpdates_triggered
()
...
...
@@ -5125,6 +5131,21 @@ void OBSBasic::on_actionCheckForUpdates_triggered()
void
OBSBasic
::
logUploadFinished
(
const
QString
&
text
,
const
QString
&
error
)
{
ui
->
menuLogFiles
->
setEnabled
(
true
);
ui
->
menuCrashLogs
->
setEnabled
(
true
);
if
(
text
.
isEmpty
())
{
OBSMessageBox
::
critical
(
this
,
QTStr
(
"LogReturnDialog.ErrorUploadingLog"
),
error
);
return
;
}
openLogDialog
(
text
,
false
);
}
void
OBSBasic
::
crashUploadFinished
(
const
QString
&
text
,
const
QString
&
error
)
{
ui
->
menuLogFiles
->
setEnabled
(
true
);
ui
->
menuCrashLogs
->
setEnabled
(
true
);
if
(
text
.
isEmpty
())
{
OBSMessageBox
::
critical
(
...
...
@@ -5132,13 +5153,18 @@ void OBSBasic::logUploadFinished(const QString &text, const QString &error)
error
);
return
;
}
openLogDialog
(
text
,
true
);
}
void
OBSBasic
::
openLogDialog
(
const
QString
&
text
,
const
bool
crash
)
{
obs_data_t
*
returnData
=
obs_data_create_from_json
(
QT_TO_UTF8
(
text
));
string
resURL
=
obs_data_get_string
(
returnData
,
"url"
);
QString
logURL
=
resURL
.
c_str
();
obs_data_release
(
returnData
);
OBSLogReply
logDialog
(
this
,
logURL
);
OBSLogReply
logDialog
(
this
,
logURL
,
crash
);
logDialog
.
exec
();
}
...
...
UI/window-basic-main.hpp
浏览文件 @
695f3c1f
...
...
@@ -301,7 +301,7 @@ private:
void
UpdateVolumeControlsPeakMeterType
();
void
ClearVolumeControls
();
void
UploadLog
(
const
char
*
subdir
,
const
char
*
file
);
void
UploadLog
(
const
char
*
subdir
,
const
char
*
file
,
const
bool
crash
);
void
Save
(
const
char
*
file
);
void
Load
(
const
char
*
file
);
...
...
@@ -935,6 +935,8 @@ private slots:
void
PauseToggled
();
void
logUploadFinished
(
const
QString
&
text
,
const
QString
&
error
);
void
crashUploadFinished
(
const
QString
&
text
,
const
QString
&
error
);
void
openLogDialog
(
const
QString
&
text
,
const
bool
crash
);
void
updateCheckFinished
();
...
...
UI/window-log-reply.cpp
浏览文件 @
695f3c1f
...
...
@@ -16,14 +16,23 @@
******************************************************************************/
#include <QClipboard>
#include <QUrl>
#include <QUrlQuery>
#include <QDesktopServices>
#include "window-log-reply.hpp"
#include "obs-app.hpp"
OBSLogReply
::
OBSLogReply
(
QWidget
*
parent
,
const
QString
&
url
)
OBSLogReply
::
OBSLogReply
(
QWidget
*
parent
,
const
QString
&
url
,
const
bool
crash
)
:
QDialog
(
parent
),
ui
(
new
Ui
::
OBSLogReply
)
{
setWindowFlags
(
windowFlags
()
&
~
Qt
::
WindowContextHelpButtonHint
);
ui
->
setupUi
(
this
);
ui
->
urlEdit
->
setText
(
url
);
if
(
crash
)
{
ui
->
analyzeURL
->
hide
();
ui
->
description
->
setText
(
Str
(
"LogReturnDialog.Description.Crash"
));
}
installEventFilter
(
CreateShortcutFilter
());
}
...
...
@@ -33,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
);
}
UI/window-log-reply.hpp
浏览文件 @
695f3c1f
...
...
@@ -27,8 +27,9 @@ private:
std
::
unique_ptr
<
Ui
::
OBSLogReply
>
ui
;
public:
OBSLogReply
(
QWidget
*
parent
,
const
QString
&
url
);
OBSLogReply
(
QWidget
*
parent
,
const
QString
&
url
,
const
bool
crash
);
private
slots
:
void
on_copyURL_clicked
();
void
on_analyzeURL_clicked
();
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录