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
2fbe1447
Commit
2fbe1447
authored
Apr 30, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beautify
parent
0104e614
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
43 deletions
+48
-43
prjconfig.cpp
kicad/prjconfig.cpp
+48
-43
No files found.
kicad/prjconfig.cpp
View file @
2fbe1447
/*************************************************************/
/*************************************************************/
/** prjconfig.cpp : load and save configuration (file *.pro) */
/** prjconfig.cpp : load and save configuration (file *.pro) */
/*************************************************************/
/*************************************************************/
#ifdef KICAD_PYTHON
#ifdef KICAD_PYTHON
...
@@ -20,25 +20,26 @@
...
@@ -20,25 +20,26 @@
void
WinEDA_MainFrame
::
Load_Prj_Config
()
void
WinEDA_MainFrame
::
Load_Prj_Config
()
/*******************************************/
/*******************************************/
{
{
if
(
!
wxFileExists
(
m_PrjFileName
)
)
if
(
!
wxFileExists
(
m_PrjFileName
)
)
{
{
wxString
msg
=
_
(
"Project File <"
)
+
m_PrjFileName
+
_
(
"> not found"
);
wxString
msg
=
_
(
"Project File <"
)
+
m_PrjFileName
+
_
(
"> not found"
);
DisplayError
(
this
,
msg
);
DisplayError
(
this
,
msg
);
return
;
return
;
}
}
wxSetWorkingDirectory
(
wxPathOnly
(
m_PrjFileName
)
);
wxSetWorkingDirectory
(
wxPathOnly
(
m_PrjFileName
)
);
SetTitle
(
g_Main_Title
+
wxT
(
" "
)
+
GetBuildVersion
()
+
wxT
(
" "
)
+
m_PrjFileName
);
SetTitle
(
g_Main_Title
+
wxT
(
" "
)
+
GetBuildVersion
()
+
wxT
(
" "
)
+
m_PrjFileName
);
ReCreateMenuBar
();
ReCreateMenuBar
();
m_LeftWin
->
ReCreateTreePrj
();
m_LeftWin
->
ReCreateTreePrj
();
wxString
msg
=
_
(
"
\n
Working dir: "
)
+
wxGetCwd
();
wxString
msg
=
_
(
"
\n
Working dir: "
)
+
wxGetCwd
();
msg
<<
_
(
"
\n
Project: "
)
<<
m_PrjFileName
<<
wxT
(
"
\n
"
);
msg
<<
_
(
"
\n
Project: "
)
<<
m_PrjFileName
<<
wxT
(
"
\n
"
);
PrintMsg
(
msg
);
PrintMsg
(
msg
);
#ifdef KICAD_PYTHON
PyHandler
::
GetInstance
()
->
TriggerEvent
(
wxT
(
"kicad::LoadProject"
),
PyHandler
::
Convert
(
m_PrjFileName
)
);
#ifdef KICAD_PYTHON
#endif
PyHandler
::
GetInstance
()
->
TriggerEvent
(
wxT
(
"kicad::LoadProject"
),
PyHandler
::
Convert
(
m_PrjFileName
)
);
#endif
}
}
...
@@ -46,15 +47,16 @@ void WinEDA_MainFrame::Load_Prj_Config()
...
@@ -46,15 +47,16 @@ void WinEDA_MainFrame::Load_Prj_Config()
void
WinEDA_MainFrame
::
Save_Prj_Config
()
void
WinEDA_MainFrame
::
Save_Prj_Config
()
/*********************************************/
/*********************************************/
{
{
wxString
FullFileName
;
wxString
FullFileName
;
wxString
mask
(
wxT
(
"*"
));
g_Prj_Config_Filename_ext
=
wxT
(
".pro"
);
wxString
mask
(
wxT
(
"*"
)
);
g_Prj_Config_Filename_ext
=
wxT
(
".pro"
);
mask
+=
g_Prj_Config_Filename_ext
;
mask
+=
g_Prj_Config_Filename_ext
;
FullFileName
=
m_PrjFileName
;
FullFileName
=
m_PrjFileName
;
ChangeFileNameExt
(
FullFileName
,
g_Prj_Config_Filename_ext
);
ChangeFileNameExt
(
FullFileName
,
g_Prj_Config_Filename_ext
);
FullFileName
=
EDA_FileSelector
(
_
(
"Save project file"
),
FullFileName
=
EDA_FileSelector
(
_
(
"Save project file"
),
wxGetCwd
(),
/* Chemin par defaut */
wxGetCwd
(),
/* Chemin par defaut */
FullFileName
,
/* nom fichier par defaut */
FullFileName
,
/* nom fichier par defaut */
g_Prj_Config_Filename_ext
,
/* extension par defaut */
g_Prj_Config_Filename_ext
,
/* extension par defaut */
...
@@ -63,10 +65,13 @@ wxString mask( wxT("*"));
...
@@ -63,10 +65,13 @@ wxString mask( wxT("*"));
wxFD_SAVE
,
wxFD_SAVE
,
TRUE
TRUE
);
);
if
(
FullFileName
.
IsEmpty
()
)
return
;
if
(
FullFileName
.
IsEmpty
()
)
return
;
/* ecriture de la configuration */
/* ecriture de la configuration */
g_EDA_Appl
->
WriteProjectConfig
(
FullFileName
,
wxT
(
"/general"
),
CfgParamList
);
g_EDA_Appl
->
WriteProjectConfig
(
FullFileName
,
wxT
(
"/general"
),
CfgParamList
);
}
}
// vim: set tabstop=4 : noexpandtab :
// vim: set tabstop=4 : noexpandtab :
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