Centralize retained cloud dialog closing
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "canvas.h"
|
||||
#include "legacy_app_dialog_services.h"
|
||||
#include "legacy_canvas_view_services.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
#include "node_dialog_cloud.h"
|
||||
#include "node_progress_bar.h"
|
||||
#include "util.h"
|
||||
@@ -44,7 +45,7 @@ public:
|
||||
pb->set_progress(p);
|
||||
});
|
||||
|
||||
pb->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*pb);
|
||||
const auto success_plan = pp::app::plan_cloud_upload_success_prompt();
|
||||
app->message_box(success_plan.title, success_plan.message, success_plan.show_cancel);
|
||||
};
|
||||
@@ -53,10 +54,10 @@ public:
|
||||
auto m = app_.message_box(prompt_plan.title, prompt_plan.message, prompt_plan.show_cancel);
|
||||
m->btn_ok->on_click = [m, upload_thread](Node*) {
|
||||
std::thread(upload_thread).detach();
|
||||
m->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*m);
|
||||
};
|
||||
m->btn_cancel->on_click = [m](Node*) {
|
||||
m->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*m);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -87,7 +88,7 @@ public:
|
||||
void end_bulk_upload() override
|
||||
{
|
||||
if (bulk_progress_) {
|
||||
bulk_progress_->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*bulk_progress_);
|
||||
}
|
||||
bulk_progress_.reset();
|
||||
}
|
||||
@@ -138,7 +139,7 @@ public:
|
||||
for (auto& l : app->canvas->m_canvas->m_layers)
|
||||
app->layers->add_layer(l->m_name.c_str(), false);
|
||||
ActionManager::clear();
|
||||
m->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*m);
|
||||
}).detach();
|
||||
}
|
||||
|
||||
@@ -184,7 +185,7 @@ pp::foundation::Status execute_legacy_cloud_download_selection_action(
|
||||
.selected_name = dialog.selected_name,
|
||||
};
|
||||
if (action == pp::app::CloudDownloadSelectionAction::start_download) {
|
||||
dialog.destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(dialog);
|
||||
}
|
||||
LegacyCloudServices services(app);
|
||||
return pp::app::execute_cloud_download_selection_action(action, services, request);
|
||||
|
||||
Reference in New Issue
Block a user