From b3e30e50c8bc003f239363fe8ad33af993b358c0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 10 Jun 2019 23:27:34 +0100 Subject: [PATCH] Cleanup. --- eeschema/eeschema_config.cpp | 82 ++++++------------------------------ eeschema/sch_edit_frame.cpp | 3 -- eeschema/sch_edit_frame.h | 2 - include/id.h | 4 -- 4 files changed, 14 insertions(+), 77 deletions(-) diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 955cb47a88..757fdf8edf 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2014-2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2014-2019 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 @@ -21,26 +21,18 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -/** - * @file eeschema_config.cpp - */ - #include #include #include -#include #include #include #include #include -#include #include #include -#include #include #include #include -#include #include #include #include @@ -120,59 +112,13 @@ COLOR4D GetItemSelectedColor() } -// Color to draw items flagged invisible, in libedit (they are invisible -// in Eeschema +// Color to draw items flagged invisible, in libedit (they are invisible in Eeschema) COLOR4D GetInvisibleItemColor() { return COLOR4D( DARKGRAY ); } -void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event ) -{ - int id = event.GetId(); - wxFileName fn; - - switch( id ) - { - // JEY TODO: are these still active? - case ID_CONFIG_SAVE: - SaveProjectSettings( true ); - break; - - case ID_CONFIG_READ: - { - fn = g_RootSheet->GetScreen()->GetFileName(); - fn.SetExt( ProjectFileExtension ); - - wxFileDialog dlg( this, _( "Load Project File" ), fn.GetPath(), fn.GetFullName(), - ProjectFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); - - if( dlg.ShowModal() == wxID_CANCEL ) - break; - - wxString chosen = dlg.GetPath(); - - if( chosen == Prj().GetProjectFullName() ) - LoadProjectFile(); - else - { - // Read library list and library path list - Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, - GetProjectFileParameters() ); - // Read schematic editor setup - Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDIT, - GetProjectFileParameters() ); - } - } - break; - - default: - DisplayError( this, wxT( "SCH_EDIT_FRAME::Process_Config error" ) ); - } -} - - void SCH_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent, PANEL_HOTKEYS_EDITOR* aHotkeysPanel ) { @@ -307,8 +253,8 @@ const wxChar RescueNeverShowEntry[] = wxT( "RescueNeverShow" ); const wxChar AutoplaceFieldsEntry[] = wxT( "AutoplaceFields" ); const wxChar AutoplaceJustifyEntry[] = wxT( "AutoplaceJustify" ); const wxChar AutoplaceAlignEntry[] = wxT( "AutoplaceAlign" ); -static const wxChar MoveWarpsCursorEntry[] = wxT( "MoveWarpsCursor" ); -static const wxChar MoveTakesCursorAsOriginEntry[] = wxT( "MoveTakesCursorAsOrigin" ); +static const wxChar MoveWarpsCursorEntry[] = wxT( "MoveWarpsCursor" ); +static const wxChar MoveTakesCursorAsOriginEntry[] = wxT( "MoveTakesCursorAsOrigin" ); static const wxChar DragActionIsMoveEntry[] = wxT( "DragActionIsMove" ); static const wxChar DragAlwaysSelectsEntry[] = wxT( "DragAlwaysSelects" ); static const wxChar FootprintPreviewEntry[] = wxT( "FootprintPreview" ); @@ -361,18 +307,18 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings() &m_printSheetReference, true ) ); m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepXEntry, - &m_repeatStep.x, - DEFAULT_REPEAT_OFFSET_X, - -REPEAT_OFFSET_MAX, - REPEAT_OFFSET_MAX ) ); + &m_repeatStep.x, + DEFAULT_REPEAT_OFFSET_X, + -REPEAT_OFFSET_MAX, + REPEAT_OFFSET_MAX ) ); m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatStepYEntry, - &m_repeatStep.y, - DEFAULT_REPEAT_OFFSET_Y, - -REPEAT_OFFSET_MAX, - REPEAT_OFFSET_MAX ) ); + &m_repeatStep.y, + DEFAULT_REPEAT_OFFSET_Y, + -REPEAT_OFFSET_MAX, + REPEAT_OFFSET_MAX ) ); m_configSettings.push_back( new PARAM_CFG_INT( true, RepeatLabelIncrementEntry, - &m_repeatDeltaLabel, - DEFAULT_REPEAT_LABEL_INC, -10, +10 ) ); + &m_repeatDeltaLabel, + DEFAULT_REPEAT_LABEL_INC, -10, +10 ) ); return m_configSettings; } diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index c7e33ed7f3..4f4736a1a8 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -224,9 +224,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, SCH_EDIT_FRAME::DrawCurrentSheetToClipboard ) EVT_MENU( wxID_EXIT, SCH_EDIT_FRAME::OnExit ) - EVT_MENU( ID_CONFIG_SAVE, SCH_EDIT_FRAME::Process_Config ) - EVT_MENU( ID_CONFIG_READ, SCH_EDIT_FRAME::Process_Config ) - EVT_TOOL( ID_RESCUE_CACHED, SCH_EDIT_FRAME::OnRescueProject ) EVT_MENU( ID_REMAP_SYMBOLS, SCH_EDIT_FRAME::OnRemapSymbols ) diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index 045d5c528b..68e437489c 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -229,8 +229,6 @@ public: const wxString& GetPlotDirectoryName() const { return m_plotDirectoryName; } void SetPlotDirectoryName( const wxString& aDirName ) { m_plotDirectoryName = aDirName; } - void Process_Config( wxCommandEvent& event ); - /** * Return the project file parameter list for Eeschema. * diff --git a/include/id.h b/include/id.h index b1752f971f..3df039d970 100644 --- a/include/id.h +++ b/include/id.h @@ -83,10 +83,6 @@ enum main_id ID_SAVE_BOARD_AS, ID_AUTO_SAVE_TIMER, - ID_CONFIG_REQ, - ID_CONFIG_SAVE, - ID_CONFIG_READ, - // ID for menuitems used in our file history management, // when we do not use wxFILE_ID (restricted to 9 items) ID_FILE,