mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-12 12:08:10 +08:00
last save path
This commit is contained in:
parent
63ee4e3a2f
commit
66f203379c
@ -272,9 +272,10 @@ bool GUI_App::on_init_inner()
|
|||||||
|
|
||||||
this->obj_manipul()->update_if_dirty();
|
this->obj_manipul()->update_if_dirty();
|
||||||
|
|
||||||
//RemovableDriveManager::get_instance().update(wxGetLocalTime());
|
|
||||||
std::cout << RemovableDriveManager::get_instance().is_last_drive_removed() << "\n";
|
RemovableDriveManager::get_instance().update(wxGetLocalTime());
|
||||||
|
|
||||||
|
|
||||||
// Preset updating & Configwizard are done after the above initializations,
|
// Preset updating & Configwizard are done after the above initializations,
|
||||||
// and after MainFrame is created & shown.
|
// and after MainFrame is created & shown.
|
||||||
// The extra CallAfter() is needed because of Mac, where this is the only way
|
// The extra CallAfter() is needed because of Mac, where this is the only way
|
||||||
|
@ -420,11 +420,11 @@ std::string RemovableDriveManager::get_drive_from_path(const std::string& path)
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
bool RemovableDriveManager::update(long time)
|
bool RemovableDriveManager::update(const long time)
|
||||||
{
|
{
|
||||||
if(m_last_update == 0)
|
if(m_last_update == 0)
|
||||||
{
|
{
|
||||||
//add_callback([](void) { RemovableDriveManager::get_instance().print(); });
|
add_callback([](void) { RemovableDriveManager::get_instance().print(); });
|
||||||
#if _WIN32
|
#if _WIN32
|
||||||
//register_window();
|
//register_window();
|
||||||
#endif
|
#endif
|
||||||
@ -510,12 +510,18 @@ bool RemovableDriveManager::is_last_drive_removed()
|
|||||||
}
|
}
|
||||||
return !is_drive_mounted(m_last_save_path);
|
return !is_drive_mounted(m_last_save_path);
|
||||||
}
|
}
|
||||||
|
bool RemovableDriveManager::is_last_drive_removed_with_update(const long time)
|
||||||
|
{
|
||||||
|
update(time);
|
||||||
|
return is_last_drive_removed();
|
||||||
|
}
|
||||||
void RemovableDriveManager::reset_last_save_path()
|
void RemovableDriveManager::reset_last_save_path()
|
||||||
{
|
{
|
||||||
m_last_save_path = "";
|
m_last_save_path = "";
|
||||||
}
|
}
|
||||||
void RemovableDriveManager::print()
|
void RemovableDriveManager::print()
|
||||||
{
|
{
|
||||||
|
//std::cout << "Removed Device: "<<(int)is_last_drive_removed()<<"\n";
|
||||||
std::cout << "notified\n";
|
std::cout << "notified\n";
|
||||||
}
|
}
|
||||||
}}//namespace Slicer::Gui::
|
}}//namespace Slicer::Gui::
|
@ -24,7 +24,7 @@ public:
|
|||||||
void operator=(RemovableDriveManager const&) = delete;
|
void operator=(RemovableDriveManager const&) = delete;
|
||||||
|
|
||||||
//update() searches for removable devices, returns false if empty.
|
//update() searches for removable devices, returns false if empty.
|
||||||
bool update(long time = 0); //time = 0 is forced update, time expects wxGetLocalTime()
|
bool update(const long time = 0); //time = 0 is forced update, time expects wxGetLocalTime()
|
||||||
bool is_drive_mounted(const std::string &path);
|
bool is_drive_mounted(const std::string &path);
|
||||||
void eject_drive(const std::string &path);
|
void eject_drive(const std::string &path);
|
||||||
std::string get_last_drive_path();
|
std::string get_last_drive_path();
|
||||||
@ -33,6 +33,7 @@ public:
|
|||||||
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 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);
|
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();
|
bool is_last_drive_removed(); //if we dont need info about this drive, call reset_last_save_path();
|
||||||
|
bool is_last_drive_removed_with_update(const long time = 0); // param as update()
|
||||||
void reset_last_save_path();
|
void reset_last_save_path();
|
||||||
void print();
|
void print();
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user