|
@@ -194,6 +194,7 @@ ScriptsTool::ScriptsTool() : QDialog(nullptr), ui(new Ui_ScriptsTool)
|
|
config_get_string(config, "Python", "Path" ARCH_NAME);
|
|
config_get_string(config, "Python", "Path" ARCH_NAME);
|
|
ui->pythonPath->setText(path);
|
|
ui->pythonPath->setText(path);
|
|
ui->pythonPathLabel->setText(obs_module_text(PYTHONPATH_LABEL_TEXT));
|
|
ui->pythonPathLabel->setText(obs_module_text(PYTHONPATH_LABEL_TEXT));
|
|
|
|
+ updatePythonVersionLabel();
|
|
#else
|
|
#else
|
|
delete ui->pythonSettingsTab;
|
|
delete ui->pythonSettingsTab;
|
|
ui->pythonSettingsTab = nullptr;
|
|
ui->pythonSettingsTab = nullptr;
|
|
@@ -219,6 +220,20 @@ ScriptsTool::~ScriptsTool()
|
|
ui->scripts->currentRow());
|
|
ui->scripts->currentRow());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void ScriptsTool::updatePythonVersionLabel()
|
|
|
|
+{
|
|
|
|
+ QString label;
|
|
|
|
+ if (obs_scripting_python_loaded()) {
|
|
|
|
+ char version[8];
|
|
|
|
+ obs_scripting_python_version(version, sizeof(version));
|
|
|
|
+ label = QString(obs_module_text("PythonSettings.PythonVersion"))
|
|
|
|
+ .arg(version);
|
|
|
|
+ } else {
|
|
|
|
+ label = obs_module_text("PythonSettings.PythonNotLoaded");
|
|
|
|
+ }
|
|
|
|
+ ui->pythonVersionLabel->setText(label);
|
|
|
|
+}
|
|
|
|
+
|
|
void ScriptsTool::RemoveScript(const char *path)
|
|
void ScriptsTool::RemoveScript(const char *path)
|
|
{
|
|
{
|
|
for (size_t i = 0; i < scriptData->scripts.size(); i++) {
|
|
for (size_t i = 0; i < scriptData->scripts.size(); i++) {
|
|
@@ -460,6 +475,8 @@ void ScriptsTool::on_pythonPathBrowse_clicked()
|
|
if (!obs_scripting_load_python(path))
|
|
if (!obs_scripting_load_python(path))
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
+ updatePythonVersionLabel();
|
|
|
|
+
|
|
for (OBSScript &script : scriptData->scripts) {
|
|
for (OBSScript &script : scriptData->scripts) {
|
|
enum obs_script_lang lang = obs_script_get_lang(script);
|
|
enum obs_script_lang lang = obs_script_get_lang(script);
|
|
if (lang == OBS_SCRIPT_LANG_PYTHON) {
|
|
if (lang == OBS_SCRIPT_LANG_PYTHON) {
|