void CMainFrame::OnReloadPlugins()
{
- UpdatePrediffersMenu();
+ CAllThreadsScripts::ReloadAllScripts();
}
/** @brief Return active merge edit view, if can figure it out/is available */
// force to reload the scriptlet list
UnloadTheScriptletList();
+
+ m_aPluginsByEvent.clear();
}
-void CScriptsOfThread::FreeScriptsForEvent(const wchar_t *transformationEvent)
+void CScriptsOfThread::ReloadAllScripts()
{
- if (auto it = m_aPluginsByEvent.find(transformationEvent); it != m_aPluginsByEvent.end())
- {
- if (it->second != nullptr)
- ::FreeAllScripts(it->second);
- }
+ FreeAllScripts();
+ m_aPluginsByEvent = ::GetAvailableScripts();
}
PluginInfo* CScriptsOfThread::GetUnpackerPluginByFilter(const String& filteredText)
LoadCustomSettings(thread->m_aPluginsByEvent);
}
+void CAllThreadsScripts::ReloadAllScripts()
+{
+ for (auto& thread : m_aAvailableThreads)
+ thread->ReloadAllScripts();
+}
+
////////////////////////////////////////////////////////////////////////////////////
// class CAssureScriptsForThread : control creation/destruction of CScriptsOfThread
void SaveSettings();
void FreeAllScripts();
- void FreeScriptsForEvent(const wchar_t *transformationEvent);
+ void ReloadAllScripts();
protected:
CScriptsOfThread();
static InternalPluginLoaderFuncPtr GetInternalPluginsLoader() { return m_funcInternalPluginsLoader; }
static void RegisterInternalPluginsLoader(InternalPluginLoaderFuncPtr func) { m_funcInternalPluginsLoader = func; }
static void ReloadCustomSettings();
+ static void ReloadAllScripts();
private:
// fixed size array, advantage : no mutex to allocate/free
static std::vector<CScriptsOfThread *> m_aAvailableThreads;