From ee89187dffa4f63ed0d5e6cf1ffd2414eaf3978c Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Mon, 23 Oct 2023 14:56:18 -0400 Subject: [PATCH 1/2] Add support for installing energy scripts Signed-off-by: Geoff Hutchison --- avogadro/mainwindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index bf5a340b..09d1e4a2 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -826,7 +826,8 @@ bool MainWindow::addScript(const QString& filePath) // TODO: add some sort of warning? QStringList types; types << tr("Commands") << tr("Input Generators") << tr("File Formats") - << tr("Charges", "atomic electrostatics"); + << tr("Charges", "atomic electrostatics") + << tr("Force Fields", "potential energy calculators"); bool ok; QString item = @@ -853,6 +854,9 @@ bool MainWindow::addScript(const QString& filePath) case 4: typePath = "charges"; break; + case 5: + typePath = "energy" + break; default: typePath = "other"; } @@ -2529,7 +2533,7 @@ bool MainWindow::handleCommand(const QString& command, glWidget->setActiveTool(tool->objectName()); bool result = tool->handleCommand(command, options); glWidget->setActiveTool(currentTool); - + return result; } else if (m_extensionCommandMap.contains(command)) { auto* extension = m_extensionCommandMap.value(command); From 35171f1cdd476b847be7e11a019db8379dd2889b Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Mon, 23 Oct 2023 15:21:56 -0400 Subject: [PATCH 2/2] Fix compile error Signed-off-by: Geoff Hutchison --- avogadro/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index 09d1e4a2..2339b0b5 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -855,7 +855,7 @@ bool MainWindow::addScript(const QString& filePath) typePath = "charges"; break; case 5: - typePath = "energy" + typePath = "energy"; break; default: typePath = "other";