Fix bugs with ACTIONs not being "honest" singletons.

Delete the copy ctor and assignment operator to start with, but
even then the separate apps each have their own statically allocated
copy of the common actions.  So we need to update all of them, which
also means having the kicad manager frame's set of actions on hand).

This changelist also adds a Clear Hotkey Assignment function since
the hotkeys set is now likely to be sparse with respect to the
actions.
This commit is contained in:
Jeff Young
2019-06-14 16:54:46 +01:00
parent 83ee51370c
commit b429dbfb88
14 changed files with 98 additions and 179 deletions
+7 -2
View File
@@ -39,6 +39,7 @@
#include <tool/action_menu.h>
#include <tool/common_control.h>
#include <tool/tool_manager.h>
#include <tool/action_manager.h>
#include <menus_helpers.h>
#include <tool/actions.h>
@@ -318,6 +319,8 @@ void EDA_BASE_FRAME::ShowChangedLanguage()
void EDA_BASE_FRAME::CommonSettingsChanged()
{
GetToolManager()->GetActionManager()->UpdateHotKeys( false );
if( GetMenuBar() )
{
// For icons in menus, icon scaling & hotkeys
@@ -530,8 +533,10 @@ void EDA_BASE_FRAME::OnPreferences( wxCommandEvent& event )
}
// The Kicad manager frame is not a player so we have to add it by hand
if( IsType( KICAD_MAIN_FRAME_T ) )
InstallPreferences( &dlg, hotkeysPanel );
wxWindow* manager = wxFindWindowByName( KICAD_MANAGER_FRAME_NAME );
if( manager )
static_cast<EDA_BASE_FRAME*>( manager )->InstallPreferences( &dlg, hotkeysPanel );
if( dlg.ShowModal() == wxID_OK )
dlg.Kiway().CommonSettingsChanged();