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
Expand all
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 )
...
@@ -113,7 +113,7 @@ void EDA_3D_FRAME::OnCloseWindow( wxCloseEvent& Event )
void
EDA_3D_FRAME
::
GetSettings
()
void
EDA_3D_FRAME
::
GetSettings
()
{
{
wxString
text
;
wxString
text
;
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
// Current config used by application
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
// Current config used by application
if
(
config
)
if
(
config
)
{
{
...
@@ -140,7 +140,7 @@ void EDA_3D_FRAME::GetSettings()
...
@@ -140,7 +140,7 @@ void EDA_3D_FRAME::GetSettings()
void
EDA_3D_FRAME
::
SaveSettings
()
void
EDA_3D_FRAME
::
SaveSettings
()
{
{
wxString
text
;
wxString
text
;
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
// Current config used by application
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
// Current config used by application
if
(
!
Config
)
if
(
!
Config
)
return
;
return
;
...
...
common/basicframe.cpp
View file @
0e27f45f
...
@@ -100,10 +100,8 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* father,
...
@@ -100,10 +100,8 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* father,
EDA_BASE_FRAME
::~
EDA_BASE_FRAME
()
EDA_BASE_FRAME
::~
EDA_BASE_FRAME
()
{
{
if
(
wxGetApp
().
m_HtmlCtrl
)
if
(
wxGetApp
().
GetHtmlHelpController
()
)
delete
wxGetApp
().
m_HtmlCtrl
;
wxGetApp
().
SetHtmlHelpController
(
NULL
);
wxGetApp
().
m_HtmlCtrl
=
NULL
;
delete
m_autoSaveTimer
;
delete
m_autoSaveTimer
;
...
@@ -174,7 +172,7 @@ void EDA_BASE_FRAME::LoadSettings()
...
@@ -174,7 +172,7 @@ void EDA_BASE_FRAME::LoadSettings()
int
Ypos_min
;
int
Ypos_min
;
wxConfig
*
config
;
wxConfig
*
config
;
config
=
wxGetApp
().
m_EDA_Config
;
config
=
wxGetApp
().
GetSettings
()
;
int
maximized
=
0
;
int
maximized
=
0
;
...
@@ -219,7 +217,7 @@ void EDA_BASE_FRAME::SaveSettings()
...
@@ -219,7 +217,7 @@ void EDA_BASE_FRAME::SaveSettings()
wxString
text
;
wxString
text
;
wxConfig
*
config
;
wxConfig
*
config
;
config
=
wxGetApp
().
m_EDA_Config
;
config
=
wxGetApp
().
GetSettings
()
;
if
(
(
config
==
NULL
)
||
IsIconized
()
)
if
(
(
config
==
NULL
)
||
IsIconized
()
)
return
;
return
;
...
@@ -275,7 +273,7 @@ void EDA_BASE_FRAME::UpdateFileHistory( const wxString& FullFileName,
...
@@ -275,7 +273,7 @@ void EDA_BASE_FRAME::UpdateFileHistory( const wxString& FullFileName,
wxFileHistory
*
fileHistory
=
aFileHistory
;
wxFileHistory
*
fileHistory
=
aFileHistory
;
if
(
fileHistory
==
NULL
)
if
(
fileHistory
==
NULL
)
fileHistory
=
&
wxGetApp
().
m_fileHistory
;
fileHistory
=
&
wxGetApp
().
GetFileHistory
()
;
fileHistory
->
AddFileToHistory
(
FullFileName
);
fileHistory
->
AddFileToHistory
(
FullFileName
);
}
}
...
@@ -289,7 +287,7 @@ wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type,
...
@@ -289,7 +287,7 @@ wxString EDA_BASE_FRAME::GetFileFromHistory( int cmdId, const wxString& type,
wxFileHistory
*
fileHistory
=
aFileHistory
;
wxFileHistory
*
fileHistory
=
aFileHistory
;
if
(
fileHistory
==
NULL
)
if
(
fileHistory
==
NULL
)
fileHistory
=
&
wxGetApp
().
m_fileHistory
;
fileHistory
=
&
wxGetApp
().
GetFileHistory
()
;
int
baseId
=
fileHistory
->
GetBaseId
();
int
baseId
=
fileHistory
->
GetBaseId
();
...
@@ -321,28 +319,28 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
...
@@ -321,28 +319,28 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
/* We have to get document for beginners,
/* We have to get document for beginners,
* or the the full specific doc
* or the the full specific doc
* if event id is wxID_INDEX, we want the document for beginners.
* 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
* The document for beginners is the same for all KiCad utilities
*/
*/
if
(
event
.
GetId
()
==
wxID_INDEX
)
if
(
event
.
GetId
()
==
wxID_INDEX
)
{
{
// Temporary change the help filename
// 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"
// 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
();
wxString
helpFile
=
wxGetApp
().
GetHelpFile
();
if
(
!
helpFile
)
if
(
!
helpFile
)
{
// Try to find "Getting_Started_in_KiCad.pdf"
{
// 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
();
helpFile
=
wxGetApp
().
GetHelpFile
();
}
}
if
(
!
helpFile
)
if
(
!
helpFile
)
{
{
msg
.
Printf
(
_
(
"Help file %s could not be found."
),
msg
.
Printf
(
_
(
"Help file %s could not be found."
),
GetChars
(
wxGetApp
().
m_HelpFileName
)
);
GetChars
(
wxGetApp
().
GetHelpFileName
()
)
);
DisplayError
(
this
,
msg
);
DisplayError
(
this
,
msg
);
}
}
else
else
...
@@ -350,26 +348,26 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
...
@@ -350,26 +348,26 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
GetAssociatedDocument
(
this
,
helpFile
);
GetAssociatedDocument
(
this
,
helpFile
);
}
}
wxGetApp
().
m_HelpFileName
=
tmp
;
wxGetApp
().
SetHelpFileName
(
tmp
)
;
return
;
return
;
}
}
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
#if defined ONLINE_HELP_FILES_FORMAT_IS_HTML
if
(
wxGetApp
().
m_HtmlCtrl
==
NULL
)
if
(
wxGetApp
().
GetHtmlHelpController
()
==
NULL
)
{
{
wxGetApp
().
InitOnLineHelp
();
wxGetApp
().
InitOnLineHelp
();
}
}
if
(
wxGetApp
().
m_HtmlCtrl
)
if
(
wxGetApp
().
GetHtmlHelpController
()
)
{
{
wxGetApp
().
m_HtmlCtrl
->
DisplayContents
();
wxGetApp
().
GetHtmlHelpController
()
->
DisplayContents
();
wxGetApp
().
m_HtmlCtrl
->
Display
(
wxGetApp
().
m_HelpFileName
);
wxGetApp
().
GetHtmlHelpController
()
->
Display
(
wxGetApp
().
GetHelpFileName
()
);
}
}
else
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
);
DisplayError
(
this
,
msg
);
}
}
...
@@ -379,7 +377,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
...
@@ -379,7 +377,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
if
(
!
helpFile
)
if
(
!
helpFile
)
{
{
msg
.
Printf
(
_
(
"Help file %s could not be found."
),
msg
.
Printf
(
_
(
"Help file %s could not be found."
),
GetChars
(
wxGetApp
().
m_HelpFileName
)
);
GetChars
(
wxGetApp
().
GetHelpFileName
()
)
);
DisplayError
(
this
,
msg
);
DisplayError
(
this
,
msg
);
}
}
else
else
...
@@ -395,7 +393,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
...
@@ -395,7 +393,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
void
EDA_BASE_FRAME
::
OnSelectPreferredEditor
(
wxCommandEvent
&
event
)
void
EDA_BASE_FRAME
::
OnSelectPreferredEditor
(
wxCommandEvent
&
event
)
{
{
wxFileName
fn
=
wxGetApp
().
m_EditorName
;
wxFileName
fn
=
wxGetApp
().
GetEditorName
()
;
wxString
wildcard
(
wxT
(
"*"
)
);
wxString
wildcard
(
wxT
(
"*"
)
);
#ifdef __WINDOWS__
#ifdef __WINDOWS__
...
@@ -411,11 +409,11 @@ void EDA_BASE_FRAME::OnSelectPreferredEditor( wxCommandEvent& event )
...
@@ -411,11 +409,11 @@ void EDA_BASE_FRAME::OnSelectPreferredEditor( wxCommandEvent& event )
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
;
return
;
wxASSERT
(
wxGetApp
().
m_EDA_CommonConfig
);
wxASSERT
(
wxGetApp
().
GetCommonSettings
()
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_CommonConfig
;
wxConfig
*
cfg
=
wxGetApp
().
GetCommonSettings
()
;
wxGetApp
().
m_EditorName
=
dlg
.
GetPath
(
);
wxGetApp
().
SetEditorName
(
dlg
.
GetPath
()
);
cfg
->
Write
(
wxT
(
"Editor"
),
wxGetApp
().
m_EditorName
);
cfg
->
Write
(
wxT
(
"Editor"
),
wxGetApp
().
GetEditorName
()
);
}
}
...
...
common/drawframe.cpp
View file @
0e27f45f
...
@@ -829,9 +829,9 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
...
@@ -829,9 +829,9 @@ void EDA_DRAW_FRAME::UpdateStatusBar()
void
EDA_DRAW_FRAME
::
LoadSettings
()
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
();
EDA_BASE_FRAME
::
LoadSettings
();
cfg
->
Read
(
m_FrameName
+
CursorShapeEntryKeyword
,
&
m_cursorShape
,
(
long
)
0
);
cfg
->
Read
(
m_FrameName
+
CursorShapeEntryKeyword
,
&
m_cursorShape
,
(
long
)
0
);
...
@@ -851,9 +851,9 @@ void EDA_DRAW_FRAME::LoadSettings()
...
@@ -851,9 +851,9 @@ void EDA_DRAW_FRAME::LoadSettings()
void
EDA_DRAW_FRAME
::
SaveSettings
()
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
();
EDA_BASE_FRAME
::
SaveSettings
();
cfg
->
Write
(
m_FrameName
+
CursorShapeEntryKeyword
,
m_cursorShape
);
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,
...
@@ -102,8 +102,8 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
m_mouseCaptureCallback
=
NULL
;
m_mouseCaptureCallback
=
NULL
;
m_endMouseCaptureCallback
=
NULL
;
m_endMouseCaptureCallback
=
NULL
;
if
(
wxGetApp
().
m_EDA_Config
)
if
(
wxGetApp
().
GetSettings
()
)
wxGetApp
().
m_EDA_Config
->
Read
(
wxT
(
"AutoPAN"
),
&
m_AutoPAN_Enable
,
true
);
wxGetApp
().
GetSettings
()
->
Read
(
wxT
(
"AutoPAN"
),
&
m_AutoPAN_Enable
,
true
);
m_AutoPAN_Request
=
false
;
m_AutoPAN_Request
=
false
;
m_Block_Enable
=
false
;
m_Block_Enable
=
false
;
...
@@ -123,7 +123,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
...
@@ -123,7 +123,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
EDA_DRAW_PANEL
::~
EDA_DRAW_PANEL
()
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 @@
...
@@ -16,25 +16,17 @@
void
EDA_APP
::
ReadPdfBrowserInfos
()
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_commonSettings
->
Read
(
wxT
(
"PdfBrowserName"
),
wxEmptyString
);
m_PdfBrowser
=
m_EDA_CommonConfig
->
Read
(
wxT
(
"PdfBrowserName"
),
wxEmptyString
);
if
(
m_PdfBrowser
.
IsEmpty
()
)
m_PdfBrowserIsDefault
=
true
;
}
}
void
EDA_APP
::
WritePdfBrowserInfos
()
void
EDA_APP
::
WritePdfBrowserInfos
()
{
{
wxASSERT
(
m_EDA_CommonConfig
!=
NULL
);
wxASSERT
(
m_commonSettings
!=
NULL
);
if
(
m_PdfBrowser
.
IsEmpty
()
)
m_PdfBrowserIsDefault
=
true
;
m_EDA_CommonConfig
->
Write
(
wxT
(
"PdfBrowserIsDefault"
),
m_PdfBrowserIsDefault
);
m_commonSettings
->
Write
(
wxT
(
"PdfBrowserName"
),
m_PdfBrowser
);
m_EDA_CommonConfig
->
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
* @file edaapl.cpp
*
*
* @brief
For the main application: init functions, and language selection
* @brief For the main application: init functions, and language selection
*
(locale handling)
* (locale handling)
*
**
/
*/
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
...
@@ -246,15 +271,13 @@ static struct LANGUAGE_DESCR s_Language_List[] =
...
@@ -246,15 +271,13 @@ static struct LANGUAGE_DESCR s_Language_List[] =
EDA_APP
::
EDA_APP
()
EDA_APP
::
EDA_APP
()
{
{
m_Checker
=
NULL
;
m_Checker
=
NULL
;
m_HtmlCtrl
=
NULL
;
m_HtmlCtrl
=
NULL
;
m_EDA_Config
=
NULL
;
m_settings
=
NULL
;
m_Env_Defined
=
false
;
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
m_PdfBrowserIsDefault
=
true
;
m_Locale
=
NULL
;
m_Locale
=
NULL
;
m_
ProjectConfig
=
NULL
;
m_
projectSettings
=
NULL
;
m_
EDA_CommonConfig
=
NULL
;
m_
commonSettings
=
NULL
;
}
}
...
@@ -263,13 +286,13 @@ EDA_APP::~EDA_APP()
...
@@ -263,13 +286,13 @@ EDA_APP::~EDA_APP()
SaveSettings
();
SaveSettings
();
/* delete user datas */
/* delete user datas */
if
(
m_
ProjectConfig
)
if
(
m_
projectSettings
)
delete
m_
ProjectConfig
;
delete
m_
projectSettings
;
if
(
m_
EDA_CommonConfig
)
if
(
m_
commonSettings
)
delete
m_
EDA_CommonConfig
;
delete
m_
commonSettings
;
delete
m_
EDA_Config
;
delete
m_
settings
;
if
(
m_Checker
)
if
(
m_Checker
)
delete
m_Checker
;
delete
m_Checker
;
...
@@ -289,9 +312,9 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
...
@@ -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:
* the environment variable KICAD (if exists) gives the kicad path:
* something like set KICAD=d:\kicad
* 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
);
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 )
...
@@ -313,10 +336,10 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
SetVendorName
(
wxT
(
"KiCad"
)
);
SetVendorName
(
wxT
(
"KiCad"
)
);
SetAppName
(
aName
.
Lower
()
);
SetAppName
(
aName
.
Lower
()
);
SetTitle
(
aName
);
SetTitle
(
aName
);
m_
EDA_Config
=
new
wxConfig
();
m_
settings
=
new
wxConfig
();
wxASSERT
(
m_
EDA_Config
!=
NULL
);
wxASSERT
(
m_
settings
!=
NULL
);
m_
EDA_CommonConfig
=
new
wxConfig
(
CommonConfigPath
);
m_
commonSettings
=
new
wxConfig
(
CommonConfigPath
);
wxASSERT
(
m_
EDA_CommonConfig
!=
NULL
);
wxASSERT
(
m_
commonSettings
!=
NULL
);
/* Install some image handlers, mainly for help */
/* Install some image handlers, mainly for help */
wxImage
::
AddHandler
(
new
wxPNGHandler
);
wxImage
::
AddHandler
(
new
wxPNGHandler
);
...
@@ -332,7 +355,7 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
...
@@ -332,7 +355,7 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
// Internationalization: loading the kicad suitable Dictionary
// Internationalization: loading the kicad suitable Dictionary
wxString
languageSel
;
wxString
languageSel
;
m_
EDA_CommonConfig
->
Read
(
languageCfgKey
,
&
languageSel
);
m_
commonSettings
->
Read
(
languageCfgKey
,
&
languageSel
);
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
// Search for the current selection
// Search for the current selection
...
@@ -356,6 +379,15 @@ void EDA_APP::InitEDA_Appl( const wxString& aName, EDA_APP_T aId )
...
@@ -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
()
void
EDA_APP
::
InitOnLineHelp
()
{
{
wxString
fullfilename
=
FindKicadHelpPath
();
wxString
fullfilename
=
FindKicadHelpPath
();
...
@@ -369,7 +401,7 @@ void EDA_APP::InitOnLineHelp()
...
@@ -369,7 +401,7 @@ void EDA_APP::InitOnLineHelp()
m_HtmlCtrl
=
new
wxHtmlHelpController
(
wxHF_TOOLBAR
|
wxHF_CONTENTS
|
m_HtmlCtrl
=
new
wxHtmlHelpController
(
wxHF_TOOLBAR
|
wxHF_CONTENTS
|
wxHF_PRINT
|
wxHF_OPEN_FILES
wxHF_PRINT
|
wxHF_OPEN_FILES
/*| wxHF_SEARCH */
);
/*| wxHF_SEARCH */
);
m_HtmlCtrl
->
UseConfig
(
m_
EDA_CommonConfig
);
m_HtmlCtrl
->
UseConfig
(
m_
commonSettings
);
m_HtmlCtrl
->
SetTitleFormat
(
wxT
(
"KiCad Help"
)
);
m_HtmlCtrl
->
SetTitleFormat
(
wxT
(
"KiCad Help"
)
);
m_HtmlCtrl
->
AddBook
(
fullfilename
);
m_HtmlCtrl
->
AddBook
(
fullfilename
);
}
}
...
@@ -620,7 +652,7 @@ void EDA_APP::SetDefaultSearchPaths( void )
...
@@ -620,7 +652,7 @@ void EDA_APP::SetDefaultSearchPaths( void )
void
EDA_APP
::
GetSettings
(
bool
aReopenLastUsedDirectory
)
void
EDA_APP
::
GetSettings
(
bool
aReopenLastUsedDirectory
)
{
{
wxASSERT
(
m_
EDA_Config
!=
NULL
&&
m_EDA_CommonConfig
!=
NULL
);
wxASSERT
(
m_
settings
!=
NULL
&&
m_commonSettings
!=
NULL
);
wxString
Line
;
wxString
Line
;
...
@@ -628,7 +660,7 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
...
@@ -628,7 +660,7 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
m_HelpSize
.
y
=
400
;
m_HelpSize
.
y
=
400
;
wxString
languageSel
;
wxString
languageSel
;
m_
EDA_CommonConfig
->
Read
(
languageCfgKey
,
&
languageSel
);
m_
commonSettings
->
Read
(
languageCfgKey
,
&
languageSel
);
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
m_LanguageId
=
wxLANGUAGE_DEFAULT
;
// Search for the current selection
// Search for the current selection
...
@@ -641,21 +673,21 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
...
@@ -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
(
aReopenLastUsedDirectory
)
{
{
if
(
m_
EDA_Config
->
Read
(
wxT
(
"WorkingDir"
),
&
Line
)
&&
wxDirExists
(
Line
)
)
if
(
m_
settings
->
Read
(
wxT
(
"WorkingDir"
),
&
Line
)
&&
wxDirExists
(
Line
)
)
{
{
wxSetWorkingDirectory
(
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 */
/* Load per-user search paths from settings file */
...
@@ -664,8 +696,8 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
...
@@ -664,8 +696,8 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
while
(
1
)
while
(
1
)
{
{
upath
=
m_
EDA_CommonConfig
->
Read
(
wxString
::
Format
(
wxT
(
"LibraryPath%d"
),
i
),
upath
=
m_
commonSettings
->
Read
(
wxString
::
Format
(
wxT
(
"LibraryPath%d"
),
i
),
wxT
(
""
)
);
wxT
(
""
)
);
if
(
upath
.
IsSameAs
(
wxT
(
""
)
)
)
if
(
upath
.
IsSameAs
(
wxT
(
""
)
)
)
break
;
break
;
...
@@ -678,13 +710,13 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
...
@@ -678,13 +710,13 @@ void EDA_APP::GetSettings( bool aReopenLastUsedDirectory )
void
EDA_APP
::
SaveSettings
()
void
EDA_APP
::
SaveSettings
()
{
{
wxASSERT
(
m_
EDA_Config
!=
NULL
);
wxASSERT
(
m_
settings
!=
NULL
);
m_
EDA_Config
->
Write
(
wxT
(
"ShowPageLimits"
),
g_ShowPageLimits
);
m_
settings
->
Write
(
wxT
(
"ShowPageLimits"
),
g_ShowPageLimits
);
m_
EDA_Config
->
Write
(
wxT
(
"WorkingDir"
),
wxGetCwd
()
);
m_
settings
->
Write
(
wxT
(
"WorkingDir"
),
wxGetCwd
()
);
m_
EDA_Config
->
Write
(
wxT
(
"BgColor"
),
g_DrawBgColor
);
m_
settings
->
Write
(
wxT
(
"BgColor"
),
g_DrawBgColor
);
/* Save the file history list */
/* 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 )
...
@@ -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)
// 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
* @file gestfich.cpp
* @brief Functions for file management
* @brief Functions for file management
...
@@ -272,14 +297,14 @@ wxString FindKicadHelpPath()
...
@@ -272,14 +297,14 @@ wxString FindKicadHelpPath()
bool
PathFound
=
false
;
bool
PathFound
=
false
;
/* find kicad/help/ */
/* find kicad/help/ */
tmp
=
wxGetApp
().
m_BinDir
;
tmp
=
wxGetApp
().
GetExecutablePath
()
;
if
(
tmp
.
Last
()
==
'/'
)
if
(
tmp
.
Last
()
==
'/'
)
tmp
.
RemoveLast
();
tmp
.
RemoveLast
();
FullPath
=
tmp
.
BeforeLast
(
'/'
);
// cd ..
FullPath
=
tmp
.
BeforeLast
(
'/'
);
// cd ..
FullPath
+=
wxT
(
"/doc/help/"
);
FullPath
+=
wxT
(
"/doc/help/"
);
LocaleString
=
wxGetApp
().
m_Locale
->
GetCanonicalName
();
LocaleString
=
wxGetApp
().
GetLocale
()
->
GetCanonicalName
();
wxString
path_tmp
=
FullPath
;
wxString
path_tmp
=
FullPath
;
#ifdef __WINDOWS__
#ifdef __WINDOWS__
...
@@ -292,9 +317,9 @@ wxString FindKicadHelpPath()
...
@@ -292,9 +317,9 @@ wxString FindKicadHelpPath()
}
}
/* find kicad/help/ from environment variable KICAD */
/* 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
)
)
if
(
wxDirExists
(
FullPath
)
)
PathFound
=
true
;
PathFound
=
true
;
...
@@ -352,7 +377,7 @@ wxString FindKicadFile( const wxString& shortname )
...
@@ -352,7 +377,7 @@ wxString FindKicadFile( const wxString& shortname )
/* Test the presence of the file in the directory shortname of
/* Test the presence of the file in the directory shortname of
* the KiCad binary path.
* the KiCad binary path.
*/
*/
FullFileName
=
wxGetApp
().
m_BinDir
+
shortname
;
FullFileName
=
wxGetApp
().
GetExecutablePath
()
+
shortname
;
if
(
wxFileExists
(
FullFileName
)
)
if
(
wxFileExists
(
FullFileName
)
)
return
FullFileName
;
return
FullFileName
;
...
@@ -360,9 +385,9 @@ wxString FindKicadFile( const wxString& shortname )
...
@@ -360,9 +385,9 @@ wxString FindKicadFile( const wxString& shortname )
/* Test the presence of the file in the directory shortname
/* Test the presence of the file in the directory shortname
* defined by the environment variable KiCad.
* 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
)
)
if
(
wxFileExists
(
FullFileName
)
)
return
FullFileName
;
return
FullFileName
;
...
@@ -416,22 +441,21 @@ wxString ReturnKicadDatasPath()
...
@@ -416,22 +441,21 @@ wxString ReturnKicadDatasPath()
bool
PathFound
=
false
;
bool
PathFound
=
false
;
wxString
data_path
;
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
;
PathFound
=
true
;
}
}
else
// Path of executables.
else
// Path of executables.
{
{
wxString
tmp
=
wxGetApp
().
m_BinDir
;
wxString
tmp
=
wxGetApp
().
GetExecutablePath
()
;
#ifdef __WINDOWS__
#ifdef __WINDOWS__
tmp
.
MakeLower
();
tmp
.
MakeLower
();
#endif
#endif
if
(
tmp
.
Contains
(
wxT
(
"kicad"
)
)
)
if
(
tmp
.
Contains
(
wxT
(
"kicad"
)
)
)
{
{
#ifdef __WINDOWS__
#ifdef __WINDOWS__
tmp
=
wxGetApp
().
m_BinDir
;
tmp
=
wxGetApp
().
GetExecutablePath
()
;
#endif
#endif
if
(
tmp
.
Last
()
==
'/'
)
if
(
tmp
.
Last
()
==
'/'
)
tmp
.
RemoveLast
();
tmp
.
RemoveLast
();
...
@@ -523,7 +547,7 @@ wxString& EDA_APP::GetEditorName()
...
@@ -523,7 +547,7 @@ wxString& EDA_APP::GetEditorName()
if
(
!
editorname
.
IsEmpty
()
)
if
(
!
editorname
.
IsEmpty
()
)
{
{
m_EditorName
=
editorname
;
m_EditorName
=
editorname
;
m_
EDA_CommonConfig
->
Write
(
wxT
(
"Editor"
),
m_EditorName
);
m_
commonSettings
->
Write
(
wxT
(
"Editor"
),
m_EditorName
);
}
}
return
m_EditorName
;
return
m_EditorName
;
...
@@ -539,10 +563,10 @@ bool OpenPDF( const wxString& file )
...
@@ -539,10 +563,10 @@ bool OpenPDF( const wxString& file )
wxGetApp
().
ReadPdfBrowserInfos
();
wxGetApp
().
ReadPdfBrowserInfos
();
if
(
!
wxGetApp
().
m_PdfBrowserIsDefault
)
// Run the preferred PDF Browser
if
(
!
wxGetApp
().
UseSystemPdfBrowser
()
)
// Run the preferred PDF Browser
{
{
AddDelimiterString
(
filename
);
AddDelimiterString
(
filename
);
command
=
wxGetApp
().
m_PdfBrowser
+
wxT
(
" "
)
+
filename
;
command
=
wxGetApp
().
GetPdfBrowserFileName
()
+
wxT
(
" "
)
+
filename
;
}
}
else
else
{
{
...
@@ -554,13 +578,15 @@ bool OpenPDF( const wxString& file )
...
@@ -554,13 +578,15 @@ bool OpenPDF( const wxString& file )
success
=
filetype
->
GetOpenCommand
(
&
command
,
params
);
success
=
filetype
->
GetOpenCommand
(
&
command
,
params
);
delete
filetype
;
delete
filetype
;
#ifndef __WINDOWS__
#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.
// it does not exist.
if
(
command
.
StartsWith
(
wxT
(
"acroread"
)
)
)
// Workaround
if
(
command
.
StartsWith
(
wxT
(
"acroread"
)
)
)
// Workaround
success
=
false
;
success
=
false
;
#endif
#endif
if
(
success
&&
!
command
.
IsEmpty
()
)
if
(
success
&&
!
command
.
IsEmpty
()
)
{
{
success
=
ProcessExecute
(
command
);
success
=
ProcessExecute
(
command
);
...
@@ -576,6 +602,7 @@ bool OpenPDF( const wxString& file )
...
@@ -576,6 +602,7 @@ bool OpenPDF( const wxString& file )
{
{
#ifndef __WINDOWS__
#ifndef __WINDOWS__
AddDelimiterString
(
filename
);
AddDelimiterString
(
filename
);
/* here is a list of PDF viewers candidates */
/* here is a list of PDF viewers candidates */
const
static
wxString
tries
[]
=
const
static
wxString
tries
[]
=
{
{
...
...
common/projet_config.cpp
View file @
0e27f45f
This diff is collapsed.
Click to expand it.
cvpcb/cvframe.cpp
View file @
0e27f45f
...
@@ -185,7 +185,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
...
@@ -185,7 +185,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( const wxString& title, long style ) :
CVPCB_MAINFRAME
::~
CVPCB_MAINFRAME
()
CVPCB_MAINFRAME
::~
CVPCB_MAINFRAME
()
{
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
)
if
(
config
)
{
{
...
@@ -199,9 +199,9 @@ CVPCB_MAINFRAME::~CVPCB_MAINFRAME()
...
@@ -199,9 +199,9 @@ CVPCB_MAINFRAME::~CVPCB_MAINFRAME()
void
CVPCB_MAINFRAME
::
LoadSettings
()
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
();
EDA_BASE_FRAME
::
LoadSettings
();
cfg
->
Read
(
KeepCvpcbOpenEntry
,
&
m_KeepCvpcbOpen
,
true
);
cfg
->
Read
(
KeepCvpcbOpenEntry
,
&
m_KeepCvpcbOpen
,
true
);
...
@@ -212,9 +212,9 @@ void CVPCB_MAINFRAME::LoadSettings()
...
@@ -212,9 +212,9 @@ void CVPCB_MAINFRAME::LoadSettings()
void
CVPCB_MAINFRAME
::
SaveSettings
()
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
();
EDA_BASE_FRAME
::
SaveSettings
();
cfg
->
Write
(
KeepCvpcbOpenEntry
,
m_KeepCvpcbOpen
);
cfg
->
Write
(
KeepCvpcbOpenEntry
,
m_KeepCvpcbOpen
);
...
@@ -278,10 +278,10 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event )
...
@@ -278,10 +278,10 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event )
}
}
// Close the help frame
// Close the help frame
if
(
wxGetApp
().
m_HtmlCtrl
)
if
(
wxGetApp
().
GetHtmlHelpController
()
)
{
{
if
(
wxGetApp
().
m_HtmlCtrl
->
GetFrame
()
)
// returns NULL if no help frame active
if
(
wxGetApp
().
GetHtmlHelpController
()
->
GetFrame
()
)
// returns NULL if no help frame active
wxGetApp
().
m_HtmlCtrl
->
GetFrame
()
->
Close
(
true
);
wxGetApp
().
GetHtmlHelpController
()
->
GetFrame
()
->
Close
(
true
);
}
}
if
(
m_NetlistFileName
.
IsOk
()
)
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 ) :
...
@@ -29,7 +29,7 @@ DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( CVPCB_MAINFRAME* parent ) :
fn
.
SetExt
(
ProjectFileExtension
);
fn
.
SetExt
(
ProjectFileExtension
);
m_Parent
=
parent
;
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_CommonConfig
;
m_Config
=
wxGetApp
().
GetCommonSettings
()
;
Init
(
);
Init
(
);
title
=
_
(
"Project file: "
)
+
fn
.
GetFullPath
();
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
* @file cvpcb/menubar.cpp
* @brief (Re)Create the menubar for CvPcb
* @brief (Re)Create the menubar for CvPcb
...
@@ -49,11 +73,11 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
...
@@ -49,11 +73,11 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Add this menu to list menu managed by m_fileHistory
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
// (the file history will be updated when adding/removing files in history
if
(
openRecentMenu
)
if
(
openRecentMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentMenu
);
openRecentMenu
=
new
wxMenu
();
openRecentMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
();
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
();
AddMenuItem
(
filesMenu
,
openRecentMenu
,
-
1
,
AddMenuItem
(
filesMenu
,
openRecentMenu
,
-
1
,
_
(
"Open &Recent"
),
_
(
"Open &Recent"
),
_
(
"Open a recent opened netlist document"
),
_
(
"Open a recent opened netlist document"
),
...
...
cvpcb/tool_cvpcb.cpp
View file @
0e27f45f
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
void
CVPCB_MAINFRAME
::
ReCreateHToolbar
()
void
CVPCB_MAINFRAME
::
ReCreateHToolbar
()
{
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
m_mainToolBar
!=
NULL
)
if
(
m_mainToolBar
!=
NULL
)
return
;
return
;
...
...
eeschema/dialogs/annotate_dialog.cpp
View file @
0e27f45f
...
@@ -54,7 +54,7 @@ DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent )
...
@@ -54,7 +54,7 @@ DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent )
void
DIALOG_ANNOTATE
::
InitValues
()
void
DIALOG_ANNOTATE
::
InitValues
()
/*********************************/
/*********************************/
{
{
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
SetFocus
();
// needed to close dialog by escape key
SetFocus
();
// needed to close dialog by escape key
if
(
m_Config
)
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 ) :
...
@@ -61,7 +61,7 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) :
DIALOG_SVG_PRINT_base
(
parent
)
DIALOG_SVG_PRINT_base
(
parent
)
{
{
m_Parent
=
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;,.");
...
@@ -111,7 +111,7 @@ static char s_ExportSeparator[] = ("\t;,.");
DIALOG_BUILD_BOM
::
DIALOG_BUILD_BOM
(
EDA_DRAW_FRAME
*
parent
)
:
DIALOG_BUILD_BOM
::
DIALOG_BUILD_BOM
(
EDA_DRAW_FRAME
*
parent
)
:
DIALOG_BUILD_BOM_BASE
(
parent
)
DIALOG_BUILD_BOM_BASE
(
parent
)
{
{
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
wxASSERT
(
m_Config
!=
NULL
);
wxASSERT
(
m_Config
!=
NULL
);
m_Parent
=
parent
;
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,
...
@@ -53,7 +53,7 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( SCH_EDIT_FRAME* aSchFrame,
Init
();
Init
();
msg
=
_
(
"from "
)
+
wxGetApp
().
m_CurrentOptionFile
;
msg
=
_
(
"from "
)
+
wxGetApp
().
GetCurrentOptionFile
()
;
SetTitle
(
msg
);
SetTitle
(
msg
);
if
(
GetSizer
()
)
if
(
GetSizer
()
)
...
...
eeschema/eeschema_config.cpp
View file @
0e27f45f
...
@@ -511,11 +511,11 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings( void )
...
@@ -511,11 +511,11 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings( void )
void
SCH_EDIT_FRAME
::
LoadSettings
()
void
SCH_EDIT_FRAME
::
LoadSettings
()
{
{
wxASSERT
(
wxGetApp
().
m_EDA_Config
!=
NULL
);
wxASSERT
(
wxGetApp
().
GetSettings
()
!=
NULL
);
long
tmp
;
long
tmp
;
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
cfg
=
wxGetApp
().
GetSettings
()
;
EDA_DRAW_FRAME
::
LoadSettings
();
EDA_DRAW_FRAME
::
LoadSettings
();
...
@@ -607,9 +607,9 @@ void SCH_EDIT_FRAME::LoadSettings()
...
@@ -607,9 +607,9 @@ void SCH_EDIT_FRAME::LoadSettings()
void
SCH_EDIT_FRAME
::
SaveSettings
()
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
();
EDA_DRAW_FRAME
::
SaveSettings
();
...
...
eeschema/libeditframe.cpp
View file @
0e27f45f
...
@@ -291,8 +291,8 @@ void LIB_EDIT_FRAME::LoadSettings()
...
@@ -291,8 +291,8 @@ void LIB_EDIT_FRAME::LoadSettings()
EDA_DRAW_FRAME
::
LoadSettings
();
EDA_DRAW_FRAME
::
LoadSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_configPath
);
wxConfigPathChanger
cpc
(
wxGetApp
().
GetSettings
()
,
m_configPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
cfg
=
wxGetApp
().
GetSettings
()
;
m_lastLibExportPath
=
cfg
->
Read
(
lastLibExportPathEntry
,
::
wxGetCwd
()
);
m_lastLibExportPath
=
cfg
->
Read
(
lastLibExportPathEntry
,
::
wxGetCwd
()
);
m_lastLibImportPath
=
cfg
->
Read
(
lastLibImportPathEntry
,
::
wxGetCwd
()
);
m_lastLibImportPath
=
cfg
->
Read
(
lastLibImportPathEntry
,
::
wxGetCwd
()
);
...
@@ -312,8 +312,8 @@ void LIB_EDIT_FRAME::SaveSettings()
...
@@ -312,8 +312,8 @@ void LIB_EDIT_FRAME::SaveSettings()
EDA_DRAW_FRAME
::
SaveSettings
();
EDA_DRAW_FRAME
::
SaveSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_configPath
);
wxConfigPathChanger
cpc
(
wxGetApp
().
GetSettings
()
,
m_configPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
cfg
=
wxGetApp
().
GetSettings
()
;
cfg
->
Write
(
lastLibExportPathEntry
,
m_lastLibExportPath
);
cfg
->
Write
(
lastLibExportPathEntry
,
m_lastLibExportPath
);
cfg
->
Write
(
lastLibImportPathEntry
,
m_lastLibImportPath
);
cfg
->
Write
(
lastLibImportPathEntry
,
m_lastLibImportPath
);
...
...
eeschema/menubar.cpp
View file @
0e27f45f
...
@@ -86,11 +86,11 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
...
@@ -86,11 +86,11 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
// Add this menu to list menu managed by m_fileHistory
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
// (the file history will be updated when adding/removing files in history
if
(
openRecentMenu
)
if
(
openRecentMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentMenu
);
openRecentMenu
=
new
wxMenu
();
openRecentMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
(
openRecentMenu
);
AddMenuItem
(
fileMenu
,
openRecentMenu
,
AddMenuItem
(
fileMenu
,
openRecentMenu
,
wxID_ANY
,
_
(
"Open &Recent"
),
wxID_ANY
,
_
(
"Open &Recent"
),
_
(
"Open a recent opened schematic project"
),
_
(
"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
* @file netlist_control.cpp
* @brief Dialog box for creating netlists.
* @brief Dialog box for creating netlists.
...
@@ -58,8 +83,8 @@ wxString ReturnUserNetlistTypeName( bool first_item )
...
@@ -58,8 +83,8 @@ wxString ReturnUserNetlistTypeName( bool first_item )
msg
=
CUSTOM_NETLIST_TITLE
;
msg
=
CUSTOM_NETLIST_TITLE
;
msg
<<
index
+
1
;
msg
<<
index
+
1
;
if
(
wxGetApp
().
m_EDA_Config
)
if
(
wxGetApp
().
GetSettings
()
)
name
=
wxGetApp
().
m_EDA_Config
->
Read
(
msg
);
name
=
wxGetApp
().
GetSettings
()
->
Read
(
msg
);
return
name
;
return
name
;
}
}
...
@@ -332,7 +357,7 @@ void NETLIST_DIALOG::InstallCustomPages()
...
@@ -332,7 +357,7 @@ void NETLIST_DIALOG::InstallCustomPages()
msg
=
CUSTOM_NETLIST_COMMAND
;
msg
=
CUSTOM_NETLIST_COMMAND
;
msg
<<
ii
+
1
;
msg
<<
ii
+
1
;
wxString
Command
=
wxGetApp
().
m_EDA_Config
->
Read
(
msg
);
wxString
Command
=
wxGetApp
().
GetSettings
()
->
Read
(
msg
);
CurrPage
->
m_LowBoxSizer
->
Add
(
new
wxStaticText
(
CurrPage
,
CurrPage
->
m_LowBoxSizer
->
Add
(
new
wxStaticText
(
CurrPage
,
-
1
,
_
(
"Netlist command:"
)
),
0
,
-
1
,
_
(
"Netlist command:"
)
),
0
,
...
@@ -372,7 +397,7 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event )
...
@@ -372,7 +397,7 @@ void NETLIST_DIALOG::AddNewPluginPanel( wxCommandEvent& event )
wxString
FullFileName
,
Mask
,
Path
;
wxString
FullFileName
,
Mask
,
Path
;
Mask
=
wxT
(
"*"
);
Mask
=
wxT
(
"*"
);
Path
=
wxGetApp
().
m_BinDir
;
Path
=
wxGetApp
().
GetExecutablePath
()
;
FullFileName
=
EDA_FileSelector
(
_
(
"Plugin files:"
),
FullFileName
=
EDA_FileSelector
(
_
(
"Plugin files:"
),
Path
,
Path
,
FullFileName
,
FullFileName
,
...
@@ -650,7 +675,7 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event )
...
@@ -650,7 +675,7 @@ void NETLIST_DIALOG::RunSimulator( wxCommandEvent& event )
void
NETLIST_DIALOG
::
WriteCurrentNetlistSetup
(
void
)
void
NETLIST_DIALOG
::
WriteCurrentNetlistSetup
(
void
)
{
{
wxString
msg
,
Command
;
wxString
msg
,
Command
;
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
NetlistUpdateOpt
();
NetlistUpdateOpt
();
...
...
eeschema/viewlib_frame.cpp
View file @
0e27f45f
...
@@ -513,8 +513,8 @@ void LIB_VIEW_FRAME::LoadSettings( )
...
@@ -513,8 +513,8 @@ void LIB_VIEW_FRAME::LoadSettings( )
EDA_DRAW_FRAME
::
LoadSettings
();
EDA_DRAW_FRAME
::
LoadSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_configPath
);
wxConfigPathChanger
cpc
(
wxGetApp
().
GetSettings
()
,
m_configPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
cfg
=
wxGetApp
().
GetSettings
()
;
m_LibListSize
.
x
=
150
;
// default width of libs list
m_LibListSize
.
x
=
150
;
// default width of libs list
m_CmpListSize
.
x
=
150
;
// default width of component list
m_CmpListSize
.
x
=
150
;
// default width of component list
...
@@ -537,8 +537,8 @@ void LIB_VIEW_FRAME::SaveSettings()
...
@@ -537,8 +537,8 @@ void LIB_VIEW_FRAME::SaveSettings()
EDA_DRAW_FRAME
::
SaveSettings
();
EDA_DRAW_FRAME
::
SaveSettings
();
wxConfigPathChanger
cpc
(
wxGetApp
().
m_EDA_Config
,
m_configPath
);
wxConfigPathChanger
cpc
(
wxGetApp
().
GetSettings
()
,
m_configPath
);
cfg
=
wxGetApp
().
m_EDA_Config
;
cfg
=
wxGetApp
().
GetSettings
()
;
if
(
m_LibListSize
.
x
)
if
(
m_LibListSize
.
x
)
cfg
->
Write
(
LIBLIST_WIDTH_KEY
,
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 )
...
@@ -110,7 +110,7 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( GERBVIEW_FRAME* parent )
/*************************************************************************************/
/*************************************************************************************/
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
InitValues
(
);
InitValues
(
);
...
...
gerbview/gerbview_frame.cpp
View file @
0e27f45f
...
@@ -200,7 +200,7 @@ double GERBVIEW_FRAME::BestZoom()
...
@@ -200,7 +200,7 @@ double GERBVIEW_FRAME::BestZoom()
void
GERBVIEW_FRAME
::
LoadSettings
()
void
GERBVIEW_FRAME
::
LoadSettings
()
{
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
==
NULL
)
if
(
config
==
NULL
)
return
;
return
;
...
@@ -245,7 +245,7 @@ void GERBVIEW_FRAME::LoadSettings()
...
@@ -245,7 +245,7 @@ void GERBVIEW_FRAME::LoadSettings()
void
GERBVIEW_FRAME
::
SaveSettings
()
void
GERBVIEW_FRAME
::
SaveSettings
()
{
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
==
NULL
)
if
(
config
==
NULL
)
return
;
return
;
...
...
gerbview/menubar.cpp
View file @
0e27f45f
...
@@ -82,11 +82,11 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
...
@@ -82,11 +82,11 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
// Add this menu to list menu managed by m_fileHistory
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
// (the file history will be updated when adding/removing files in history
if
(
openRecentGbrMenu
)
if
(
openRecentGbrMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentGbrMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentGbrMenu
);
openRecentGbrMenu
=
new
wxMenu
();
openRecentGbrMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentGbrMenu
);
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentGbrMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
();
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
();
AddMenuItem
(
fileMenu
,
openRecentGbrMenu
,
AddMenuItem
(
fileMenu
,
openRecentGbrMenu
,
wxID_ANY
,
wxID_ANY
,
_
(
"Open &Recent Gerber File"
),
_
(
"Open &Recent Gerber File"
),
...
...
gerbview/select_layers_to_pcb.cpp
View file @
0e27f45f
...
@@ -283,7 +283,7 @@ void LAYERS_MAP_DIALOG::OnResetClick( wxCommandEvent& event )
...
@@ -283,7 +283,7 @@ void LAYERS_MAP_DIALOG::OnResetClick( wxCommandEvent& event )
*/
*/
void
LAYERS_MAP_DIALOG
::
OnStoreSetup
(
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
);
config
->
Write
(
wxT
(
"BrdLayersCount"
),
m_itemsCount
);
wxString
key
;
wxString
key
;
...
@@ -296,7 +296,7 @@ void LAYERS_MAP_DIALOG::OnStoreSetup( wxCommandEvent& event )
...
@@ -296,7 +296,7 @@ void LAYERS_MAP_DIALOG::OnStoreSetup( wxCommandEvent& event )
void
LAYERS_MAP_DIALOG
::
OnGetSetup
(
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
);
config
->
Read
(
wxT
(
"BrdLayersCount"
),
&
m_exportBoardCopperLayersCount
);
normalizeBrdLayersCount
();
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
* @file appl_wxstruct.h
* @brief Base class implementation for all KiCad applications.
* @brief Base class implementation for all KiCad applications.
...
@@ -34,43 +59,55 @@ class wxHtmlHelpController;
...
@@ -34,43 +59,55 @@ class wxHtmlHelpController;
*/
*/
class
EDA_APP
:
public
wxApp
class
EDA_APP
:
public
wxApp
{
{
public
:
protected
:
EDA_APP_T
m_Id
;
/* Used mainly to handle default paths libs
/// Used mainly to handle default paths libs m_Id = APP_EESCHEMA_T, APP_PCBNEW_T ...
* m_Id = APP_EESCHEMA_T, APP_PCBNEW_T ... */
EDA_APP_T
m_Id
;
wxString
m_Project
;
/// Used to prevent multiple instances of an application from being run at the same time.
wxSingleInstanceChecker
*
m_Checker
;
wxSingleInstanceChecker
*
m_Checker
;
wxPoint
m_HelpPos
;
wxString
m_Project
;
wxSize
m_HelpSize
;
wxHtmlHelpController
*
m_HtmlCtrl
;
/// The application specific configuration settings.
wxConfig
*
m_EDA_Config
;
wxConfig
*
m_settings
;
wxConfig
*
m_EDA_CommonConfig
;
wxFileConfig
*
m_ProjectConfig
;
/// The configuration settings common to all KiCad applications.
wxString
m_HelpFileName
;
wxConfig
*
m_commonSettings
;
wxString
m_EditorName
;
wxString
m_CurrentOptionFile
;
/// The current project specific settings.
wxString
m_CurrentOptionFileDateAndTime
;
wxFileConfig
*
m_projectSettings
;
/// KiCad executable path.
wxString
m_BinDir
;
wxString
m_BinDir
;
/* KiCad executable path.*/
/// The KICAD system environment variable.
wxString
m_KicadEnv
;
/* environment variable KICAD */
wxString
m_KicadEnv
;
bool
m_Env_Defined
;
// true if environment KICAD is defined.
/// 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
;
wxPathList
m_searchPaths
;
wxFileHistory
m_fileHistory
;
wxFileHistory
m_fileHistory
;
wxString
m_HelpFileName
;
protected
:
wxString
m_EditorName
;
wxString
m_CurrentOptionFile
;
wxString
m_CurrentOptionFileDateAndTime
;
wxPoint
m_HelpPos
;
wxSize
m_HelpSize
;
wxHtmlHelpController
*
m_HtmlCtrl
;
wxString
m_Title
;
wxString
m_Title
;
wxPathList
m_libSearchPaths
;
wxPathList
m_libSearchPaths
;
wxFileName
m_projectFileName
;
wxFileName
m_projectFileName
;
wxString
m_LastVisitedLibPath
;
wxString
m_LastVisitedLibPath
;
public
:
EDA_APP
();
public
:
EDA_APP
();
~
EDA_APP
();
~
EDA_APP
();
/**
/**
...
@@ -80,6 +117,40 @@ public: EDA_APP();
...
@@ -80,6 +117,40 @@ public: EDA_APP();
*/
*/
bool
OnInit
();
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
* Function SetBinDir
* finds the path to the executable and store it in EDA_APP::m_BinDir
* finds the path to the executable and store it in EDA_APP::m_BinDir
...
@@ -183,7 +254,7 @@ public: EDA_APP();
...
@@ -183,7 +254,7 @@ public: EDA_APP();
/**
/**
* Function SaveCurrentSetupValues
* 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
* saved parameters are parameters that have the .m_Setup member set to
* true
* true
* @param aList = array of PARAM_CFG_BASE pointers
* @param aList = array of PARAM_CFG_BASE pointers
...
@@ -193,7 +264,7 @@ public: EDA_APP();
...
@@ -193,7 +264,7 @@ public: EDA_APP();
/**
/**
* Function ReadCurrentSetupValues
* 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
* saved parameters are parameters that have the .m_Setup member set to
* true
* true
* @param aList = array of PARAM_CFG_BASE pointers
* @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 )
...
@@ -142,12 +142,12 @@ void KICAD_MANAGER_FRAME::OnCloseWindow( wxCloseEvent& Event )
SaveSettings
();
SaveSettings
();
// Close the help frame
// Close the help frame
if
(
wxGetApp
().
m_HtmlCtrl
)
if
(
wxGetApp
().
GetHtmlHelpController
()
)
{
{
if
(
wxGetApp
().
m_HtmlCtrl
->
GetFrame
()
)
// returns NULL if no help frame active
if
(
wxGetApp
().
GetHtmlHelpController
()
->
GetFrame
()
)
// returns NULL if no help frame active
wxGetApp
().
m_HtmlCtrl
->
GetFrame
()
->
Close
(
true
);
wxGetApp
().
GetHtmlHelpController
()
->
GetFrame
()
->
Close
(
true
);
wxGetApp
().
m_HtmlCtrl
=
NULL
;
wxGetApp
().
SetHtmlHelpController
(
NULL
)
;
}
}
m_LeftWin
->
Show
(
false
);
m_LeftWin
->
Show
(
false
);
...
@@ -258,9 +258,9 @@ void KICAD_MANAGER_FRAME::ClearMsg()
...
@@ -258,9 +258,9 @@ void KICAD_MANAGER_FRAME::ClearMsg()
void
KICAD_MANAGER_FRAME
::
LoadSettings
()
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
();
EDA_BASE_FRAME
::
LoadSettings
();
cfg
->
Read
(
TreeFrameWidthEntry
,
&
m_LeftWin_Width
);
cfg
->
Read
(
TreeFrameWidthEntry
,
&
m_LeftWin_Width
);
...
@@ -269,9 +269,9 @@ void KICAD_MANAGER_FRAME::LoadSettings()
...
@@ -269,9 +269,9 @@ void KICAD_MANAGER_FRAME::LoadSettings()
void
KICAD_MANAGER_FRAME
::
SaveSettings
()
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
();
EDA_BASE_FRAME
::
SaveSettings
();
...
...
kicad/menubar.cpp
View file @
0e27f45f
...
@@ -121,11 +121,11 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
...
@@ -121,11 +121,11 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Add this menu to list menu managed by m_fileHistory
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
// (the file history will be updated when adding/removing files in history
if
(
openRecentMenu
)
if
(
openRecentMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentMenu
);
openRecentMenu
=
new
wxMenu
();
openRecentMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
(
);
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
(
);
AddMenuItem
(
fileMenu
,
openRecentMenu
,
AddMenuItem
(
fileMenu
,
openRecentMenu
,
wxID_ANY
,
wxID_ANY
,
_
(
"Open &Recent"
),
_
(
"Open &Recent"
),
...
@@ -211,7 +211,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
...
@@ -211,7 +211,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
SubMenuPdfBrowserChoice
->
Append
(
item
);
SubMenuPdfBrowserChoice
->
Append
(
item
);
SubMenuPdfBrowserChoice
->
Check
(
ID_SELECT_DEFAULT_PDF_BROWSER
,
SubMenuPdfBrowserChoice
->
Check
(
ID_SELECT_DEFAULT_PDF_BROWSER
,
wxGetApp
().
m_PdfBrowserIsDefault
);
wxGetApp
().
UseSystemPdfBrowser
()
);
// Favourite
// Favourite
item
=
new
wxMenuItem
(
SubMenuPdfBrowserChoice
,
item
=
new
wxMenuItem
(
SubMenuPdfBrowserChoice
,
...
@@ -225,7 +225,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
...
@@ -225,7 +225,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
SubMenuPdfBrowserChoice
->
Append
(
item
);
SubMenuPdfBrowserChoice
->
Append
(
item
);
SubMenuPdfBrowserChoice
->
AppendSeparator
();
SubMenuPdfBrowserChoice
->
AppendSeparator
();
SubMenuPdfBrowserChoice
->
Check
(
ID_SELECT_PREFERED_PDF_BROWSER
,
SubMenuPdfBrowserChoice
->
Check
(
ID_SELECT_PREFERED_PDF_BROWSER
,
!
wxGetApp
().
m_PdfBrowserIsDefault
);
!
wxGetApp
().
UseSystemPdfBrowser
()
);
// Append PDF Viewer submenu to preferences
// Append PDF Viewer submenu to preferences
AddMenuItem
(
SubMenuPdfBrowserChoice
,
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__
#ifdef __GNUG__
#pragma implementation
#pragma implementation
...
@@ -18,20 +43,19 @@
...
@@ -18,20 +43,19 @@
void
KICAD_MANAGER_FRAME
::
OnUpdateDefaultPdfBrowser
(
wxUpdateUIEvent
&
event
)
void
KICAD_MANAGER_FRAME
::
OnUpdateDefaultPdfBrowser
(
wxUpdateUIEvent
&
event
)
{
{
event
.
Check
(
wxGetApp
().
m_PdfBrowserIsDefault
);
event
.
Check
(
wxGetApp
().
UseSystemPdfBrowser
()
);
}
}
void
KICAD_MANAGER_FRAME
::
OnSelectDefaultPdfBrowser
(
wxCommandEvent
&
event
)
void
KICAD_MANAGER_FRAME
::
OnSelectDefaultPdfBrowser
(
wxCommandEvent
&
event
)
{
{
wxGetApp
().
m_PdfBrowserIsDefault
=
true
;
wxGetApp
().
WritePdfBrowserInfos
();
wxGetApp
().
WritePdfBrowserInfos
();
}
}
void
KICAD_MANAGER_FRAME
::
OnUpdatePreferredPdfBrowser
(
wxUpdateUIEvent
&
event
)
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 )
...
@@ -39,7 +63,7 @@ void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
{
{
bool
select
=
event
.
GetId
()
==
ID_SELECT_PREFERED_PDF_BROWSER_NAME
;
bool
select
=
event
.
GetId
()
==
ID_SELECT_PREFERED_PDF_BROWSER_NAME
;
if
(
!
wxGetApp
().
m_PdfBrowser
&&
!
select
)
if
(
!
wxGetApp
().
GetPdfBrowserFileName
()
&&
!
select
)
{
{
DisplayError
(
this
,
DisplayError
(
this
,
_
(
"You must choose a PDF viewer before using this option."
)
);
_
(
"You must choose a PDF viewer before using this option."
)
);
...
@@ -54,7 +78,7 @@ void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
...
@@ -54,7 +78,7 @@ void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
wildcard
=
_
(
"Executable files ("
)
+
wildcard
+
wxT
(
")|"
)
+
wildcard
;
wildcard
=
_
(
"Executable files ("
)
+
wildcard
+
wxT
(
")|"
)
+
wildcard
;
wxGetApp
().
ReadPdfBrowserInfos
();
wxGetApp
().
ReadPdfBrowserInfos
();
wxFileName
fn
=
wxGetApp
().
m_PdfBrowser
;
wxFileName
fn
=
wxGetApp
().
GetPdfBrowserFileName
()
;
wxFileDialog
dlg
(
this
,
_
(
"Select Preferred Pdf Browser"
),
fn
.
GetPath
(),
wxFileDialog
dlg
(
this
,
_
(
"Select Preferred Pdf Browser"
),
fn
.
GetPath
(),
fn
.
GetFullName
(),
wildcard
,
fn
.
GetFullName
(),
wildcard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
...
@@ -62,11 +86,11 @@ void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
...
@@ -62,11 +86,11 @@ void KICAD_MANAGER_FRAME::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
;
return
;
wxGetApp
().
m_PdfBrowser
=
dlg
.
GetPath
();
wxGetApp
().
SetPdfBrowserFileName
(
dlg
.
GetPath
()
);
wxGetApp
().
m_PdfBrowserIsDefault
=
wxGetApp
().
m_PdfBrowser
.
IsEmpty
();
wxGetApp
().
WritePdfBrowserInfos
();
wxGetApp
().
WritePdfBrowserInfos
();
}
}
void
KICAD_MANAGER_FRAME
::
SetLanguage
(
wxCommandEvent
&
event
)
void
KICAD_MANAGER_FRAME
::
SetLanguage
(
wxCommandEvent
&
event
)
{
{
EDA_BASE_FRAME
::
SetLanguage
(
event
);
EDA_BASE_FRAME
::
SetLanguage
(
event
);
...
...
pcbnew/basepcbframe.cpp
View file @
0e27f45f
...
@@ -522,9 +522,9 @@ void PCB_BASE_FRAME::unitsChangeRefresh()
...
@@ -522,9 +522,9 @@ void PCB_BASE_FRAME::unitsChangeRefresh()
void
PCB_BASE_FRAME
::
LoadSettings
()
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
();
EDA_DRAW_FRAME
::
LoadSettings
();
...
@@ -566,9 +566,9 @@ void PCB_BASE_FRAME::LoadSettings()
...
@@ -566,9 +566,9 @@ void PCB_BASE_FRAME::LoadSettings()
void
PCB_BASE_FRAME
::
SaveSettings
()
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
();
EDA_DRAW_FRAME
::
SaveSettings
();
cfg
->
Write
(
m_FrameName
+
UserGridSizeXEntry
,
m_UserGridSize
.
x
);
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 ) :
...
@@ -52,8 +52,8 @@ DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) :
DIALOG_SVG_PRINT_base
(
parent
)
DIALOG_SVG_PRINT_base
(
parent
)
{
{
m_Parent
=
(
PCB_BASE_FRAME
*
)
parent
;
m_Parent
=
(
PCB_BASE_FRAME
*
)
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
initDialog
(
);
initDialog
();
GetSizer
()
->
SetSizeHints
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
Centre
();
Centre
();
m_buttonBoard
->
SetDefault
();
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
...
@@ -34,7 +34,7 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_EDIT_FRAME* parent, ZONE_SETTING* zo
DIALOG_COPPER_ZONE_BASE
(
parent
)
DIALOG_COPPER_ZONE_BASE
(
parent
)
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
m_Zone_Setting
=
zone_setting
;
m_Zone_Setting
=
zone_setting
;
m_NetSortingByPadCount
=
true
;
// false = alphabetic sort, true = pad count sort
m_NetSortingByPadCount
=
true
;
// false = alphabetic sort, true = pad count sort
m_OnExitCode
=
ZONE_ABORT
;
m_OnExitCode
=
ZONE_ABORT
;
...
...
pcbnew/dialogs/dialog_freeroute_exchange.cpp
View file @
0e27f45f
...
@@ -54,7 +54,8 @@ void DIALOG_FREEROUTE::MyInit()
...
@@ -54,7 +54,8 @@ void DIALOG_FREEROUTE::MyInit()
m_FreeRouteSetupChanged
=
false
;
m_FreeRouteSetupChanged
=
false
;
wxString
msg
;
wxString
msg
;
wxGetApp
().
m_EDA_Config
->
Read
(
FREEROUTE_URL_KEY
,
&
msg
);
wxGetApp
().
GetSettings
()
->
Read
(
FREEROUTE_URL_KEY
,
&
msg
);
if
(
msg
.
IsEmpty
()
)
if
(
msg
.
IsEmpty
()
)
m_FreerouteURLName
->
SetValue
(
wxT
(
"http://www.freerouting.net/"
)
);
m_FreerouteURLName
->
SetValue
(
wxT
(
"http://www.freerouting.net/"
)
);
else
else
...
@@ -140,8 +141,8 @@ void DIALOG_FREEROUTE::OnOKButtonClick( wxCommandEvent& event )
...
@@ -140,8 +141,8 @@ void DIALOG_FREEROUTE::OnOKButtonClick( wxCommandEvent& event )
{
{
if
(
m_FreeRouteSetupChanged
)
// Save new config
if
(
m_FreeRouteSetupChanged
)
// Save new config
{
{
wxGetApp
().
m_EDA_Config
->
Write
(
FREEROUTE_URL_KEY
,
wxGetApp
().
GetSettings
()
->
Write
(
FREEROUTE_URL_KEY
,
m_FreerouteURLName
->
GetValue
()
);
m_FreerouteURLName
->
GetValue
()
);
}
}
EndModal
(
wxID_OK
);
EndModal
(
wxID_OK
);
...
...
pcbnew/dialogs/dialog_gendrill.cpp
View file @
0e27f45f
...
@@ -100,7 +100,7 @@ DIALOG_GENDRILL::~DIALOG_GENDRILL()
...
@@ -100,7 +100,7 @@ DIALOG_GENDRILL::~DIALOG_GENDRILL()
void
DIALOG_GENDRILL
::
initDialog
()
void
DIALOG_GENDRILL
::
initDialog
()
{
{
SetFocus
();
// Under wxGTK: mandatory to close dialog by the ESC key
SetFocus
();
// Under wxGTK: mandatory to close dialog by the ESC key
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
if
(
Config
)
if
(
Config
)
{
{
...
@@ -234,7 +234,7 @@ void DIALOG_GENDRILL::UpdateConfig()
...
@@ -234,7 +234,7 @@ void DIALOG_GENDRILL::UpdateConfig()
{
{
SetParams
();
SetParams
();
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
if
(
Config
)
if
(
Config
)
{
{
...
...
pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp
View file @
0e27f45f
...
@@ -21,9 +21,7 @@
...
@@ -21,9 +21,7 @@
#include "dialog_pcbnew_config_libs_and_paths.h"
#include "dialog_pcbnew_config_libs_and_paths.h"
/*****************************************************************/
void
PCB_EDIT_FRAME
::
InstallConfigFrame
(
)
void
PCB_EDIT_FRAME
::
InstallConfigFrame
(
)
/*****************************************************************/
{
{
DIALOG_PCBNEW_CONFIG_LIBS
dialog
(
this
);
DIALOG_PCBNEW_CONFIG_LIBS
dialog
(
this
);
dialog
.
ShowModal
();
dialog
.
ShowModal
();
...
@@ -33,11 +31,11 @@ void PCB_EDIT_FRAME::InstallConfigFrame( )
...
@@ -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
::
DIALOG_PCBNEW_CONFIG_LIBS
(
PCB_EDIT_FRAME
*
parent
)
:
DIALOG_PCBNEW_CONFIG_LIBS_FBP
(
parent
)
DIALOG_PCBNEW_CONFIG_LIBS_FBP
(
parent
)
{
{
m_Config
=
wxGetApp
().
m_EDA_CommonConfig
;
m_Config
=
wxGetApp
().
GetCommonSettings
()
;
Init
(
);
Init
(
);
wxString
title
=
_
(
"from "
)
+
wxGetApp
().
m_CurrentOptionFile
;
wxString
title
=
_
(
"from "
)
+
wxGetApp
().
GetCurrentOptionFile
()
;
SetTitle
(
title
);
SetTitle
(
title
);
m_sdbSizer1OK
->
SetDefault
();
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 ) :
...
@@ -85,7 +85,7 @@ DIALOG_PRINT_FOR_MODEDIT::DIALOG_PRINT_FOR_MODEDIT( EDA_DRAW_FRAME* parent ) :
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
s_Parameters
.
m_ForceCentered
=
true
;
s_Parameters
.
m_ForceCentered
=
true
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
InitValues
();
InitValues
();
m_buttonPrint
->
SetDefault
();
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 )
...
@@ -120,7 +120,7 @@ DIALOG_PRINT_USING_PRINTER::DIALOG_PRINT_USING_PRINTER( PCB_EDIT_FRAME* parent )
/*************************************************************************************/
/*************************************************************************************/
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
InitValues
(
);
InitValues
(
);
...
...
pcbnew/edit.cpp
View file @
0e27f45f
...
@@ -1066,7 +1066,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
...
@@ -1066,7 +1066,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_PCB_DISPLAY_FOOTPRINT_DOC
:
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
);
cfg
->
Read
(
wxT
(
"module_doc_file"
),
g_DocModulesFileName
);
GetAssociatedDocument
(
this
,
g_DocModulesFileName
,
&
wxGetApp
().
GetLibraryPathList
()
);
GetAssociatedDocument
(
this
,
g_DocModulesFileName
,
&
wxGetApp
().
GetLibraryPathList
()
);
}
}
...
...
pcbnew/export_vrml.cpp
View file @
0e27f45f
...
@@ -51,7 +51,7 @@ public:
...
@@ -51,7 +51,7 @@ public:
DIALOG_EXPORT_3DFILE_BASE
(
parent
)
DIALOG_EXPORT_3DFILE_BASE
(
parent
)
{
{
m_parent
=
parent
;
m_parent
=
parent
;
m_config
=
wxGetApp
().
m_EDA_Config
;
m_config
=
wxGetApp
().
GetSettings
()
;
SetFocus
();
SetFocus
();
m_config
->
Read
(
OPTKEY_OUTPUT_UNIT
,
&
m_unitsOpt
);
m_config
->
Read
(
OPTKEY_OUTPUT_UNIT
,
&
m_unitsOpt
);
m_config
->
Read
(
OPTKEY_3DFILES_OPT
,
&
m_3DFilesOpt
);
m_config
->
Read
(
OPTKEY_3DFILES_OPT
,
&
m_3DFilesOpt
);
...
...
pcbnew/librairi.cpp
View file @
0e27f45f
...
@@ -51,7 +51,7 @@ MODULE* FOOTPRINT_EDIT_FRAME::Import_Module()
...
@@ -51,7 +51,7 @@ MODULE* FOOTPRINT_EDIT_FRAME::Import_Module()
bool
Footprint_Is_GPCB_Format
=
false
;
bool
Footprint_Is_GPCB_Format
=
false
;
wxString
LastOpenedPathForLoading
;
wxString
LastOpenedPathForLoading
;
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
if
(
Config
)
if
(
Config
)
Config
->
Read
(
EXPORT_IMPORT_LASTPATH_KEY
,
&
LastOpenedPathForLoading
);
Config
->
Read
(
EXPORT_IMPORT_LASTPATH_KEY
,
&
LastOpenedPathForLoading
);
...
@@ -145,7 +145,7 @@ void FOOTPRINT_EDIT_FRAME::Export_Module( MODULE* aModule, bool aCreateSysLib )
...
@@ -145,7 +145,7 @@ void FOOTPRINT_EDIT_FRAME::Export_Module( MODULE* aModule, bool aCreateSysLib )
wxFileName
fn
;
wxFileName
fn
;
FILE
*
file
;
FILE
*
file
;
wxString
msg
,
path
,
title
,
wildcard
;
wxString
msg
,
path
,
title
,
wildcard
;
wxConfig
*
Config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
Config
=
wxGetApp
().
GetSettings
()
;
if
(
aModule
==
NULL
)
if
(
aModule
==
NULL
)
return
;
return
;
...
...
pcbnew/menubar_pcbframe.cpp
View file @
0e27f45f
...
@@ -78,11 +78,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
...
@@ -78,11 +78,11 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Add this menu to list menu managed by m_fileHistory
// Add this menu to list menu managed by m_fileHistory
// (the file history will be updated when adding/removing files in history
// (the file history will be updated when adding/removing files in history
if
(
openRecentMenu
)
if
(
openRecentMenu
)
wxGetApp
().
m_fileHistory
.
RemoveMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
RemoveMenu
(
openRecentMenu
);
openRecentMenu
=
new
wxMenu
();
openRecentMenu
=
new
wxMenu
();
wxGetApp
().
m_fileHistory
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
GetFileHistory
()
.
UseMenu
(
openRecentMenu
);
wxGetApp
().
m_fileHistory
.
AddFilesToMenu
();
wxGetApp
().
GetFileHistory
()
.
AddFilesToMenu
();
AddMenuItem
(
filesMenu
,
openRecentMenu
,
AddMenuItem
(
filesMenu
,
openRecentMenu
,
-
1
,
_
(
"Open &Recent"
),
-
1
,
_
(
"Open &Recent"
),
_
(
"Open a recent opened board"
),
_
(
"Open a recent opened board"
),
...
...
pcbnew/pcbframe.cpp
View file @
0e27f45f
...
@@ -544,7 +544,7 @@ void PCB_EDIT_FRAME::ShowDesignRulesEditor( wxCommandEvent& event )
...
@@ -544,7 +544,7 @@ void PCB_EDIT_FRAME::ShowDesignRulesEditor( wxCommandEvent& event )
void
PCB_EDIT_FRAME
::
LoadSettings
()
void
PCB_EDIT_FRAME
::
LoadSettings
()
{
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
==
NULL
)
if
(
config
==
NULL
)
return
;
return
;
...
@@ -572,7 +572,7 @@ void PCB_EDIT_FRAME::LoadSettings()
...
@@ -572,7 +572,7 @@ void PCB_EDIT_FRAME::LoadSettings()
void
PCB_EDIT_FRAME
::
SaveSettings
()
void
PCB_EDIT_FRAME
::
SaveSettings
()
{
{
wxConfig
*
config
=
wxGetApp
().
m_EDA_Config
;
wxConfig
*
config
=
wxGetApp
().
GetSettings
()
;
if
(
config
==
NULL
)
if
(
config
==
NULL
)
return
;
return
;
...
...
pcbnew/pcbplot.cpp
View file @
0e27f45f
...
@@ -91,7 +91,7 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* parent ) :
...
@@ -91,7 +91,7 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* parent ) :
DIALOG_PLOT_BASE
(
parent
)
DIALOG_PLOT_BASE
(
parent
)
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
m_Config
=
wxGetApp
().
m_EDA_Config
;
m_Config
=
wxGetApp
().
GetSettings
()
;
Init_Dialog
();
Init_Dialog
();
...
...
pcbnew/zones_by_polygon.cpp
View file @
0e27f45f
...
@@ -479,10 +479,10 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
...
@@ -479,10 +479,10 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
zone
->
SetNetNameFromNetCode
(
);
zone
->
SetNetNameFromNetCode
(
);
}
}
wxGetApp
().
m_EDA_Config
->
Read
(
ZONE_THERMAL_RELIEF_GAP_STRING_KEY
,
wxGetApp
().
GetSettings
()
->
Read
(
ZONE_THERMAL_RELIEF_GAP_STRING_KEY
,
&
g_Zone_Default_Setting
.
m_ThermalReliefGap
);
&
g_Zone_Default_Setting
.
m_ThermalReliefGap
);
wxGetApp
().
m_EDA_Config
->
Read
(
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY
,
wxGetApp
().
GetSettings
()
->
Read
(
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY
,
&
g_Zone_Default_Setting
.
m_ThermalReliefCopperBridge
);
&
g_Zone_Default_Setting
.
m_ThermalReliefCopperBridge
);
g_Zone_Default_Setting
.
m_CurrentZone_Layer
=
zone
->
GetLayer
();
g_Zone_Default_Setting
.
m_CurrentZone_Layer
=
zone
->
GetLayer
();
DIALOG_COPPER_ZONE
*
frame
=
new
DIALOG_COPPER_ZONE
(
this
,
&
g_Zone_Default_Setting
);
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 )
...
@@ -152,10 +152,10 @@ void DialogNonCopperZonesEditor::OnOkClick( wxCommandEvent& event )
break
;
break
;
}
}
if
(
wxGetApp
().
m_EDA_Config
)
if
(
wxGetApp
().
GetSettings
()
)
{
{
wxGetApp
().
m_EDA_Config
->
Write
(
ZONE_NET_OUTLINES_HATCH_OPTION_KEY
,
wxGetApp
().
GetSettings
()
->
Write
(
ZONE_NET_OUTLINES_HATCH_OPTION_KEY
,
(
long
)
g_Zone_Default_Setting
.
m_Zone_HatchingStyle
);
(
long
)
g_Zone_Default_Setting
.
m_Zone_HatchingStyle
);
}
}
if
(
m_OrientEdgesOpt
->
GetSelection
()
==
0
)
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