frontend-tools: Display dialog when changing Python version
Runtime switching of Python version is not supported.
This commit is contained in:
parent
1b2fc73021
commit
493270e022
@ -41,6 +41,8 @@ PythonSettings.PythonInstallPath64bit="Python Install Path (64bit)"
|
|||||||
PythonSettings.BrowsePythonPath="Browse Python Path"
|
PythonSettings.BrowsePythonPath="Browse Python Path"
|
||||||
PythonSettings.PythonVersion="Loaded Python Version: %1"
|
PythonSettings.PythonVersion="Loaded Python Version: %1"
|
||||||
PythonSettings.PythonNotLoaded="Python not currently loaded"
|
PythonSettings.PythonNotLoaded="Python not currently loaded"
|
||||||
|
PythonSettings.AlreadyLoaded.Title="Python Already Loaded"
|
||||||
|
PythonSettings.AlreadyLoaded.Message="A copy of Python %1 is already loaded. To load the newly selected Python version, please restart OBS."
|
||||||
ScriptLogWindow="Script Log"
|
ScriptLogWindow="Script Log"
|
||||||
Description="Description"
|
Description="Description"
|
||||||
ScriptDescriptionLink.Text="Open this link in your default web browser?"
|
ScriptDescriptionLink.Text="Open this link in your default web browser?"
|
||||||
|
@ -470,8 +470,24 @@ void ScriptsTool::on_pythonPathBrowse_clicked()
|
|||||||
|
|
||||||
ui->pythonPath->setText(newPath);
|
ui->pythonPath->setText(newPath);
|
||||||
|
|
||||||
if (obs_scripting_python_loaded())
|
bool loaded = obs_scripting_python_loaded();
|
||||||
|
|
||||||
|
if (loaded && !newPath.isEmpty() && curPath.compare(newPath) != 0) {
|
||||||
|
char version[8];
|
||||||
|
obs_scripting_python_version(version, sizeof(version));
|
||||||
|
QString message =
|
||||||
|
QString(obs_module_text(
|
||||||
|
"PythonSettings.AlreadyLoaded.Message"))
|
||||||
|
.arg(version);
|
||||||
|
OBSMessageBox::information(
|
||||||
|
this,
|
||||||
|
obs_module_text("PythonSettings.AlreadyLoaded.Title"),
|
||||||
|
message);
|
||||||
return;
|
return;
|
||||||
|
} else if (loaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!obs_scripting_load_python(path))
|
if (!obs_scripting_load_python(path))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user