Browse Source

Move preferences to an action instead of a wx event

newinvert
Ian McInerney 2 years ago
parent
commit
a3a701a95e
  1. 5
      3d-viewer/3d_viewer/3d_menubar.cpp
  2. 7
      bitmap2component/bitmap2cmp_frame.cpp
  3. 7
      common/eda_base_frame.cpp
  4. 12
      common/tool/actions.cpp
  5. 5
      common/tool/common_control.cpp
  6. 8
      cvpcb/menubar.cpp
  7. 8
      eeschema/menubar.cpp
  8. 8
      eeschema/sim/toolbars_simulator_frame.cpp
  9. 8
      eeschema/symbol_editor/menubar_symbol_editor.cpp
  10. 7
      gerbview/menubar.cpp
  11. 5
      include/eda_base_frame.h
  12. 8
      kicad/menubar.cpp
  13. 7
      pagelayout_editor/menubar.cpp
  14. 8
      pcb_calculator/pcb_calculator_frame.cpp
  15. 8
      pcbnew/menubar_footprint_editor.cpp
  16. 8
      pcbnew/menubar_pcb_editor.cpp
  17. 3
      pcbnew/widgets/appearance_controls.cpp

5
3d-viewer/3d_viewer/3d_menubar.cpp

@ -109,10 +109,7 @@ void EDA_3D_VIEWER_FRAME::CreateMenuBar()
BITMAPS::tools,
ACTION_MENU::CHECK );
prefsMenu->Add( _( "Preferences..." ) + wxT( "\tCtrl+," ),
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences );
prefsMenu->Add( _( "Reset to Default Settings" ), ID_MENU3D_RESET_DEFAULTS, BITMAPS::tools );

7
bitmap2component/bitmap2cmp_frame.cpp

@ -245,12 +245,7 @@ void BITMAP2CMP_FRAME::doReCreateMenuBar()
//
ACTION_MENU* prefsMenu = new ACTION_MENU( false, tool );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,",
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences );
prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, tool );

7
common/eda_base_frame.cpp

@ -101,7 +101,6 @@ static const wxSize defaultSize( FRAME_T aFrameType )
BEGIN_EVENT_TABLE( EDA_BASE_FRAME, wxFrame )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::OnKicadAbout )
EVT_MENU( wxID_PREFERENCES, EDA_BASE_FRAME::OnPreferences )
EVT_CHAR_HOOK( EDA_BASE_FRAME::OnCharHook )
EVT_MENU_OPEN( EDA_BASE_FRAME::OnMenuEvent )
@ -1049,12 +1048,6 @@ void EDA_BASE_FRAME::OnKicadAbout( wxCommandEvent& event )
}
void EDA_BASE_FRAME::OnPreferences( wxCommandEvent& event )
{
ShowPreferences( wxEmptyString, wxEmptyString );
}
void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParentPage )
{
wxBeginBusyCursor( wxHOURGLASS_CURSOR );

12
common/tool/actions.cpp

@ -738,10 +738,14 @@ TOOL_ACTION ACTIONS::updateSchematicFromPcb( "common.Control.updateSchematicFrom
_( "Update Schematic from PCB..." ), _( "Update schematic with changes made to PCB" ),
BITMAPS::update_sch_from_pcb );
TOOL_ACTION ACTIONS::openPreferences( "common.SuiteControl.openPreferences",
AS_GLOBAL, MD_CTRL + ',', "",
_( "Preferences..." ), _( "Show preferences for all open tools" ),
BITMAPS::preference );
TOOL_ACTION ACTIONS::openPreferences( TOOL_ACTION_ARGS()
.Name( "common.SuiteControl.openPreferences" )
.Scope( AS_GLOBAL )
.DefaultHotkey( MD_CTRL + ',' )
.MenuText( _( "Preferences..." ) )
.Tooltip( _( "Show preferences for all open tools" ) )
.Icon( BITMAPS::preference )
.UIId( wxID_PREFERENCES ) );
TOOL_ACTION ACTIONS::configurePaths( "common.SuiteControl.configurePaths",
AS_GLOBAL, 0, "",

5
common/tool/common_control.cpp

@ -68,10 +68,7 @@ void COMMON_CONTROL::Reset( RESET_REASON aReason )
int COMMON_CONTROL::OpenPreferences( const TOOL_EVENT& aEvent )
{
wxCommandEvent dummy;
m_frame->OnPreferences( dummy );
m_frame->ShowPreferences( wxEmptyString, wxEmptyString );
return 0;
}

8
cvpcb/menubar.cpp

@ -68,13 +68,7 @@ void CVPCB_MAINFRAME::doReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showFootprintLibTable );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + wxS( "\tCtrl+," ),
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences);
prefsMenu->AppendSeparator();
prefsMenu->Add( CVPCB_ACTIONS::showEquFileTable);

