Browse Source

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.
6.0.7
Jeff Young 5 years ago
parent
commit
3ff670d2a4
  1. 3
      common/eda_base_frame.cpp
  2. 5
      common/tool/common_control.cpp
  3. 8
      cvpcb/menubar.cpp
  4. 9
      eeschema/menubar.cpp
  5. 8
      eeschema/symbol_editor/menubar_symbol_editor.cpp
  6. 7
      gerbview/menubar.cpp
  7. 2
      include/eda_base_frame.h
  8. 8
      kicad/menubar.cpp
  9. 7
      pagelayout_editor/menubar.cpp
  10. 8
      pcbnew/menubar_footprint_editor.cpp
  11. 7
      pcbnew/menubar_pcb_editor.cpp
  12. 3
      pcbnew/widgets/appearance_controls.cpp

3
common/eda_base_frame.cpp

@ -95,6 +95,7 @@ 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 )
@ -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 );
wxTreebook* book = dlg.GetTreebook();

5
common/tool/common_control.cpp

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

8
cvpcb/menubar.cpp

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

9
eeschema/menubar.cpp

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

8
eeschema/symbol_editor/menubar_symbol_editor.cpp

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

7
gerbview/menubar.cpp

@ -207,7 +207,12 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
//
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();
AddMenuLanguageList( preferencesMenu, selTool );

2
include/eda_base_frame.h

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

8
kicad/menubar.cpp

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

7
pagelayout_editor/menubar.cpp

@ -152,7 +152,12 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
//
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
AddMenuLanguageList( preferencesMenu, selTool );

8
pcbnew/menubar_footprint_editor.cpp

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

7
pcbnew/menubar_pcb_editor.cpp

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

3
pcbnew/widgets/appearance_controls.cpp

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

Loading…
Cancel
Save