diff --git a/kicad/CMakeLists.txt b/kicad/CMakeLists.txt index a4e2999893..d4838d080c 100644 --- a/kicad/CMakeLists.txt +++ b/kicad/CMakeLists.txt @@ -65,6 +65,10 @@ if( UNIX ) ) endif() +if( WIN32 ) + list( APPEND EXTRA_KICAD_LIBS "Shlwapi" ) +endif() + if( APPLE ) set_target_properties( kicad PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_BINARY_DIR}/kicad/Info.plist @@ -79,6 +83,7 @@ else() gal ${wxWidgets_LIBRARIES} ${GDI_PLUS_LIBRARIES} + ${EXTRA_KICAD_LIBS} ) endif() diff --git a/kicad/tree_project_frame.cpp b/kicad/tree_project_frame.cpp index e02b4c5f79..2b61fa0be2 100644 --- a/kicad/tree_project_frame.cpp +++ b/kicad/tree_project_frame.cpp @@ -47,6 +47,9 @@ #include "tree_project_frame.h" +#if defined(_WIN32) +#include +#endif /* Note about the tree project build process: * Building the tree project can be *very* long if there are a lot of subdirectories @@ -1065,7 +1068,26 @@ void TREE_PROJECT_FRAME::OnFileSystemEvent( wxFileSystemWatcherEvent& event ) void TREE_PROJECT_FRAME::FileWatcherReset() { + wxString prj_dir = wxPathOnly( m_Parent->GetProjectFileName() ); + // Prepare file watcher: + #ifdef _WIN32 + if( PathIsNetworkPathW( prj_dir.wc_str() ) ) + { + // Don't support network shares for now + // SAMBA passes bad events to Windows and wxWidgets idiotically asserts + // rather than accepting vlaid event IDs + // Windows Server shares do not have this problem + m_Parent->SetStatusText( _( "Project on network share, auto refresh not available" ), 0 ); + return; + } + else + { + m_Parent->SetStatusText( _( "" ), 0 ); + } + #endif + + if( m_watcher ) { m_watcher->RemoveAll(); @@ -1084,7 +1106,6 @@ void TREE_PROJECT_FRAME::FileWatcherReset() // moreover, under wxWidgets 2.9.4, AddTree does not work properly. // We can see wxString under a debugger, not a wxFileName - wxString prj_dir = wxPathOnly( m_Parent->GetProjectFileName() ); wxFileName fn; fn.AssignDir( prj_dir ); fn.DontFollowLink();