KiCad PCB EDA Suite
Loading...
Searching...
No Matches
project_local_settings.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jon Evans <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#ifndef KICAD_PROJECT_LOCAL_SETTINGS_H
23#define KICAD_PROJECT_LOCAL_SETTINGS_H
24
25#include <layer_ids.h>
31
32class PROJECT;
33
40
41
55{
56public:
57 PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxString& aFilename );
58
60
61 bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
62
63 bool SaveAs( const wxString& aDirectory, const wxString& aFile );
64
65 bool SaveToFile( const wxString& aDirectory = "", bool aForce = false ) override;
66
67 void SetProject( PROJECT* aProject ) { m_project = aProject; }
68
69 const PROJECT* GetOwningProject() const override { return m_project; }
70
71 void SaveFileState( const wxString& aFileName, const WINDOW_SETTINGS* aWindowCfg, bool aOpen );
72
73 const PROJECT_FILE_STATE* GetFileState( const wxString& aFileName );
74
75 void ClearFileState();
76
80 bool ShouldAutoSave() const { return !m_wasMigrated && !m_isFutureFormat; }
81
82protected:
83 wxString getFileExt() const override
84 {
86 }
87
88 wxString getLegacyFileExt() const override
89 {
90 return wxT( "NO_SUCH_FILE_EXTENSION" );
91 }
92
93public:
94
98
100 std::vector<PROJECT_FILE_STATE> m_files;
101
102 std::vector<wxString> m_OpenJobSets;
103
107
110
113
116
119
122
125
128
131
134
137
144
149 std::vector<wxString> m_HiddenNets;
150 std::set<wxString> m_HiddenNetclasses;
151
155
157 std::vector<wxString> m_SchHierarchyCollapsed;
158
159 // Upstream git repo info
162 wxString m_GitSSHKey;
163
166
167private:
170
172};
173
174#endif
HIGH_CONTRAST_MODE
Determine how inactive layers should be displayed.
Helper for storing and iterating over GAL_LAYER_IDs.
Definition layer_ids.h:401
bool m_isFutureFormat
Set to true if this settings is loaded from a file with a newer schema version than is known.
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
LSET is a set of PCB_LAYER_IDs.
Definition lset.h:37
bool m_PrototypeZoneFill
Whether Zone fill should always be solid for performance with large boards.
wxString getFileExt() const override
LSET m_VisibleLayers
Board settings.
SCH_SELECTION_FILTER_OPTIONS m_SchSelectionFilter
std::vector< wxString > m_SchHierarchyCollapsed
Collapsed nodes in the schematic hierarchy navigator.
wxString getLegacyFileExt() const override
bool m_GitIntegrationDisabled
If true, KiCad will not use Git integration for this project even if a .git directory exists.
double m_PadOpacity
Opacity override for SMD pads and PTH.
void SetProject(PROJECT *aProject)
std::vector< PROJECT_FILE_STATE > m_files
Project scope.
double m_ViaOpacity
Opacity override for all types of via.
PANEL_NET_INSPECTOR_SETTINGS m_NetInspectorPanel
The state of the net inspector panel.
PCB_SELECTION_FILTER_OPTIONS m_PcbSelectionFilter
State of the selection filter widgets.
wxString m_ActiveLayerPreset
The name of a LAYER_PRESET that is currently activated (or blank if none)
const PROJECT * GetOwningProject() const override
Project-located settings override this to report the project they belong to so their save path is res...
double m_TrackOpacity
Opacity override for all tracks.
PROJECT * m_project
A link to the owning project.
double m_ZoneOpacity
Opacity override for filled zones.
bool m_AutoTrackWidth
The current setting for whether to automatically adjust track widths to match.
ZONE_DISPLAY_MODE m_ZoneDisplayMode
How zones are drawn.
double m_ShapeOpacity
Opacity override for graphic shapes.
PCB_LAYER_ID m_ActiveLayer
The current (active) board layer for editing.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
The current contrast mode.
NET_COLOR_MODE m_NetColorMode
The current net color mode.
std::vector< wxString > m_OpenJobSets
GAL_SET m_VisibleItems
The GAL layers (aka items) that are turned on for viewing (.
std::vector< wxString > m_HiddenNets
A list of netnames that have been manually hidden in the board editor.
PROJECT_LOCAL_SETTINGS(PROJECT *aProject, const wxString &aFilename)
std::set< wxString > m_HiddenNetclasses
double m_ImageOpacity
Opacity override for user images.
Container for project specific data.
Definition project.h:62
static const std::string ProjectLocalSettingsFileExtension
#define KICOMMON_API
Definition kicommon.h:27
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
Persisted state for the net inspector panel.
This file contains data structures that are saved in the project file or project local settings file ...
struct WINDOW_STATE window
Store the common settings that are saved and loaded for each window / frame.
Store the window positioning/state.
Definition of file extensions used in Kicad.