Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
0e27f45f
Commit
0e27f45f
authored
Dec 16, 2011
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Encapsulate EDA_APP class.
parent
d4635805
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
493 additions
and
299 deletions
+493
-299
3d_frame.cpp
3d-viewer/3d_frame.cpp
+2
-2
basicframe.cpp
common/basicframe.cpp
+23
-25
drawframe.cpp
common/drawframe.cpp
+4
-4
drawpanel.cpp
common/drawpanel.cpp
+3
-3
eda_doc.cpp
common/eda_doc.cpp
+4
-12
edaappl.cpp
common/edaappl.cpp
+72
-40
gestfich.cpp
common/gestfich.cpp
+43
-16
projet_config.cpp
common/projet_config.cpp
+68
-66
cvframe.cpp
cvpcb/cvframe.cpp
+8
-8
dialog_cvpcb_config.cpp
cvpcb/dialogs/dialog_cvpcb_config.cpp
+1
-1
menubar.cpp
cvpcb/menubar.cpp
+27
-3
tool_cvpcb.cpp
cvpcb/tool_cvpcb.cpp
+1
-1
annotate_dialog.cpp
eeschema/dialogs/annotate_dialog.cpp
+1
-1
dialog_SVG_print.cpp
eeschema/dialogs/dialog_SVG_print.cpp
+1
-1
dialog_build_BOM.cpp
eeschema/dialogs/dialog_build_BOM.cpp
+1
-1
dialog_eeschema_config.cpp
eeschema/dialogs/dialog_eeschema_config.cpp
+1
-1
eeschema_config.cpp
eeschema/eeschema_config.cpp
+4
-4
libeditframe.cpp
eeschema/libeditframe.cpp
+4
-4
menubar.cpp
eeschema/menubar.cpp
+3
-3
netlist_control.cpp
eeschema/netlist_control.cpp
+30
-5
viewlib_frame.cpp
eeschema/viewlib_frame.cpp
+4
-4
dialog_print_using_printer.cpp
gerbview/dialogs/dialog_print_using_printer.cpp
+1
-1
gerbview_frame.cpp
gerbview/gerbview_frame.cpp
+2
-2
menubar.cpp
gerbview/menubar.cpp
+3
-3
select_layers_to_pcb.cpp
gerbview/select_layers_to_pcb.cpp
+2
-2
appl_wxstruct.h
include/appl_wxstruct.h
+99
-28
mainframe.cpp
kicad/mainframe.cpp
+8
-8
menubar.cpp
kicad/menubar.cpp
+5
-5
preferences.cpp
kicad/preferences.cpp
+34
-10
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+4
-4
dialog_SVG_print.cpp
pcbnew/dialogs/dialog_SVG_print.cpp
+2
-2
dialog_copper_zones.cpp
pcbnew/dialogs/dialog_copper_zones.cpp
+1
-1
dialog_freeroute_exchange.cpp
pcbnew/dialogs/dialog_freeroute_exchange.cpp
+4
-3
dialog_gendrill.cpp
pcbnew/dialogs/dialog_gendrill.cpp
+2
-2
dialog_pcbnew_config_libs_and_paths.cpp
pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp
+2
-4
dialog_print_for_modedit.cpp
pcbnew/dialogs/dialog_print_for_modedit.cpp
+1
-1
dialog_print_using_printer.cpp
pcbnew/dialogs/dialog_print_using_printer.cpp
+1
-1
edit.cpp
pcbnew/edit.cpp
+1
-1
export_vrml.cpp
pcbnew/export_vrml.cpp
+1
-1
librairi.cpp
pcbnew/librairi.cpp
+2
-2
menubar_pcbframe.cpp
pcbnew/menubar_pcbframe.cpp
+3
-3
pcbframe.cpp
pcbnew/pcbframe.cpp
+2
-2
pcbplot.cpp
pcbnew/pcbplot.cpp
+1
-1
zones_by_polygon.cpp
pcbnew/zones_by_polygon.cpp
+4
-4
zones_non_copper_type_functions.cpp
pcbnew/zones_non_copper_type_functions.cpp
+3
-3
No files found.
3d-viewer/3d_frame.cpp
View file @
0e27f45f
...
...
@@ -113,7 +113,7 @@ void EDA_3D_FRAME::OnCloseWindow( wxCloseEvent& Event )
void
EDA_3D_FRAME
::
GetSettings
()
{
wxString
text
;
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
// Current config used by application
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
// Current config used by application
if
(
config
)
{
...
...
@@ -140,7 +140,7 @@ void EDA_3D_FRAME::GetSettings()
void
EDA_3D_FRAME
::
SaveSettings
()
{
wxString
text
;
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
// Current config used by application
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
// Current config used by application
if
(
!
Config
)
return
;
...
...
common/basicframe.cpp
View file @
0e27f45f
...
...
@@ -100,10 +100,8 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* father,
EDA_BASE_FRAME
::~
EDA_BASE_FRAME
()
{
if
(
wxGetApp
().
m_HtmlCtrl
)
delete
wxGetApp
().
m_HtmlCtrl
;
wxGetApp
().
m_HtmlCtrl
=
NULL
;
if
(
wxGetApp
().
GetHtmlHelpController
()
)
wxGetApp
().
SetHtmlHelpController
(
NULL
);
delete
m_autoSaveTimer
;
...
...
@@ -174,7 +172,7 @@ void EDA_BASE_FRAME::LoadSettings()
int
Ypos_min
;
wxConfig
*
config
;
config
=
wxGetApp
().
m_EDA_Config
;
config
=
wxGetApp
().
GetSettings
()
;
int
maximized
=
0
;
...
...
@@ -219,7 +217,7 @@ void EDA_BASE_FRAME::SaveSettings()
wxString
text
;
wxConfig
*
config
;
config
=
wxGetApp
().
m_EDA_Config
;
config
=
wxGetApp
().
GetSettings
()
;
if
(
(
config
==
NULL
)
||
IsIconized
()
)
return
;
...
...
@@ -275,7 +273,7 @@ void EDA_BASE_FRAME::UpdateFileHistory( const wxString& FullFileName,
wxFileHistory
*
fileHistory
=
aFileHistory
;
if
(
fileHistory
==
NULL
)
fileHistory
=
&
wxGetApp
().
m_fileHistory
;
fileHistory
=
&
wxGetApp
().
GetFileHistory
()
;
fileHistory
->
AddFileToHistory
(
FullFileName
);
}
...
...
@@ -289,7 +287,7 @@ wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type,
wxFileHistory
*
fileHistory
=
aFileHistory
;
if
(
fileHistory
==
NULL
)
fileHistory
=
&
wxGetApp
().
m_fileHistory
;
fileHistory
=
&
wxGetApp
().
GetFileHistory
()
;
int
baseId
=
fileHistory
->
GetBaseId
();
...
...
@@ -321,28 +319,28 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
/* We have to get document for beginners,
* or the the full specific doc
* if event id is wxID_INDEX, we want the document for beginners.
* else the specific doc file (its name is in wxGetApp().
m_HelpFileName
)
* else the specific doc file (its name is in wxGetApp().
GetHelpFileName()
)
* The document for beginners is the same for all KiCad utilities
*/
if
(
event
.
GetId
()
==
wxID_INDEX
)
{
// Temporary change the help filename
wxString
tmp
=
wxGetApp
().
m_HelpFileName
;
wxString
tmp
=
wxGetApp
().
GetHelpFileName
()
;
// Search for "getting_started_in_kicad.pdf" or "Getting_Started_in_KiCad.pdf"
wxGetApp
().
m_HelpFileName
=
wxT
(
"getting_started_in_kicad.pdf"
);
wxGetApp
().
GetHelpFileName
()
=
wxT
(
"getting_started_in_kicad.pdf"
);
wxString
helpFile
=
wxGetApp
().
GetHelpFile
();
if
(
!
helpFile
)
{
// Try to find "Getting_Started_in_KiCad.pdf"
wxGetApp
().
m_HelpFileName
=
wxT
(
"Getting_Started_in_KiCad.pdf"
);
wxGetApp
().
GetHelpFileName
()
=
wxT
(
"Getting_Started_in_KiCad.pdf"
);
helpFile
=
wxGetApp
().
GetHelpFile
();
}
if
(
!
helpFile
)
{
msg
.
Printf
(
_
(
"Help file %s could not be found."
),
GetChars
(
wxGetApp
().
m_HelpFileName
)
);
GetChars
(
wxGetApp
().
GetHelpFileName
()
)
);
DisplayError
(
this
,
msg
);
}
else
...
...
@@ -350,26 +348,26 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
GetAssociatedDocument
(
this
,
helpFile
);
}
wxGetApp
().
m_HelpFileName
=
tmp
;
wxGetApp
().
SetHelpFileName
(
tmp
)
;
return
;
}
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
if
(
wxGetApp
().
m_HtmlCtrl
==
NULL
)
if
(
wxGetApp
().
GetHtmlHelpController
()
==
NULL
)
{
wxGetApp
().
InitOnLineHelp
();
}
if
(
wxGetApp
().
m_HtmlCtrl
)
if
(
wxGetApp
().
GetHtmlHelpController
()
)
{
wxGetApp
().
m_HtmlCtrl
->
DisplayContents
();
wxGetApp
().
m_HtmlCtrl
->
Display
(
wxGetApp
().
m_HelpFileName
);
wxGetApp
().
GetHtmlHelpController
()
->
DisplayContents
();
wxGetApp
().
GetHtmlHelpController
()
->
Display
(
wxGetApp
().
GetHelpFileName
()
);
}
else
{
msg
.
Printf
(
_
(
"Help file %s not found."
),
GetChars
(
wxGetApp
().
m_HelpFileName
)
);
msg
.
Printf
(
_
(
"Help file %s not found."
),
GetChars
(
wxGetApp
().
GetHelpFileName
()
)
);
DisplayError
(
this
,
msg
);
}
...
...
@@ -379,7 +377,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
if
(
!
helpFile
)
{
msg
.
Printf
(
_
(
"Help file %s could not be found."
),
GetChars
(
wxGetApp
().
m_HelpFileName
)
);
GetChars
(
wxGetApp
().
GetHelpFileName
()
)
);
DisplayError
(
this
,
msg
);
}
else
...
...
@@ -395,7 +393,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
void
EDA_BASE_FRAME
::
OnSelectPreferredEditor
(
wxCommandEvent
&
event
)
{
wxFileName
fn
=
wxGetApp
().
m_EditorName
;
wxFileName
fn
=
wxGetApp
().
GetEditorName
()
;
wxString
wildcard
(
wxT
(
"*"
)
);
#ifdef __WINDOWS__
...
...
@@ -411,11 +409,11 @@ void EDA_BASE_FRAME::OnSelectPreferredEditor( wxCommandEvent& event )
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
;
wxASSERT
(
wxGetApp
().
m_EDA_CommonConfig
);
wxASSERT
(
wxGetApp
().
GetCommonSettings
()
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_CommonConfig
;
wxGetApp
().
m_EditorName
=
dlg
.
GetPath
(
);
cfg
->
Write
(
wxT
(
"Editor"
),
wxGetApp
().
m_EditorName
);
wxConfig
*
cfg
=
wxGetApp
().
GetCommonSettings
()
;
wxGetApp
().
SetEditorName
(
dlg
.
GetPath
()
);
cfg
->
Write
(
wxT
(
"Editor"
),
wxGetApp
().
GetEditorName
()
);
}
...
...
common/drawframe.cpp
View file @
0e27f45f
...
...
@@ -829,9 +829,9 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
void
EDA_DRAW_FRAME
::
LoadSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_BASE_FRAME
::
LoadSettings
();
cfg
->
Read
(
m_FrameName
+
CursorShapeEntryKeyword
,
&
m_cursorShape
,
(
long
)
0
);
...
...
@@ -851,9 +851,9 @@ void EDA_DRAW_FRAME::LoadSettings()
void
EDA_DRAW_FRAME
::
SaveSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_BASE_FRAME
::
SaveSettings
();
cfg
->
Write
(
m_FrameName
+
CursorShapeEntryKeyword
,
m_cursorShape
);
...
...
common/drawpanel.cpp
View file @
0e27f45f
...
...
@@ -102,8 +102,8 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
m_mouseCaptureCallback
=
NULL
;
m_endMouseCaptureCallback
=
NULL
;
if
(
wxGetApp
().
m_EDA_Config
)
wxGetApp
().
m_EDA_Config
->
Read
(
wxT
(
"AutoPAN"
),
&
m_AutoPAN_Enable
,
true
);
if
(
wxGetApp
().
GetSettings
()
)
wxGetApp
().
GetSettings
()
->
Read
(
wxT
(
"AutoPAN"
),
&
m_AutoPAN_Enable
,
true
);
m_AutoPAN_Request
=
false
;
m_Block_Enable
=
false
;
...
...
@@ -123,7 +123,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
EDA_DRAW_PANEL
::~
EDA_DRAW_PANEL
()
{
wxGetApp
().
m_EDA_Config
->
Write
(
wxT
(
"AutoPAN"
),
m_AutoPAN_Enable
);
wxGetApp
().
GetSettings
()
->
Write
(
wxT
(
"AutoPAN"
),
m_AutoPAN_Enable
);
}
...
...
common/eda_doc.cpp
View file @
0e27f45f
...
...
@@ -16,25 +16,17 @@
void
EDA_APP
::
ReadPdfBrowserInfos
()
{
wxASSERT
(
m_
EDA_CommonConfig
!=
NULL
);
wxASSERT
(
m_
commonSettings
!=
NULL
);
m_PdfBrowserIsDefault
=
m_EDA_CommonConfig
->
Read
(
wxT
(
"PdfBrowserIsDefault"
),
true
);
m_PdfBrowser
=
m_EDA_CommonConfig
->
Read
(
wxT
(
"PdfBrowserName"
),
wxEmptyString
);
if
(
m_PdfBrowser
.
IsEmpty
()
)
m_PdfBrowserIsDefault
=
true
;
m_PdfBrowser
=
m_commonSettings
->
Read
(
wxT
(
"PdfBrowserName"
),
wxEmptyString
);
}
void
EDA_APP
::
WritePdfBrowserInfos
()
{
wxASSERT
(
m_EDA_CommonConfig
!=
NULL
);
if
(
m_PdfBrowser
.
IsEmpty
()
)
m_PdfBrowserIsDefault
=
true
;
wxASSERT
(
m_commonSettings
!=
NULL
);
m_EDA_CommonConfig
->
Write
(
wxT
(
"PdfBrowserIsDefault"
),
m_PdfBrowserIsDefault
);
m_EDA_CommonConfig
->
Write
(
wxT
(
"PdfBrowserName"
),
m_PdfBrowser
);
m_commonSettings
->
Write
(
wxT
(
"PdfBrowserName"
),
m_PdfBrowser
);
}
...
...
common/edaappl.cpp
View file @
0e27f45f
/***
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 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
*/
/**
* @file edaapl.cpp
*
* @brief
For the main application: init functions, and language selection
*
(locale handling)
*
**
/
* @brief For the main application: init functions, and language selection
* (locale handling)
*/
#include "fctsys.h"
#include "gr_basic.h"
...
...
@@ -246,15 +271,13 @@ static struct LANGUAGE_DESCR s_Language_List[] =
EDA_APP
::
EDA_APP
()
{
m_Checker
=
NULL
;
m_HtmlCtrl
=
NULL
;
m_EDA_Config
=
NULL
;
m_Env_Defined
=
false
;
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
m_PdfBrowserIsDefault
=
true
;
m_Checker
=
NULL
;
m_HtmlCtrl
=
NULL
;
m_settings
=
NULL
;
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
m_Locale
=
NULL
;
m_
ProjectConfig
=
NULL
;
m_
EDA_CommonConfig
=
NULL
;
m_
projectSettings
=
NULL
;
m_
commonSettings
=
NULL
;
}
...
...
@@ -263,13 +286,13 @@ EDA_APP::~EDA_APP()
SaveSettings
();
/* delete user datas */
if
(
m_
ProjectConfig
)
delete
m_
ProjectConfig
;
if
(
m_
projectSettings
)
delete
m_
projectSettings
;
if
(
m_
EDA_CommonConfig
)
delete
m_
EDA_CommonConfig
;
if
(
m_
commonSettings
)
delete
m_
commonSettings
;
delete
m_
EDA_Config
;
delete
m_
settings
;
if
(
m_Checker
)
delete
m_Checker
;
...
...
@@ -289,9 +312,9 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
* the environment variable KICAD (if exists) gives the kicad path:
* something like set KICAD=d:\kicad
*/
m_Env_
Defined
=
wxGetEnv
(
wxT
(
"KICAD"
),
&
m_KicadEnv
);
bool
is
Defined
=
wxGetEnv
(
wxT
(
"KICAD"
),
&
m_KicadEnv
);
if
(
m_Env_
Defined
)
// ensure m_KicadEnv ends by "/"
if
(
is
Defined
)
// ensure m_KicadEnv ends by "/"
{
m_KicadEnv
.
Replace
(
WIN_STRING_DIR_SEP
,
UNIX_STRING_DIR_SEP
);
...
...
@@ -313,10 +336,10 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
SetVendorName
(
wxT
(
"KiCad"
)
);
SetAppName
(
aName
.
Lower
()
);
SetTitle
(
aName
);
m_
EDA_Config
=
new
wxConfig
();
wxASSERT
(
m_
EDA_Config
!=
NULL
);
m_
EDA_CommonConfig
=
new
wxConfig
(
CommonConfigPath
);
wxASSERT
(
m_
EDA_CommonConfig
!=
NULL
);
m_
settings
=
new
wxConfig
();
wxASSERT
(
m_
settings
!=
NULL
);
m_
commonSettings
=
new
wxConfig
(
CommonConfigPath
);
wxASSERT
(
m_
commonSettings
!=
NULL
);
/* Install some image handlers, mainly for help */
wxImage
::
AddHandler
(
new
wxPNGHandler
);
...
...
@@ -332,7 +355,7 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
// Internationalization: loading the kicad suitable Dictionary
wxString
languageSel
;
m_
EDA_CommonConfig
->
Read
(
languageCfgKey
,
&
languageSel
);
m_
commonSettings
->
Read
(
languageCfgKey
,
&
languageSel
);
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
// Search for the current selection
...
...
@@ -356,6 +379,15 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
}
void
EDA_APP
::
SetHtmlHelpController
(
wxHtmlHelpController
*
aController
)
{
if
(
m_HtmlCtrl
)
delete
m_HtmlCtrl
;
m_HtmlCtrl
=
aController
;
}
void
EDA_APP
::
InitOnLineHelp
()
{
wxString
fullfilename
=
FindKicadHelpPath
();
...
...
@@ -369,7 +401,7 @@ void EDA_APP::InitOnLineHelp()
m_HtmlCtrl
=
new
wxHtmlHelpController
(
wxHF_TOOLBAR
|
wxHF_CONTENTS
|
wxHF_PRINT
|
wxHF_OPEN_FILES
/*| wxHF_SEARCH */
);
m_HtmlCtrl
->
UseConfig
(
m_
EDA_CommonConfig
);
m_HtmlCtrl
->
UseConfig
(
m_
commonSettings
);
m_HtmlCtrl
->
SetTitleFormat
(
wxT
(
"KiCad Help"
)
);
m_HtmlCtrl
->
AddBook
(
fullfilename
);
}
...
...
@@ -620,7 +652,7 @@ void EDA_APP::SetDefaultSearchPaths( void )
void
EDA_APP
::
GetSettings
(
bool
aReopenLastUsedDirectory
)
{
wxASSERT
(
m_
EDA_Config
!=
NULL
&&
m_EDA_CommonConfig
!=
NULL
);
wxASSERT
(
m_
settings
!=
NULL
&&
m_commonSettings
!=
NULL
);
wxString
Line
;
...
...
@@ -628,7 +660,7 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
m_HelpSize
.
y
=
400
;
wxString
languageSel
;
m_
EDA_CommonConfig
->
Read
(
languageCfgKey
,
&
languageSel
);
m_
commonSettings
->
Read
(
languageCfgKey
,
&
languageSel
);
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
// Search for the current selection
...
...
@@ -641,21 +673,21 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
}
}
m_EditorName
=
m_
EDA_CommonConfig
->
Read
(
wxT
(
"Editor"
)
);
m_EditorName
=
m_
commonSettings
->
Read
(
wxT
(
"Editor"
)
);
m_fileHistory
.
Load
(
*
m_
EDA_Config
);
m_fileHistory
.
Load
(
*
m_
settings
);
m_
EDA_Config
->
Read
(
wxT
(
"ShowPageLimits"
),
&
g_ShowPageLimits
);
m_
settings
->
Read
(
wxT
(
"ShowPageLimits"
),
&
g_ShowPageLimits
);
if
(
aReopenLastUsedDirectory
)
{
if
(
m_
EDA_Config
->
Read
(
wxT
(
"WorkingDir"
),
&
Line
)
&&
wxDirExists
(
Line
)
)
if
(
m_
settings
->
Read
(
wxT
(
"WorkingDir"
),
&
Line
)
&&
wxDirExists
(
Line
)
)
{
wxSetWorkingDirectory
(
Line
);
}
}
m_
EDA_Config
->
Read
(
wxT
(
"BgColor"
),
&
g_DrawBgColor
);
m_
settings
->
Read
(
wxT
(
"BgColor"
),
&
g_DrawBgColor
);
/* Load per-user search paths from settings file */
...
...
@@ -664,8 +696,8 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
while
(
1
)
{
upath
=
m_
EDA_CommonConfig
->
Read
(
wxString
::
Format
(
wxT
(
"LibraryPath%d"
),
i
),
wxT
(
""
)
);
upath
=
m_
commonSettings
->
Read
(
wxString
::
Format
(
wxT
(
"LibraryPath%d"
),
i
),
wxT
(
""
)
);
if
(
upath
.
IsSameAs
(
wxT
(
""
)
)
)
break
;
...
...
@@ -678,13 +710,13 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
void
EDA_APP
::
SaveSettings
()
{
wxASSERT
(
m_
EDA_Config
!=
NULL
);
m_
EDA_Config
->
Write
(
wxT
(
"ShowPageLimits"
),
g_ShowPageLimits
);
m_
EDA_Config
->
Write
(
wxT
(
"WorkingDir"
),
wxGetCwd
()
);
m_
EDA_Config
->
Write
(
wxT
(
"BgColor"
),
g_DrawBgColor
);
wxASSERT
(
m_
settings
!=
NULL
);
m_
settings
->
Write
(
wxT
(
"ShowPageLimits"
),
g_ShowPageLimits
);
m_
settings
->
Write
(
wxT
(
"WorkingDir"
),
wxGetCwd
()
);
m_
settings
->
Write
(
wxT
(
"BgColor"
),
g_DrawBgColor
);
/* Save the file history list */
m_fileHistory
.
Save
(
*
m_
EDA_Config
);
m_fileHistory
.
Save
(
*
m_
settings
);
}
...
...
@@ -734,7 +766,7 @@ bool EDA_APP::SetLanguage( bool first_time )
}
}
m_
EDA_CommonConfig
->
Write
(
languageCfgKey
,
languageSel
);
m_
commonSettings
->
Write
(
languageCfgKey
,
languageSel
);
}
// Test if floating point notation is working (bug in cross compilation, using wine)
...
...
common/gestfich.cpp
View file @
0e27f45f
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 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
*/
/**
* @file gestfich.cpp
* @brief Functions for file management
...
...
@@ -272,14 +297,14 @@ wxString FindKicadHelpPath()
bool
PathFound
=
false
;
/* find kicad/help/ */
tmp
=
wxGetApp
().
m_BinDir
;
tmp
=
wxGetApp
().
GetExecutablePath
()
;
if
(
tmp
.
Last
()
==
'/'
)
tmp
.
RemoveLast
();
FullPath
=
tmp
.
BeforeLast
(
'/'
);
// cd ..
FullPath
+=
wxT
(
"/doc/help/"
);
LocaleString
=
wxGetApp
().
m_Locale
->
GetCanonicalName
();
LocaleString
=
wxGetApp
().
GetLocale
()
->
GetCanonicalName
();
wxString
path_tmp
=
FullPath
;
#ifdef __WINDOWS__
...
...
@@ -292,9 +317,9 @@ wxString FindKicadHelpPath()
}
/* find kicad/help/ from environment variable KICAD */
if
(
!
PathFound
&&
wxGetApp
().
m_Env_Defined
)
if
(
!
PathFound
&&
wxGetApp
().
IsKicadEnvVariableDefined
()
)
{
FullPath
=
wxGetApp
().
m_KicadEnv
+
wxT
(
"/doc/help/"
);
FullPath
=
wxGetApp
().
GetKicadEnvVariable
()
+
wxT
(
"/doc/help/"
);
if
(
wxDirExists
(
FullPath
)
)
PathFound
=
true
;
...
...
@@ -352,7 +377,7 @@ wxString FindKicadFile( const wxString& shortname )
/* Test the presence of the file in the directory shortname of
* the KiCad binary path.
*/
FullFileName
=
wxGetApp
().
m_BinDir
+
shortname
;
FullFileName
=
wxGetApp
().
GetExecutablePath
()
+
shortname
;
if
(
wxFileExists
(
FullFileName
)
)
return
FullFileName
;
...
...
@@ -360,9 +385,9 @@ wxString FindKicadFile( const wxString& shortname )
/* Test the presence of the file in the directory shortname
* defined by the environment variable KiCad.
*/
if
(
wxGetApp
().
m_Env_Defined
)
if
(
wxGetApp
().
IsKicadEnvVariableDefined
()
)
{
FullFileName
=
wxGetApp
().
m_KicadEnv
+
shortname
;
FullFileName
=
wxGetApp
().
GetKicadEnvVariable
()
+
shortname
;
if
(
wxFileExists
(
FullFileName
)
)
return
FullFileName
;
...
...
@@ -416,22 +441,21 @@ wxString ReturnKicadDatasPath()
bool
PathFound
=
false
;
wxString
data_path
;
if
(
wxGetApp
().
m_Env_Defined
)
// Path defined by the KICAD environment variable.
if
(
wxGetApp
().
IsKicadEnvVariableDefined
()
)
// Path defined by the KICAD environment variable.
{
data_path
=
wxGetApp
().
m_KicadEnv
;
data_path
=
wxGetApp
().
GetKicadEnvVariable
()
;
PathFound
=
true
;
}
else
// Path of executables.
{
wxString
tmp
=
wxGetApp
().
m_BinDir
;
wxString
tmp
=
wxGetApp
().
GetExecutablePath
()
;
#ifdef __WINDOWS__
tmp
.
MakeLower
();
#endif
if
(
tmp
.
Contains
(
wxT
(
"kicad"
)
)
)
{
#ifdef __WINDOWS__
tmp
=
wxGetApp
().
m_BinDir
;
tmp
=
wxGetApp
().
GetExecutablePath
()
;
#endif
if
(
tmp
.
Last
()
==
'/'
)
tmp
.
RemoveLast
();
...
...
@@ -523,7 +547,7 @@ wxString& EDA_APP::GetEditorName()
if
(
!
editorname
.
IsEmpty
()
)
{
m_EditorName
=
editorname
;
m_
EDA_CommonConfig
->
Write
(
wxT
(
"Editor"
),
m_EditorName
);
m_
commonSettings
->
Write
(
wxT
(
"Editor"
),
m_EditorName
);
}
return
m_EditorName
;
...
...
@@ -539,10 +563,10 @@ bool OpenPDF( const wxString& file )
wxGetApp
().
ReadPdfBrowserInfos
();
if
(
!
wxGetApp
().
m_PdfBrowserIsDefault
)
// Run the preferred PDF Browser
if
(
!
wxGetApp
().
UseSystemPdfBrowser
()
)
// Run the preferred PDF Browser
{
AddDelimiterString
(
filename
);
command
=
wxGetApp
().
m_PdfBrowser
+
wxT
(
" "
)
+
filename
;
command
=
wxGetApp
().
GetPdfBrowserFileName
()
+
wxT
(
" "
)
+
filename
;
}
else
{
...
...
@@ -554,13 +578,15 @@ bool OpenPDF( const wxString& file )
success
=
filetype
->
GetOpenCommand
(
&
command
,
params
);
delete
filetype
;
#ifndef __WINDOWS__
// Bug ? under linux wxWidgets returns acroread as PDF viewer, even
// Bug ? under linux wxWidgets returns acroread as PDF viewer, even
if
// it does not exist.
if
(
command
.
StartsWith
(
wxT
(
"acroread"
)
)
)
// Workaround
success
=
false
;
#endif
if
(
success
&&
!
command
.
IsEmpty
()
)
{
success
=
ProcessExecute
(
command
);
...
...
@@ -576,6 +602,7 @@ bool OpenPDF( const wxString& file )
{
#ifndef __WINDOWS__
AddDelimiterString
(
filename
);
/* here is a list of PDF viewers candidates */
const
static
wxString
tries
[]
=
{
...
...
common/projet_config.cpp
View file @
0e27f45f
...
...
@@ -30,10 +30,10 @@ bool EDA_APP::ReCreatePrjConfig( const wxString& fileName,
wxString
defaultFileName
;
// Free old config file.
if
(
m_
ProjectConfig
)
if
(
m_
projectSettings
)
{
delete
m_
ProjectConfig
;
m_
ProjectConfig
=
NULL
;
delete
m_
projectSettings
;
m_
projectSettings
=
NULL
;
}
/* Check the file name does not a KiCad project extension.
...
...
@@ -56,9 +56,9 @@ bool EDA_APP::ReCreatePrjConfig( const wxString& fileName,
// Init local config filename
if
(
ForceUseLocalConfig
||
fn
.
FileExists
()
)
{
m_
ProjectConfig
=
new
wxFileConfig
(
wxEmptyString
,
wxEmptyString
,
fn
.
GetFullPath
(),
wxEmptyString
);
m_
ProjectConfig
->
DontCreateOnDemand
();
m_
projectSettings
=
new
wxFileConfig
(
wxEmptyString
,
wxEmptyString
,
fn
.
GetFullPath
(),
wxEmptyString
);
m_
projectSettings
->
DontCreateOnDemand
();
if
(
ForceUseLocalConfig
)
return
true
;
...
...
@@ -74,9 +74,9 @@ bool EDA_APP::ReCreatePrjConfig( const wxString& fileName,
int
version
=
-
1
;
int
def_version
=
0
;
m_
ProjectConfig
->
SetPath
(
GroupName
);
version
=
m_
ProjectConfig
->
Read
(
wxT
(
"version"
),
def_version
);
m_
ProjectConfig
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
m_
projectSettings
->
SetPath
(
GroupName
);
version
=
m_
projectSettings
->
Read
(
wxT
(
"version"
),
def_version
);
m_
projectSettings
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
if
(
version
>
0
)
{
...
...
@@ -84,7 +84,7 @@ bool EDA_APP::ReCreatePrjConfig( const wxString& fileName,
}
else
{
delete
m_
ProjectConfig
;
// Version incorrect
delete
m_
projectSettings
;
// Version incorrect
}
}
...
...
@@ -102,9 +102,9 @@ bool EDA_APP::ReCreatePrjConfig( const wxString& fileName,
}
// Create new project file using the default name.
m_
ProjectConfig
=
new
wxFileConfig
(
wxEmptyString
,
wxEmptyString
,
wxEmptyString
,
fn
.
GetFullPath
()
);
m_
ProjectConfig
->
DontCreateOnDemand
();
m_
projectSettings
=
new
wxFileConfig
(
wxEmptyString
,
wxEmptyString
,
wxEmptyString
,
fn
.
GetFullPath
()
);
m_
projectSettings
->
DontCreateOnDemand
();
return
false
;
}
...
...
@@ -122,30 +122,30 @@ void EDA_APP::WriteProjectConfig( const wxString& fileName,
/* Write time (especially to avoid bug wxFileConfig that writes the
* wrong item if declaration [xx] in first line (If empty group)
*/
m_
ProjectConfig
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
m_
projectSettings
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
msg
=
DateAndTime
();
m_
ProjectConfig
->
Write
(
wxT
(
"update"
),
msg
);
m_
projectSettings
->
Write
(
wxT
(
"update"
),
msg
);
msg
=
GetAppName
();
m_
ProjectConfig
->
Write
(
wxT
(
"last_client"
),
msg
);
m_
projectSettings
->
Write
(
wxT
(
"last_client"
),
msg
);
/* Save parameters */
m_
ProjectConfig
->
DeleteGroup
(
GroupName
);
// Erase all data
m_
ProjectConfig
->
Flush
();
m_
projectSettings
->
DeleteGroup
(
GroupName
);
// Erase all data
m_
projectSettings
->
Flush
();
m_
ProjectConfig
->
SetPath
(
GroupName
);
m_
ProjectConfig
->
Write
(
wxT
(
"version"
),
CONFIG_VERSION
);
m_
ProjectConfig
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
m_
projectSettings
->
SetPath
(
GroupName
);
m_
projectSettings
->
Write
(
wxT
(
"version"
),
CONFIG_VERSION
);
m_
projectSettings
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
for
(
;
List
!=
NULL
&&
*
List
!=
NULL
;
List
++
)
{
pt_cfg
=
*
List
;
if
(
pt_cfg
->
m_Group
)
m_
ProjectConfig
->
SetPath
(
pt_cfg
->
m_Group
);
m_
projectSettings
->
SetPath
(
pt_cfg
->
m_Group
);
else
m_
ProjectConfig
->
SetPath
(
GroupName
);
m_
projectSettings
->
SetPath
(
GroupName
);
if
(
pt_cfg
->
m_Setup
)
continue
;
...
...
@@ -153,17 +153,17 @@ void EDA_APP::WriteProjectConfig( const wxString& fileName,
if
(
pt_cfg
->
m_Type
==
PARAM_COMMAND_ERASE
)
// Erase all data
{
if
(
pt_cfg
->
m_Ident
)
m_
ProjectConfig
->
DeleteGroup
(
pt_cfg
->
m_Ident
);
m_
projectSettings
->
DeleteGroup
(
pt_cfg
->
m_Ident
);
}
else
{
pt_cfg
->
SaveParam
(
m_
ProjectConfig
);
pt_cfg
->
SaveParam
(
m_
projectSettings
);
}
}
m_
ProjectConfig
->
SetPath
(
UNIX_STRING_DIR_SEP
);
delete
m_
ProjectConfig
;
m_
ProjectConfig
=
NULL
;
m_
projectSettings
->
SetPath
(
UNIX_STRING_DIR_SEP
);
delete
m_
projectSettings
;
m_
projectSettings
=
NULL
;
}
...
...
@@ -176,25 +176,25 @@ void EDA_APP::WriteProjectConfig( const wxString& fileName,
/* Write date ( surtout pour eviter bug de wxFileConfig
* qui se trompe de rubrique si declaration [xx] en premiere ligne
* (en fait si groupe vide) */
m_
ProjectConfig
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
m_
projectSettings
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
m_
ProjectConfig
->
Write
(
wxT
(
"update"
),
DateAndTime
()
);
m_
ProjectConfig
->
Write
(
wxT
(
"last_client"
),
GetAppName
()
);
m_
projectSettings
->
Write
(
wxT
(
"update"
),
DateAndTime
()
);
m_
projectSettings
->
Write
(
wxT
(
"last_client"
),
GetAppName
()
);
/* Save parameters */
m_
ProjectConfig
->
DeleteGroup
(
GroupName
);
// Erase all data
m_
ProjectConfig
->
Flush
();
m_
projectSettings
->
DeleteGroup
(
GroupName
);
// Erase all data
m_
projectSettings
->
Flush
();
m_
ProjectConfig
->
SetPath
(
GroupName
);
m_
ProjectConfig
->
Write
(
wxT
(
"version"
),
CONFIG_VERSION
);
m_
ProjectConfig
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
m_
projectSettings
->
SetPath
(
GroupName
);
m_
projectSettings
->
Write
(
wxT
(
"version"
),
CONFIG_VERSION
);
m_
projectSettings
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
BOOST_FOREACH
(
const
PARAM_CFG_BASE
&
param
,
params
)
{
if
(
param
.
m_Group
)
m_
ProjectConfig
->
SetPath
(
param
.
m_Group
);
m_
projectSettings
->
SetPath
(
param
.
m_Group
);
else
m_
ProjectConfig
->
SetPath
(
GroupName
);
m_
projectSettings
->
SetPath
(
GroupName
);
if
(
param
.
m_Setup
)
continue
;
...
...
@@ -202,23 +202,23 @@ void EDA_APP::WriteProjectConfig( const wxString& fileName,
if
(
param
.
m_Type
==
PARAM_COMMAND_ERASE
)
// Erase all data
{
if
(
param
.
m_Ident
)
m_
ProjectConfig
->
DeleteGroup
(
param
.
m_Ident
);
m_
projectSettings
->
DeleteGroup
(
param
.
m_Ident
);
}
else
{
param
.
SaveParam
(
m_
ProjectConfig
);
param
.
SaveParam
(
m_
projectSettings
);
}
}
m_
ProjectConfig
->
SetPath
(
UNIX_STRING_DIR_SEP
);
delete
m_
ProjectConfig
;
m_
ProjectConfig
=
NULL
;
m_
projectSettings
->
SetPath
(
UNIX_STRING_DIR_SEP
);
delete
m_
projectSettings
;
m_
projectSettings
=
NULL
;
}
/**
* Function SaveCurrentSetupValues
* Save the current setup values in m_
EDA_Config
* Save the current setup values in m_
settings
* saved parameters are parameters that have the .m_Setup member set to true
* @param aList = array of PARAM_CFG_BASE pointers
*/
...
...
@@ -226,7 +226,7 @@ void EDA_APP::SaveCurrentSetupValues( PARAM_CFG_BASE** aList )
{
PARAM_CFG_BASE
*
pt_cfg
;
if
(
m_
EDA_Config
==
NULL
)
if
(
m_
settings
==
NULL
)
return
;
for
(
;
*
aList
!=
NULL
;
aList
++
)
...
...
@@ -238,11 +238,11 @@ void EDA_APP::SaveCurrentSetupValues( PARAM_CFG_BASE** aList )
if
(
pt_cfg
->
m_Type
==
PARAM_COMMAND_ERASE
)
// Erase all data
{
if
(
pt_cfg
->
m_Ident
)
m_
EDA_Config
->
DeleteGroup
(
pt_cfg
->
m_Ident
);
m_
settings
->
DeleteGroup
(
pt_cfg
->
m_Ident
);
}
else
{
pt_cfg
->
SaveParam
(
m_
EDA_Config
);
pt_cfg
->
SaveParam
(
m_
settings
);
}
}
}
...
...
@@ -250,7 +250,7 @@ void EDA_APP::SaveCurrentSetupValues( PARAM_CFG_BASE** aList )
void
EDA_APP
::
SaveCurrentSetupValues
(
const
PARAM_CFG_ARRAY
&
List
)
{
if
(
m_
EDA_Config
==
NULL
)
if
(
m_
settings
==
NULL
)
return
;
BOOST_FOREACH
(
const
PARAM_CFG_BASE
&
param
,
List
)
...
...
@@ -261,10 +261,12 @@ void EDA_APP::SaveCurrentSetupValues( const PARAM_CFG_ARRAY& List )
if
(
param
.
m_Type
==
PARAM_COMMAND_ERASE
)
// Erase all data
{
if
(
param
.
m_Ident
)
m_
EDA_Config
->
DeleteGroup
(
param
.
m_Ident
);
m_
settings
->
DeleteGroup
(
param
.
m_Ident
);
}
else
param
.
SaveParam
(
m_EDA_Config
);
{
param
.
SaveParam
(
m_settings
);
}
}
}
...
...
@@ -279,8 +281,8 @@ bool EDA_APP::ReadProjectConfig( const wxString& local_config_filename,
ReCreatePrjConfig
(
local_config_filename
,
GroupName
,
false
);
m_
ProjectConfig
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
timestamp
=
m_
ProjectConfig
->
Read
(
wxT
(
"update"
)
);
m_
projectSettings
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
timestamp
=
m_
projectSettings
->
Read
(
wxT
(
"update"
)
);
if
(
Load_Only_if_New
&&
(
!
timestamp
.
IsEmpty
()
)
&&
(
timestamp
==
m_CurrentOptionFileDateAndTime
)
)
...
...
@@ -307,18 +309,18 @@ bool EDA_APP::ReadProjectConfig( const wxString& local_config_filename,
pt_cfg
=
*
List
;
if
(
pt_cfg
->
m_Group
)
m_
ProjectConfig
->
SetPath
(
pt_cfg
->
m_Group
);
m_
projectSettings
->
SetPath
(
pt_cfg
->
m_Group
);
else
m_
ProjectConfig
->
SetPath
(
GroupName
);
m_
projectSettings
->
SetPath
(
GroupName
);
if
(
pt_cfg
->
m_Setup
)
continue
;
pt_cfg
->
ReadParam
(
m_
ProjectConfig
);
pt_cfg
->
ReadParam
(
m_
projectSettings
);
}
delete
m_
ProjectConfig
;
m_
ProjectConfig
=
NULL
;
delete
m_
projectSettings
;
m_
projectSettings
=
NULL
;
return
true
;
}
...
...
@@ -333,8 +335,8 @@ bool EDA_APP::ReadProjectConfig( const wxString& local_config_filename,
ReCreatePrjConfig
(
local_config_filename
,
GroupName
,
false
);
m_
ProjectConfig
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
timestamp
=
m_
ProjectConfig
->
Read
(
wxT
(
"update"
)
);
m_
projectSettings
->
SetPath
(
wxCONFIG_PATH_SEPARATOR
);
timestamp
=
m_
projectSettings
->
Read
(
wxT
(
"update"
)
);
if
(
Load_Only_if_New
&&
(
!
timestamp
.
IsEmpty
()
)
&&
(
timestamp
==
m_CurrentOptionFileDateAndTime
)
)
...
...
@@ -359,18 +361,18 @@ bool EDA_APP::ReadProjectConfig( const wxString& local_config_filename,
BOOST_FOREACH
(
const
PARAM_CFG_BASE
&
param
,
params
)
{
if
(
param
.
m_Group
)
m_
ProjectConfig
->
SetPath
(
param
.
m_Group
);
m_
projectSettings
->
SetPath
(
param
.
m_Group
);
else
m_
ProjectConfig
->
SetPath
(
GroupName
);
m_
projectSettings
->
SetPath
(
GroupName
);
if
(
param
.
m_Setup
)
continue
;
param
.
ReadParam
(
m_
ProjectConfig
);
param
.
ReadParam
(
m_
projectSettings
);
}
delete
m_
ProjectConfig
;
m_
ProjectConfig
=
NULL
;
delete
m_
projectSettings
;
m_
projectSettings
=
NULL
;
return
true
;
}
...
...
@@ -387,7 +389,7 @@ void EDA_APP::ReadCurrentSetupValues( PARAM_CFG_BASE** aList )
if
(
pt_cfg
->
m_Setup
==
false
)
continue
;
pt_cfg
->
ReadParam
(
m_
EDA_Config
);
pt_cfg
->
ReadParam
(
m_
settings
);
}
}
...
...
@@ -399,7 +401,7 @@ void EDA_APP::ReadCurrentSetupValues( const PARAM_CFG_ARRAY& List )
if
(
param
.
m_Setup
==
false
)
continue
;
param
.
ReadParam
(
m_
EDA_Config
);
param
.
ReadParam
(
m_
settings
);
}
}
...
...
cvpcb/cvframe.cpp
View file @
0e27f45f
...
...
@@ -185,7 +185,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
CVPCB_MAINFRAME
::~
CVPCB_MAINFRAME
()
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
)
{
...
...
@@ -199,9 +199,9 @@ CVPCB_MAINFRAME::~CVPCB_MAINFRAME()
void
CVPCB_MAINFRAME
::
LoadSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_BASE_FRAME
::
LoadSettings
();
cfg
->
Read
(
KeepCvpcbOpenEntry
,
&
m_KeepCvpcbOpen
,
true
);
...
...
@@ -212,9 +212,9 @@ void CVPCB_MAINFRAME::LoadSettings()
void
CVPCB_MAINFRAME
::
SaveSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_BASE_FRAME
::
SaveSettings
();
cfg
->
Write
(
KeepCvpcbOpenEntry
,
m_KeepCvpcbOpen
);
...
...
@@ -278,10 +278,10 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event )
}
// Close the help frame
if
(
wxGetApp
().
m_HtmlCtrl
)
if
(
wxGetApp
().
GetHtmlHelpController
()
)
{
if
(
wxGetApp
().
m_HtmlCtrl
->
GetFrame
()
)
// returns NULL if no help frame active
wxGetApp
().
m_HtmlCtrl
->
GetFrame
()
->
Close
(
true
);
if
(
wxGetApp
().
GetHtmlHelpController
()
->
GetFrame
()
)
// returns NULL if no help frame active
wxGetApp
().
GetHtmlHelpController
()
->
GetFrame
()
->
Close
(
true
);
}
if
(
m_NetlistFileName
.
IsOk
()
)
...
...
cvpcb/dialogs/dialog_cvpcb_config.cpp
View file @
0e27f45f
...
...
@@ -29,7 +29,7 @@ DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( CVPCB_MAINFRAME* parent ) :
fn
.
SetExt
(
ProjectFileExtension
);
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_CommonConfig
;
m_Config
=
wxGetApp
().
GetCommonSettings
()
;
Init
(
);
title
=
_
(
"Project file: "
)
+
fn
.
GetFullPath
();
...
...
cvpcb/menubar.cpp
View file @
0e27f45f
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2004-2011 KiCad Developers, see change_log.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
*/
/**
* @file cvpcb/menubar.cpp
* @brief (Re)Create the menubar for CvPcb
...
...
@@ -49,11 +73,11 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if
(
openRecentMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentMenu
);
openRecentMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
();
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
();
AddMenuItem
(
filesMenu
,
openRecentMenu
,
-
1
,
_
(
"Open &Recent"
),
_
(
"Open a recent opened netlist document"
),
...
...
cvpcb/tool_cvpcb.cpp
View file @
0e27f45f
...
...
@@ -39,7 +39,7 @@
void
CVPCB_MAINFRAME
::
ReCreateHToolbar
()
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
m_mainToolBar
!=
NULL
)
return
;
...
...
eeschema/dialogs/annotate_dialog.cpp
View file @
0e27f45f
...
...
@@ -54,7 +54,7 @@ DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent )
void
DIALOG_ANNOTATE
::
InitValues
()
/*********************************/
{
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
SetFocus
();
// needed to close dialog by escape key
if
(
m_Config
)
{
...
...
eeschema/dialogs/dialog_SVG_print.cpp
View file @
0e27f45f
...
...
@@ -61,7 +61,7 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) :
DIALOG_SVG_PRINT_base
(
parent
)
{
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
}
...
...
eeschema/dialogs/dialog_build_BOM.cpp
View file @
0e27f45f
...
...
@@ -111,7 +111,7 @@ static char s_ExportSeparator[] = ("\t;,.");
DIALOG_BUILD_BOM
::
DIALOG_BUILD_BOM
(
EDA_DRAW_FRAME
*
parent
)
:
DIALOG_BUILD_BOM_BASE
(
parent
)
{
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
wxASSERT
(
m_Config
!=
NULL
);
m_Parent
=
parent
;
...
...
eeschema/dialogs/dialog_eeschema_config.cpp
View file @
0e27f45f
...
...
@@ -53,7 +53,7 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( SCH_EDIT_FRAME* aSchFrame,
Init
();
msg
=
_
(
"from "
)
+
wxGetApp
().
m_CurrentOptionFile
;
msg
=
_
(
"from "
)
+
wxGetApp
().
GetCurrentOptionFile
()
;
SetTitle
(
msg
);
if
(
GetSizer
()
)
...
...
eeschema/eeschema_config.cpp
View file @
0e27f45f
...
...
@@ -511,11 +511,11 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings( void )
void
SCH_EDIT_FRAME
::
LoadSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
long
tmp
;
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_DRAW_FRAME
::
LoadSettings
();
...
...
@@ -607,9 +607,9 @@ void SCH_EDIT_FRAME::LoadSettings()
void
SCH_EDIT_FRAME
::
SaveSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_DRAW_FRAME
::
SaveSettings
();
...
...
eeschema/libeditframe.cpp
View file @
0e27f45f
...
...
@@ -291,8 +291,8 @@ void LIB_EDIT_FRAME::LoadSettings()
EDA_DRAW_FRAME
::
LoadSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_configPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfigPathChanger
cpc
(
wxGetApp
().
GetSettings
()
,
m_configPath
);
cfg
=
wxGetApp
().
GetSettings
()
;
m_lastLibExportPath
=
cfg
->
Read
(
lastLibExportPathEntry
,
::
wxGetCwd
()
);
m_lastLibImportPath
=
cfg
->
Read
(
lastLibImportPathEntry
,
::
wxGetCwd
()
);
...
...
@@ -312,8 +312,8 @@ void LIB_EDIT_FRAME::SaveSettings()
EDA_DRAW_FRAME
::
SaveSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_configPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfigPathChanger
cpc
(
wxGetApp
().
GetSettings
()
,
m_configPath
);
cfg
=
wxGetApp
().
GetSettings
()
;
cfg
->
Write
(
lastLibExportPathEntry
,
m_lastLibExportPath
);
cfg
->
Write
(
lastLibImportPathEntry
,
m_lastLibImportPath
);
...
...
eeschema/menubar.cpp
View file @
0e27f45f
...
...
@@ -86,11 +86,11 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if
(
openRecentMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentMenu
);
openRecentMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
(
openRecentMenu
);
AddMenuItem
(
fileMenu
,
openRecentMenu
,
wxID_ANY
,
_
(
"Open &Recent"
),
_
(
"Open a recent opened schematic project"
),
...
...
eeschema/netlist_control.cpp
View file @
0e27f45f
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 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
*/
/**
* @file netlist_control.cpp
* @brief Dialog box for creating netlists.
...
...
@@ -58,8 +83,8 @@ wxString ReturnUserNetlistTypeName( bool first_item )
msg
=
CUSTOM_NETLIST_TITLE
;
msg
<<
index
+
1
;
if
(
wxGetApp
().
m_EDA_Config
)
name
=
wxGetApp
().
m_EDA_Config
->
Read
(
msg
);
if
(
wxGetApp
().
GetSettings
()
)
name
=
wxGetApp
().
GetSettings
()
->
Read
(
msg
);
return
name
;
}
...
...
@@ -332,7 +357,7 @@ void NETLIST_DIALOG::InstallCustomPages()
msg
=
CUSTOM_NETLIST_COMMAND
;
msg
<<
ii
+
1
;
wxString
Command
=
wxGetApp
().
m_EDA_Config
->
Read
(
msg
);
wxString
Command
=
wxGetApp
().
GetSettings
()
->
Read
(
msg
);
CurrPage
->
m_LowBoxSizer
->
Add
(
new
wxStaticText
(
CurrPage
,
-
1
,
_
(
"Netlist command:"
)
),
0
,
...
...
@@ -372,7 +397,7 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event )
wxString
FullFileName
,
Mask
,
Path
;
Mask
=
wxT
(
"*"
);
Path
=
wxGetApp
().
m_BinDir
;
Path
=
wxGetApp
().
GetExecutablePath
()
;
FullFileName
=
EDA_FileSelector
(
_
(
"Plugin files:"
),
Path
,
FullFileName
,
...
...
@@ -650,7 +675,7 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event )
void
NETLIST_DIALOG
::
WriteCurrentNetlistSetup
(
void
)
{
wxString
msg
,
Command
;
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
NetlistUpdateOpt
();
...
...
eeschema/viewlib_frame.cpp
View file @
0e27f45f
...
...
@@ -513,8 +513,8 @@ void LIB_VIEW_FRAME::LoadSettings( )
EDA_DRAW_FRAME
::
LoadSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_configPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfigPathChanger
cpc
(
wxGetApp
().
GetSettings
()
,
m_configPath
);
cfg
=
wxGetApp
().
GetSettings
()
;
m_LibListSize
.
x
=
150
;
// default width of libs list
m_CmpListSize
.
x
=
150
;
// default width of component list
...
...
@@ -537,8 +537,8 @@ void LIB_VIEW_FRAME::SaveSettings()
EDA_DRAW_FRAME
::
SaveSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_configPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfigPathChanger
cpc
(
wxGetApp
().
GetSettings
()
,
m_configPath
);
cfg
=
wxGetApp
().
GetSettings
()
;
if
(
m_LibListSize
.
x
)
cfg
->
Write
(
LIBLIST_WIDTH_KEY
,
m_LibListSize
.
x
);
...
...
gerbview/dialogs/dialog_print_using_printer.cpp
View file @
0e27f45f
...
...
@@ -110,7 +110,7 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( GERBVIEW_FRAME* parent )
/*************************************************************************************/
{
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
InitValues
(
);
...
...
gerbview/gerbview_frame.cpp
View file @
0e27f45f
...
...
@@ -200,7 +200,7 @@ double GERBVIEW_FRAME::BestZoom()
void
GERBVIEW_FRAME
::
LoadSettings
()
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
==
NULL
)
return
;
...
...
@@ -245,7 +245,7 @@ void GERBVIEW_FRAME::LoadSettings()
void
GERBVIEW_FRAME
::
SaveSettings
()
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
==
NULL
)
return
;
...
...
gerbview/menubar.cpp
View file @
0e27f45f
...
...
@@ -82,11 +82,11 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if
(
openRecentGbrMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentGbrMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentGbrMenu
);
openRecentGbrMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentGbrMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
();
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentGbrMenu
);
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
();
AddMenuItem
(
fileMenu
,
openRecentGbrMenu
,
wxID_ANY
,
_
(
"Open &Recent Gerber File"
),
...
...
gerbview/select_layers_to_pcb.cpp
View file @
0e27f45f
...
...
@@ -283,7 +283,7 @@ void LAYERS_MAP_DIALOG::OnResetClick( wxCommandEvent& event )
*/
void
LAYERS_MAP_DIALOG
::
OnStoreSetup
(
wxCommandEvent
&
event
)
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
config
->
Write
(
wxT
(
"BrdLayersCount"
),
m_itemsCount
);
wxString
key
;
...
...
@@ -296,7 +296,7 @@ void LAYERS_MAP_DIALOG::OnStoreSetup( wxCommandEvent& event )
void
LAYERS_MAP_DIALOG
::
OnGetSetup
(
wxCommandEvent
&
event
)
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
config
->
Read
(
wxT
(
"BrdLayersCount"
),
&
m_exportBoardCopperLayersCount
);
normalizeBrdLayersCount
();
...
...
include/appl_wxstruct.h
View file @
0e27f45f
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 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
*/
/**
* @file appl_wxstruct.h
* @brief Base class implementation for all KiCad applications.
...
...
@@ -34,43 +59,55 @@ class wxHtmlHelpController;
*/
class
EDA_APP
:
public
wxApp
{
public
:
EDA_APP_T
m_Id
;
/* Used mainly to handle default paths libs
* m_Id = APP_EESCHEMA_T, APP_PCBNEW_T ... */
wxString
m_Project
;
protected
:
/// Used mainly to handle default paths libs m_Id = APP_EESCHEMA_T, APP_PCBNEW_T ...
EDA_APP_T
m_Id
;
/// Used to prevent multiple instances of an application from being run at the same time.
wxSingleInstanceChecker
*
m_Checker
;
wxPoint
m_HelpPos
;
wxSize
m_HelpSize
;
wxHtmlHelpController
*
m_HtmlCtrl
;
wxConfig
*
m_EDA_Config
;
wxConfig
*
m_EDA_CommonConfig
;
wxFileConfig
*
m_ProjectConfig
;
wxString
m_HelpFileName
;
wxString
m_EditorName
;
wxString
m_CurrentOptionFile
;
wxString
m_CurrentOptionFileDateAndTime
;
wxString
m_Project
;
/// The application specific configuration settings.
wxConfig
*
m_settings
;
/// The configuration settings common to all KiCad applications.
wxConfig
*
m_commonSettings
;
/// The current project specific settings.
wxFileConfig
*
m_projectSettings
;
/// KiCad executable path.
wxString
m_BinDir
;
wxString
m_BinDir
;
/* KiCad executable path.*/
wxString
m_KicadEnv
;
/* environment variable KICAD */
bool
m_Env_Defined
;
// true if environment KICAD is defined.
/// The KICAD system environment variable.
wxString
m_KicadEnv
;
/// The current locale.
wxLocale
*
m_Locale
;
/// The current language setting.
int
m_LanguageId
;
/// The file name of the the program selected for browsing pdf files.
wxString
m_PdfBrowser
;
wxLocale
*
m_Locale
;
// The current locale.
int
m_LanguageId
;
// The current language setting.
wxString
m_PdfBrowser
;
// Name of the selected browser,
// for browsing pdf datasheets
bool
m_PdfBrowserIsDefault
;
// True if the pdf browser is the
// default (m_PdfBrowser not used)
wxPathList
m_searchPaths
;
wxFileHistory
m_fileHistory
;
protected
:
wxString
m_HelpFileName
;
wxString
m_EditorName
;
wxString
m_CurrentOptionFile
;
wxString
m_CurrentOptionFileDateAndTime
;
wxPoint
m_HelpPos
;
wxSize
m_HelpSize
;
wxHtmlHelpController
*
m_HtmlCtrl
;
wxString
m_Title
;
wxPathList
m_libSearchPaths
;
wxFileName
m_projectFileName
;
wxString
m_LastVisitedLibPath
;
public
:
EDA_APP
();
public
:
EDA_APP
();
~
EDA_APP
();
/**
...
...
@@ -80,6 +117,40 @@ public: EDA_APP();
*/
bool
OnInit
();
wxHtmlHelpController
*
GetHtmlHelpController
()
{
return
m_HtmlCtrl
;
}
void
SetHtmlHelpController
(
wxHtmlHelpController
*
aController
);
wxString
GetHelpFileName
()
const
{
return
m_HelpFileName
;
}
void
SetHelpFileName
(
const
wxString
&
aFileName
)
{
m_HelpFileName
=
aFileName
;
}
wxConfig
*
GetSettings
()
{
return
m_settings
;
}
wxConfig
*
GetCommonSettings
()
{
return
m_commonSettings
;
}
wxString
GetEditorName
()
const
{
return
m_EditorName
;
}
void
SetEditorName
(
const
wxString
&
aFileName
)
{
m_EditorName
=
aFileName
;
}
wxString
GetCurrentOptionFile
()
const
{
return
m_CurrentOptionFile
;
}
bool
IsKicadEnvVariableDefined
()
const
{
return
!
m_KicadEnv
.
IsEmpty
();
}
wxString
GetKicadEnvVariable
()
const
{
return
m_KicadEnv
;
}
wxString
GetExecutablePath
()
const
{
return
m_BinDir
;
}
wxLocale
*
GetLocale
()
{
return
m_Locale
;
}
wxString
GetPdfBrowserFileName
()
const
{
return
m_PdfBrowser
;
}
void
SetPdfBrowserFileName
(
const
wxString
&
aFileName
)
{
m_PdfBrowser
=
aFileName
;
}
bool
UseSystemPdfBrowser
()
const
{
return
m_PdfBrowser
.
IsEmpty
();
}
wxFileHistory
&
GetFileHistory
()
{
return
m_fileHistory
;
}
/**
* Function SetBinDir
* finds the path to the executable and store it in EDA_APP::m_BinDir
...
...
@@ -183,7 +254,7 @@ public: EDA_APP();
/**
* Function SaveCurrentSetupValues
* Save the current setup values in m_
EDA_Config
* Save the current setup values in m_
settings
* saved parameters are parameters that have the .m_Setup member set to
* true
* @param aList = array of PARAM_CFG_BASE pointers
...
...
@@ -193,7 +264,7 @@ public: EDA_APP();
/**
* Function ReadCurrentSetupValues
* Read the current setup values previously saved, from m_
EDA_Config
* Read the current setup values previously saved, from m_
settings
* saved parameters are parameters that have the .m_Setup member set to
* true
* @param aList = array of PARAM_CFG_BASE pointers
...
...
kicad/mainframe.cpp
View file @
0e27f45f
...
...
@@ -142,12 +142,12 @@ void KICAD_MANAGER_FRAME::OnCloseWindow( wxCloseEvent& Event )
SaveSettings
();
// Close the help frame
if
(
wxGetApp
().
m_HtmlCtrl
)
if
(
wxGetApp
().
GetHtmlHelpController
()
)
{
if
(
wxGetApp
().
m_HtmlCtrl
->
GetFrame
()
)
// returns NULL if no help frame active
wxGetApp
().
m_HtmlCtrl
->
GetFrame
()
->
Close
(
true
);
if
(
wxGetApp
().
GetHtmlHelpController
()
->
GetFrame
()
)
// returns NULL if no help frame active
wxGetApp
().
GetHtmlHelpController
()
->
GetFrame
()
->
Close
(
true
);
wxGetApp
().
m_HtmlCtrl
=
NULL
;
wxGetApp
().
SetHtmlHelpController
(
NULL
)
;
}
m_LeftWin
->
Show
(
false
);
...
...
@@ -258,9 +258,9 @@ void KICAD_MANAGER_FRAME::ClearMsg()
void
KICAD_MANAGER_FRAME
::
LoadSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_BASE_FRAME
::
LoadSettings
();
cfg
->
Read
(
TreeFrameWidthEntry
,
&
m_LeftWin_Width
);
...
...
@@ -269,9 +269,9 @@ void KICAD_MANAGER_FRAME::LoadSettings()
void
KICAD_MANAGER_FRAME
::
SaveSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_BASE_FRAME
::
SaveSettings
();
...
...
kicad/menubar.cpp
View file @
0e27f45f
...
...
@@ -121,11 +121,11 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if
(
openRecentMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentMenu
);
openRecentMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
(
);
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
(
);
AddMenuItem
(
fileMenu
,
openRecentMenu
,
wxID_ANY
,
_
(
"Open &Recent"
),
...
...
@@ -211,7 +211,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
SubMenuPdfBrowserChoice
->
Append
(
item
);
SubMenuPdfBrowserChoice
->
Check
(
ID_SELECT_DEFAULT_PDF_BROWSER
,
wxGetApp
().
m_PdfBrowserIsDefault
);
wxGetApp
().
UseSystemPdfBrowser
()
);
// Favourite
item
=
new
wxMenuItem
(
SubMenuPdfBrowserChoice
,
...
...
@@ -225,7 +225,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
SubMenuPdfBrowserChoice
->
Append
(
item
);
SubMenuPdfBrowserChoice
->
AppendSeparator
();
SubMenuPdfBrowserChoice
->
Check
(
ID_SELECT_PREFERED_PDF_BROWSER
,
!
wxGetApp
().
m_PdfBrowserIsDefault
);
!
wxGetApp
().
UseSystemPdfBrowser
()
);
// Append PDF Viewer submenu to preferences
AddMenuItem
(
SubMenuPdfBrowserChoice
,
...
...
kicad/preferences.cpp
View file @
0e27f45f
/*******************/
/* preferences.cpp */
/*******************/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2008-2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 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
*/
/**
* @file preferences.cpp
*/
#ifdef __GNUG__
#pragma implementation
...
...
@@ -18,20 +43,19 @@
void
KICAD_MANAGER_FRAME
::
OnUpdateDefaultPdfBrowser
(
wxUpdateUIEvent
&
event
)
{
event
.
Check
(
wxGetApp
().
m_PdfBrowserIsDefault
);
event
.
Check
(
wxGetApp
().
UseSystemPdfBrowser
()
);
}
void
KICAD_MANAGER_FRAME
::
OnSelectDefaultPdfBrowser
(
wxCommandEvent
&
event
)
{
wxGetApp
().
m_PdfBrowserIsDefault
=
true
;
wxGetApp
().
WritePdfBrowserInfos
();
}
void
KICAD_MANAGER_FRAME
::
OnUpdatePreferredPdfBrowser
(
wxUpdateUIEvent
&
event
)
{
event
.
Check
(
!
wxGetApp
().
m_PdfBrowserIsDefault
);
event
.
Check
(
!
wxGetApp
().
UseSystemPdfBrowser
()
);
}
...
...
@@ -39,7 +63,7 @@ void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
{
bool
select
=
event
.
GetId
()
==
ID_SELECT_PREFERED_PDF_BROWSER_NAME
;
if
(
!
wxGetApp
().
m_PdfBrowser
&&
!
select
)
if
(
!
wxGetApp
().
GetPdfBrowserFileName
()
&&
!
select
)
{
DisplayError
(
this
,
_
(
"You must choose a PDF viewer before using this option."
)
);
...
...
@@ -54,7 +78,7 @@ void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
wildcard
=
_
(
"Executable files ("
)
+
wildcard
+
wxT
(
")|"
)
+
wildcard
;
wxGetApp
().
ReadPdfBrowserInfos
();
wxFileName
fn
=
wxGetApp
().
m_PdfBrowser
;
wxFileName
fn
=
wxGetApp
().
GetPdfBrowserFileName
()
;
wxFileDialog
dlg
(
this
,
_
(
"Select Preferred Pdf Browser"
),
fn
.
GetPath
(),
fn
.
GetFullName
(),
wildcard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
...
...
@@ -62,11 +86,11 @@ void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
;
wxGetApp
().
m_PdfBrowser
=
dlg
.
GetPath
();
wxGetApp
().
m_PdfBrowserIsDefault
=
wxGetApp
().
m_PdfBrowser
.
IsEmpty
();
wxGetApp
().
SetPdfBrowserFileName
(
dlg
.
GetPath
()
);
wxGetApp
().
WritePdfBrowserInfos
();
}
void
KICAD_MANAGER_FRAME
::
SetLanguage
(
wxCommandEvent
&
event
)
{
EDA_BASE_FRAME
::
SetLanguage
(
event
);
...
...
pcbnew/basepcbframe.cpp
View file @
0e27f45f
...
...
@@ -522,9 +522,9 @@ void PCB_BASE_FRAME::unitsChangeRefresh()
void
PCB_BASE_FRAME
::
LoadSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_DRAW_FRAME
::
LoadSettings
();
...
...
@@ -566,9 +566,9 @@ void PCB_BASE_FRAME::LoadSettings()
void
PCB_BASE_FRAME
::
SaveSettings
()
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_DRAW_FRAME
::
SaveSettings
();
cfg
->
Write
(
m_FrameName
+
UserGridSizeXEntry
,
m_UserGridSize
.
x
);
...
...
pcbnew/dialogs/dialog_SVG_print.cpp
View file @
0e27f45f
...
...
@@ -52,8 +52,8 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) :
DIALOG_SVG_PRINT_base
(
parent
)
{
m_Parent
=
(
PCB_BASE_FRAME
*
)
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
initDialog
(
);
m_Config
=
wxGetApp
().
GetSettings
()
;
initDialog
();
GetSizer
()
->
SetSizeHints
(
this
);
Centre
();
m_buttonBoard
->
SetDefault
();
...
...
pcbnew/dialogs/dialog_copper_zones.cpp
View file @
0e27f45f
...
...
@@ -34,7 +34,7 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_EDIT_FRAME* parent, ZONE_SETTING* zo
DIALOG_COPPER_ZONE_BASE
(
parent
)
{
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
m_Zone_Setting
=
zone_setting
;
m_NetSortingByPadCount
=
true
;
// false = alphabetic sort, true = pad count sort
m_OnExitCode
=
ZONE_ABORT
;
...
...
pcbnew/dialogs/dialog_freeroute_exchange.cpp
View file @
0e27f45f
...
...
@@ -54,7 +54,8 @@ void DIALOG_FREEROUTE::MyInit()
m_FreeRouteSetupChanged
=
false
;
wxString
msg
;
wxGetApp
().
m_EDA_Config
->
Read
(
FREEROUTE_URL_KEY
,
&
msg
);
wxGetApp
().
GetSettings
()
->
Read
(
FREEROUTE_URL_KEY
,
&
msg
);
if
(
msg
.
IsEmpty
()
)
m_FreerouteURLName
->
SetValue
(
wxT
(
"http://www.freerouting.net/"
)
);
else
...
...
@@ -140,8 +141,8 @@ void DIALOG_FREEROUTE::OnOKButtonClick( wxCommandEvent& event )
{
if
(
m_FreeRouteSetupChanged
)
// Save new config
{
wxGetApp
().
m_EDA_Config
->
Write
(
FREEROUTE_URL_KEY
,
m_FreerouteURLName
->
GetValue
()
);
wxGetApp
().
GetSettings
()
->
Write
(
FREEROUTE_URL_KEY
,
m_FreerouteURLName
->
GetValue
()
);
}
EndModal
(
wxID_OK
);
...
...
pcbnew/dialogs/dialog_gendrill.cpp
View file @
0e27f45f
...
...
@@ -100,7 +100,7 @@ DIALOG_GENDRILL::~DIALOG_GENDRILL()
void
DIALOG_GENDRILL
::
initDialog
()
{
SetFocus
();
// Under wxGTK: mandatory to close dialog by the ESC key
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
if
(
Config
)
{
...
...
@@ -234,7 +234,7 @@ void DIALOG_GENDRILL::UpdateConfig()
{
SetParams
();
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
if
(
Config
)
{
...
...
pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp
View file @
0e27f45f
...
...
@@ -21,9 +21,7 @@
#include "dialog_pcbnew_config_libs_and_paths.h"
/*****************************************************************/
void
PCB_EDIT_FRAME
::
InstallConfigFrame
(
)
/*****************************************************************/
{
DIALOG_PCBNEW_CONFIG_LIBS
dialog
(
this
);
dialog
.
ShowModal
();
...
...
@@ -33,11 +31,11 @@ void PCB_EDIT_FRAME::InstallConfigFrame( )
DIALOG_PCBNEW_CONFIG_LIBS
::
DIALOG_PCBNEW_CONFIG_LIBS
(
PCB_EDIT_FRAME
*
parent
)
:
DIALOG_PCBNEW_CONFIG_LIBS_FBP
(
parent
)
{
m_Config
=
wxGetApp
().
m_EDA_CommonConfig
;
m_Config
=
wxGetApp
().
GetCommonSettings
()
;
Init
(
);
wxString
title
=
_
(
"from "
)
+
wxGetApp
().
m_CurrentOptionFile
;
wxString
title
=
_
(
"from "
)
+
wxGetApp
().
GetCurrentOptionFile
()
;
SetTitle
(
title
);
m_sdbSizer1OK
->
SetDefault
();
...
...
pcbnew/dialogs/dialog_print_for_modedit.cpp
View file @
0e27f45f
...
...
@@ -85,7 +85,7 @@ DIALOG_PRINT_FOR_MODEDIT::DIALOG_PRINT_FOR_MODEDIT( EDA_DRAW_FRAME* parent ) :
{
m_Parent
=
parent
;
s_Parameters
.
m_ForceCentered
=
true
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
InitValues
();
m_buttonPrint
->
SetDefault
();
...
...
pcbnew/dialogs/dialog_print_using_printer.cpp
View file @
0e27f45f
...
...
@@ -120,7 +120,7 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( PCB_EDIT_FRAME* parent )
/*************************************************************************************/
{
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
InitValues
(
);
...
...
pcbnew/edit.cpp
View file @
0e27f45f
...
...
@@ -1066,7 +1066,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC
:
{
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_CommonConfig
;
wxConfig
*
cfg
=
wxGetApp
().
GetCommonSettings
()
;
cfg
->
Read
(
wxT
(
"module_doc_file"
),
g_DocModulesFileName
);
GetAssociatedDocument
(
this
,
g_DocModulesFileName
,
&
wxGetApp
().
GetLibraryPathList
()
);
}
...
...
pcbnew/export_vrml.cpp
View file @
0e27f45f
...
...
@@ -51,7 +51,7 @@ public:
DIALOG_EXPORT_3DFILE_BASE
(
parent
)
{
m_parent
=
parent
;
m_config
=
wxGetApp
().
m_EDA_Config
;
m_config
=
wxGetApp
().
GetSettings
()
;
SetFocus
();
m_config
->
Read
(
OPTKEY_OUTPUT_UNIT
,
&
m_unitsOpt
);
m_config
->
Read
(
OPTKEY_3DFILES_OPT
,
&
m_3DFilesOpt
);
...
...
pcbnew/librairi.cpp
View file @
0e27f45f
...
...
@@ -51,7 +51,7 @@ MODULE* FOOTPRINT_EDIT_FRAME::Import_Module()
bool
Footprint_Is_GPCB_Format
=
false
;
wxString
LastOpenedPathForLoading
;
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
if
(
Config
)
Config
->
Read
(
EXPORT_IMPORT_LASTPATH_KEY
,
&
LastOpenedPathForLoading
);
...
...
@@ -145,7 +145,7 @@ void FOOTPRINT_EDIT_FRAME::Export_Module( MODULE* aModule, bool aCreateSysLib )
wxFileName
fn
;
FILE
*
file
;
wxString
msg
,
path
,
title
,
wildcard
;
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
if
(
aModule
==
NULL
)
return
;
...
...
pcbnew/menubar_pcbframe.cpp
View file @
0e27f45f
...
...
@@ -78,11 +78,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
if
(
openRecentMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentMenu
);
openRecentMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
();
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
();
AddMenuItem
(
filesMenu
,
openRecentMenu
,
-
1
,
_
(
"Open &Recent"
),
_
(
"Open a recent opened board"
),
...
...
pcbnew/pcbframe.cpp
View file @
0e27f45f
...
...
@@ -544,7 +544,7 @@ void PCB_EDIT_FRAME::ShowDesignRulesEditor( wxCommandEvent& event )
void
PCB_EDIT_FRAME
::
LoadSettings
()
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
==
NULL
)
return
;
...
...
@@ -572,7 +572,7 @@ void PCB_EDIT_FRAME::LoadSettings()
void
PCB_EDIT_FRAME
::
SaveSettings
()
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
==
NULL
)
return
;
...
...
pcbnew/pcbplot.cpp
View file @
0e27f45f
...
...
@@ -91,7 +91,7 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* parent ) :
DIALOG_PLOT_BASE
(
parent
)
{
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
Init_Dialog
();
...
...
pcbnew/zones_by_polygon.cpp
View file @
0e27f45f
...
...
@@ -479,10 +479,10 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
zone
->
SetNetNameFromNetCode
(
);
}
wxGetApp
().
m_EDA_Config
->
Read
(
ZONE_THERMAL_RELIEF_GAP_STRING_KEY
,
&
g_Zone_Default_Setting
.
m_ThermalReliefGap
);
wxGetApp
().
m_EDA_Config
->
Read
(
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY
,
&
g_Zone_Default_Setting
.
m_ThermalReliefCopperBridge
);
wxGetApp
().
GetSettings
()
->
Read
(
ZONE_THERMAL_RELIEF_GAP_STRING_KEY
,
&
g_Zone_Default_Setting
.
m_ThermalReliefGap
);
wxGetApp
().
GetSettings
()
->
Read
(
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY
,
&
g_Zone_Default_Setting
.
m_ThermalReliefCopperBridge
);
g_Zone_Default_Setting
.
m_CurrentZone_Layer
=
zone
->
GetLayer
();
DIALOG_COPPER_ZONE
*
frame
=
new
DIALOG_COPPER_ZONE
(
this
,
&
g_Zone_Default_Setting
);
...
...
pcbnew/zones_non_copper_type_functions.cpp
View file @
0e27f45f
...
...
@@ -152,10 +152,10 @@ void DialogNonCopperZonesEditor::OnOkClick( wxCommandEvent& event )
break
;
}
if
(
wxGetApp
().
m_EDA_Config
)
if
(
wxGetApp
().
GetSettings
()
)
{
wxGetApp
().
m_EDA_Config
->
Write
(
ZONE_NET_OUTLINES_HATCH_OPTION_KEY
,
(
long
)
g_Zone_Default_Setting
.
m_Zone_HatchingStyle
);
wxGetApp
().
GetSettings
()
->
Write
(
ZONE_NET_OUTLINES_HATCH_OPTION_KEY
,
(
long
)
g_Zone_Default_Setting
.
m_Zone_HatchingStyle
);
}
if
(
m_OrientEdgesOpt
->
GetSelection
()
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment