diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index 389ff2d8b7..c148abe901 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -39,7 +39,6 @@ #include // To use GetRunningMicroSecs or another profiling utility #include #include -#include #include #include #include diff --git a/3d-viewer/3d_viewer/3d_menubar.cpp b/3d-viewer/3d_viewer/3d_menubar.cpp index fac671e10f..5dec1c8a11 100644 --- a/3d-viewer/3d_viewer/3d_menubar.cpp +++ b/3d-viewer/3d_viewer/3d_menubar.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include <3d_viewer_id.h> #include <3d_viewer/tools/eda_3d_actions.h> #include diff --git a/3d-viewer/3d_viewer/3d_toolbar.cpp b/3d-viewer/3d_viewer/3d_toolbar.cpp index 85960b51a4..6fd55ffd41 100644 --- a/3d-viewer/3d_viewer/3d_toolbar.cpp +++ b/3d-viewer/3d_viewer/3d_toolbar.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include <3d_viewer_id.h> diff --git a/bitmap2component/bitmap2cmp_frame.cpp b/bitmap2component/bitmap2cmp_frame.cpp index 3ce7c589cb..0bf4d26dfb 100644 --- a/bitmap2component/bitmap2cmp_frame.cpp +++ b/bitmap2component/bitmap2cmp_frame.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 8a15e09a1e..be88a88abb 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -450,7 +450,6 @@ set( COMMON_SRCS kiway_express.cpp kiway_holder.cpp kiway_player.cpp - languages_menu.cpp launch_ext.cpp lib_table_base.cpp lib_table_grid_tricks.cpp diff --git a/common/dialogs/dialog_configure_paths.cpp b/common/dialogs/dialog_configure_paths.cpp index a827708281..fb217c873c 100644 --- a/common/dialogs/dialog_configure_paths.cpp +++ b/common/dialogs/dialog_configure_paths.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/common/dialogs/panel_color_settings.cpp b/common/dialogs/panel_color_settings.cpp index 87b821e6c2..ee7b755c26 100644 --- a/common/dialogs/panel_color_settings.cpp +++ b/common/dialogs/panel_color_settings.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index 4fb13375a5..ff9443f155 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -516,7 +515,7 @@ void EDA_BASE_FRAME::AddStandardHelpMenu( wxMenuBar* aMenuBar ) helpMenu->AppendSeparator(); helpMenu->Add( ACTIONS::about ); - + // Trailing space keeps OSX from hijacking our menu (and disabling everything in it). aMenuBar->Append( helpMenu, _( "&Help" ) + wxS( " " ) ); helpMenu->wxMenu::SetTitle( _( "&Help" ) + wxS( " " ) ); @@ -1553,3 +1552,40 @@ WXLRESULT EDA_BASE_FRAME::MSWWindowProc( WXUINT message, WXWPARAM wParam, WXLPAR return wxFrame::MSWWindowProc( message, wParam, lParam ); } #endif + + +/** + * Function AddMenuLanguageList + * creates a menu list for language choice, and add it as submenu to \a MasterMenu. + * + * @param aMasterMenu is the main menu. + * @param aControlTool is the tool to associate with the menu + */ +void EDA_BASE_FRAME::AddMenuLanguageList( ACTION_MENU* aMasterMenu, TOOL_INTERACTIVE* aControlTool ) +{ + ACTION_MENU* langsMenu = new ACTION_MENU( false, aControlTool ); + langsMenu->SetTitle( _( "Set Language" ) ); + langsMenu->SetIcon( BITMAPS::language ); + + wxString tooltip; + + for( unsigned ii = 0; LanguagesList[ii].m_KI_Lang_Identifier != 0; ii++ ) + { + wxString label; + + if( LanguagesList[ii].m_DoNotTranslate ) + label = LanguagesList[ii].m_Lang_Label; + else + label = wxGetTranslation( LanguagesList[ii].m_Lang_Label ); + + wxMenuItem* item = + new wxMenuItem( langsMenu, + LanguagesList[ii].m_KI_Lang_Identifier, // wxMenuItem wxID + label, tooltip, wxITEM_CHECK ); + + langsMenu->Append( item ); + } + + // This must be done after the items are added + aMasterMenu->Add( langsMenu ); +} diff --git a/common/languages_menu.cpp b/common/languages_menu.cpp deleted file mode 100644 index dbfafa2caa..0000000000 --- a/common/languages_menu.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 1992-2020 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 Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * @file languages_menu.cpp - * - * @brief build the standard menu to show the list of available translations - */ - -#include -#include -#include // LanguagesList -#include -#include -#include -#include - -/** - * Function AddMenuLanguageList - * creates a menu list for language choice, and add it as submenu to \a MasterMenu. - * - * @param aMasterMenu is the main menu. - * @param aControlTool is the tool to associate with the menu - */ -void AddMenuLanguageList( ACTION_MENU* aMasterMenu, TOOL_INTERACTIVE* aControlTool ) -{ - ACTION_MENU* langsMenu = new ACTION_MENU( false, aControlTool ); - langsMenu->SetTitle( _( "Set Language" ) ); - langsMenu->SetIcon( BITMAPS::language ); - - wxString tooltip; - - for( unsigned ii = 0; LanguagesList[ii].m_KI_Lang_Identifier != 0; ii++ ) - { - wxString label; - - if( LanguagesList[ii].m_DoNotTranslate ) - label = LanguagesList[ii].m_Lang_Label; - else - label = wxGetTranslation( LanguagesList[ii].m_Lang_Label ); - - wxMenuItem* item = new wxMenuItem( langsMenu, - LanguagesList[ii].m_KI_Lang_Identifier, // wxMenuItem wxID - label, - tooltip, - wxITEM_CHECK ); - - langsMenu->Append( item ); - } - - // This must be done after the items are added - aMasterMenu->Add( langsMenu ); -} diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index 70afdb909d..8cf7ae1488 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/common/tool/conditional_menu.cpp b/common/tool/conditional_menu.cpp index 841bf9af4c..73adf100c0 100644 --- a/common/tool/conditional_menu.cpp +++ b/common/tool/conditional_menu.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/cvpcb/menubar.cpp b/cvpcb/menubar.cpp index fea45d4ead..01766070eb 100644 --- a/cvpcb/menubar.cpp +++ b/cvpcb/menubar.cpp @@ -23,7 +23,6 @@ */ #include -#include #include #include #include diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index ef1432c993..cf7cd0c7d1 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/eeschema/sim/toolbars_simulator_frame.cpp b/eeschema/sim/toolbars_simulator_frame.cpp index 08c1b53216..4d0edaf869 100644 --- a/eeschema/sim/toolbars_simulator_frame.cpp +++ b/eeschema/sim/toolbars_simulator_frame.cpp @@ -25,7 +25,6 @@ #include #include #include -#include "menus_helpers.h" void SIMULATOR_FRAME::ReCreateHToolbar() diff --git a/eeschema/symbol_editor/menubar_symbol_editor.cpp b/eeschema/symbol_editor/menubar_symbol_editor.cpp index e1a96eb035..49c5a2b6e2 100644 --- a/eeschema/symbol_editor/menubar_symbol_editor.cpp +++ b/eeschema/symbol_editor/menubar_symbol_editor.cpp @@ -24,7 +24,6 @@ */ #include -#include #include #include #include diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index 2cbd9a0dae..3bd2c31a48 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include diff --git a/gerbview/menubar.cpp b/gerbview/menubar.cpp index 5b711214a2..e8a5792082 100644 --- a/gerbview/menubar.cpp +++ b/gerbview/menubar.cpp @@ -28,7 +28,6 @@ #include #include "gerbview_id.h" #include -#include #include #include #include diff --git a/gerbview/tools/gerbview_control.cpp b/gerbview/tools/gerbview_control.cpp index d37784c5b5..61c2967c52 100644 --- a/gerbview/tools/gerbview_control.cpp +++ b/gerbview/tools/gerbview_control.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/gerbview/widgets/gerbview_layer_widget.cpp b/gerbview/widgets/gerbview_layer_widget.cpp index cc39fbf76f..d5d38286f7 100644 --- a/gerbview/widgets/gerbview_layer_widget.cpp +++ b/gerbview/widgets/gerbview_layer_widget.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "gerbview_draw_panel_gal.h" #include diff --git a/gerbview/widgets/layer_widget.cpp b/gerbview/widgets/layer_widget.cpp index 06a63140db..dbc9818824 100644 --- a/gerbview/widgets/layer_widget.cpp +++ b/gerbview/widgets/layer_widget.cpp @@ -37,7 +37,6 @@ #include #include -#include #include #include #include diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index ef473b565c..d7e1f5d0cd 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -82,6 +82,8 @@ class APP_SETTINGS_BASE; class APPEARANCE_CONTROLS_3D; struct WINDOW_SETTINGS; struct WINDOW_STATE; +class ACTION_MENU; +class TOOL_INTERACTIVE; #define DEFAULT_MAX_UNDO_ITEMS 0 #define ABS_MAX_UNDO_ITEMS (INT_MAX / 2) @@ -681,6 +683,9 @@ protected: */ virtual void OnDropFiles( wxDropFilesEvent& aEvent ); + + void AddMenuLanguageList( ACTION_MENU* aMasterMenu, TOOL_INTERACTIVE* aControlTool ); + /** * Execute action on accepted dropped file. * Called in OnDropFiles and should be populated with diff --git a/include/menus_helpers.h b/include/menus_helpers.h deleted file mode 100644 index 695c0314ac..0000000000 --- a/include/menus_helpers.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2004-2020 KiCad Developers. - * - * 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 Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef MENUS_HELPERS_H_ -#define MENUS_HELPERS_H_ - -/** - * @file menus_helpers.h - * @brief Macros and inline functions to create menus items in menubars or popup menus. - */ - - -#include -#include - -class ACTION_MENU; -class TOOL_INTERACTIVE; - -void AddMenuLanguageList( ACTION_MENU* aMasterMenu, TOOL_INTERACTIVE* aControlTool ); - -#endif // MENUS_HELPERS_H_ diff --git a/kicad/menubar.cpp b/kicad/menubar.cpp index f9666cf4c8..0515ac5bc7 100644 --- a/kicad/menubar.cpp +++ b/kicad/menubar.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/kicad/project_tree_pane.cpp b/kicad/project_tree_pane.cpp index e03720cfee..cbe648aad1 100644 --- a/kicad/project_tree_pane.cpp +++ b/kicad/project_tree_pane.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/pagelayout_editor/menubar.cpp b/pagelayout_editor/menubar.cpp index e393b1eb0e..428fd1fe97 100644 --- a/pagelayout_editor/menubar.cpp +++ b/pagelayout_editor/menubar.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/pcb_calculator/pcb_calculator_frame.cpp b/pcb_calculator/pcb_calculator_frame.cpp index e038a7cbdd..3c68b36f13 100644 --- a/pcb_calculator/pcb_calculator_frame.cpp +++ b/pcb_calculator/pcb_calculator_frame.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/menubar_footprint_editor.cpp b/pcbnew/menubar_footprint_editor.cpp index 06dee2f722..2a7d60fe52 100644 --- a/pcbnew/menubar_footprint_editor.cpp +++ b/pcbnew/menubar_footprint_editor.cpp @@ -27,7 +27,6 @@ #include "footprint_edit_frame.h" #include "pcbnew_id.h" #include -#include #include #include #include diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index acf67f2458..a76df886a4 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/python/scripting/pcbnew_action_plugins.cpp b/pcbnew/python/scripting/pcbnew_action_plugins.cpp index 68e3abc786..d7385fdc1b 100644 --- a/pcbnew/python/scripting/pcbnew_action_plugins.cpp +++ b/pcbnew/python/scripting/pcbnew_action_plugins.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/tools/placement_tool.cpp b/pcbnew/tools/placement_tool.cpp index 2730ae43a4..f2861fe7f4 100644 --- a/pcbnew/tools/placement_tool.cpp +++ b/pcbnew/tools/placement_tool.cpp @@ -35,8 +35,6 @@ #include #include -#include - ALIGN_DISTRIBUTE_TOOL::ALIGN_DISTRIBUTE_TOOL() : TOOL_INTERACTIVE( "pcbnew.Placement" ), diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index e1ebed066e..180c2b8e03 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include