diff --git a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp index 8c4e003862..3b3e60de24 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer_frame.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -751,6 +752,8 @@ bool EDA_3D_VIEWER_FRAME::getExportFileName( EDA_3D_VIEWER_EXPORT_FORMAT& aForma m_defaultSaveScreenshotFileName.GetFullName(), wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + // Set initial filter index based on current format dlg.SetFilterIndex( ( aFormat == EDA_3D_VIEWER_EXPORT_FORMAT::JPEG ) ? 0 : 1 ); diff --git a/bitmap2component/bitmap2cmp_frame.cpp b/bitmap2component/bitmap2cmp_frame.cpp index 2c3cf24f76..ebe13a5888 100644 --- a/bitmap2component/bitmap2cmp_frame.cpp +++ b/bitmap2component/bitmap2cmp_frame.cpp @@ -42,6 +42,7 @@ #include #include +#include #define DEFAULT_DPI 300 // the image DPI used in formats that do not define a DPI @@ -401,6 +402,8 @@ void BITMAP2CMP_FRAME::OnLoadFile() wxFileDialog fileDlg( this, _( "Choose Image" ), path, wxEmptyString, FILEEXT::ImageFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &fileDlg ); + if( fileDlg.ShowModal() != wxID_OK ) return; @@ -442,6 +445,8 @@ void BITMAP2CMP_FRAME::ExportDrawingSheetFormat() wxFileDialog fileDlg( this, _( "Create Drawing Sheet File" ), path, wxEmptyString, FILEEXT::DrawingSheetFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &fileDlg ); + if( fileDlg.ShowModal() != wxID_OK ) return; @@ -475,6 +480,8 @@ void BITMAP2CMP_FRAME::ExportPostScriptFormat() wxFileDialog fileDlg( this, _( "Create PostScript File" ), path, wxEmptyString, FILEEXT::PSFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &fileDlg ); + if( fileDlg.ShowModal() != wxID_OK ) return; @@ -509,6 +516,8 @@ void BITMAP2CMP_FRAME::ExportEeschemaFormat() FILEEXT::KiCadSymbolLibFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &fileDlg ); + if( fileDlg.ShowModal() != wxID_OK ) return; @@ -542,6 +551,8 @@ void BITMAP2CMP_FRAME::ExportPcbnewFormat() FILEEXT::KiCadFootprintLibFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &fileDlg ); + if( fileDlg.ShowModal() != wxID_OK ) return; diff --git a/common/dialogs/dialog_page_settings.cpp b/common/dialogs/dialog_page_settings.cpp index dfce4aa33c..82f3574ba6 100644 --- a/common/dialogs/dialog_page_settings.cpp +++ b/common/dialogs/dialog_page_settings.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #define MAX_PAGE_EXAMPLE_SIZE 200 @@ -710,6 +711,8 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event ) if( m_embeddedFiles ) fileDialog.SetCustomizeHook( customize ); + KIPLATFORM::UI::AllowNetworkFileSystems( &fileDialog ); + if( fileDialog.ShowModal() != wxID_OK ) return; diff --git a/common/dialogs/panel_common_settings.cpp b/common/dialogs/panel_common_settings.cpp index 99608a8356..7973915e41 100644 --- a/common/dialogs/panel_common_settings.cpp +++ b/common/dialogs/panel_common_settings.cpp @@ -381,6 +381,8 @@ void PANEL_COMMON_SETTINGS::OnPDFViewerClick( wxCommandEvent& event ) wxFileDialog dlg( topLevelParent, _( "Select Preferred PDF Viewer" ), fn.GetPath(), fn.GetFullPath(), wildcard, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/common/dialogs/panel_design_block_lib_table.cpp b/common/dialogs/panel_design_block_lib_table.cpp index f20e775c29..494c8d1da0 100644 --- a/common/dialogs/panel_design_block_lib_table.cpp +++ b/common/dialogs/panel_design_block_lib_table.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -686,6 +687,8 @@ void PANEL_DESIGN_BLOCK_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event wxFileDialog dlg( topLevelParent, title, *lastDir, wxEmptyString, fileDesc.FileFilter(), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/common/dialogs/panel_embedded_files.cpp b/common/dialogs/panel_embedded_files.cpp index f73c9eb5d4..e529c94670 100644 --- a/common/dialogs/panel_embedded_files.cpp +++ b/common/dialogs/panel_embedded_files.cpp @@ -39,6 +39,7 @@ #include #include #include +#include /* ---------- GRID_TRICKS for embedded files grid ---------- */ @@ -395,6 +396,8 @@ void PANEL_EMBEDDED_FILES::onAddEmbeddedFiles( wxCommandEvent& event ) _( "All Files" ) + wxT( " (*.*)|*.*" ), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &fileDialog ); + if( fileDialog.ShowModal() == wxID_OK ) { wxArrayString paths; diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index fcae72a5f3..c8e04d3f29 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -1245,6 +1245,8 @@ bool EDA_DRAW_FRAME::LibraryFileBrowser( const wxString& aTitle, bool doOpen, wx if( aFileDlgHook ) dlg.SetCustomizeHook( *aFileDlgHook ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return false; diff --git a/common/properties/pg_editors.cpp b/common/properties/pg_editors.cpp index 5101a587b9..a5a92443ed 100644 --- a/common/properties/pg_editors.cpp +++ b/common/properties/pg_editors.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -600,6 +601,8 @@ bool PG_URL_EDITOR::OnEvent( wxPropertyGrid* aGrid, wxPGProperty* aProperty, wxW _( "All Files" ) + wxS( " (*.*)|*.*" ), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &openFileDialog ); + if( openFileDialog.ShowModal() == wxID_OK ) { filename = openFileDialog.GetPath(); diff --git a/common/widgets/grid_text_button_helpers.cpp b/common/widgets/grid_text_button_helpers.cpp index e218d472ad..908008764d 100644 --- a/common/widgets/grid_text_button_helpers.cpp +++ b/common/widgets/grid_text_button_helpers.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -256,6 +257,8 @@ protected: openFileDialog.SetCustomizeHook( customize ); + KIPLATFORM::UI::AllowNetworkFileSystems( &openFileDialog ); + if( openFileDialog.ShowModal() == wxID_OK ) { filename = openFileDialog.GetPath(); @@ -392,6 +395,8 @@ protected: if( m_embedCallback ) dlg.SetCustomizeHook( customize ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_OK ) { wxString filePath = dlg.GetPath(); diff --git a/common/widgets/wx_html_report_panel.cpp b/common/widgets/wx_html_report_panel.cpp index ecfc684c70..e84c8d32de 100644 --- a/common/widgets/wx_html_report_panel.cpp +++ b/common/widgets/wx_html_report_panel.cpp @@ -315,6 +315,8 @@ void WX_HTML_REPORT_PANEL::onBtnSaveToFile( wxCommandEvent& event ) wxFileDialog dlg( topLevelParent, _( "Save Report File" ), fn.GetPath(), fn.GetFullName(), FILEEXT::TextFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_OK ) return; diff --git a/cvpcb/dialogs/dialog_config_equfiles.cpp b/cvpcb/dialogs/dialog_config_equfiles.cpp index 5588fd1575..9874bc5c3a 100644 --- a/cvpcb/dialogs/dialog_config_equfiles.cpp +++ b/cvpcb/dialogs/dialog_config_equfiles.cpp @@ -38,6 +38,7 @@ #include #include +#include DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES( wxWindow* aParent ) : @@ -214,6 +215,8 @@ void DIALOG_CONFIG_EQUFILES::OnAddFiles( wxCommandEvent& event ) wxFileDialog dlg( this, _( "Footprint Association File" ), libpath, wxEmptyString, FILEEXT::EquFileWildcard(), wxFD_DEFAULT_STYLE | wxFD_MULTIPLE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_OK ) return; diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index a6a1507336..0ce03c798f 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -1121,6 +1121,8 @@ void DIALOG_ERC::OnSaveReport( wxCommandEvent& aEvent ) FILEEXT::ReportFileWildcard() + wxS( "|" ) + FILEEXT::JsonFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_OK ) return; diff --git a/eeschema/dialogs/dialog_export_netlist.cpp b/eeschema/dialogs/dialog_export_netlist.cpp index 24755c0406..5af63dcd18 100644 --- a/eeschema/dialogs/dialog_export_netlist.cpp +++ b/eeschema/dialogs/dialog_export_netlist.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -563,6 +564,8 @@ bool DIALOG_EXPORT_NETLIST::TransferDataFromWindow() // full name does not and should not include the path, per wx docs. wxFileDialog dlg( this, title, path, fullname, fileWildcard, wxFD_SAVE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return false; diff --git a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp index bef9f4721d..9fee2037ee 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin_table.cpp +++ b/eeschema/dialogs/dialog_lib_edit_pin_table.cpp @@ -1014,6 +1014,8 @@ private: wxFileDialog dlg( &m_frame, _( "Select pin data file" ), "", "", FILEEXT::CsvTsvFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return wxEmptyString; @@ -1546,6 +1548,8 @@ void DIALOG_LIB_EDIT_PIN_TABLE::OnExportButtonClick( wxCommandEvent& event ) wxFileDialog dlg( this, _( "Select pin data file" ), "", fn.GetFullName(), FILEEXT::CsvFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/eeschema/dialogs/dialog_sch_import_settings.cpp b/eeschema/dialogs/dialog_sch_import_settings.cpp index 1532c9747c..5dd5ff0604 100644 --- a/eeschema/dialogs/dialog_sch_import_settings.cpp +++ b/eeschema/dialogs/dialog_sch_import_settings.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -52,6 +53,8 @@ void DIALOG_SCH_IMPORT_SETTINGS::OnBrowseClicked( wxCommandEvent& event ) wxFileDialog dlg( this, _( "Import Settings From" ), fn.GetPath(), fn.GetFullName(), FILEEXT::ProjectFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_OK ) m_filePathCtrl->SetValue( dlg.GetPath() ); } diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index 7c9440a68d..ae297c2b16 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -1287,6 +1287,8 @@ void DIALOG_SIM_MODEL::onBrowseButtonClick( wxCommandEvent& aEvent ) dlg.SetCustomizeHook( customize ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index b884bc4a25..fdd5953095 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -1399,6 +1399,8 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnOutputFileBrowseClicked( wxCommandEvent& even wxFileDialog saveDlg( this, _( "Bill of Materials Output File" ), path, fn.GetFullName(), FILEEXT::CsvFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &saveDlg ); + if( saveDlg.ShowModal() == wxID_CANCEL ) return; diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index bbe7ee2969..0ef780e6af 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/eeschema/dialogs/panel_sym_lib_table.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -556,6 +557,8 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) wxFileDialog dlg( topLevelParent, title, *lastDir, wxEmptyString, fileDesc.FileFilter(), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 491c9240a3..b35476082d 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -892,6 +893,8 @@ void SCH_EDIT_FRAME::OnImportProject( wxCommandEvent& aEvent ) FILEDLG_IMPORT_NON_KICAD importOptions( eeconfig()->m_System.show_import_issues ); dlg.SetCustomizeHook( importOptions ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; @@ -1183,6 +1186,8 @@ bool SCH_EDIT_FRAME::SaveProject( bool aSaveAs ) dlg.SetCustomizeHook( newProjectHook ); } + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return false; diff --git a/eeschema/import_gfx/dialog_import_gfx_sch.cpp b/eeschema/import_gfx/dialog_import_gfx_sch.cpp index c5c82930a1..bbda38d379 100644 --- a/eeschema/import_gfx/dialog_import_gfx_sch.cpp +++ b/eeschema/import_gfx/dialog_import_gfx_sch.cpp @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -164,6 +165,8 @@ void DIALOG_IMPORT_GFX_SCH::onBrowseFiles( wxCommandEvent& event ) wxFileDialog dlg( m_parent, _( "Import Graphics" ), path, filename, wildcardsDesc, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_OK && !dlg.GetPath().IsEmpty() ) m_textCtrlFileName->SetValue( dlg.GetPath() ); } diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index cae4c9dda7..05350c7c3e 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -1406,6 +1407,8 @@ void SCH_EDIT_FRAME::NewProject() wxFileDialog dlg( this, _( "New Schematic" ), pro_dir, wxEmptyString, FILEEXT::KiCadSchematicFileWildcard(), wxFD_SAVE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_CANCEL ) { // Enforce the extension, wxFileDialog is inept. @@ -1443,6 +1446,8 @@ void SCH_EDIT_FRAME::LoadProject() wxFileDialog dlg( this, _( "Open Schematic" ), pro_dir, wxEmptyString, wildcards, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_CANCEL ) { OpenProjectFiles( std::vector( 1, dlg.GetPath() ) ); diff --git a/eeschema/symbol_editor/symbol_editor.cpp b/eeschema/symbol_editor/symbol_editor.cpp index 624db2a7e2..bc9e93e836 100644 --- a/eeschema/symbol_editor/symbol_editor.cpp +++ b/eeschema/symbol_editor/symbol_editor.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include "symbol_saveas_type.h" #include @@ -1078,6 +1079,8 @@ void SYMBOL_EDIT_FRAME::ExportSymbol() wxFileDialog dlg( this, _( "Export Symbol" ), m_mruPath, fn.GetFullName(), FILEEXT::KiCadSymbolLibFileWildcard(), wxFD_SAVE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; @@ -1546,6 +1549,8 @@ bool SYMBOL_EDIT_FRAME::saveLibrary( const wxString& aLibrary, bool aNewFile ) SYMBOL_LIBRARY_SAVE_AS_FILEDLG_HOOK saveAsHook( type ); dlg.SetCustomizeHook( saveAsHook ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return false; diff --git a/eeschema/symbol_editor/symbol_editor_import_export.cpp b/eeschema/symbol_editor/symbol_editor_import_export.cpp index 528bd6f82a..09768568ad 100644 --- a/eeschema/symbol_editor/symbol_editor_import_export.cpp +++ b/eeschema/symbol_editor/symbol_editor_import_export.cpp @@ -35,6 +35,7 @@ #include #include #include +#include void SYMBOL_EDIT_FRAME::ImportSymbol() @@ -78,6 +79,8 @@ void SYMBOL_EDIT_FRAME::ImportSymbol() wxFileDialog fileDlg( this, _( "Import Symbol" ), m_mruPath, wxEmptyString, fileFiltersStr, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &fileDlg ); + if( fileDlg.ShowModal() == wxID_CANCEL ) return; diff --git a/eeschema/tools/assign_footprints.cpp b/eeschema/tools/assign_footprints.cpp index 9eb85a7a83..6daf1b42d1 100644 --- a/eeschema/tools/assign_footprints.cpp +++ b/eeschema/tools/assign_footprints.cpp @@ -40,6 +40,7 @@ #include #include +#include void SCH_EDITOR_CONTROL::AssignFootprints( const std::string& aChangedSetOfReferences ) @@ -209,6 +210,8 @@ int SCH_EDITOR_CONTROL::ImportFPAssignments( const TOOL_EVENT& aEvent ) FILEEXT::FootprintAssignmentFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return 0; diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index 33edcd4c57..30d03b6467 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -940,6 +940,8 @@ int SCH_DRAWING_TOOLS::ImportSheet( const TOOL_EVENT& aEvent ) FILEDLG_IMPORT_SHEET_CONTENTS dlgHook( cfg ); dlg.SetCustomizeHook( dlgHook ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return 0; @@ -1186,6 +1188,8 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) wxFileDialog dlg( m_frame, _( "Choose Image" ), m_mruPath, wxEmptyString, FILEEXT::ImageFileWildcard(), wxFD_OPEN ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + bool cancelled = false; RunMainStack( diff --git a/eeschema/tools/sch_edit_table_tool.cpp b/eeschema/tools/sch_edit_table_tool.cpp index 8648552ffe..41b884bdeb 100644 --- a/eeschema/tools/sch_edit_table_tool.cpp +++ b/eeschema/tools/sch_edit_table_tool.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -121,6 +122,8 @@ int SCH_EDIT_TABLE_TOOL::ExportTableToCSV( const TOOL_EVENT& aEvent ) _( "CSV files (*.csv)|*.csv" ), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &saveDialog ); + if( saveDialog.ShowModal() == wxID_CANCEL ) { if( clearSelection ) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 32477bd8a4..95c265f423 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -398,6 +399,8 @@ int SCH_EDITOR_CONTROL::SaveCurrSheetCopyAs( const TOOL_EVENT& aEvent ) wxFileDialog dlg( m_frame, _( "Schematic Files" ), curr_fn.GetPath(), curr_fn.GetFullName(), FILEEXT::KiCadSchematicFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return false; diff --git a/eeschema/tools/simulator_control.cpp b/eeschema/tools/simulator_control.cpp index 25bf1be1f5..4f6d5df984 100644 --- a/eeschema/tools/simulator_control.cpp +++ b/eeschema/tools/simulator_control.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -109,6 +110,8 @@ int SIMULATOR_CONTROL::OpenWorkbook( const TOOL_EVENT& aEvent ) wxFileDialog openDlg( m_simulatorFrame, _( "Open Simulation Workbook" ), getDefaultPath(), "", FILEEXT::WorkbookFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &openDlg ); + if( openDlg.ShowModal() == wxID_CANCEL ) return -1; @@ -163,6 +166,8 @@ int SIMULATOR_CONTROL::SaveWorkbook( const TOOL_EVENT& aEvent ) FILEEXT::WorkbookFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &saveAsDlg ); + if( saveAsDlg.ShowModal() == wxID_CANCEL ) return -1; @@ -181,6 +186,8 @@ int SIMULATOR_CONTROL::ExportPlotAsPNG( const TOOL_EVENT& aEvent ) wxFileDialog saveDlg( m_simulatorFrame, _( "Save Plot as Image" ), "", "", FILEEXT::PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &saveDlg ); + if( saveDlg.ShowModal() == wxID_CANCEL ) return -1; @@ -288,6 +295,8 @@ int SIMULATOR_CONTROL::ExportPlotAsCSV( const TOOL_EVENT& aEvent ) FILEEXT::CsvFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &saveDlg ); + if( saveDlg.ShowModal() == wxID_CANCEL ) return -1; diff --git a/eeschema/tools/symbol_editor_control.cpp b/eeschema/tools/symbol_editor_control.cpp index f640d18d1d..24ab6b39f9 100644 --- a/eeschema/tools/symbol_editor_control.cpp +++ b/eeschema/tools/symbol_editor_control.cpp @@ -46,6 +46,7 @@ #include #include +#include bool SYMBOL_EDITOR_CONTROL::Init() @@ -779,6 +780,8 @@ int SYMBOL_EDITOR_CONTROL::ExportView( const TOOL_EVENT& aEvent ) wxFileDialog dlg( editFrame, _( "Export View as PNG" ), projectPath, fn.GetFullName(), FILEEXT::PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_OK && !dlg.GetPath().IsEmpty() ) { // calling wxYield is mandatory under Linux, after closing the file selector dialog diff --git a/gerbview/files.cpp b/gerbview/files.cpp index fffc96f9f1..fab78776f8 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -39,6 +39,7 @@ #include #include "widgets/gerbview_layer_widget.h" #include +#include // HTML Messages used more than one time: #define MSG_NO_MORE_LAYER _( "No more available layers in GerbView to load files" ) @@ -150,6 +151,8 @@ bool GERBVIEW_FRAME::LoadFileOrShowDialog( const wxString& aFileName, wxFileDialog dlg( this, dialogTitle, currentPath, filename.GetFullName(), dialogFiletypes, wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE | wxFD_CHANGE_DIR ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + wxArrayString dummy1, dummy2; const int nWildcards = wxParseCommonDialogsFilter( dialogFiletypes, dummy1, dummy2 ); @@ -659,6 +662,8 @@ bool GERBVIEW_FRAME::LoadZipArchiveFile( const wxString& aFullFileName ) FILEEXT::ZipFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return false; diff --git a/gerbview/job_file_reader.cpp b/gerbview/job_file_reader.cpp index 6ae5231cd0..720df5bcc8 100644 --- a/gerbview/job_file_reader.cpp +++ b/gerbview/job_file_reader.cpp @@ -41,6 +41,7 @@ #include #include #include +#include using json = nlohmann::json; @@ -192,6 +193,8 @@ bool GERBVIEW_FRAME::LoadGerberJobFile( const wxString& aFullFileName ) FILEEXT::GerberJobFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return false; diff --git a/gerbview/tools/gerbview_control.cpp b/gerbview/tools/gerbview_control.cpp index 8b2f677fd2..c0a116fd8f 100644 --- a/gerbview/tools/gerbview_control.cpp +++ b/gerbview/tools/gerbview_control.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "gerbview_actions.h" #include "gerbview_control.h" @@ -126,6 +127,8 @@ int GERBVIEW_CONTROL::ExportToPcbnew( const TOOL_EVENT& aEvent ) wxFileDialog filedlg( m_frame, _( "Export as KiCad Board File" ), path, fileDialogName, FILEEXT::PcbFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &filedlg ); + if( filedlg.ShowModal() == wxID_CANCEL ) return 0; diff --git a/kicad/dialogs/dialog_destination.cpp b/kicad/dialogs/dialog_destination.cpp index 01b3a58ab1..978e2c640f 100644 --- a/kicad/dialogs/dialog_destination.cpp +++ b/kicad/dialogs/dialog_destination.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -99,6 +100,8 @@ void DIALOG_DESTINATION::onOutputPathBrowseClicked(wxCommandEvent& event) fileWildcard, wxFD_OVERWRITE_PROMPT | wxFD_SAVE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_OK ) return; diff --git a/kicad/files-io.cpp b/kicad/files-io.cpp index 3e96e95428..8b8098e69e 100644 --- a/kicad/files-io.cpp +++ b/kicad/files-io.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -60,6 +61,8 @@ void KICAD_MANAGER_FRAME::UnarchiveFiles() wxFileDialog zipfiledlg( this, _( "Unzip Project" ), fn.GetPath(), fn.GetFullName(), FILEEXT::ZipFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &zipfiledlg ); + if( zipfiledlg.ShowModal() == wxID_CANCEL ) return; diff --git a/kicad/import_project.cpp b/kicad/import_project.cpp index 9cd4c17ebd..0530a7ac0f 100644 --- a/kicad/import_project.cpp +++ b/kicad/import_project.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -55,6 +56,8 @@ void KICAD_MANAGER_FRAME::ImportNonKiCadProject( const wxString& aWindowTitle, wxFileDialog inputdlg( this, aWindowTitle, default_dir, wxEmptyString, aFilesWildcard, style ); + KIPLATFORM::UI::AllowNetworkFileSystems( &inputdlg ); + if( inputdlg.ShowModal() == wxID_CANCEL ) return; diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index 962c53ded4..9e1ebb1cfe 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -1127,6 +1128,8 @@ void KICAD_MANAGER_FRAME::OnOpenFileInTextEditor( wxCommandEvent& event ) wxFileDialog dlg( this, _( "Edit File in Text Editor" ), default_dir, wxEmptyString, wildcard, wxFD_OPEN ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/kicad/pcm/dialogs/dialog_pcm.cpp b/kicad/pcm/dialogs/dialog_pcm.cpp index d6d89c4aad..07c40f181c 100644 --- a/kicad/pcm/dialogs/dialog_pcm.cpp +++ b/kicad/pcm/dialogs/dialog_pcm.cpp @@ -36,6 +36,7 @@ #include "widgets/wx_grid.h" #include +#include #include #include #include @@ -303,6 +304,8 @@ void DIALOG_PCM::OnInstallFromFileClicked( wxCommandEvent& event ) wxFileDialog open_file_dialog( this, _( "Install Package" ), wxEmptyString, wxEmptyString, wxT( "Zip files (*.zip)|*.zip" ), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &open_file_dialog ); + if( open_file_dialog.ShowModal() == wxID_CANCEL ) return; diff --git a/kicad/pcm/dialogs/panel_packages_view.cpp b/kicad/pcm/dialogs/panel_packages_view.cpp index de43460613..543187d87c 100644 --- a/kicad/pcm/dialogs/panel_packages_view.cpp +++ b/kicad/pcm/dialogs/panel_packages_view.cpp @@ -518,6 +518,8 @@ void PANEL_PACKAGES_VIEW::OnDownloadVersionClicked( wxCommandEvent& event ) wxString::Format( wxT( "%s_v%s.zip" ), package.identifier, version ), wxT( "ZIP files (*.zip)|*.zip" ), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dialog ); + if( dialog.ShowModal() == wxID_CANCEL ) return; diff --git a/kicad/tools/kicad_manager_control.cpp b/kicad/tools/kicad_manager_control.cpp index 02320092d1..b82c159490 100644 --- a/kicad/tools/kicad_manager_control.cpp +++ b/kicad/tools/kicad_manager_control.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -87,6 +88,8 @@ wxFileName KICAD_MANAGER_CONTROL::newProjectDirectory( wxString* aFileName, bool FILEDLG_NEW_PROJECT newProjectHook; dlg.SetCustomizeHook( newProjectHook ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return wxFileName(); @@ -281,6 +284,8 @@ int KICAD_MANAGER_CONTROL::NewProject( const TOOL_EVENT& aEvent ) FILEDLG_NEW_PROJECT newProjectHook; dlg.SetCustomizeHook( newProjectHook ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return -1; @@ -435,6 +440,8 @@ int KICAD_MANAGER_CONTROL::NewJobsetFile( const TOOL_EVENT& aEvent ) wxFileDialog dlg( m_frame, _( "Create New Jobset" ), default_dir, wxEmptyString, FILEEXT::JobsetFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return -1; @@ -471,6 +478,8 @@ int KICAD_MANAGER_CONTROL::openProject( const wxString& aDefaultDir ) dlg.AddShortcut( PATHS::GetDefaultUserProjectsPath() ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return -1; @@ -511,6 +520,8 @@ int KICAD_MANAGER_CONTROL::OpenJobsetFile( const TOOL_EVENT& aEvent ) wxFileDialog dlg( m_frame, _( "Open Jobset" ), default_dir, wxEmptyString, FILEEXT::JobsetFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return -1; @@ -546,6 +557,8 @@ int KICAD_MANAGER_CONTROL::ArchiveProject( const TOOL_EVENT& aEvent ) wxFileDialog dlg( m_frame, _( "Archive Project Files" ), fileName.GetPath(), fileName.GetFullName(), FILEEXT::ZipFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return 0; @@ -629,6 +642,8 @@ int KICAD_MANAGER_CONTROL::SaveProjectAs( const TOOL_EVENT& aEvent ) dlg.AddShortcut( PATHS::GetDefaultUserProjectsPath() ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return -1; diff --git a/libs/kiplatform/include/kiplatform/ui.h b/libs/kiplatform/include/kiplatform/ui.h index 9f6c6d954a..ad0ba61224 100644 --- a/libs/kiplatform/include/kiplatform/ui.h +++ b/libs/kiplatform/include/kiplatform/ui.h @@ -24,6 +24,7 @@ #include class wxChoice; +class wxDialog; class wxNonOwnedWindow; class wxTopLevelWindow; class wxWindow; @@ -210,6 +211,23 @@ namespace KIPLATFORM * above other windows. */ void ReleaseChildWindow( wxNonOwnedWindow* aWindow ); + + /** + * Configure a file dialog to show network and virtual file systems. + * + * On GTK, file dialogs default to showing only local files, which excludes + * GVFS-mounted filesystems like Google Drive, SMB shares, SFTP connections, + * and removable media mounted through GVFS. This function configures the + * dialog to also show these non-local filesystems. + * + * This function must be called after creating the dialog but before calling + * ShowModal(). + * + * This is a NOP on Windows and macOS where network filesystems are shown by default. + * + * @param aDialog is the file dialog to configure + */ + void AllowNetworkFileSystems( wxDialog* aDialog ); } } diff --git a/libs/kiplatform/port/wxgtk/ui.cpp b/libs/kiplatform/port/wxgtk/ui.cpp index 7830662a29..514df6c8d2 100644 --- a/libs/kiplatform/port/wxgtk/ui.cpp +++ b/libs/kiplatform/port/wxgtk/ui.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -712,4 +713,13 @@ void KIPLATFORM::UI::ReleaseChildWindow( wxNonOwnedWindow* aWindow ) // Not needed on this platform } + +void KIPLATFORM::UI::AllowNetworkFileSystems( wxDialog* aDialog ) +{ + GtkWidget* widget = static_cast( aDialog->GetHandle() ); + + if( widget && GTK_IS_FILE_CHOOSER( widget ) ) + gtk_file_chooser_set_local_only( GTK_FILE_CHOOSER( widget ), FALSE ); +} + #endif diff --git a/libs/kiplatform/port/wxmsw/ui.cpp b/libs/kiplatform/port/wxmsw/ui.cpp index b07064c784..70a87f4306 100644 --- a/libs/kiplatform/port/wxmsw/ui.cpp +++ b/libs/kiplatform/port/wxmsw/ui.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -209,4 +210,10 @@ void KIPLATFORM::UI::SetFloatLevel( wxWindow* aWindow ) void KIPLATFORM::UI::ReleaseChildWindow( wxNonOwnedWindow* aWindow ) { // Not needed on this platform -} \ No newline at end of file +} + + +void KIPLATFORM::UI::AllowNetworkFileSystems( wxDialog* aDialog ) +{ + // Not needed on Windows - file dialogs show network filesystems by default +} diff --git a/libs/kiplatform/port/wxosx/ui.mm b/libs/kiplatform/port/wxosx/ui.mm index 2c6b671fa7..463d6bb65f 100644 --- a/libs/kiplatform/port/wxosx/ui.mm +++ b/libs/kiplatform/port/wxosx/ui.mm @@ -22,6 +22,7 @@ #import +#include #include #include #include @@ -252,4 +253,10 @@ void KIPLATFORM::UI::ReleaseChildWindow( wxNonOwnedWindow* aWindow ) [theWindow setLevel:NSFloatingWindowLevel]; } } -} \ No newline at end of file +} + + +void KIPLATFORM::UI::AllowNetworkFileSystems( wxDialog* aDialog ) +{ + // Not needed on macOS - file dialogs show network filesystems by default +} diff --git a/pagelayout_editor/files.cpp b/pagelayout_editor/files.cpp index fed88331da..b7312ab5d5 100644 --- a/pagelayout_editor/files.cpp +++ b/pagelayout_editor/files.cpp @@ -41,6 +41,7 @@ #include #include #include +#include bool PL_EDITOR_FRAME::saveCurrentPageLayout() { @@ -132,6 +133,8 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event ) wxEmptyString, wxEmptyString, FILEEXT::DrawingSheetFileWildcard(), wxFD_OPEN ); + KIPLATFORM::UI::AllowNetworkFileSystems( &openFileDialog ); + if( openFileDialog.ShowModal() == wxID_CANCEL ) return; @@ -158,6 +161,8 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event ) wxFileDialog openFileDialog( this, _( "Open Drawing Sheet" ), wxEmptyString, wxEmptyString, FILEEXT::DrawingSheetFileWildcard(), wxFD_OPEN ); + KIPLATFORM::UI::AllowNetworkFileSystems( &openFileDialog ); + if( openFileDialog.ShowModal() == wxID_CANCEL ) return; @@ -199,6 +204,8 @@ void PL_EDITOR_FRAME::Files_io( wxCommandEvent& event ) FILEEXT::DrawingSheetFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &openFileDialog ); + if( openFileDialog.ShowModal() == wxID_CANCEL ) return; diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index cb4ee3c6f7..eb3ad6c8f1 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -64,6 +64,7 @@ #include #include #include +#include #ifndef __linux__ #include @@ -845,6 +846,8 @@ DS_DATA_ITEM* PL_EDITOR_FRAME::AddDrawingSheetItem( int aType ) wxFileDialog fileDlg( this, _( "Choose Image" ), m_mruImagePath, wxEmptyString, FILEEXT::ImageFileWildcard(), wxFD_OPEN ); + KIPLATFORM::UI::AllowNetworkFileSystems( &fileDlg ); + if( fileDlg.ShowModal() != wxID_OK ) return nullptr; diff --git a/pcb_calculator/calculator_panels/panel_regulator.cpp b/pcb_calculator/calculator_panels/panel_regulator.cpp index d3d555cb44..d194caa705 100644 --- a/pcb_calculator/calculator_panels/panel_regulator.cpp +++ b/pcb_calculator/calculator_panels/panel_regulator.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -196,6 +197,8 @@ void PANEL_REGULATOR::OnDataFileSelection( wxCommandEvent& event ) wxFileDialog dlg( topLevelParent, _( "Select PCB Calculator Data File" ), wxEmptyString, fullfilename, wildcard, wxFD_SAVE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/pcbnew/build_BOM_from_board.cpp b/pcbnew/build_BOM_from_board.cpp index 702c592060..d69200a711 100644 --- a/pcbnew/build_BOM_from_board.cpp +++ b/pcbnew/build_BOM_from_board.cpp @@ -36,6 +36,7 @@ #include #include #include +#include /* creates a BOM list from board @@ -86,6 +87,8 @@ int BOARD_EDITOR_CONTROL::GenBOMFileFromBoard( const TOOL_EVENT& aEvent ) wxFileDialog dlg( m_frame, _( "Save Bill of Materials" ), pro_dir, fn.GetFullName(), FILEEXT::CsvFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return 0; diff --git a/pcbnew/dialogs/dialog_board_statistics.cpp b/pcbnew/dialogs/dialog_board_statistics.cpp index 806428d24d..cb4c6ce5d7 100644 --- a/pcbnew/dialogs/dialog_board_statistics.cpp +++ b/pcbnew/dialogs/dialog_board_statistics.cpp @@ -453,6 +453,8 @@ void DIALOG_BOARD_STATISTICS::saveReportClicked( wxCommandEvent& aEvent ) s_savedDialogState.saveReportName, FILEEXT::TextFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index d94094b5b8..001f96ec24 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -1075,6 +1075,8 @@ void DIALOG_DRC::OnSaveReport( wxCommandEvent& aEvent ) FILEEXT::ReportFileWildcard() + wxS( "|" ) + FILEEXT::JsonFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_OK ) return; diff --git a/pcbnew/dialogs/dialog_export_2581.cpp b/pcbnew/dialogs/dialog_export_2581.cpp index 4ea6b21de1..9d8f966129 100644 --- a/pcbnew/dialogs/dialog_export_2581.cpp +++ b/pcbnew/dialogs/dialog_export_2581.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -101,6 +102,8 @@ void DIALOG_EXPORT_2581::onBrowseClicked( wxCommandEvent& event ) m_cbCompress->IsChecked() ? compressed_files : ipc_files, wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/pcbnew/dialogs/dialog_export_odbpp.cpp b/pcbnew/dialogs/dialog_export_odbpp.cpp index c51fb392c8..558bc33733 100644 --- a/pcbnew/dialogs/dialog_export_odbpp.cpp +++ b/pcbnew/dialogs/dialog_export_odbpp.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -135,6 +136,8 @@ void DIALOG_EXPORT_ODBPP::onBrowseClicked( wxCommandEvent& event ) wxFileDialog dlg( this, _( "Export ODB++ File" ), fn.GetPath(), fileDialogName, filter, wxFD_SAVE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/pcbnew/dialogs/dialog_export_step.cpp b/pcbnew/dialogs/dialog_export_step.cpp index 70ab96b839..a1f8b59e09 100644 --- a/pcbnew/dialogs/dialog_export_step.cpp +++ b/pcbnew/dialogs/dialog_export_step.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -274,6 +275,8 @@ void DIALOG_EXPORT_STEP::onBrowseClicked( wxCommandEvent& aEvent ) wxFileDialog dlg( this, _( "3D Model Output File" ), fn.GetPath(), fn.GetFullName(), filter, wxFD_SAVE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/pcbnew/dialogs/dialog_gencad_export_options.cpp b/pcbnew/dialogs/dialog_gencad_export_options.cpp index 81f9b45394..25c5b6b9d7 100644 --- a/pcbnew/dialogs/dialog_gencad_export_options.cpp +++ b/pcbnew/dialogs/dialog_gencad_export_options.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -120,6 +121,9 @@ void DIALOG_GENCAD_EXPORT_OPTIONS::onBrowseClicked( wxCommandEvent& aEvent ) wxFileDialog dlg( this, _( "Export GenCAD File" ), fn.GetPath(), fileDialogName, FILEEXT::GencadFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_OK ) m_outputFileName->SetValue( dlg.GetPath() ); } diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index fff87191b0..5d77effd47 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -398,6 +399,8 @@ void DIALOG_GENDRILL::onGenReportFile( wxCommandEvent& event ) wxFileDialog dlg( this, _( "Save Drill Report File" ), defaultPath, fn.GetFullName(), FILEEXT::ReportFileWildcard(), wxFD_SAVE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/pcbnew/dialogs/dialog_import_netlist.cpp b/pcbnew/dialogs/dialog_import_netlist.cpp index ca814f22b3..2292ec515c 100644 --- a/pcbnew/dialogs/dialog_import_netlist.cpp +++ b/pcbnew/dialogs/dialog_import_netlist.cpp @@ -38,6 +38,7 @@ #include // LAST_PATH_TYPE #include #include +#include #include #include #include @@ -112,6 +113,8 @@ void DIALOG_IMPORT_NETLIST::onBrowseNetlistFiles( wxCommandEvent& event ) wxFileDialog FilesDialog( this, _( "Import Netlist" ), dirPath, filename, FILEEXT::NetlistFileWildcard(), wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &FilesDialog ); + if( FilesDialog.ShowModal() != wxID_OK ) return; diff --git a/pcbnew/dialogs/dialog_import_settings.cpp b/pcbnew/dialogs/dialog_import_settings.cpp index ab27f21929..534aede50e 100644 --- a/pcbnew/dialogs/dialog_import_settings.cpp +++ b/pcbnew/dialogs/dialog_import_settings.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -117,6 +118,8 @@ void DIALOG_IMPORT_SETTINGS::OnBrowseClicked( wxCommandEvent& event ) FILEEXT::PcbFileWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_OK ) m_filePathCtrl->SetValue( dlg.GetPath() ); } diff --git a/pcbnew/dialogs/panel_fp_lib_table.cpp b/pcbnew/dialogs/panel_fp_lib_table.cpp index b845074297..fd6af4486d 100644 --- a/pcbnew/dialogs/panel_fp_lib_table.cpp +++ b/pcbnew/dialogs/panel_fp_lib_table.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -624,6 +625,8 @@ void PANEL_FP_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) wxFileDialog dlg( m_parent, title, *lastDir, wxEmptyString, fileDesc.FileFilter(), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/pcbnew/exporters/export_d356.cpp b/pcbnew/exporters/export_d356.cpp index dc09d8d2e1..f00f02bced 100644 --- a/pcbnew/exporters/export_d356.cpp +++ b/pcbnew/exporters/export_d356.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -445,6 +446,8 @@ int BOARD_EDITOR_CONTROL::GenD356File( const TOOL_EVENT& aEvent ) D365_CUSTOMIZE_HOOK customizeHook( m_frame->GetPcbNewSettings()->m_ExportD356.doNotExportUnconnectedPads ); dlg.SetCustomizeHook( customizeHook ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return 0; diff --git a/pcbnew/exporters/export_footprint_associations.cpp b/pcbnew/exporters/export_footprint_associations.cpp index 6389d435e2..cd331e28ef 100644 --- a/pcbnew/exporters/export_footprint_associations.cpp +++ b/pcbnew/exporters/export_footprint_associations.cpp @@ -31,6 +31,7 @@ #include #include #include +#include @@ -76,6 +77,8 @@ int BOARD_EDITOR_CONTROL::ExportCmpFile( const TOOL_EVENT& aEvent ) FILEEXT::FootprintAssignmentFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return 0; diff --git a/pcbnew/exporters/export_hyperlynx.cpp b/pcbnew/exporters/export_hyperlynx.cpp index 793b20d7d9..e400846cc1 100644 --- a/pcbnew/exporters/export_hyperlynx.cpp +++ b/pcbnew/exporters/export_hyperlynx.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -677,6 +678,8 @@ int BOARD_EDITOR_CONTROL::ExportHyperlynx( const TOOL_EVENT& aEvent ) wxFileDialog dlg( m_frame, _( "Export Hyperlynx Layout" ), fn.GetPath(), fn.GetFullName(), wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_OK ) return 0; diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index afbb5e7f28..ad6934a349 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -188,6 +189,8 @@ bool AskLoadBoardFileName( PCB_EDIT_FRAME* aParent, wxString* aFileName, int aCt if( !kicadFormat ) dlg.SetCustomizeHook( importOptions ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_OK ) { *aFileName = dlg.GetPath(); @@ -230,6 +233,8 @@ bool AskSaveBoardFileName( PCB_EDIT_FRAME* aParent, wxString* aFileName, bool* a if( Kiface().IsSingle() && aParent->Prj().IsNullProject() ) dlg.SetCustomizeHook( newProjectHook ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_OK ) return false; diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 666d59845b..58a3b05f6c 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -1539,6 +1540,8 @@ void FOOTPRINT_EDIT_FRAME::OnSaveFootprintAsPng( wxCommandEvent& event ) wxFileDialog dlg( this, _( "Export View as PNG" ), projectPath, fn.GetFullName(), FILEEXT::PngFileWildcard(), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL || dlg.GetPath().IsEmpty() ) return; diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index b25a59074d..d61ba0455d 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -134,6 +135,8 @@ FOOTPRINT* FOOTPRINT_EDIT_FRAME::ImportFootprint( const wxString& aName ) if( lastFilterIndex >= 0 && lastFilterIndex < nWildcards ) dlg.SetFilterIndex( lastFilterIndex ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return nullptr; @@ -249,6 +252,8 @@ void FOOTPRINT_EDIT_FRAME::ExportFootprint( FOOTPRINT* aFootprint ) wxFileDialog dlg( this, _( "Export Footprint" ), fn.GetPath(), fn.GetFullName(), wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/pcbnew/import_gfx/dialog_import_graphics.cpp b/pcbnew/import_gfx/dialog_import_graphics.cpp index 885f175496..d6fe8bec24 100644 --- a/pcbnew/import_gfx/dialog_import_graphics.cpp +++ b/pcbnew/import_gfx/dialog_import_graphics.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -163,6 +164,8 @@ void DIALOG_IMPORT_GRAPHICS::onBrowseFiles( wxCommandEvent& event ) wxFileDialog dlg( m_parent, _( "Import Graphics" ), path, filename, wildcardsDesc, wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_OK && !dlg.GetPath().IsEmpty() ) m_textCtrlFileName->SetValue( dlg.GetPath() ); } diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index f63f6dca0b..fc186ce1a4 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -675,6 +676,8 @@ void ROUTER_TOOL::saveRouterDebugLog() "PNS log files" + AddFileExtListToFilter( { "log" } ), wxFD_OVERWRITE_PROMPT | wxFD_SAVE ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_OK ) { lastLoggerSize = logger->GetEvents().size(); // prevent re-entry diff --git a/pcbnew/tools/board_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp index 66e52b640b..fd592e64da 100644 --- a/pcbnew/tools/board_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -58,6 +58,7 @@ #include #include // LAST_PATH_TYPE #include +#include #include #include #include @@ -470,6 +471,8 @@ int BOARD_EDITOR_CONTROL::ExportNetlist( const TOOL_EVENT& aEvent ) dlg.SetExtraControlCreator( &LEGACYFILEDLG_NETLIST_OPTIONS::Create ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return 0; diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 8e083f16a3..5325f675a9 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -751,6 +752,9 @@ int DRAWING_TOOL::PlaceReferenceImage( const TOOL_EVENT& aEvent ) wxFileDialog dlg( m_frame, _( "Choose Image" ), wxEmptyString, wxEmptyString, FILEEXT::ImageFileWildcard(), wxFD_OPEN ); + + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + bool cancelled = false; RunMainStack( diff --git a/pcbnew/tools/pcb_edit_table_tool.cpp b/pcbnew/tools/pcb_edit_table_tool.cpp index e65e3df6ca..28e1e2766a 100644 --- a/pcbnew/tools/pcb_edit_table_tool.cpp +++ b/pcbnew/tools/pcb_edit_table_tool.cpp @@ -30,6 +30,7 @@ #include #include #include +#include PCB_EDIT_TABLE_TOOL::PCB_EDIT_TABLE_TOOL() : @@ -162,6 +163,8 @@ int PCB_EDIT_TABLE_TOOL::ExportTableToCSV( const TOOL_EVENT& aEvent ) _( "CSV files (*.csv)|*.csv" ), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &saveDialog ); + if( saveDialog.ShowModal() == wxID_CANCEL ) { if( clearSelection ) diff --git a/pcbnew/widgets/pcb_net_inspector_panel.cpp b/pcbnew/widgets/pcb_net_inspector_panel.cpp index b2cab14337..c49f251ec6 100644 --- a/pcbnew/widgets/pcb_net_inspector_panel.cpp +++ b/pcbnew/widgets/pcb_net_inspector_panel.cpp @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -1407,6 +1408,8 @@ void PCB_NET_INSPECTOR_PANEL::generateReport() _( "Report file" ) + AddFileExtListToFilter( { "csv" } ), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() == wxID_CANCEL ) return; diff --git a/qa/tools/pns/pns_log_viewer_frame.cpp b/qa/tools/pns/pns_log_viewer_frame.cpp index c2a8891f4e..f3201f08fd 100644 --- a/qa/tools/pns/pns_log_viewer_frame.cpp +++ b/qa/tools/pns/pns_log_viewer_frame.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "label_manager.h" @@ -417,6 +418,8 @@ void PNS_LOG_VIEWER_FRAME::onOpen( wxCommandEvent& event ) "PNS log files" + AddFileExtListToFilter( { "log" } ), wxFD_OPEN | wxFD_FILE_MUST_EXIST ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_CANCEL ) { wxString logPath = dlg.GetPath(); @@ -438,6 +441,8 @@ void PNS_LOG_VIEWER_FRAME::onSaveAs( wxCommandEvent& event ) "PNS log files" + AddFileExtListToFilter( { "log" } ), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); + KIPLATFORM::UI::AllowNetworkFileSystems( &dlg ); + if( dlg.ShowModal() != wxID_CANCEL ) { // Enforce the extension, wxFileDialog is inept.