Update selected tool string when language changes.
Fixes https://gitlab.com/kicad/code/kicad/issues/8813
This commit is contained in:
parent
9820e89268
commit
3c1af1af74
|
@ -458,6 +458,8 @@ void EDA_BASE_FRAME::AddStandardHelpMenu( wxMenuBar* aMenuBar )
|
|||
|
||||
void EDA_BASE_FRAME::ShowChangedLanguage()
|
||||
{
|
||||
TOOLS_HOLDER::ShowChangedLanguage();
|
||||
|
||||
if( GetMenuBar() )
|
||||
{
|
||||
ReCreateMenuBar();
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
if( GetToolManager() )
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* 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
|
||||
* 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() )
|
||||
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
||||
|
||||
// single click? Select single object
|
||||
if( evt->IsClick( BUT_LEFT ) )
|
||||
{
|
||||
clearSelection();
|
||||
}
|
||||
|
||||
// right click? if there is any object - show the context menu
|
||||
else if( evt->IsClick( BUT_RIGHT ) )
|
||||
{
|
||||
m_menu.ShowContextMenu( m_selection );
|
||||
}
|
||||
|
||||
// Middle double click? Do zoom to fit or zoom to objects
|
||||
else if( evt->IsDblClick( BUT_MIDDLE ) )
|
||||
{
|
||||
m_toolMgr->RunAction( ACTIONS::zoomFitScreen, true );
|
||||
|
@ -75,10 +70,11 @@ int CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
clearSelection();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -491,7 +491,7 @@ public:
|
|||
/**
|
||||
* 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.
|
||||
|
|
|
@ -120,6 +120,8 @@ public:
|
|||
|
||||
virtual void DisplayToolMsg( const wxString& msg ) {};
|
||||
|
||||
virtual void ShowChangedLanguage();
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
|
|
@ -36,9 +36,7 @@ bool DIALOG_REGULATOR_FORM::TransferDataFromWindow()
|
|||
bool success = true;
|
||||
|
||||
if( m_textCtrlName->GetValue().IsEmpty() )
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
|
||||
if( m_textCtrlVref->GetValue().IsEmpty() )
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
/**
|
||||
* @return true if regulator parameters are acceptable.
|
||||
*/
|
||||
bool TransferDataFromWindow();
|
||||
bool TransferDataFromWindow() override;
|
||||
|
||||
/**
|
||||
* Transfer data from dialog to aItem.
|
||||
|
|
Loading…
Reference in New Issue