diff --git a/common/dialogs/panel_embedded_files.cpp b/common/dialogs/panel_embedded_files.cpp
index 8fdf9e0871..66a7aef23d 100644
--- a/common/dialogs/panel_embedded_files.cpp
+++ b/common/dialogs/panel_embedded_files.cpp
@@ -313,13 +313,21 @@ EMBEDDED_FILES::EMBEDDED_FILE* PANEL_EMBEDDED_FILES::AddEmbeddedFile( const wxSt
}
-void PANEL_EMBEDDED_FILES::onAddEmbeddedFile( wxCommandEvent& event )
+void PANEL_EMBEDDED_FILES::onAddEmbeddedFiles( wxCommandEvent& event )
{
+ // TODO: Update strings to reflect that multiple files can be selected.
wxFileDialog fileDialog( this, _( "Select a file to embed" ), wxEmptyString, wxEmptyString,
- _( "All files|*.*" ), wxFD_OPEN | wxFD_FILE_MUST_EXIST );
+ _( "All files|*.*" ),
+ wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE );
if( fileDialog.ShowModal() == wxID_OK )
- AddEmbeddedFile( fileDialog.GetPath() );
+ {
+ wxArrayString paths;
+ fileDialog.GetPaths( paths );
+
+ for( wxString path : paths )
+ AddEmbeddedFile( path );
+ }
}
diff --git a/common/dialogs/panel_embedded_files.h b/common/dialogs/panel_embedded_files.h
index b94d499473..de1963d0a8 100644
--- a/common/dialogs/panel_embedded_files.h
+++ b/common/dialogs/panel_embedded_files.h
@@ -68,7 +68,7 @@ public:
protected:
void onFontEmbedClick( wxCommandEvent& event ) override;
- void onAddEmbeddedFile( wxCommandEvent& event ) override;
+ void onAddEmbeddedFiles( wxCommandEvent& event ) override;
void onDeleteEmbeddedFile( wxCommandEvent& event ) override;
void onExportFiles( wxCommandEvent& event ) override;
void onSize( wxSizeEvent& event ) override;
diff --git a/common/dialogs/panel_embedded_files_base.cpp b/common/dialogs/panel_embedded_files_base.cpp
index 11606da117..1d2ddf01c6 100644
--- a/common/dialogs/panel_embedded_files_base.cpp
+++ b/common/dialogs/panel_embedded_files_base.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6a-dirty)
+// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@@ -101,7 +101,7 @@ PANEL_EMBEDDED_FILES_BASE::PANEL_EMBEDDED_FILES_BASE( wxWindow* parent, wxWindow
// Connect Events
this->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_EMBEDDED_FILES_BASE::onSize ) );
m_files_grid->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( PANEL_EMBEDDED_FILES_BASE::onGridRightClick ), NULL, this );
- m_browse_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onAddEmbeddedFile ), NULL, this );
+ m_browse_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onAddEmbeddedFiles ), NULL, this );
m_delete_button->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onDeleteEmbeddedFile ), NULL, this );
m_cbEmbedFonts->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onFontEmbedClick ), NULL, this );
m_export->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onExportFiles ), NULL, this );
@@ -112,7 +112,7 @@ PANEL_EMBEDDED_FILES_BASE::~PANEL_EMBEDDED_FILES_BASE()
// Disconnect Events
this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_EMBEDDED_FILES_BASE::onSize ) );
m_files_grid->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( PANEL_EMBEDDED_FILES_BASE::onGridRightClick ), NULL, this );
- m_browse_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onAddEmbeddedFile ), NULL, this );
+ m_browse_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onAddEmbeddedFiles ), NULL, this );
m_delete_button->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onDeleteEmbeddedFile ), NULL, this );
m_cbEmbedFonts->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onFontEmbedClick ), NULL, this );
m_export->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_EMBEDDED_FILES_BASE::onExportFiles ), NULL, this );
diff --git a/common/dialogs/panel_embedded_files_base.fbp b/common/dialogs/panel_embedded_files_base.fbp
index 4820d724d2..92e037c10f 100644
--- a/common/dialogs/panel_embedded_files_base.fbp
+++ b/common/dialogs/panel_embedded_files_base.fbp
@@ -243,7 +243,7 @@
- onAddEmbeddedFile
+ onAddEmbeddedFiles