diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-12-09 10:07:11 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-12-09 10:07:11 -0500 |
| commit | 2bc544509cb594df229055c7aac89151921f9861 (patch) | |
| tree | 510483032c9b45b990534d53be01804b5fb4dc44 | |
| parent | 5521b12fb30c525b5d4b919e355266de9fb524ef (diff) | |
disable run hooked in filetree when mod is disabled
| -rw-r--r-- | src/modinfodialogfiletree.cpp | 17 | ||||
| -rw-r--r-- | src/organizer_en.ts | 8 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/modinfodialogfiletree.cpp b/src/modinfodialogfiletree.cpp index 607d2e5b..c49c767f 100644 --- a/src/modinfodialogfiletree.cpp +++ b/src/modinfodialogfiletree.cpp @@ -453,6 +453,21 @@ void FileTreeTab::onContextMenu(const QPoint &pos) } } + bool enableRunHooked = false; + + if (enableRun || enableOpen) { + if (auto* p=core().currentProfile()) { + if (mod().canBeEnabled()) { + const auto index = ModInfo::getIndex(mod().name()); + if (index == UINT_MAX) { + log::error("mod '{}' not found (filetree)", mod().name()); + } else { + enableRunHooked = p->modEnabled(index); + } + } + } + } + if (enableRun) { m_actions.open->setText(tr("&Execute")); m_actions.runHooked->setText(tr("Execute with &VFS")); @@ -481,7 +496,7 @@ void FileTreeTab::onContextMenu(const QPoint &pos) } } - if (enableOpen || enableRun) { + if (enableRunHooked) { menu.addAction(m_actions.runHooked); } diff --git a/src/organizer_en.ts b/src/organizer_en.ts index 9f83278b..a7796942 100644 --- a/src/organizer_en.ts +++ b/src/organizer_en.ts @@ -1283,7 +1283,7 @@ Right now the only case I know of where this needs to be overwritten is for the </message> <message> <location filename="modinfodialogfiletree.cpp" line="30"/> - <location filename="modinfodialogfiletree.cpp" line="461"/> + <location filename="modinfodialogfiletree.cpp" line="476"/> <source>Open with &VFS</source> <translation type="unfinished"></translation> </message> @@ -1349,17 +1349,17 @@ Right now the only case I know of where this needs to be overwritten is for the <translation type="unfinished"></translation> </message> <message> - <location filename="modinfodialogfiletree.cpp" line="457"/> + <location filename="modinfodialogfiletree.cpp" line="472"/> <source>&Execute</source> <translation type="unfinished"></translation> </message> <message> - <location filename="modinfodialogfiletree.cpp" line="458"/> + <location filename="modinfodialogfiletree.cpp" line="473"/> <source>Execute with &VFS</source> <translation type="unfinished"></translation> </message> <message> - <location filename="modinfodialogfiletree.cpp" line="460"/> + <location filename="modinfodialogfiletree.cpp" line="475"/> <source>&Open</source> <translation type="unfinished"></translation> </message> |
