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
3be6ba42
Commit
3be6ba42
authored
Jul 13, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged dialog_load_error_base and dialog_display_info_HTML_base, code cleaning
parent
1700a6a7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
47 deletions
+37
-47
CMakeLists.txt
common/CMakeLists.txt
+0
-1
dialog_load_error.cpp
common/dialog_load_error.cpp
+5
-5
listlib.cpp
cvpcb/listlib.cpp
+23
-31
eelibs_read_libraryfiles.cpp
eeschema/eelibs_read_libraryfiles.cpp
+5
-6
dialog_load_error.h
include/dialog_load_error.h
+4
-4
No files found.
common/CMakeLists.txt
View file @
3be6ba42
...
...
@@ -24,7 +24,6 @@ set(COMMON_SRCS
copy_to_clipboard.cpp
dialog_display_info_HTML_base.cpp
dialog_load_error.cpp
dialog_load_error_base.cpp
dcsvg.cpp
displlst.cpp
dlist.cpp
...
...
common/dialog_load_error.cpp
View file @
3be6ba42
...
...
@@ -10,7 +10,7 @@ DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, _("Load Error!"),wxDefaultPosit
void
DIALOG_LOAD_ERROR
::
OnCloseButtonClick
(
wxCommandEvent
&
event
)
{
Destroy
(
);
EndModal
(
0
);
}
...
...
@@ -23,11 +23,11 @@ void DIALOG_LOAD_ERROR::ListClear(void)
* Add a list of items.
* @param list = a pointer on a string containing items. Items are separated by '\n'
*/
void
DIALOG_LOAD_ERROR
::
ListSet
(
wxString
*
list
)
void
DIALOG_LOAD_ERROR
::
ListSet
(
const
wxString
&
list
)
{
wxArrayString
*
wxStringSplit
(
wxString
txt
,
wxChar
splitter
);
wxArrayString
*
strings_list
=
wxStringSplit
(
*
list
,
wxChar
(
'\n'
)
);
wxArrayString
*
strings_list
=
wxStringSplit
(
list
,
wxChar
(
'\n'
)
);
m_htmlWindow
->
AppendToPage
(
wxT
(
"<ul>"
)
);
for
(
unsigned
ii
=
0
;
ii
<
strings_list
->
GetCount
();
ii
++
)
{
...
...
@@ -44,10 +44,10 @@ void DIALOG_LOAD_ERROR::ListSet(wxString *list)
* Add a message (in bold) to message list.
* @param message = a pointer to the message
*/
void
DIALOG_LOAD_ERROR
::
MessageSet
(
wxString
*
message
)
void
DIALOG_LOAD_ERROR
::
MessageSet
(
const
wxString
&
message
)
{
wxString
message_value
;
message_value
.
Printf
(
wxT
(
"<b>%s</b><br>"
),
message
->
GetData
()
);
message_value
.
Printf
(
wxT
(
"<b>%s</b><br>"
),
message
.
GetData
()
);
m_htmlWindow
->
AppendToPage
(
message_value
);
}
cvpcb/listlib.cpp
View file @
3be6ba42
...
...
@@ -76,9 +76,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
if
(
!
tmp
)
{
msg
.
Printf
(
_
(
"PCB foot print library file <%s> could not be found in the default search paths."
),
filename
.
GetFullName
().
c_str
()
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
mdc_files_not_found
<<
filename
.
GetFullName
()
<<
wxT
(
"
\n
"
);
continue
;
}
...
...
@@ -87,9 +85,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
if
(
file
==
NULL
)
{
msg
.
Printf
(
_
(
"Could not open PCB foot print library file <%s>."
),
tmp
.
c_str
()
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
mdc_files_invalid
<<
tmp
<<
_
(
" (file cannot be opened)"
)
<<
wxT
(
"
\n
"
);
continue
;
}
...
...
@@ -97,9 +93,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
fgets
(
buffer
,
32
,
file
);
if
(
strncmp
(
buffer
,
ENTETE_LIBRAIRIE
,
L_ENTETE_LIB
)
!=
0
)
{
msg
.
Printf
(
_
(
"<%s> is not a valid Kicad PCB foot print library"
),
tmp
.
c_str
()
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
mdc_files_invalid
<<
tmp
<<
_
(
" (Not a Kicad file)"
)
<<
wxT
(
"
\n
"
);
fclose
(
file
);
continue
;
}
...
...
@@ -129,9 +123,7 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
if
(
!
end
)
{
msg
.
Printf
(
_
(
"Unexpected end of file occurred while parsing PCB foot print library <%s>."
),
tmp
.
c_str
()
);
wxMessageBox
(
msg
,
titleLibLoadError
,
wxOK
|
wxICON_ERROR
);
mdc_files_invalid
<<
tmp
<<
_
(
" (Unexpected end of file)"
)
<<
wxT
(
"
\n
"
);
}
}
}
...
...
@@ -144,26 +136,26 @@ bool LoadFootprintFiles( const wxArrayString& libNames,
/* Display if there are mdc files not found */
if
(
!
mdc_files_not_found
.
IsEmpty
()
)
{
wxString
message
=
_
(
"Some MDC files could not be found!"
);
DIALOG_LOAD_ERROR
*
dialog
=
new
DIALOG_LOAD_ERROR
(
NULL
);
dialog
->
Show
();
dialog
->
MessageSet
(
&
message
);
dialog
->
ListSet
(
&
mdc_files_not_found
);
mdc_files_not_found
=
wxT
(
""
);
}
if
(
!
mdc_files_not_found
.
IsEmpty
()
||
!
mdc_files_invalid
.
IsEmpty
()
)
{
DIALOG_LOAD_ERROR
dialog
(
NULL
);
if
(
!
mdc_files_not_found
.
IsEmpty
()
)
{
wxString
message
=
_
(
"Some MDC files could not be found!"
);
dialog
.
MessageSet
(
message
);
dialog
.
ListSet
(
mdc_files_not_found
);
mdc_files_not_found
.
Empty
();
}
/* Display if there are mdc files invalid */
if
(
!
mdc_files_invalid
.
IsEmpty
()
)
{
wxString
message
=
_
(
"Some MDC files are invalid!"
);
DIALOG_LOAD_ERROR
*
dialog
=
new
DIALOG_LOAD_ERROR
(
NULL
);
dialog
->
Show
();
dialog
->
MessageSet
(
&
message
);
dialog
->
ListSet
(
&
mdc_files_invalid
);
mdc_files_invalid
=
wxT
(
""
);
}
/* Display if there are mdc files invalid */
if
(
!
mdc_files_invalid
.
IsEmpty
()
)
{
dialog
.
MessageSet
(
_
(
"Some MDC files are invalid!"
));
dialog
.
ListSet
(
mdc_files_invalid
);
mdc_files_invalid
.
Empty
();
}
dialog
.
ShowModal
();
}
list
.
sort
();
...
...
eeschema/eelibs_read_libraryfiles.cpp
View file @
3be6ba42
...
...
@@ -168,12 +168,11 @@ void LoadLibraries( WinEDA_SchematicFrame* frame )
/* Print the libraries not found */
if
(
!
libraries_not_found
.
IsEmpty
()
)
{
wxString
message
=
_
(
"The following libraries could not be found:"
);
DIALOG_LOAD_ERROR
*
dialog
=
new
DIALOG_LOAD_ERROR
(
NULL
);
dialog
->
Show
();
dialog
->
MessageSet
(
&
message
);
dialog
->
ListSet
(
&
libraries_not_found
);
libraries_not_found
=
wxT
(
""
);
DIALOG_LOAD_ERROR
dialog
(
frame
);
dialog
.
MessageSet
(
_
(
"The following libraries could not be found:"
));
dialog
.
ListSet
(
libraries_not_found
);
libraries_not_found
.
empty
();
dialog
.
ShowModal
();
}
...
...
include/dialog_load_error.h
View file @
3be6ba42
...
...
@@ -20,15 +20,15 @@ public:
DIALOG_LOAD_ERROR
(
wxWindow
*
parent
);
/** Function ListSet
* Add a list of items.
* @param list = a
pointer on a
string containing items. Items are separated by '\n'
* @param list = a string containing items. Items are separated by '\n'
*/
void
ListSet
(
wxString
*
list
);
void
ListSet
(
const
wxString
&
list
);
void
ListClear
();
/** Function MessageSet
* Add a message (in bold) to message list.
* @param message =
a pointer to
the message
* @param message = the message
*/
void
MessageSet
(
wxString
*
message
);
void
MessageSet
(
const
wxString
&
message
);
};
#endif // __dialog_load_error_h_
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