Merge branch 'dk_remote_devices'

This commit is contained in:
David Kocik 2020-07-26 21:17:39 +02:00
commit 710e6b08f4
5 changed files with 16 additions and 9 deletions

View file

@ -106,7 +106,7 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_S
m_statusbar->embed(this);
m_statusbar->set_status_text(_(L("Version")) + " " +
SLIC3R_VERSION +
_(L(" - Remember to check for updates at http://github.com/prusa3d/PrusaSlicer/releases")));
_(L(" - Remember to check for updates at https://github.com/prusa3d/PrusaSlicer/releases")));
/* Load default preset bitmaps before a tabpanel initialization,
* but after filling of an em_unit value
@ -909,7 +909,7 @@ void MainFrame::init_menubar()
wxMenu* export_menu = new wxMenu();
wxMenuItem* item_export_gcode = append_menu_item(export_menu, wxID_ANY, _(L("Export &G-code")) + dots +"\tCtrl+G", _(L("Export current plate as G-code")),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(); }, "export_gcode", nullptr,
[this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(false); }, "export_gcode", nullptr,
[this](){return can_export_gcode(); }, this);
m_changeable_menu_items.push_back(item_export_gcode);
wxMenuItem* item_send_gcode = append_menu_item(export_menu, wxID_ANY, _(L("S&end G-code")) + dots +"\tCtrl+Shift+G", _(L("Send to print current plate as G-code")),
@ -1141,7 +1141,7 @@ void MainFrame::init_menubar()
append_menu_item(helpMenu, wxID_ANY, _(L("Prusa 3D &Drivers")), _(L("Open the Prusa3D drivers download page in your browser")),
[this](wxCommandEvent&) { wxGetApp().open_web_page_localized("https://www.prusa3d.com/downloads"); });
append_menu_item(helpMenu, wxID_ANY, _(L("Software &Releases")), _(L("Open the software releases page in your browser")),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/prusa3d/PrusaSlicer/releases"); });
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/prusa3d/PrusaSlicer/releases"); });
//# my $versioncheck = $self->_append_menu_item($helpMenu, "Check for &Updates...", "Check for new Slic3r versions", sub{
//# wxTheApp->check_version(1);
//# });
@ -1158,7 +1158,7 @@ void MainFrame::init_menubar()
append_menu_item(helpMenu, wxID_ANY, _(L("Show &Configuration Folder")), _(L("Show user configuration folder (datadir)")),
[this](wxCommandEvent&) { Slic3r::GUI::desktop_open_datadir_folder(); });
append_menu_item(helpMenu, wxID_ANY, _(L("Report an I&ssue")), wxString::Format(_(L("Report an issue on %s")), SLIC3R_APP_NAME),
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("http://github.com/prusa3d/slic3r/issues/new"); });
[this](wxCommandEvent&) { wxLaunchDefaultBrowser("https://github.com/prusa3d/slic3r/issues/new"); });
append_menu_item(helpMenu, wxID_ANY, wxString::Format(_(L("&About %s")), SLIC3R_APP_NAME), _(L("Show about dialog")),
[this](wxCommandEvent&) { Slic3r::GUI::about(); });
helpMenu->AppendSeparator();

View file

@ -929,7 +929,7 @@ Sidebar::Sidebar(Plater *parent)
{
const bool export_gcode_after_slicing = wxGetKeyState(WXK_SHIFT);
if (export_gcode_after_slicing)
p->plater->export_gcode();
p->plater->export_gcode(true);
else
p->plater->reslice();
p->plater->select_view_3D("Preview");
@ -3450,7 +3450,7 @@ void Plater::priv::on_slicing_completed(wxCommandEvent &)
break;
default: break;
}
}
}
void Plater::priv::on_process_completed(wxCommandEvent &evt)
{
@ -3510,7 +3510,10 @@ void Plater::priv::on_process_completed(wxCommandEvent &evt)
show_action_buttons(true);
}
else if (this->writing_to_removable_device || wxGetApp().get_mode() == comSimple)
{
wxGetApp().removable_drive_manager()->set_exporting_finished(true);
show_action_buttons(false);
}
this->writing_to_removable_device = false;
}

View file

@ -220,7 +220,7 @@ public:
void cut(size_t obj_idx, size_t instance_idx, coordf_t z, bool keep_upper = true, bool keep_lower = true, bool rotate_lower = false);
void export_gcode(bool prefer_removable = true);
void export_gcode(bool prefer_removable);
void export_stl(bool extended = false, bool selection_only = false);
void export_amf();
void export_3mf(const boost::filesystem::path& output_path = boost::filesystem::path());

View file

@ -393,6 +393,7 @@ bool RemovableDriveManager::set_and_verify_last_save_path(const std::string &pat
#endif // REMOVABLE_DRIVE_MANAGER_OS_CALLBACKS
m_last_save_path = this->get_removable_drive_from_path(path);
m_exporting_finished = false;
return ! m_last_save_path.empty();
}
@ -407,6 +408,7 @@ RemovableDriveManager::RemovableDrivesStatus RemovableDriveManager::status()
}
if (! out.has_eject)
m_last_save_path.clear();
out.has_eject = out.has_eject && m_exporting_finished;
return out;
}

View file

@ -83,7 +83,7 @@ public:
// 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.
void update();
void set_exporting_finished(bool b) { m_exporting_finished = b; }
#ifdef _WIN32
// Called by Win32 Volume arrived / detached callback.
void volumes_changed();
@ -121,7 +121,9 @@ private:
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.
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__
void register_window_osx();
void unregister_window_osx();