Commit 9b97938a authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Code cleaning: rename DIALOG_LOAD_ERROR (a stupid name) class to the more...

Code cleaning: rename DIALOG_LOAD_ERROR (a stupid name)  class to the more understandable  HTML_MESSAGE_BOX.
rename corresponding files are move them in a better place.
parent 4da0bfc2
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@ set( COMMON_ABOUT_DLG_SRCS
    dialogs/dialog_get_component_base.cpp
    dialogs/dialog_get_component_base.cpp
    dialogs/dialog_hotkeys_editor.cpp
    dialogs/dialog_hotkeys_editor.cpp
    dialogs/dialog_hotkeys_editor_base.cpp
    dialogs/dialog_hotkeys_editor_base.cpp
    dialogs/dialog_load_error.cpp
    dialogs/dialog_page_settings_base.cpp
    dialogs/dialog_page_settings_base.cpp
)
)


@@ -58,6 +57,7 @@ set(COMMON_SRCS
    gr_basic.cpp
    gr_basic.cpp
    hotkeys_basic.cpp
    hotkeys_basic.cpp
    hotkey_grid_table.cpp
    hotkey_grid_table.cpp
    html_messagebox.cpp
    msgpanel.cpp
    msgpanel.cpp
    netlist_keywords.cpp
    netlist_keywords.cpp
    newstroke_font.cpp
    newstroke_font.cpp
+19 −9
Original line number Original line Diff line number Diff line
#include "fctsys.h"
#include "fctsys.h"
#include "dialog_load_error.h"
#include "html_messagebox.h"
#include "macros.h"
#include "macros.h"


DIALOG_LOAD_ERROR::DIALOG_LOAD_ERROR( wxWindow* parent )
HTML_MESSAGE_BOX::HTML_MESSAGE_BOX( wxWindow* parent, const wxString & aTitle,
:
                                      wxPoint aPos, wxSize aSize)
DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, _("Load Error!"),wxDefaultPosition, wxSize( 450,250 ) )
    : DIALOG_DISPLAY_HTML_TEXT_BASE( parent, wxID_ANY, aTitle, aPos, aSize )
{
{
    SetFocus();
    SetFocus();
    ListClear();
    ListClear();
}
}


void DIALOG_LOAD_ERROR::OnCloseButtonClick( wxCommandEvent& event )
void HTML_MESSAGE_BOX::OnCloseButtonClick( wxCommandEvent& event )
{
{
    EndModal(0);
    EndModal(0);
}
}




void DIALOG_LOAD_ERROR::ListClear(void)
void HTML_MESSAGE_BOX::ListClear(void)
{
{
    m_htmlWindow->SetPage(wxEmptyString);
    m_htmlWindow->SetPage(wxEmptyString);
}
}
@@ -26,7 +26,7 @@ void DIALOG_LOAD_ERROR::ListClear(void)
 * Add a list of items.
 * Add a list of items.
 * @param aList = a string containing items. Items are separated by '\n'
 * @param aList = a string containing items. Items are separated by '\n'
 */
 */
