eject button after export

This commit is contained in:
David Kocik 2019-12-12 10:48:33 +01:00
parent 1d25201a12
commit 2c7b711f76
3 changed files with 10 additions and 9 deletions

View file

@ -274,7 +274,7 @@ bool GUI_App::on_init_inner()
this->obj_manipul()->update_if_dirty(); this->obj_manipul()->update_if_dirty();
#if __linux__ #if !__APPLE__
RemovableDriveManager::get_instance().update(wxGetLocalTime(), true); RemovableDriveManager::get_instance().update(wxGetLocalTime(), true);
#endif #endif

View file

@ -4158,7 +4158,7 @@ void Plater::priv::show_action_buttons(const bool is_ready_to_slice) const
if (sidebar->show_reslice(false) | if (sidebar->show_reslice(false) |
sidebar->show_export(true) | sidebar->show_export(true) |
sidebar->show_send(send_gcode_shown) | sidebar->show_send(send_gcode_shown) |
sidebar->show_disconnect(disconnect_shown)) sidebar->show_disconnect(false/*disconnect_shown*/))
sidebar->Layout(); sidebar->Layout();
} }
else else
@ -4709,12 +4709,13 @@ void Plater::export_gcode()
fs::path path = into_path(dlg.GetPath()); fs::path path = into_path(dlg.GetPath());
wxGetApp().app_config->update_last_output_dir(path.parent_path().string()); wxGetApp().app_config->update_last_output_dir(path.parent_path().string());
output_path = std::move(path); output_path = std::move(path);
RemovableDriveManager::get_instance().update(0, true);
RemovableDriveManager::get_instance().set_last_save_path(output_path.string());
} }
if (! output_path.empty()) if (! output_path.empty())
{
RemovableDriveManager::get_instance().update(0, true);
RemovableDriveManager::get_instance().set_last_save_path(output_path.string());
p->export_gcode(std::move(output_path), PrintHostJob()); p->export_gcode(std::move(output_path), PrintHostJob());
}
} }

View file

@ -410,7 +410,7 @@ void RemovableDriveManager::init()
{ {
//add_callback([](void) { RemovableDriveManager::get_instance().print(); }); //add_callback([](void) { RemovableDriveManager::get_instance().print(); });
#if _WIN32 #if _WIN32
register_window(); //register_window();
#elif __APPLE__ #elif __APPLE__
m_rdmmm->register_window(); m_rdmmm->register_window();
#endif #endif
@ -501,16 +501,16 @@ void RemovableDriveManager::set_last_save_path(const std::string& path)
} }
bool RemovableDriveManager::is_last_drive_removed() bool RemovableDriveManager::is_last_drive_removed()
{ {
std::cout<<"is last: "<<m_last_save_path; //std::cout<<"is last: "<<m_last_save_path;
m_drives_count = m_current_drives.size(); m_drives_count = m_current_drives.size();
if(m_last_save_path == "") if(m_last_save_path == "")
{ {
std::cout<<"\n"; //std::cout<<"\n";
return true; return true;
} }
bool r = !is_drive_mounted(m_last_save_path); bool r = !is_drive_mounted(m_last_save_path);
if (r) reset_last_save_path(); if (r) reset_last_save_path();
std::cout<<" "<< r <<"\n"; //std::cout<<" "<< r <<"\n";
return r; return r;
} }
bool RemovableDriveManager::is_last_drive_removed_with_update(const long time) bool RemovableDriveManager::is_last_drive_removed_with_update(const long time)