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 639 additions and 752 deletions
+4
View File
@@ -25,6 +25,7 @@
#include "wxExtensions.hpp"
#include "GUI_ObjectList.hpp"
#include "Mouse3DController.hpp"
#include "RemovableDriveManager.hpp"
#include "I18N.hpp"
#include <fstream>
@@ -124,6 +125,9 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
// Store the device parameter database back to appconfig.
m_plater->get_mouse3d_controller().save_config(*wxGetApp().app_config);
// Stop the background thread of the removable drive manager, so that no new updates will be sent to the Plater.
wxGetApp().removable_drive_manager()->shutdown();
// Save the slic3r.ini.Usually the ini file is saved from "on idle" callback,
// but in rare cases it may not have been called yet.
wxGetApp().app_config->save();