diff options
author | David Kocik <kocikdav@gmail.com> | 2019-11-26 16:19:29 +0300 |
---|---|---|
committer | David Kocik <kocikdav@gmail.com> | 2019-12-13 16:54:25 +0300 |
commit | f3ecf55d3840634941a0f9b053516d20a183a6a5 (patch) | |
tree | 02b3e29cd023e22bec13cc70ca2e0b4093272f53 /src/slic3r/GUI/RemovableDriveManager.hpp | |
parent | acab61fa5430ae3c983e9c08e5ff1e7159319af1 (diff) |
removable drive manager - Windows part
Diffstat (limited to 'src/slic3r/GUI/RemovableDriveManager.hpp')
-rw-r--r-- | src/slic3r/GUI/RemovableDriveManager.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/slic3r/GUI/RemovableDriveManager.hpp b/src/slic3r/GUI/RemovableDriveManager.hpp index ac1645df7..a5abde72d 100644 --- a/src/slic3r/GUI/RemovableDriveManager.hpp +++ b/src/slic3r/GUI/RemovableDriveManager.hpp @@ -6,6 +6,7 @@ namespace Slic3r { namespace GUI { +<<<<<<< HEAD #if __APPLE__ class RDMMMWrapper; #endif @@ -23,12 +24,25 @@ friend class RDMMMWrapper; #endif public: static RemovableDriveManager& get_instance() +======= +struct DriveData +{ + std::wstring name; + std::string path; + DriveData(std::wstring n, std::string p):name(n),path(p){} +}; +class RemovableDriveManager +{ +public: + static RemovableDriveManager& getInstance() +>>>>>>> removable drive manager - Windows part { static RemovableDriveManager instance; return instance; } RemovableDriveManager(RemovableDriveManager const&) = delete; void operator=(RemovableDriveManager const&) = delete; +<<<<<<< HEAD //call only once. on apple register for unmnount callbacks. on windows register for device notification is prepared but not called (eject usb drive on widnows doesnt trigger the callback, sdc ard does), also enumerates devices for first time so init shoud be called on linux too. void init(); //update() searches for removable devices, returns false if empty. /time = 0 is forced update, time expects wxGetLocalTime() @@ -94,3 +108,22 @@ protected: #endif }} #endif +======= + + //update() searches for removable devices, returns false if empty. + static bool update(); + static bool isDriveMounted(std::string path); + static void ejectDrive(std::string path); + static std::string getLastDrivePath(); + static void getAllDrives(std::vector<DriveData>& drives); +private: + RemovableDriveManager(){} + static void searchForDrives(std::vector<DriveData>& newDrives); + static void printDrivesToLog(); + static void updateCurrentDrives(const std::vector<DriveData>& newDrives); + static std::vector<DriveData> currentDrives; + +}; +}} +#endif +>>>>>>> removable drive manager - Windows part |