diff options
author | David Kocik <kocikdav@gmail.com> | 2019-12-05 16:07:02 +0300 |
---|---|---|
committer | David Kocik <kocikdav@gmail.com> | 2019-12-13 15:51:45 +0300 |
commit | 63ee4e3a2f766ad3856244c42e4f28ff5828b240 (patch) | |
tree | dd8e4c0c0168a5eed27531b51194a7fc70cc4cfe /src/slic3r/GUI/RemovableDriveManager.hpp | |
parent | 1c8ca1aec15d70a4b1ed172a245b028e26948b44 (diff) |
last path functions
Diffstat (limited to 'src/slic3r/GUI/RemovableDriveManager.hpp')
-rw-r--r-- | src/slic3r/GUI/RemovableDriveManager.hpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/slic3r/GUI/RemovableDriveManager.hpp b/src/slic3r/GUI/RemovableDriveManager.hpp index c65a7fe62..be5ae5968 100644 --- a/src/slic3r/GUI/RemovableDriveManager.hpp +++ b/src/slic3r/GUI/RemovableDriveManager.hpp @@ -24,24 +24,30 @@ public: void operator=(RemovableDriveManager const&) = delete; //update() searches for removable devices, returns false if empty. - bool update(long time = 0); //time = 0 is forced update + bool update(long time = 0); //time = 0 is forced update, time expects wxGetLocalTime() bool is_drive_mounted(const std::string &path); void eject_drive(const std::string &path); std::string get_last_drive_path(); std::vector<DriveData> get_all_drives(); bool is_path_on_removable_drive(const std::string &path); - void add_callback(std::function<void()> callback); + void add_callback(std::function<void()> callback); // callback will notify every drive removal. to see if it was last used drive call is_last_drive_removed() + void set_last_save_path(const std::string &path); + bool is_last_drive_removed(); //if we dont need info about this drive, call reset_last_save_path(); + void reset_last_save_path(); void print(); private: - RemovableDriveManager():m_drives_count(0),m_last_update(0){} + RemovableDriveManager():m_drives_count(0),m_last_update(0),m_last_save_path(""){} void search_for_drives(); void check_and_notify(); + std::string get_drive_from_path(const std::string& path);//returns drive path (same as path in DriveData) if exists otherwise empty string "" std::vector<DriveData> m_current_drives; std::vector<std::function<void()>> m_callbacks; size_t m_drives_count; long m_last_update; + std::string m_last_save_path; #if _WIN32 void register_window(); + //INT_PTR WINAPI WinProcCallback(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); #else void search_path(const std::string &path, const std::string &parent_path); bool compare_filesystem_id(const std::string &path_a, const std::string &path_b); |