Ongoing uploads while exiting dialog

Ongoing uploads while exiting dialog

Ongoing uploads while exiting dialog
This commit is contained in:
David Kocik 2020-12-10 10:58:40 +01:00
parent 48a21cae93
commit 3523bb421f
10 changed files with 63 additions and 12 deletions

View file

@ -65,6 +65,7 @@
#include "NotificationManager.hpp"
#include "UnsavedChangesDialog.hpp"
#include "SavePresetDialog.hpp"
#include "PrintHostDialogs.hpp"
#include "BitmapCache.hpp"
@ -1707,6 +1708,33 @@ bool GUI_App::check_unsaved_changes(const wxString &header)
return true;
}
bool GUI_App::check_print_host_queue()
{
wxString dirty;
std::vector<std::pair<std::string, std::string>> jobs;
// Get ongoing jobs from dialog
mainframe->m_printhost_queue_dlg->get_active_jobs(jobs);
if (jobs.empty())
return true;
// Show dialog
wxString job_string = wxString();
for (const auto& job : jobs) {
job_string += (boost::format(" %1% : %2% \n") % job.first % job.second).str();
}
wxString message;
message += _(L("The uploads are still ongoing")) + ":\n\n" + job_string +"\n" + _(L("Stop them and continue anyway?"));
wxMessageDialog dialog(mainframe,
message,
wxString(SLIC3R_APP_NAME) + " - " + _(L("Ongoing uploads")),
wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT);
if (dialog.ShowModal() == wxID_YES)
return true;
// TODO: If already shown, bring forward
mainframe->m_printhost_queue_dlg->Show();
return false;
}
bool GUI_App::checked_tab(Tab* tab)
{
bool ret = true;