PreferencesDialog moved to C++ part

This commit is contained in:
YuSanka 2018-02-22 11:12:29 +01:00
parent 916378097c
commit 3d805a0f43
7 changed files with 45 additions and 3 deletions

View file

@ -44,6 +44,7 @@
#include "TabIface.hpp"
#include "AppConfig.hpp"
#include "Utils.hpp"
#include "Preferences.hpp"
namespace Slic3r { namespace GUI {
@ -342,6 +343,12 @@ void add_debug_menu(wxMenuBar *menu, int event_language_change)
//#endif
}
void open_preferences_dialog(int event_preferences)
{
auto dlg = new PreferencesDialog(g_wxMainFrame, event_preferences);
dlg->ShowModal();
}
void create_preset_tabs(PresetBundle *preset_bundle,
bool no_controller, bool is_disabled_button_browse, bool is_user_agent,
int event_value_change, int event_presets_changed,
@ -487,6 +494,13 @@ void show_info(wxWindow* parent, wxString message, wxString title){
msg_wingow->ShowModal();
}
void warning_catcher(wxWindow* parent, wxString message){
if (message == _L("GLUquadricObjPtr | Attempt to free unreferenced scalar") )
return;
auto msg = new wxMessageDialog(parent, message, _L("Warning"), wxOK | wxICON_WARNING);
msg->ShowModal();
}
wxApp* get_app(){
return g_wxApp;
}
@ -536,4 +550,9 @@ int combochecklist_get_flags(wxComboCtrl* comboCtrl)
return flags;
}
AppConfig* get_app_config()
{
return g_AppConfig;
}
} }

View file

@ -66,7 +66,14 @@ void set_main_frame(wxFrame *main_frame);
void set_tab_panel(wxNotebook *tab_panel);
void set_app_config(AppConfig *app_config);
AppConfig* get_app_config();
wxApp* get_app();
void add_debug_menu(wxMenuBar *menu, int event_language_change);
// Create "Preferences" dialog after selecting menu "Preferences" in Perl part
void open_preferences_dialog(int event_preferences);
// Create a new preset tab (print, filament and printer),
void create_preset_tabs(PresetBundle *preset_bundle,
bool no_controller, bool is_disabled_button_browse, bool is_user_agent,
@ -81,6 +88,7 @@ void change_opt_value(DynamicPrintConfig& config, t_config_option_key opt_key, b
void show_error(wxWindow* parent, wxString message);
void show_info(wxWindow* parent, wxString message, wxString title);
void warning_catcher(wxWindow* parent, wxString message);
// load language saved at application config
bool load_language();

View file

@ -904,7 +904,7 @@ void TabFilament::update()
void TabFilament::OnActivate()
{
m_volumetric_speed_description_line->SetText(PresetHints::maximum_volumetric_flow_description(*m_preset_bundle));
m_volumetric_speed_description_line->SetText(wxString::FromUTF8(PresetHints::maximum_volumetric_flow_description(*m_preset_bundle).c_str()));
}
wxSizer* Tab::description_line_widget(wxWindow* parent, ogStaticText* *StaticText)