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
84c782fb
Commit
84c782fb
authored
May 15, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try to delete a footprint library before exporting or creating, quietly
parent
42f1b9e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
richio.h
include/richio.h
+1
-1
librairi.cpp
pcbnew/librairi.cpp
+16
-13
No files found.
include/richio.h
View file @
84c782fb
...
...
@@ -140,7 +140,7 @@ struct PARSE_ERROR : public IO_ERROR
// wxString errorText is still public from IO_ERROR
int
lineNumber
;
///< at which line number, 1 based index.
int
byteIndex
;
///< at which
character position
within the line, 1 based index
int
byteIndex
;
///< at which
byte offset
within the line, 1 based index
/// problem line of input [say, from a LINE_READER].
/// this is brought up in original byte format rather than wxString form, incase
...
...
pcbnew/librairi.cpp
View file @
84c782fb
...
...
@@ -25,15 +25,6 @@
#include <legacy_plugin.h> // temporarily, for LoadMODULE()
/*
* Module library header format:
* Array LIBRARY HEADER-datetime
* $INDEX
* List of modules names (1 name per line)
* $EndIndex
* List of descriptions of Modules
* $EndLIBRARY
*/
#define BACKUP_EXT wxT( "bak" )
#define FILETMP_EXT wxT( "$$$" )
#define EXPORT_IMPORT_LASTPATH_KEY wxT( "import_last_path" )
...
...
@@ -191,7 +182,7 @@ void FOOTPRINT_EDIT_FRAME::Export_Module( MODULE* aModule, bool aCreateSysLib )
config
->
Write
(
EXPORT_IMPORT_LASTPATH_KEY
,
fn
.
GetPath
()
);
}
wxString
lib
Name
=
fn
.
GetFullPath
();
wxString
lib
Path
=
fn
.
GetFullPath
();
try
{
...
...
@@ -200,8 +191,20 @@ void FOOTPRINT_EDIT_FRAME::Export_Module( MODULE* aModule, bool aCreateSysLib )
// Use IO_MGR::LEGACY for now, until the IO_MGR::KICAD plugin is ready.
PLUGIN
::
RELEASER
pi
(
IO_MGR
::
PluginFind
(
IO_MGR
::
LEGACY
)
);
pi
->
FootprintLibCreate
(
libName
);
pi
->
FootprintSave
(
libName
,
aModule
);
try
{
// try to delete the library whether it exists or not, quietly.
pi
->
FootprintLibDelete
(
libPath
);
}
catch
(
IO_ERROR
ioe
)
{
// Ignore this, it will often happen and is not an error because
// the library may not exist. If library was in a read only directory,
// it will still exist as we get to the FootprintLibCreate() below.
}
pi
->
FootprintLibCreate
(
libPath
);
pi
->
FootprintSave
(
libPath
,
aModule
);
}
catch
(
IO_ERROR
ioe
)
{
...
...
@@ -209,7 +212,7 @@ void FOOTPRINT_EDIT_FRAME::Export_Module( MODULE* aModule, bool aCreateSysLib )
return
;
}
msg
.
Printf
(
_
(
"Module exported in file <%s>"
),
lib
Name
.
GetData
()
);
msg
.
Printf
(
_
(
"Module exported in file <%s>"
),
lib
Path
.
GetData
()
);
DisplayInfoMessage
(
this
,
msg
);
}
...
...
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