8
eeschema/menubar.cpp

@ -313,13 +313,7 @@ void SCH_EDIT_FRAME::doReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showSymbolLibTable );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,",
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences );
prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, selTool );

8
eeschema/sim/toolbars_simulator_frame.cpp

@ -146,13 +146,7 @@ void SIMULATOR_FRAME::doReCreateMenuBar()
//prefsMenu->Add( ACTIONS::configurePaths );
//prefsMenu->Add( EE_ACTIONS::showSimLibTable );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,",
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences );
prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, tool );

8
eeschema/symbol_editor/menubar_symbol_editor.cpp

@ -165,13 +165,7 @@ void SYMBOL_EDIT_FRAME::doReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showSymbolLibTable );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,",
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences );
prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, selTool );

7
gerbview/menubar.cpp

@ -221,12 +221,7 @@ void GERBVIEW_FRAME::doReCreateMenuBar()
//
ACTION_MENU* preferencesMenu = new ACTION_MENU( false, selTool );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
preferencesMenu->Add( _( "Preferences..." ) + wxT( "\tCtrl+," ),
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
preferencesMenu->Add( ACTIONS::openPreferences );
preferencesMenu->AppendSeparator();
AddMenuLanguageList( preferencesMenu, selTool );

5
include/eda_base_frame.h

@ -211,11 +211,6 @@ public:
void OnKicadAbout( wxCommandEvent& event );
/**
* Displays the preferences and settings of all opened editors paged dialog
*/
void OnPreferences( wxCommandEvent& event );
/**
* Displays the preferences and settings of all opened editors paged dialog, starting with
* a particular page

8
kicad/menubar.cpp

@ -196,13 +196,7 @@ void KICAD_MANAGER_FRAME::doReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showSymbolLibTable );
prefsMenu->Add( ACTIONS::showFootprintLibTable );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + wxS( "\tCtrl+," ),
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences );
prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, controlTool );

7
pagelayout_editor/menubar.cpp

@ -156,12 +156,7 @@ void PL_EDITOR_FRAME::doReCreateMenuBar()
//
ACTION_MENU* preferencesMenu = new ACTION_MENU( false, selTool );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
preferencesMenu->Add( _( "Preferences..." ) + "\tCtrl+,",
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
preferencesMenu->Add( ACTIONS::openPreferences );
// Language submenu
AddMenuLanguageList( preferencesMenu, selTool );

8
pcb_calculator/pcb_calculator_frame.cpp

@ -28,6 +28,7 @@
#include <geometry/shape_poly_set.h>
#include <kiface_base.h>
#include <menus_helpers.h>
#include <tool/actions.h>
#include <tool/tool_manager.h>
#include <tool/tool_dispatcher.h>
#include <tool/common_control.h>
@ -213,12 +214,7 @@ void PCB_CALCULATOR_FRAME::doReCreateMenuBar()
//
ACTION_MENU* prefsMenu = new ACTION_MENU( false, tool );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,",
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences );
prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, tool );

8
pcbnew/menubar_footprint_editor.cpp

@ -239,13 +239,7 @@ void FOOTPRINT_EDIT_FRAME::doReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showFootprintLibTable );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + wxT( "\tCtrl+," ),
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences );
prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, selTool );

8
pcbnew/menubar_pcb_editor.cpp

@ -451,13 +451,7 @@ void PCB_EDIT_FRAME::doReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showFootprintLibTable );
// We can't use ACTIONS::showPreferences yet because wxWidgets moves this on
// Mac, and it needs the wxID_PREFERENCES id to find it.
prefsMenu->Add( _( "Preferences..." ) + wxT( "\tCtrl+," ),
_( "Show preferences for all open tools" ),
wxID_PREFERENCES,
BITMAPS::preference );
prefsMenu->Add( ACTIONS::openPreferences );
prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, selTool );

3
pcbnew/widgets/appearance_controls.cpp

@ -3278,8 +3278,7 @@ void APPEARANCE_CONTROLS::onReadOnlySwatch()
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
[&]( wxHyperlinkEvent& aEvent )
{
wxCommandEvent dummy;
m_frame->OnPreferences( dummy );
m_frame->ShowPreferences( wxEmptyString, wxEmptyString );
} ) );
infobar->RemoveAllButtons();

Loading…
Cancel
Save