Skip to content

Commit cf3ed34

Browse files
committed
Set script path as tooltip for the module label
1 parent b25ea3c commit cf3ed34

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

Source/PythonProcessor.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ bool PythonProcessor::initInterpreter(String pythonHome)
457457
}
458458
}
459459
LOGC("Python Interpreter initialized successfully! Python Home: ", String(Py_GetPythonHome()));
460+
CoreServices::sendStatusMessage("Python Home: " + String(Py_GetPythonHome()));
460461
return true;
461462
}
462463
catch(py::error_already_set& e)
@@ -505,7 +506,7 @@ bool PythonProcessor::importModule()
505506

506507
LOGC("Successfully imported ", moduleName);
507508

508-
editorPtr->setPathLabelText(moduleName);
509+
editorPtr->setPathLabelText(moduleName, scriptPath);
509510
moduleReady = true;
510511
MouseCursor::hideWaitCursor();
511512
return true;
@@ -533,13 +534,13 @@ void PythonProcessor::reload()
533534
pyModule->reload();
534535
}
535536
catch (py::error_already_set& e) {
536-
handlePythonException("Reloding failed!", "", e);
537+
handlePythonException("Reloading failed!", "", e);
537538
return;
538539
}
539540

540541
LOGC("Module successfully reloaded");
541542
moduleReady = true;
542-
editorPtr->setPathLabelText(moduleName);
543+
editorPtr->setPathLabelText(moduleName, scriptPath);
543544
initModule();
544545
}
545546
else
@@ -613,5 +614,5 @@ void PythonProcessor::handlePythonException(const String& title, const String& m
613614
exceptionWindow.runModalLoop();
614615

615616
moduleReady = false;
616-
editorPtr->setPathLabelText("(ERROR) " + moduleName);
617+
editorPtr->setPathLabelText("(ERROR) " + moduleName, scriptPath);
617618
}

Source/PythonProcessorEditor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ void PythonProcessorEditor::comboBoxChanged(ComboBox* cb)
148148
}
149149

150150

151-
void PythonProcessorEditor::setPathLabelText(String s)
151+
void PythonProcessorEditor::setPathLabelText(String text, String tooltip)
152152
{
153-
scriptPathLabel->setText(s, dontSendNotification);
154-
scriptPathLabel->setTooltip(s);
153+
scriptPathLabel->setText(text, dontSendNotification);
154+
scriptPathLabel->setTooltip(tooltip);
155155
}
156156

157157

Source/PythonProcessorEditor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ class PythonProcessorEditor :
8282
/** Called when a ComboBox changes*/
8383
void comboBoxChanged(ComboBox* comboBox) override;
8484

85-
/** Sets the text of the path label */
86-
void setPathLabelText(String);
85+
/** Sets the text & tooltip of the path label */
86+
void setPathLabelText(String text, String tooltip);
8787

8888
private:
8989

0 commit comments

Comments
 (0)