mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-07-20 16:34:44 +03:00
Polymorphic AppController for cli and gui modes.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "GUI.hpp"
|
||||
#include "../AppController.hpp"
|
||||
#include "WipeTowerDialog.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
@@ -1405,4 +1406,23 @@ void desktop_open_datadir_folder()
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace {
|
||||
AppControllerPtr g_appctl;
|
||||
}
|
||||
|
||||
AppControllerPtr get_appctl()
|
||||
{
|
||||
return g_appctl;
|
||||
}
|
||||
|
||||
void set_cli_appctl()
|
||||
{
|
||||
g_appctl = std::make_shared<AppControllerCli>();
|
||||
}
|
||||
|
||||
void set_gui_appctl()
|
||||
{
|
||||
g_appctl = std::make_shared<AppControllerGui>();
|
||||
}
|
||||
|
||||
} }
|
||||
|
||||
@@ -42,6 +42,9 @@ class TabIface;
|
||||
class PreviewIface;
|
||||
class Print;
|
||||
class GCodePreviewData;
|
||||
class AppControllerBase;
|
||||
|
||||
using AppControllerPtr = std::shared_ptr<AppControllerBase>;
|
||||
|
||||
#define _(s) Slic3r::GUI::I18N::translate((s))
|
||||
|
||||
@@ -129,6 +132,10 @@ ProgressStatusBar* get_progress_status_bar();
|
||||
wxNotebook * get_tab_panel();
|
||||
wxNotebook* get_tab_panel();
|
||||
|
||||
AppControllerPtr get_appctl();
|
||||
void set_cli_appctl();
|
||||
void set_gui_appctl();
|
||||
|
||||
const wxColour& get_label_clr_modified();
|
||||
const wxColour& get_label_clr_sys();
|
||||
const wxColour& get_label_clr_default();
|
||||
|
||||
Reference in New Issue
Block a user