mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-15 10:43:15 +02:00
When importing settings from a board with more copper layers and applying it to a board with less copper layers, if the user has ticked the checkbox "Layer settings", then KiCad will delete the inner copper layers. Only when the user clicks OK does it then warn that it found deleted items on inner layers. The message is too generic and comes after the layers have already been deleted. This Merge Request tries to address this by warning them early. The changes are: 1 - Added code to check if user is trying to import settings from a board with less copper layers than the current loaded board. This results in KiCad deleting inner copper layers. Now it presents a warning dialog that explains the current settings will result in deleted inner layers, and lets the user stop the import process before making any changes. 2 - Made "Import Settings" dialog disable "Import Settings" button until at least one import option checkbox is checked. 3 - Made "Select All" button on "Import Settings" dialog toggle between "Select All" and "Deselect All" on each click. Items 2&3 were added to improve the overall import settings usability experience. Fixes issue https://gitlab.com/kicad/code/kicad/-/issues/4904
77 lines
2.4 KiB
C++
77 lines
2.4 KiB
C++
/*
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
*
|
|
* Copyright (C) 2018 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
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, you may find one here:
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
*/
|
|
|
|
|
|
#ifndef KICAD_DIALOG_IMPORT_SETTINGS_H
|
|
#define KICAD_DIALOG_IMPORT_SETTINGS_H
|
|
|
|
#include "dialog_import_settings_base.h"
|
|
|
|
|
|
class PCB_EDIT_FRAME;
|
|
|
|
|
|
class DIALOG_IMPORT_SETTINGS : public DIALOG_IMPORT_SETTINGS_BASE
|
|
{
|
|
protected:
|
|
PCB_EDIT_FRAME* m_frame;
|
|
static wxString m_filePath;
|
|
|
|
private:
|
|
|
|
/**
|
|
* Stores state used to toggle button between "Select All" and "Deselect All"
|
|
*/
|
|
bool m_showSelectAllOnBtn;
|
|
|
|
public:
|
|
DIALOG_IMPORT_SETTINGS( wxWindow* aParent, PCB_EDIT_FRAME* aFrame );
|
|
|
|
void OnBrowseClicked( wxCommandEvent& event ) override;
|
|
void OnSelectAll( wxCommandEvent& event ) override;
|
|
void OnCheckboxClicked( wxCommandEvent& event ) override;
|
|
|
|
bool TransferDataToWindow() override;
|
|
bool TransferDataFromWindow() override;
|
|
|
|
/**
|
|
* Enables/Disables "Import Settings" button
|
|
*
|
|
* This dialog defaults to all import selections cleared, and the "Import
|
|
* Settings" button disabled. The user must check at least one of the import
|
|
* selection checkboxes for the "Import Settings" button to be enabled.
|
|
*
|
|
* @return bool - "Import Settings" button enable state
|
|
*/
|
|
bool UpdateImportSettingsButton();
|
|
|
|
/**
|
|
* Update "Select All" button label as appropriate
|
|
*/
|
|
void UpdateSelectAllButton();
|
|
|
|
wxString GetFilePath() { return m_filePath; }
|
|
};
|
|
|
|
#endif //KICAD_DIALOG_IMPORT_SETTINGS_H
|