Centralize service adapter dialog closing
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "legacy_brush_package_export_services.h"
|
||||
|
||||
#include "app.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
#include "node_dialog_export_ppbr.h"
|
||||
#include "node_panel_brush.h"
|
||||
|
||||
@@ -49,7 +50,7 @@ public:
|
||||
std::thread([app, dialog, path_string, info] {
|
||||
BT_SetTerminate();
|
||||
app->presets->export_ppbr(path_string, info);
|
||||
dialog->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*dialog);
|
||||
const auto plan = pp::app::plan_brush_package_export_success_dialog(path_string);
|
||||
app->message_box(plan.title, plan.message, plan.show_cancel);
|
||||
}).detach();
|
||||
@@ -94,7 +95,7 @@ pp::foundation::Status execute_legacy_brush_package_export(
|
||||
void complete_legacy_brush_package_export(NodeDialogExportPPBR& dialog, bool saved)
|
||||
{
|
||||
if (saved) {
|
||||
dialog.destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(dialog);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "legacy_brush_package_import_services.h"
|
||||
#include "legacy_canvas_view_services.h"
|
||||
#include "legacy_history_services.h"
|
||||
#include "legacy_ui_overlay_services.h"
|
||||
#include "log.h"
|
||||
#include "node_panel_brush.h"
|
||||
#include "node_panel_layer.h"
|
||||
@@ -61,7 +62,7 @@ public:
|
||||
path);
|
||||
if (!status.ok())
|
||||
LOG("ABR import failed: %s", status.message);
|
||||
target->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*target);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ public:
|
||||
path);
|
||||
if (!status.ok())
|
||||
LOG("PPBR import failed: %s", status.message);
|
||||
target->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*target);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -94,7 +95,7 @@ public:
|
||||
true);
|
||||
mb->on_submit = [app, route](Node* target) {
|
||||
open_legacy_project(*app, route);
|
||||
target->destroy();
|
||||
pp::panopainter::close_legacy_dialog_node(*target);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user