Showing Eject button only after exporting is finished. Fix of #4212
This commit is contained in:
parent
87824ef5f8
commit
67d2f43845
3 changed files with 10 additions and 3 deletions
|
@ -3450,7 +3450,7 @@ void Plater::priv::on_slicing_completed(wxCommandEvent &)
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plater::priv::on_process_completed(wxCommandEvent &evt)
|
void Plater::priv::on_process_completed(wxCommandEvent &evt)
|
||||||
{
|
{
|
||||||
|
@ -3510,7 +3510,10 @@ void Plater::priv::on_process_completed(wxCommandEvent &evt)
|
||||||
show_action_buttons(true);
|
show_action_buttons(true);
|
||||||
}
|
}
|
||||||
else if (this->writing_to_removable_device || wxGetApp().get_mode() == comSimple)
|
else if (this->writing_to_removable_device || wxGetApp().get_mode() == comSimple)
|
||||||
|
{
|
||||||
|
wxGetApp().removable_drive_manager()->set_exporting_finished(true);
|
||||||
show_action_buttons(false);
|
show_action_buttons(false);
|
||||||
|
}
|
||||||
this->writing_to_removable_device = false;
|
this->writing_to_removable_device = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -393,6 +393,7 @@ bool RemovableDriveManager::set_and_verify_last_save_path(const std::string &pat
|
||||||
#endif // REMOVABLE_DRIVE_MANAGER_OS_CALLBACKS
|
#endif // REMOVABLE_DRIVE_MANAGER_OS_CALLBACKS
|
||||||
|
|
||||||
m_last_save_path = this->get_removable_drive_from_path(path);
|
m_last_save_path = this->get_removable_drive_from_path(path);
|
||||||
|
m_exporting_finished = false;
|
||||||
return ! m_last_save_path.empty();
|
return ! m_last_save_path.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,6 +408,7 @@ RemovableDriveManager::RemovableDrivesStatus RemovableDriveManager::status()
|
||||||
}
|
}
|
||||||
if (! out.has_eject)
|
if (! out.has_eject)
|
||||||
m_last_save_path.clear();
|
m_last_save_path.clear();
|
||||||
|
out.has_eject = out.has_eject && m_exporting_finished;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ public:
|
||||||
// Public to be accessible from RemovableDriveManagerMM::on_device_unmount OSX notification handler.
|
// Public to be accessible from RemovableDriveManagerMM::on_device_unmount OSX notification handler.
|
||||||
// It would be better to make this method private and friend to RemovableDriveManagerMM, but RemovableDriveManagerMM is an ObjectiveC class.
|
// It would be better to make this method private and friend to RemovableDriveManagerMM, but RemovableDriveManagerMM is an ObjectiveC class.
|
||||||
void update();
|
void update();
|
||||||
|
void set_exporting_finished(bool b) { m_exporting_finished = b; }
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// Called by Win32 Volume arrived / detached callback.
|
// Called by Win32 Volume arrived / detached callback.
|
||||||
void volumes_changed();
|
void volumes_changed();
|
||||||
|
@ -121,7 +121,9 @@ private:
|
||||||
std::vector<DriveData>::const_iterator find_last_save_path_drive_data() const;
|
std::vector<DriveData>::const_iterator find_last_save_path_drive_data() const;
|
||||||
// Set with set_and_verify_last_save_path() to a removable drive path to be ejected.
|
// Set with set_and_verify_last_save_path() to a removable drive path to be ejected.
|
||||||
std::string m_last_save_path;
|
std::string m_last_save_path;
|
||||||
|
// Verifies that exporting was finished so drive can be ejected.
|
||||||
|
// Set false by set_and_verify_last_save_path() that is called just before exporting.
|
||||||
|
bool m_exporting_finished;
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
void register_window_osx();
|
void register_window_osx();
|
||||||
void unregister_window_osx();
|
void unregister_window_osx();
|
||||||
|
|
Loading…
Reference in a new issue