Disable ACTIONS::openPreferences for now.

wxWidgets needs to move the item to the KiCad menu on Mac, and it
can only find it if it has the id wxID_PREFERENCES.
This commit is contained in:
Jeff Young 2021-06-07 20:45:17 +01:00
parent e91721cb62
commit 3ff670d2a4
12 changed files with 63 additions and 12 deletions

View File

@ -95,6 +95,7 @@ static const wxSize defaultSize( FRAME_T aFrameType )
BEGIN_EVENT_TABLE( EDA_BASE_FRAME, wxFrame ) BEGIN_EVENT_TABLE( EDA_BASE_FRAME, wxFrame )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::OnKicadAbout ) EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::OnKicadAbout )
EVT_MENU( wxID_PREFERENCES, EDA_BASE_FRAME::OnPreferences )
EVT_CHAR_HOOK( EDA_BASE_FRAME::OnCharHook ) EVT_CHAR_HOOK( EDA_BASE_FRAME::OnCharHook )
EVT_MENU_OPEN( EDA_BASE_FRAME::OnMenuEvent ) EVT_MENU_OPEN( EDA_BASE_FRAME::OnMenuEvent )
@ -918,7 +919,7 @@ void EDA_BASE_FRAME::OnKicadAbout( wxCommandEvent& event )
} }
void EDA_BASE_FRAME::OnPreferences() void EDA_BASE_FRAME::OnPreferences( wxCommandEvent& event )
{ {
PAGED_DIALOG dlg( this, _( "Preferences" ), true ); PAGED_DIALOG dlg( this, _( "Preferences" ), true );
wxTreebook* book = dlg.GetTreebook(); wxTreebook* book = dlg.GetTreebook();

View File

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

View File

@ -68,7 +68,13 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths ); prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showFootprintLibTable ); prefsMenu->Add( ACTIONS::showFootprintLibTable );
prefsMenu->Add( ACTIONS::openPreferences );
// 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->AppendSeparator(); prefsMenu->AppendSeparator();
prefsMenu->Add( CVPCB_ACTIONS::showEquFileTable); prefsMenu->Add( CVPCB_ACTIONS::showEquFileTable);

View File

@ -262,11 +262,18 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
//-- Preferences menu ----------------------------------------------- //-- Preferences menu -----------------------------------------------
//
ACTION_MENU* prefsMenu = new ACTION_MENU( false, selTool ); ACTION_MENU* prefsMenu = new ACTION_MENU( false, selTool );
prefsMenu->Add( ACTIONS::configurePaths ); prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showSymbolLibTable ); prefsMenu->Add( ACTIONS::showSymbolLibTable );
prefsMenu->Add( ACTIONS::openPreferences );
// 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->AppendSeparator(); prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, selTool ); AddMenuLanguageList( prefsMenu, selTool );

View File

@ -160,7 +160,13 @@ void SYMBOL_EDIT_FRAME::ReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths ); prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showSymbolLibTable ); prefsMenu->Add( ACTIONS::showSymbolLibTable );
prefsMenu->Add( ACTIONS::openPreferences );
// 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->AppendSeparator(); prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, selTool ); AddMenuLanguageList( prefsMenu, selTool );

View File

@ -207,7 +207,12 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
// //
ACTION_MENU* preferencesMenu = new ACTION_MENU( false, selTool ); ACTION_MENU* preferencesMenu = new ACTION_MENU( false, selTool );
preferencesMenu->Add( ACTIONS::openPreferences ); // 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->AppendSeparator(); preferencesMenu->AppendSeparator();
AddMenuLanguageList( preferencesMenu, selTool ); AddMenuLanguageList( preferencesMenu, selTool );

View File

@ -204,7 +204,7 @@ public:
/** /**
* Displays the preferences and settings of all opened editors paged dialog * Displays the preferences and settings of all opened editors paged dialog
*/ */
void OnPreferences(); void OnPreferences( wxCommandEvent& event );
void PrintMsg( const wxString& text ); void PrintMsg( const wxString& text );

View File

@ -163,7 +163,13 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths ); prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showSymbolLibTable ); prefsMenu->Add( ACTIONS::showSymbolLibTable );
prefsMenu->Add( ACTIONS::showFootprintLibTable ); prefsMenu->Add( ACTIONS::showFootprintLibTable );
prefsMenu->Add( ACTIONS::openPreferences );
// 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->AppendSeparator(); prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, controlTool ); AddMenuLanguageList( prefsMenu, controlTool );

View File

@ -152,7 +152,12 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
// //
ACTION_MENU* preferencesMenu = new ACTION_MENU( false, selTool ); ACTION_MENU* preferencesMenu = new ACTION_MENU( false, selTool );
preferencesMenu->Add( ACTIONS::openPreferences ); // 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 );
// Language submenu // Language submenu
AddMenuLanguageList( preferencesMenu, selTool ); AddMenuLanguageList( preferencesMenu, selTool );

View File

@ -225,7 +225,13 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths ); prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showFootprintLibTable ); prefsMenu->Add( ACTIONS::showFootprintLibTable );
prefsMenu->Add( ACTIONS::openPreferences );
// 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->AppendSeparator(); prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, selTool ); AddMenuLanguageList( prefsMenu, selTool );

View File

@ -436,7 +436,12 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
prefsMenu->Add( ACTIONS::configurePaths ); prefsMenu->Add( ACTIONS::configurePaths );
prefsMenu->Add( ACTIONS::showFootprintLibTable ); prefsMenu->Add( ACTIONS::showFootprintLibTable );
prefsMenu->Add( ACTIONS::openPreferences ); // 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->AppendSeparator(); prefsMenu->AppendSeparator();
AddMenuLanguageList( prefsMenu, selTool ); AddMenuLanguageList( prefsMenu, selTool );

View File

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