You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.7 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
  5. * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software: you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation, either version 3 of the License, or (at your
  10. * option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef FOOTPRINT_EDITOR_SETTINGS_H_
  21. #define FOOTPRINT_EDITOR_SETTINGS_H_
  22. #include <board_design_settings.h>
  23. #include <settings/app_settings.h>
  24. #include <pcbnew_settings.h>
  25. #include <project/board_project_settings.h>
  26. class FOOTPRINT_EDITOR_SETTINGS : public PCB_VIEWERS_SETTINGS_BASE
  27. {
  28. public:
  29. struct AUI_PANELS
  30. {
  31. int appearance_panel_tab;
  32. int right_panel_width;
  33. bool show_layer_manager;
  34. bool show_properties;
  35. int properties_panel_width;
  36. float properties_splitter;
  37. };
  38. struct USER_GRID
  39. {
  40. double size_x;
  41. double size_y;
  42. int units;
  43. };
  44. FOOTPRINT_EDITOR_SETTINGS();
  45. virtual ~FOOTPRINT_EDITOR_SETTINGS() {}
  46. virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
  47. /// Only some of these settings are actually used for footprint editing
  48. // TODO: factor out the relevant stuff so the whole BDS doesn't have to be here
  49. BOARD_DESIGN_SETTINGS m_DesignSettings;
  50. // Only the magneticPads element is used
  51. MAGNETIC_SETTINGS m_MagneticItems;
  52. PCB_DISPLAY_OPTIONS m_Display;
  53. AUI_PANELS m_AuiPanels;
  54. int m_LibrarySortMode;
  55. USER_GRID m_UserGrid;
  56. bool m_PolarCoords;
  57. bool m_DisplayInvertXAxis;
  58. bool m_DisplayInvertYAxis;
  59. EDA_ANGLE m_RotationAngle;
  60. bool m_Use45Limit;
  61. ARC_EDIT_MODE m_ArcEditMode;
  62. int m_LibWidth;
  63. wxString m_LastExportPath;
  64. wxString m_FootprintTextShownColumns;
  65. PCB_SELECTION_FILTER_OPTIONS m_SelectionFilter;
  66. std::vector<LAYER_PRESET> m_LayerPresets;
  67. wxString m_ActiveLayerPreset;
  68. protected:
  69. virtual std::string getLegacyFrameName() const override { return "ModEditFrame"; }
  70. private:
  71. bool migrateSchema0to1();
  72. bool migrateSchema2To3();
  73. bool migrateSchema3To4();
  74. bool migrateSchema4To5();
  75. };
  76. #endif