KiCad PCB EDA Suite
common_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 Jon Evans <jon@craftyjon.com>
5  * Copyright (C) 2020 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 
21 #ifndef _COMMON_SETTINGS_H
22 #define _COMMON_SETTINGS_H
23 
24 #include <settings/json_settings.h>
25 
26 
28 {
29  // WARNING: these are encoded as integers in the file, so don't change their values.
30  DRAG_ANY = -2,
32  SELECT,
33  ZOOM,
34  PAN,
35  NONE
36 };
37 
38 enum class ICON_THEME
39 {
40  LIGHT,
41  DARK,
42  AUTO
43 };
44 
45 
47 {
48 public:
49  struct APPEARANCE
50  {
51  double canvas_scale;
55  };
56 
57  struct AUTO_BACKUP
58  {
59  bool enabled;
64 
66  unsigned long long limit_total_size;
67  };
68 
69  struct ENVIRONMENT
70  {
72  std::map<std::string, wxString> vars;
73  };
74 
75  struct INPUT
76  {
77  bool auto_pan;
83 
87 
91 
95  };
96 
97  struct GRAPHICS
98  {
101  };
102 
103  struct SESSION
104  {
106  };
107 
108  struct SYSTEM
109  {
111  wxString editor_name;
113  wxString language;
114  wxString pdf_viewer_name;
116  wxString working_dir;
118  };
119 
121  {
122  int sash_pos;
123  };
124 
125  COMMON_SETTINGS();
126 
127  virtual ~COMMON_SETTINGS() {}
128 
129  virtual bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
130 
131 private:
132  bool migrateSchema0to1();
133  bool migrateSchema1to2();
134 
135 public:
137 
139 
141 
143 
145 
147 
149 
151 
152  // TODO: These may not want to be in common
153  wxString m_3DLibsUrl;
154 
156 };
157 
158 #endif
unsigned long long limit_total_size
Maximum total size of backups (bytes), 0 for unlimited.
MOUSE_DRAG_ACTION drag_left
wxString m_3DLibsDownloadPath
bool enabled
Automatically back up the project when files are saved.
AUTO_BACKUP m_Backup
APPEARANCE m_Appearance
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
ICON_THEME
MOUSE_DRAG_ACTION drag_right
MOUSE_DRAG_ACTION
NETCLASS_PANEL m_NetclassPanel
std::map< std::string, wxString > vars
virtual ~COMMON_SETTINGS()
ENVIRONMENT m_Env
int min_interval
Minimum time, in seconds, between subsequent backups.
bool backup_on_autosave
Trigger a backup on autosave.
int limit_daily_files
Maximum files to keep per day, 0 for unlimited.
MOUSE_DRAG_ACTION drag_middle
int limit_total_files
Maximum number of backup archives to retain.