Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
2ca17e62
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2ca17e62
编写于
7月 09, 2020
作者:
M
Matt Gajownik
提交者:
jp9000
7月 18, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
frontend-tools: Make links in script description clickable
上级
cd865a0b
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
47 addition
and
0 deletion
+47
-0
UI/frontend-plugins/frontend-tools/data/locale/en-US.ini
UI/frontend-plugins/frontend-tools/data/locale/en-US.ini
+3
-0
UI/frontend-plugins/frontend-tools/forms/scripts.ui
UI/frontend-plugins/frontend-tools/forms/scripts.ui
+3
-0
UI/frontend-plugins/frontend-tools/scripts.cpp
UI/frontend-plugins/frontend-tools/scripts.cpp
+38
-0
UI/frontend-plugins/frontend-tools/scripts.hpp
UI/frontend-plugins/frontend-tools/scripts.hpp
+3
-0
未找到文件。
UI/frontend-plugins/frontend-tools/data/locale/en-US.ini
浏览文件 @
2ca17e62
...
...
@@ -38,6 +38,9 @@ PythonSettings.PythonInstallPath64bit="Python Install Path (64bit)"
PythonSettings.BrowsePythonPath
=
"Browse Python Path"
ScriptLogWindow
=
"Script Log"
Description
=
"Description"
ScriptDescriptionLink.Text
=
"Open this link in your default web browser?"
ScriptDescriptionLink.Text.Url
=
"URL: %1"
ScriptDescriptionLink.OpenURL
=
"Open URL"
FileFilter.ScriptFiles
=
"Script Files"
FileFilter.AllFiles
=
"All Files"
UI/frontend-plugins/frontend-tools/forms/scripts.ui
浏览文件 @
2ca17e62
...
...
@@ -174,6 +174,9 @@
<property
name=
"text"
>
<string
notr=
"true"
/>
</property>
<property
name=
"openExternalLinks"
>
<bool>
false
</bool>
</property>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
</property>
...
...
UI/frontend-plugins/frontend-tools/scripts.cpp
浏览文件 @
2ca17e62
#include "obs-module.h"
#include "scripts.hpp"
#include "frontend-tools-config.h"
#include "../../properties-view.hpp"
...
...
@@ -13,6 +14,9 @@
#include <QDialogButtonBox>
#include <QResizeEvent>
#include <QAction>
#include <QMessageBox>
#include <QUrl>
#include <QDesktopServices>
#include <obs.hpp>
#include <obs-module.h>
...
...
@@ -470,6 +474,40 @@ void ScriptsTool::on_defaults_clicked()
item
->
data
(
Qt
::
UserRole
).
toString
().
toUtf8
().
constData
());
}
void
ScriptsTool
::
on_description_linkActivated
(
const
QString
&
link
)
{
QUrl
url
(
link
,
QUrl
::
StrictMode
);
if
(
url
.
isValid
()
&&
(
url
.
scheme
().
compare
(
"http"
)
==
0
||
url
.
scheme
().
compare
(
"https"
)
==
0
))
{
QString
msg
(
obs_module_text
(
"ScriptDescriptionLink.Text"
));
msg
+=
"
\n\n
"
;
msg
+=
QString
(
obs_module_text
(
"ScriptDescriptionLink.Text.Url"
))
.
arg
(
link
);
const
char
*
open
=
obs_module_text
(
"ScriptDescriptionLink.OpenURL"
);
QMessageBox
messageBox
(
this
);
messageBox
.
setWindowTitle
(
open
);
messageBox
.
setText
(
msg
);
obs_frontend_push_ui_translation
(
obs_module_get_string
);
QPushButton
*
yesButton
=
messageBox
.
addButton
(
open
,
QMessageBox
::
YesRole
);
QPushButton
*
noButton
=
messageBox
.
addButton
(
tr
(
"Cancel"
),
QMessageBox
::
NoRole
);
obs_frontend_pop_ui_translation
();
messageBox
.
setDefaultButton
(
yesButton
);
messageBox
.
setEscapeButton
(
noButton
);
messageBox
.
setIcon
(
QMessageBox
::
Question
);
messageBox
.
exec
();
if
(
messageBox
.
clickedButton
()
==
yesButton
)
QDesktopServices
::
openUrl
(
url
);
}
}
/* ----------------------------------------------------------------- */
extern
"C"
void
FreeScripts
()
...
...
UI/frontend-plugins/frontend-tools/scripts.hpp
浏览文件 @
2ca17e62
...
...
@@ -51,4 +51,7 @@ public slots:
void
on_scripts_currentRowChanged
(
int
row
);
void
on_pythonPathBrowse_clicked
();
private
slots
:
void
on_description_linkActivated
(
const
QString
&
link
);
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录