From 5173699eec1134ad98e331f0df97745f4094bd34 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Fri, 15 Jan 2016 20:55:50 -0500 Subject: [PATCH] Pull hotkey editor into eeschema preferences --- common/dialogs/dialog_hotkeys_editor.cpp | 23 +- eeschema/dialogs/dialog_eeschema_options.cpp | 78 ++++- eeschema/dialogs/dialog_eeschema_options.h | 18 +- .../dialogs/dialog_eeschema_options_base.cpp | 51 +-- .../dialogs/dialog_eeschema_options_base.fbp | 290 ++++++++++++++---- .../dialogs/dialog_eeschema_options_base.h | 10 +- eeschema/menubar.cpp | 20 +- include/dialog_hotkeys_editor.h | 2 + 8 files changed, 386 insertions(+), 106 deletions(-) diff --git a/common/dialogs/dialog_hotkeys_editor.cpp b/common/dialogs/dialog_hotkeys_editor.cpp index ad0952e4d9..ee1551a9d2 100644 --- a/common/dialogs/dialog_hotkeys_editor.cpp +++ b/common/dialogs/dialog_hotkeys_editor.cpp @@ -58,6 +58,18 @@ HOTKEY_LIST_CTRL::HOTKEY_LIST_CTRL( wxWindow *aParent, const HOTKEYS_SECTIONS& a } +HOTKEYS_SECTIONS HOTKEY_LIST_CTRL::Sections( EDA_HOTKEY_CONFIG* aHotkeys ) +{ + HOTKEYS_SECTIONS sections; + for( EDA_HOTKEY_CONFIG* section = aHotkeys; section->m_HK_InfoList; ++section ) + { + HOTKEYS_SECTION sec( wxGetTranslation( *section->m_Title ), section ); + sections.push_back( sec ); + } + return sections; +} + + void HOTKEY_LIST_CTRL::DeselectRow( int aRow ) { wxASSERT( aRow >= 0 && aRow < (int)m_items.size() ); @@ -349,16 +361,7 @@ HOTKEYS_EDITOR_DIALOG::HOTKEYS_EDITOR_DIALOG( EDA_BASE_FRAME* aParent, m_parent( aParent ), m_hotkeys( aHotkeys ) { - EDA_HOTKEY_CONFIG* section; - - HOTKEYS_SECTIONS sections; - for( section = m_hotkeys; section->m_HK_InfoList; section++ ) - { - HOTKEYS_SECTION sec( wxGetTranslation( *section->m_Title ), section ); - sections.push_back( sec ); - } - - m_hotkeyListCtrl = new HOTKEY_LIST_CTRL( this, sections ); + m_hotkeyListCtrl = new HOTKEY_LIST_CTRL( this, HOTKEY_LIST_CTRL::Sections( aHotkeys ) ); m_mainSizer->Insert( 1, m_hotkeyListCtrl, wxSizerFlags( 1 ).Expand().Border( wxALL, 5 ) ); Layout(); diff --git a/eeschema/dialogs/dialog_eeschema_options.cpp b/eeschema/dialogs/dialog_eeschema_options.cpp index c6b0f34c87..35c68c161a 100644 --- a/eeschema/dialogs/dialog_eeschema_options.cpp +++ b/eeschema/dialogs/dialog_eeschema_options.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2009 Wayne Stambaugh - * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2016 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 @@ -30,9 +30,23 @@ #include #include +#include +#include "../schframe.h" +#include "hotkeys.h" #include "wx/settings.h" +/** + * Menu IDs for the import/export menu. + */ +enum IMP_EXP_MENU_IDS +{ + ID_IMPORT_PREFS = 2001, + ID_EXPORT_PREFS, + ID_IMPORT_HOTKEYS, + ID_EXPORT_HOTKEYS +}; + DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : DIALOG_EESCHEMA_OPTIONS_BASE( parent ) { @@ -50,12 +64,65 @@ DIALOG_EESCHEMA_OPTIONS::DIALOG_EESCHEMA_OPTIONS( wxWindow* parent ) : m_fieldGrid->AutoSizeColLabelSize( i ); } + // Embed the hotkeys list + HOTKEYS_SECTIONS sections = HOTKEY_LIST_CTRL::Sections( g_Eeschema_Hokeys_Descr ); + m_hotkeyListCtrl = new HOTKEY_LIST_CTRL( m_controlsPanel, sections ); + // Insert after the "Hotkeys:" label + m_controlsSizer->Insert( 1, m_hotkeyListCtrl, wxSizerFlags( 1 ).Expand().Border( wxALL, 5 ) ); + Layout(); + + // Bind event for the import/export menu + Bind( wxEVT_MENU, &DIALOG_EESCHEMA_OPTIONS::OnMenu, this ); + // Make sure we select the first tab of the options tab page m_notebook->SetSelection( 0 ); } +void DIALOG_EESCHEMA_OPTIONS::OnImpExpClick( wxCommandEvent& aEvent ) +{ + wxMenu menu; + + menu.Append( ID_IMPORT_PREFS, _( "Import Preferences" ) ); + menu.Append( ID_EXPORT_PREFS, _( "Export Preferences" ) ); + + menu.Append( wxID_SEPARATOR ); + menu.Append( ID_IMPORT_HOTKEYS, _( "Import Hotkeys" ) ); + menu.Append( ID_EXPORT_HOTKEYS, _( "Export Hotkeys" ) ); + + int btnw, btnh; + m_btnImpExp->GetSize( &btnw, &btnh ); + m_btnImpExp->PopupMenu( &menu, wxPoint( 0, btnh ) ); +} + + +void DIALOG_EESCHEMA_OPTIONS::OnMenu( wxCommandEvent& aEvent ) +{ + switch( aEvent.GetId() ) + { + case ID_IMPORT_PREFS: + aEvent.SetId( ID_CONFIG_READ ); + static_cast( m_parent )->Process_Config( aEvent ); + break; + case ID_EXPORT_PREFS: + aEvent.SetId( ID_CONFIG_SAVE ); + static_cast( m_parent )->Process_Config( aEvent ); + break; + case ID_IMPORT_HOTKEYS: + aEvent.SetId( ID_PREFERENCES_HOTKEY_IMPORT_CONFIG ); + static_cast( m_parent )->Process_Config( aEvent ); + break; + case ID_EXPORT_HOTKEYS: + aEvent.SetId( ID_PREFERENCES_HOTKEY_EXPORT_CONFIG ); + static_cast( m_parent )->Process_Config( aEvent ); + break; + default: + wxFAIL_MSG("Unexpected menu ID"); + } +} + + void DIALOG_EESCHEMA_OPTIONS::SetUnits( const wxArrayString& units, int select ) { wxASSERT( units.GetCount() > 0 @@ -217,6 +284,9 @@ bool DIALOG_EESCHEMA_OPTIONS::TransferDataToWindow() if( !wxDialog::TransferDataToWindow() ) return false; + if( !m_hotkeyListCtrl->TransferDataToControl() ) + return false; + m_fieldGrid->Freeze(); if( m_fieldGrid->GetNumberRows() ) m_fieldGrid->DeleteRows( 0, m_fieldGrid->GetNumberRows() ); @@ -247,6 +317,12 @@ bool DIALOG_EESCHEMA_OPTIONS::TransferDataToWindow() bool DIALOG_EESCHEMA_OPTIONS::TransferDataFromWindow() { + if( ! wxDialog::TransferDataFromWindow() ) + return false; + + if( !m_hotkeyListCtrl->TransferDataFromControl() ) + return false; + for( int row = 0; row < m_fieldGrid->GetNumberRows(); ++row ) { templateFields[row].m_Name = m_fieldGrid->GetCellValue( row, 0 ); diff --git a/eeschema/dialogs/dialog_eeschema_options.h b/eeschema/dialogs/dialog_eeschema_options.h index 828d1b04bd..2235b0e115 100644 --- a/eeschema/dialogs/dialog_eeschema_options.h +++ b/eeschema/dialogs/dialog_eeschema_options.h @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2009 Wayne Stambaugh - * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2016 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 @@ -34,12 +34,28 @@ #include #include +class HOTKEY_LIST_CTRL; + class DIALOG_EESCHEMA_OPTIONS : public DIALOG_EESCHEMA_OPTIONS_BASE { protected: + HOTKEY_LIST_CTRL* m_hotkeyListCtrl; + /** @brief The template fieldnames for this dialog */ TEMPLATE_FIELDNAMES templateFields; + /** + * Function OnImpExpClick + * Display the settings import/export menu. + */ + void OnImpExpClick( wxCommandEvent& aEvent ); + + /** + * Function OnMenu + * Handle menu clicks (for import/export) + */ + void OnMenu( wxCommandEvent& aEvent ); + /** * Function OnAddButtonClick * Process the wxWidgets @a event produced when the user presses the Add buton for the diff --git a/eeschema/dialogs/dialog_eeschema_options_base.cpp b/eeschema/dialogs/dialog_eeschema_options_base.cpp index b744d8dd39..14477efa80 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.cpp +++ b/eeschema/dialogs/dialog_eeschema_options_base.cpp @@ -15,6 +15,7 @@ BEGIN_EVENT_TABLE( DIALOG_EESCHEMA_OPTIONS_BASE, DIALOG_SHIM ) EVT_CHECKBOX( xwID_ANY, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnMiddleBtnPanEnbl ) EVT_BUTTON( wxID_ADD_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnAddButtonClick ) EVT_BUTTON( wxID_DELETE_FIELD, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnDeleteButtonClick ) + EVT_BUTTON( ID_IMP_EXP, DIALOG_EESCHEMA_OPTIONS_BASE::_wxFB_OnImpExpClick ) END_EVENT_TABLE() DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) @@ -117,7 +118,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_panel5->SetSizer( bSizer82 ); m_panel5->Layout(); bSizer82->Fit( m_panel5 ); - m_notebook->AddPage( m_panel5, _("Display"), true ); + m_notebook->AddPage( m_panel5, _("Display"), false ); m_panel3 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer8; bSizer8 = new wxBoxSizer( wxVERTICAL ); @@ -233,7 +234,7 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_panel3->Layout(); bSizer8->Fit( m_panel3 ); m_notebook->AddPage( m_panel3, _("Editing"), false ); - m_panel4 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_controlsPanel = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer81; bSizer81 = new wxBoxSizer( wxVERTICAL ); @@ -248,35 +249,38 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx bSizer81->Add( fgSizer31, 0, wxALL|wxEXPAND, 5 ); - wxBoxSizer* bSizer91; - bSizer91 = new wxBoxSizer( wxVERTICAL ); + m_controlsSizer = new wxBoxSizer( wxVERTICAL ); - m_checkEnableZoomCenter = new wxCheckBox( m_panel4, wxID_ANY, _("Cen&ter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText20 = new wxStaticText( m_controlsPanel, wxID_ANY, _("Hotkeys:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText20->Wrap( -1 ); + m_controlsSizer->Add( m_staticText20, 0, wxALL, 5 ); + + m_checkEnableZoomCenter = new wxCheckBox( m_controlsPanel, wxID_ANY, _("Cen&ter and warp cursor on zoom"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkEnableZoomCenter->SetToolTip( _("Keep the cursor at its current location when zooming") ); - bSizer91->Add( m_checkEnableZoomCenter, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); + m_controlsSizer->Add( m_checkEnableZoomCenter, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); - m_checkEnableMiddleButtonPan = new wxCheckBox( m_panel4, xwID_ANY, _("&Use middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkEnableMiddleButtonPan = new wxCheckBox( m_controlsPanel, xwID_ANY, _("&Use middle mouse button to pan"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkEnableMiddleButtonPan->SetToolTip( _("Use middle mouse button dragging to pan") ); - bSizer91->Add( m_checkEnableMiddleButtonPan, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); + m_controlsSizer->Add( m_checkEnableMiddleButtonPan, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); - m_checkMiddleButtonPanLimited = new wxCheckBox( m_panel4, wxID_ANY, _("&Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkMiddleButtonPanLimited = new wxCheckBox( m_controlsPanel, wxID_ANY, _("&Limit panning to scroll size"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkMiddleButtonPanLimited->SetToolTip( _("Middle mouse button panning limited by current scrollbar size") ); - bSizer91->Add( m_checkMiddleButtonPanLimited, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); + m_controlsSizer->Add( m_checkMiddleButtonPanLimited, 0, wxTOP|wxRIGHT|wxLEFT, 3 ); - m_checkAutoPan = new wxCheckBox( m_panel4, wxID_ANY, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer91->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); + m_checkAutoPan = new wxCheckBox( m_controlsPanel, wxID_ANY, _("&Pan while moving object"), wxDefaultPosition, wxDefaultSize, 0 ); + m_controlsSizer->Add( m_checkAutoPan, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 3 ); - bSizer81->Add( bSizer91, 0, wxALL|wxEXPAND, 5 ); + bSizer81->Add( m_controlsSizer, 1, wxALL|wxEXPAND, 5 ); - m_panel4->SetSizer( bSizer81 ); - m_panel4->Layout(); - bSizer81->Fit( m_panel4 ); - m_notebook->AddPage( m_panel4, _("Co&ntrols"), false ); + m_controlsPanel->SetSizer( bSizer81 ); + m_controlsPanel->Layout(); + bSizer81->Fit( m_controlsPanel ); + m_notebook->AddPage( m_controlsPanel, _("Co&ntrols"), false ); m_panel2 = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panel2->SetToolTip( _("User defined field names for schematic components. ") ); @@ -342,10 +346,16 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_panel2->SetSizer( bSizer6 ); m_panel2->Layout(); bSizer6->Fit( m_panel2 ); - m_notebook->AddPage( m_panel2, _("Default &Fields"), false ); + m_notebook->AddPage( m_panel2, _("Default &Fields"), true ); bOptionsSizer->Add( m_notebook, 1, wxALL|wxEXPAND, 5 ); + wxBoxSizer* bSizer12; + bSizer12 = new wxBoxSizer( wxHORIZONTAL ); + + m_btnImpExp = new wxButton( this, ID_IMP_EXP, _("Import/Export..."), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer12->Add( m_btnImpExp, 0, wxALL, 5 ); + m_sdbSizer = new wxStdDialogButtonSizer(); m_sdbSizerOK = new wxButton( this, wxID_OK ); m_sdbSizer->AddButton( m_sdbSizerOK ); @@ -353,7 +363,10 @@ DIALOG_EESCHEMA_OPTIONS_BASE::DIALOG_EESCHEMA_OPTIONS_BASE( wxWindow* parent, wx m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - bOptionsSizer->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 6 ); + bSizer12->Add( m_sdbSizer, 1, wxALL|wxEXPAND, 5 ); + + + bOptionsSizer->Add( bSizer12, 0, wxEXPAND, 5 ); mainSizer->Add( bOptionsSizer, 1, wxEXPAND, 12 ); diff --git a/eeschema/dialogs/dialog_eeschema_options_base.fbp b/eeschema/dialogs/dialog_eeschema_options_base.fbp index 7a24be7c2f..4e6d1131e2 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.fbp +++ b/eeschema/dialogs/dialog_eeschema_options_base.fbp @@ -106,7 +106,7 @@ 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -184,11 +184,11 @@ - + Display - 1 - + 0 + 1 1 1 @@ -262,16 +262,16 @@ - + bSizer82 wxVERTICAL none - + 5 wxALL|wxEXPAND 0 - + 3 wxBOTH 0,1,2 @@ -1675,11 +1675,11 @@ - + Editing 0 - + 1 1 1 @@ -1753,16 +1753,16 @@ - + bSizer8 wxVERTICAL none - + 5 wxALL|wxEXPAND 0 - + 3 wxBOTH 0,1,2 @@ -3069,11 +3069,11 @@ - + 3 wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT 0 - + 1 1 1 @@ -3767,11 +3767,11 @@ - + Co&ntrols 0 - + 1 1 1 @@ -3806,7 +3806,7 @@ 0 1 - m_panel4 + m_controlsPanel 1 @@ -3845,16 +3845,16 @@ - + bSizer81 wxVERTICAL none - + 5 wxALL|wxEXPAND 0 - + 3 wxBOTH 0,1,2 @@ -3871,12 +3871,95 @@ 5 wxALL|wxEXPAND - 0 + 1 - bSizer91 + m_controlsSizer wxVERTICAL - none + protected + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Hotkeys: + + 0 + + + 0 + + 1 + m_staticText20 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + 3 wxTOP|wxRIGHT|wxLEFT @@ -4234,11 +4317,11 @@ - + Default &Fields - 0 - + 1 + 1 1 1 @@ -4312,25 +4395,25 @@ - + bSizer6 wxHORIZONTAL none - + 5 wxEXPAND 1 - + bSizer11 wxVERTICAL none - + 5 wxALL|wxEXPAND 1 - + 1 1 1 @@ -4471,7 +4554,7 @@ - + 5 wxEXPAND 0 @@ -4673,30 +4756,129 @@ - - 6 - wxALL|wxEXPAND + + 5 + wxEXPAND 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 + - m_sdbSizer - protected - - - - - - - - + bSizer12 + wxHORIZONTAL + none + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_IMP_EXP + Import/Export... + + 0 + + + 0 + + 1 + m_btnImpExp + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnImpExpClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizer + protected + + + + + + + + + + diff --git a/eeschema/dialogs/dialog_eeschema_options_base.h b/eeschema/dialogs/dialog_eeschema_options_base.h index 585d4425c4..c55066cc16 100644 --- a/eeschema/dialogs/dialog_eeschema_options_base.h +++ b/eeschema/dialogs/dialog_eeschema_options_base.h @@ -50,6 +50,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM void _wxFB_OnMiddleBtnPanEnbl( wxCommandEvent& event ){ OnMiddleBtnPanEnbl( event ); } void _wxFB_OnAddButtonClick( wxCommandEvent& event ){ OnAddButtonClick( event ); } void _wxFB_OnDeleteButtonClick( wxCommandEvent& event ){ OnDeleteButtonClick( event ); } + void _wxFB_OnImpExpClick( wxCommandEvent& event ){ OnImpExpClick( event ); } protected: @@ -58,7 +59,8 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM ID_M_SPINAUTOSAVEINTERVAL = 1000, xwID_ANY, wxID_ADD_FIELD, - wxID_DELETE_FIELD + wxID_DELETE_FIELD, + ID_IMP_EXP }; wxNotebook* m_notebook; @@ -103,7 +105,9 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxCheckBox* m_checkAutoplaceFields; wxCheckBox* m_checkAutoplaceJustify; wxCheckBox* m_checkAutoplaceAlign; - wxPanel* m_panel4; + wxPanel* m_controlsPanel; + wxBoxSizer* m_controlsSizer; + wxStaticText* m_staticText20; wxCheckBox* m_checkEnableZoomCenter; wxCheckBox* m_checkEnableMiddleButtonPan; wxCheckBox* m_checkMiddleButtonPanLimited; @@ -112,6 +116,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM wxGrid* m_fieldGrid; wxButton* addFieldButton; wxButton* deleteFieldButton; + wxButton* m_btnImpExp; wxStdDialogButtonSizer* m_sdbSizer; wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; @@ -122,6 +127,7 @@ class DIALOG_EESCHEMA_OPTIONS_BASE : public DIALOG_SHIM virtual void OnMiddleBtnPanEnbl( wxCommandEvent& event ) { event.Skip(); } virtual void OnAddButtonClick( wxCommandEvent& event ) { event.Skip(); } virtual void OnDeleteButtonClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnImpExpClick( wxCommandEvent& event ) { event.Skip(); } public: diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index 0baaa1e5b3..2836cdc627 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2009-2014 Wayne Stambaugh - * Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2016 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 @@ -398,24 +398,6 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() // Language submenu Pgm().AddMenuLanguageList( preferencesMenu ); - // Hotkey submenu - AddHotkeyConfigMenu( preferencesMenu ); - - // Separator - preferencesMenu->AppendSeparator(); - - AddMenuItem( preferencesMenu, - ID_CONFIG_SAVE, - _( "&Save Preferences" ), - _( "Save application preferences" ), - KiBitmap( save_setup_xpm ) ); - - AddMenuItem( preferencesMenu, - ID_CONFIG_READ, - _( "Load Prefe&rences" ), - _( "Load application preferences" ), - KiBitmap( read_setup_xpm ) ); - // Menu Tools: wxMenu* toolsMenu = new wxMenu; diff --git a/include/dialog_hotkeys_editor.h b/include/dialog_hotkeys_editor.h index c0da68277d..072a7478dd 100644 --- a/include/dialog_hotkeys_editor.h +++ b/include/dialog_hotkeys_editor.h @@ -64,6 +64,8 @@ class DIALOG_HOTKEY_CLIENT_DATA; class HOTKEY_LIST_CTRL : public wxTreeListCtrl { public: + static HOTKEYS_SECTIONS Sections( EDA_HOTKEY_CONFIG* aHotkeys ); + HOTKEY_LIST_CTRL( wxWindow* aParent, const HOTKEYS_SECTIONS& aSections ); ~HOTKEY_LIST_CTRL() {};