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