Refactoring of RemovableDriveManager

1) On Windows and Linux, polling of removable drives is done at a background
   thread, not at a UI thread.
2) On OSX, there is no polling, but a OS notification callback.
3) Refactored for clarity of the RemovableDriveManager interface.
This commit is contained in:
bubnikv 2020-03-06 14:49:21 +01:00
parent fa00180170
commit baad542d15
11 changed files with 640 additions and 753 deletions

View file

@ -101,10 +101,9 @@ void BackgroundSlicingProcess::process_fff()
//FIXME localize the messages
// Perform the final post-processing of the export path by applying the print statistics over the file name.
std::string export_path = m_fff_print->print_statistics().finalize_output_path(m_export_path);
GUI::RemovableDriveManager::get_instance().update();
bool with_check = GUI::RemovableDriveManager::get_instance().is_path_on_removable_drive(export_path);
bool with_check = GUI::wxGetApp().removable_drive_manager()->is_path_on_removable_drive(export_path);
int copy_ret_val = copy_file(m_temp_output_path, export_path, with_check);
switch (copy_ret_val){
switch (copy_ret_val) {
case SUCCESS: break; // no error
case FAIL_COPY_FILE:
throw std::runtime_error(_utf8(L("Copying of the temporary G-code to the output G-code failed. Maybe the SD card is write locked?")));