void DIALOG_LOAD_ERROR::ListSet(const wxString &aList)
void HTML_MESSAGE_BOX::ListSet(const wxString &aList)
{
{
    wxArrayString* wxStringSplit( wxString txt, wxChar splitter );
    wxArrayString* wxStringSplit( wxString txt, wxChar splitter );


@@ -48,7 +48,7 @@ void DIALOG_LOAD_ERROR::ListSet(const wxString &aList)
 * Add a list of items.
 * Add a list of items.
 * @param aList = a wxArrayString containing items
 * @param aList = a wxArrayString containing items
 */
 */
void DIALOG_LOAD_ERROR::ListSet(const wxArrayString &aList)
void HTML_MESSAGE_BOX::ListSet(const wxArrayString &aList)
{
{
    wxString msg = wxT("<ul>");
    wxString msg = wxT("<ul>");
    for ( unsigned ii = 0; ii < aList.GetCount(); ii ++ )
    for ( unsigned ii = 0; ii < aList.GetCount(); ii ++ )
@@ -65,10 +65,20 @@ void DIALOG_LOAD_ERROR::ListSet(const wxArrayString &aList)
 * Add a message (in bold) to message list.
 * Add a message (in bold) to message list.
 * @param message = the message
 * @param message = the message
 */
 */
void DIALOG_LOAD_ERROR::MessageSet(const wxString &message)
void HTML_MESSAGE_BOX::MessageSet(const wxString &message)
{
{
    wxString message_value;
    wxString message_value;
    message_value.Printf(wxT("<b>%s</b><br>"), GetChars( message ) );
    message_value.Printf(wxT("<b>%s</b><br>"), GetChars( message ) );
    m_htmlWindow->AppendToPage( message_value );
    m_htmlWindow->AppendToPage( message_value );
}
}


/**
 * Function AddHTML_Text
 * Add a text to message list.
 * @param message = the text to add
 */
void HTML_MESSAGE_BOX::AddHTML_Text(const wxString &message)
{
    m_htmlWindow->AppendToPage( message );
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -17,7 +17,7 @@
#include "dialog_cvpcb_config.h"
#include "dialog_cvpcb_config.h"
#include "class_DisplayFootprintsFrame.h"
#include "class_DisplayFootprintsFrame.h"
#include "cvpcb_id.h"
#include "cvpcb_id.h"
#include "dialog_load_error.h"
#include "html_messagebox.h"




#include "build_version.h"
#include "build_version.h"
@@ -578,7 +578,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles()
    /* Display error messages, if any */
    /* Display error messages, if any */
    if( !m_footprints.m_filesNotFound.IsEmpty() || !m_footprints.m_filesInvalid.IsEmpty() )
    if( !m_footprints.m_filesNotFound.IsEmpty() || !m_footprints.m_filesInvalid.IsEmpty() )
    {
    {
        DIALOG_LOAD_ERROR dialog( NULL );
        HTML_MESSAGE_BOX dialog( this, _("Load Error") );


        if( !m_footprints.m_filesNotFound.IsEmpty() )
        if( !m_footprints.m_filesNotFound.IsEmpty() )
        {
        {
+2 −2
Original line number Original line Diff line number Diff line
@@ -11,7 +11,7 @@
#include "general.h"
#include "general.h"
#include "class_library.h"
#include "class_library.h"


#include "dialog_load_error.h"
#include "html_messagebox.h"




/**
/**
@@ -94,7 +94,7 @@ void SCH_EDIT_FRAME::LoadLibraries( void )
    /* Print the libraries not found */
    /* Print the libraries not found */
    if( !libraries_not_found.IsEmpty() )
    if( !libraries_not_found.IsEmpty() )
    {
    {
        DIALOG_LOAD_ERROR dialog( this );
        HTML_MESSAGE_BOX dialog( this, _("Files not found") );
        dialog.MessageSet( _( "The following libraries could not be found:" ) );
        dialog.MessageSet( _( "The following libraries could not be found:" ) );
        dialog.ListSet( libraries_not_found );
        dialog.ListSet( libraries_not_found );
        libraries_not_found.empty();
        libraries_not_found.empty();
+2 −2
Original line number Original line Diff line number Diff line
@@ -70,7 +70,7 @@


#include <math.h>
#include <math.h>


#include "dialog_load_error.h"
#include "html_messagebox.h"


extern int    ReadInt( char*& text, bool aSkipSeparator = true );
extern int    ReadInt( char*& text, bool aSkipSeparator = true );
extern double ReadDouble( char*& text, bool aSkipSeparator = true );
extern double ReadDouble( char*& text, bool aSkipSeparator = true );
@@ -180,7 +180,7 @@ bool GERBVIEW_FRAME::Read_EXCELLON_File( const wxString& aFullFileName )
    // Display errors list
    // Display errors list
    if( m_Messages.size() > 0 )
    if( m_Messages.size() > 0 )
    {
    {
        DIALOG_LOAD_ERROR dlg( this );
        HTML_MESSAGE_BOX dlg( this, _("Files not found") );
        dlg.ListSet( m_Messages );
        dlg.ListSet( m_Messages );
        dlg.ShowModal();
        dlg.ShowModal();
    }
    }
Loading