frontend-tools: Display dialog when changing Python version
Runtime switching of Python version is not supported.
This commit is contained in:
parent
89d9493468
commit
05b6346250
2 changed files with 19 additions and 1 deletions
|
|
@ -41,6 +41,8 @@ PythonSettings.PythonInstallPath64bit="Python Install Path (64bit)"
|
|||
PythonSettings.BrowsePythonPath="Browse Python Path"
|
||||
PythonSettings.PythonVersion="Loaded Python Version: %1"
|
||||
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"
|
||||
Description="Description"
|
||||
ScriptDescriptionLink.Text="Open this link in your default web browser?"
|
||||
|
|
|
|||
|
|
@ -470,8 +470,24 @@ void ScriptsTool::on_pythonPathBrowse_clicked()
|
|||
|
||||
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;
|
||||
} else if (loaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!obs_scripting_load_python(path))
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue