Update selected tool string when language changes.

Fixes https://gitlab.com/kicad/code/kicad/issues/8813
This commit is contained in:
Jeff Young 2021-07-23 20:15:55 +01:00
parent 9820e89268
commit 3c1af1af74
7 changed files with 19 additions and 11 deletions

View File

@ -458,6 +458,8 @@ void EDA_BASE_FRAME::AddStandardHelpMenu( wxMenuBar* aMenuBar )
void EDA_BASE_FRAME::ShowChangedLanguage() void EDA_BASE_FRAME::ShowChangedLanguage()
{ {
TOOLS_HOLDER::ShowChangedLanguage();
if( GetMenuBar() ) if( GetMenuBar() )
{ {
ReCreateMenuBar(); ReCreateMenuBar();

View File

@ -115,6 +115,16 @@ bool TOOLS_HOLDER::IsCurrentTool( const TOOL_ACTION& aAction ) const
} }
void TOOLS_HOLDER::ShowChangedLanguage()
{
std::string actionName = CurrentToolName();
TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName );
if( action )
DisplayToolMsg( action->GetLabel() );
}
void TOOLS_HOLDER::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) void TOOLS_HOLDER::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
{ {
if( GetToolManager() ) if( GetToolManager() )

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2018-2019 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software: you can redistribute it and/or modify it * This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
@ -54,19 +54,14 @@ int CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
if( m_frame->ToolStackIsEmpty() ) if( m_frame->ToolStackIsEmpty() )
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
// single click? Select single object
if( evt->IsClick( BUT_LEFT ) ) if( evt->IsClick( BUT_LEFT ) )
{ {
clearSelection(); clearSelection();
} }
// right click? if there is any object - show the context menu
else if( evt->IsClick( BUT_RIGHT ) ) else if( evt->IsClick( BUT_RIGHT ) )
{ {
m_menu.ShowContextMenu( m_selection ); m_menu.ShowContextMenu( m_selection );
} }
// Middle double click? Do zoom to fit or zoom to objects
else if( evt->IsDblClick( BUT_MIDDLE ) ) else if( evt->IsDblClick( BUT_MIDDLE ) )
{ {
m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true ); m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true );
@ -75,9 +70,10 @@ int CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{ {
clearSelection(); clearSelection();
} }
else else
{
evt->SetPassEvent(); evt->SetPassEvent();
}
} }
return 0; return 0;

View File

@ -491,7 +491,7 @@ public:
/** /**
* Redraw the menus and what not in current language. * Redraw the menus and what not in current language.
*/ */
virtual void ShowChangedLanguage(); void ShowChangedLanguage() override;
/** /**
* Notification event that some of the common (suite-wide) settings have changed. * Notification event that some of the common (suite-wide) settings have changed.

View File

@ -120,6 +120,8 @@ public:
virtual void DisplayToolMsg( const wxString& msg ) {}; virtual void DisplayToolMsg( const wxString& msg ) {};
virtual void ShowChangedLanguage();
/** /**
* Indicate that hotkeys should perform an immediate action even if another tool is * Indicate that hotkeys should perform an immediate action even if another tool is
* currently active. If false, the first hotkey should select the relevant tool. * currently active. If false, the first hotkey should select the relevant tool.

View File

@ -36,9 +36,7 @@ bool DIALOG_REGULATOR_FORM::TransferDataFromWindow()
bool success = true; bool success = true;
if( m_textCtrlName->GetValue().IsEmpty() ) if( m_textCtrlName->GetValue().IsEmpty() )
{
success = false; success = false;
}
if( m_textCtrlVref->GetValue().IsEmpty() ) if( m_textCtrlVref->GetValue().IsEmpty() )
{ {

View File

@ -57,7 +57,7 @@ public:
/** /**
* @return true if regulator parameters are acceptable. * @return true if regulator parameters are acceptable.
*/ */
bool TransferDataFromWindow(); bool TransferDataFromWindow() override;
/** /**
* Transfer data from dialog to aItem. * Transfer data from dialog to aItem.