mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
add Stop All Scripts and Reload All Scripts
This commit is contained in:
parent
87ec2dc25a
commit
9d841ce918
4 changed files with 32 additions and 2 deletions
|
@ -3984,6 +3984,30 @@ void Application::saveScripts() {
|
|||
settings->endArray();
|
||||
}
|
||||
|
||||
void Application::stopAllScripts() {
|
||||
// stops all current running scripts
|
||||
QList<QAction*> scriptActions = Menu::getInstance()->getActiveScriptsMenu()->actions();
|
||||
foreach (QAction* scriptAction, scriptActions) {
|
||||
scriptAction->activate(QAction::Trigger);
|
||||
qDebug() << "stopping script..." << scriptAction->text();
|
||||
}
|
||||
}
|
||||
|
||||
void Application::reloadAllScripts() {
|
||||
// reloads all current running scripts
|
||||
QList<QAction*> scriptActions = Menu::getInstance()->getActiveScriptsMenu()->actions();
|
||||
foreach (QAction* scriptAction, scriptActions) {
|
||||
scriptAction->activate(QAction::Trigger);
|
||||
qDebug() << "stopping script..." << scriptAction->text();
|
||||
}
|
||||
QStringList reloadList = _activeScripts;
|
||||
_activeScripts.clear();
|
||||
foreach (QString scriptName, reloadList){
|
||||
qDebug() << "reloading script..." << scriptName;
|
||||
loadScript(scriptName);
|
||||
}
|
||||
}
|
||||
|
||||
void Application::removeScriptName(const QString& fileNameString) {
|
||||
_activeScripts.removeOne(fileNameString);
|
||||
}
|
||||
|
|
|
@ -231,6 +231,8 @@ public slots:
|
|||
void loadDialog();
|
||||
void toggleLogDialog();
|
||||
void initAvatarAndViewFrustum();
|
||||
void stopAllScripts();
|
||||
void reloadAllScripts();
|
||||
|
||||
private slots:
|
||||
void timer();
|
||||
|
|
|
@ -93,6 +93,8 @@ Menu::Menu() :
|
|||
|
||||
addDisabledActionAndSeparator(fileMenu, "Scripts");
|
||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O, appInstance, SLOT(loadDialog()));
|
||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, appInstance, SLOT(stopAllScripts()));
|
||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::ReloadAllScripts, 0, appInstance, SLOT(reloadAllScripts()));
|
||||
_activeScriptsMenu = fileMenu->addMenu("Running Scripts");
|
||||
|
||||
addDisabledActionAndSeparator(fileMenu, "Voxels");
|
||||
|
|
|
@ -243,8 +243,10 @@ namespace MenuOption {
|
|||
const QString PasteVoxels = "Paste";
|
||||
const QString PasteToVoxel = "Paste to Voxel...";
|
||||
const QString PipelineWarnings = "Show Render Pipeline Warnings";
|
||||
const QString PlaySlaps = "Play Slaps";
|
||||
const QString Preferences = "Preferences...";
|
||||
const QString RandomizeVoxelColors = "Randomize Voxel TRUE Colors";
|
||||
const QString ReloadAllScripts = "Reload All Scripts";
|
||||
const QString ResetAvatarSize = "Reset Avatar Size";
|
||||
const QString ResetSwatchColors = "Reset Swatch Colors";
|
||||
const QString RunTimingTests = "Run Timing Tests";
|
||||
|
@ -253,11 +255,10 @@ namespace MenuOption {
|
|||
const QString SettingsExport = "Export Settings";
|
||||
const QString ShowAllLocalVoxels = "Show All Local Voxels";
|
||||
const QString ShowTrueColors = "Show TRUE Colors";
|
||||
const QString VoxelDrumming = "Voxel Drumming";
|
||||
const QString PlaySlaps = "Play Slaps";
|
||||
const QString SuppressShortTimings = "Suppress Timings Less than 10ms";
|
||||
const QString Stars = "Stars";
|
||||
const QString Stats = "Stats";
|
||||
const QString StopAllScripts = "Stop All Scripts";
|
||||
const QString TestPing = "Test Ping";
|
||||
const QString TreeStats = "Calculate Tree Stats";
|
||||
const QString TransmitterDrive = "Transmitter Drive";
|
||||
|
@ -268,6 +269,7 @@ namespace MenuOption {
|
|||
const QString VoxelAddMode = "Add Voxel Mode";
|
||||
const QString VoxelColorMode = "Color Voxel Mode";
|
||||
const QString VoxelDeleteMode = "Delete Voxel Mode";
|
||||
const QString VoxelDrumming = "Voxel Drumming";
|
||||
const QString VoxelGetColorMode = "Get Color Mode";
|
||||
const QString VoxelMode = "Cycle Voxel Mode";
|
||||
const QString VoxelPaintColor = "Voxel Paint Color";
|
||||
|
|
Loading…
Reference in a new issue