mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-12 11:37:42 +00:00
CrealityPrint: add custom send dialog boilerplate
Add CrealityPrintHostSendDialog scaffolding: an empty dialog class that inherits from PrintHostSendDialog, and Plater wiring to use it when the host type is CrealityPrint. Signed-off-by: Igor Mammedov <niallain@gmail.com>
This commit is contained in:
@@ -16134,6 +16134,11 @@ void Plater::send_gcode_legacy(int plate_idx, Export3mfProgressFn proFn, bool us
|
|||||||
pDlg = std::make_unique<ElegooPrintHostSendDialog>(default_output_file, upload_job.printhost->get_post_upload_actions(), groups,
|
pDlg = std::make_unique<ElegooPrintHostSendDialog>(default_output_file, upload_job.printhost->get_post_upload_actions(), groups,
|
||||||
storage_paths, storage_names,
|
storage_paths, storage_names,
|
||||||
config->get_bool("open_device_tab_post_upload"));
|
config->get_bool("open_device_tab_post_upload"));
|
||||||
|
} else if (host_type == htCrealityPrint) {
|
||||||
|
pDlg = std::make_unique<CrealityPrintHostSendDialog>(default_output_file, upload_job.printhost->get_post_upload_actions(), groups,
|
||||||
|
storage_paths, storage_names,
|
||||||
|
config->get_bool("open_device_tab_post_upload"),
|
||||||
|
upload_job.printhost.get());
|
||||||
} else {
|
} else {
|
||||||
pDlg = std::make_unique<PrintHostSendDialog>(default_output_file, upload_job.printhost->get_post_upload_actions(), groups,
|
pDlg = std::make_unique<PrintHostSendDialog>(default_output_file, upload_job.printhost->get_post_upload_actions(), groups,
|
||||||
storage_paths, storage_names, config->get_bool("open_device_tab_post_upload"));
|
storage_paths, storage_names, config->get_bool("open_device_tab_post_upload"));
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include "NotificationManager.hpp"
|
#include "NotificationManager.hpp"
|
||||||
#include "ExtraRenderers.hpp"
|
#include "ExtraRenderers.hpp"
|
||||||
#include "format.hpp"
|
#include "format.hpp"
|
||||||
|
#include "../Utils/CrealityPrint.hpp"
|
||||||
|
|
||||||
namespace fs = boost::filesystem;
|
namespace fs = boost::filesystem;
|
||||||
|
|
||||||
@@ -952,4 +953,25 @@ void ElegooPrintHostSendDialog::refresh()
|
|||||||
this->Fit();
|
this->Fit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CrealityPrintHostSendDialog::CrealityPrintHostSendDialog(const fs::path& path,
|
||||||
|
PrintHostPostUploadActions post_actions,
|
||||||
|
const wxArrayString& groups,
|
||||||
|
const wxArrayString& storage_paths,
|
||||||
|
const wxArrayString& storage_names,
|
||||||
|
bool switch_to_device_tab,
|
||||||
|
PrintHost* printhost)
|
||||||
|
: PrintHostSendDialog(path, post_actions, groups, storage_paths, storage_names, switch_to_device_tab)
|
||||||
|
, m_printhost(printhost)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void CrealityPrintHostSendDialog::init()
|
||||||
|
{
|
||||||
|
PrintHostSendDialog::init();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<std::string, std::string> CrealityPrintHostSendDialog::extendedInfo() const
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -180,6 +180,24 @@ private:
|
|||||||
BedType m_BedType;
|
BedType m_BedType;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CrealityPrintHostSendDialog : public PrintHostSendDialog
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CrealityPrintHostSendDialog(const boost::filesystem::path& path,
|
||||||
|
PrintHostPostUploadActions post_actions,
|
||||||
|
const wxArrayString& groups,
|
||||||
|
const wxArrayString& storage_paths,
|
||||||
|
const wxArrayString& storage_names,
|
||||||
|
bool switch_to_device_tab,
|
||||||
|
PrintHost* printhost);
|
||||||
|
|
||||||
|
virtual void init() override;
|
||||||
|
virtual std::map<std::string, std::string> extendedInfo() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
PrintHost* m_printhost;
|
||||||
|
};
|
||||||
|
|
||||||
wxDECLARE_EVENT(EVT_PRINTHOST_PROGRESS, PrintHostQueueDialog::Event);
|
wxDECLARE_EVENT(EVT_PRINTHOST_PROGRESS, PrintHostQueueDialog::Event);
|
||||||
wxDECLARE_EVENT(EVT_PRINTHOST_ERROR, PrintHostQueueDialog::Event);
|
wxDECLARE_EVENT(EVT_PRINTHOST_ERROR, PrintHostQueueDialog::Event);
|
||||||
wxDECLARE_EVENT(EVT_PRINTHOST_CANCEL, PrintHostQueueDialog::Event);
|
wxDECLARE_EVENT(EVT_PRINTHOST_CANCEL, PrintHostQueueDialog::Event);
|
||||||
|
|||||||
Reference in New Issue
Block a user