From 3d805a0f43040210f180ea1b6f559d70d39df881 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 22 Feb 2018 11:12:29 +0100 Subject: [PATCH] PreferencesDialog moved to C++ part --- lib/Slic3r/GUI.pm | 11 ++++++++++- lib/Slic3r/GUI/MainFrame.pm | 5 ++++- resources/localization/uk/Slic3rPE.mo | Bin 109308 -> 111244 bytes xs/src/slic3r/GUI/GUI.cpp | 19 +++++++++++++++++++ xs/src/slic3r/GUI/GUI.hpp | 8 ++++++++ xs/src/slic3r/GUI/Tab.cpp | 2 +- xs/xsp/GUI.xsp | 3 +++ 7 files changed, 45 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index a50363131..2204ab03c 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -69,7 +69,9 @@ our $grey = Wx::Colour->new(200,200,200); # Events to be sent from a C++ menu implementation: # 1) To inform about a change of the application language. -our $LANGUAGE_CHANGE_EVENT = Wx::NewEventType; +our $LANGUAGE_CHANGE_EVENT = Wx::NewEventType; +# 2) To inform about a change of Preferences. +our $PREFERENCES_EVENT = Wx::NewEventType; sub OnInit { my ($self) = @_; @@ -122,6 +124,7 @@ sub OnInit { no_controller => $self->{app_config}->get('no_controller'), no_plater => $no_plater, lang_ch_event => $LANGUAGE_CHANGE_EVENT, + preferences_event => $PREFERENCES_EVENT, ); $self->SetTopWindow($frame); @@ -146,6 +149,11 @@ sub OnInit { EVT_COMMAND($self, -1, $LANGUAGE_CHANGE_EVENT, sub{ $self->recreate_GUI; }); + + # The following event is emited by the C++ menu implementation of preferences change. + EVT_COMMAND($self, -1, $PREFERENCES_EVENT, sub{ + $self->update_ui_from_settings; + }); return 1; } @@ -158,6 +166,7 @@ sub recreate_GUI{ no_controller => $self->{app_config}->get('no_controller'), no_plater => $no_plater, lang_ch_event => $LANGUAGE_CHANGE_EVENT, + preferences_event => $PREFERENCES_EVENT, ); if($topwindow) diff --git a/lib/Slic3r/GUI/MainFrame.pm b/lib/Slic3r/GUI/MainFrame.pm index 76920c17f..1b05218cd 100644 --- a/lib/Slic3r/GUI/MainFrame.pm +++ b/lib/Slic3r/GUI/MainFrame.pm @@ -50,6 +50,7 @@ sub new { $self->{no_plater} = $params{no_plater}; $self->{loaded} = 0; $self->{lang_ch_event} = $params{lang_ch_event}; + $self->{preferences_event} = $params{preferences_event}; # initialize tabpanel and menubar $self->_init_tabpanel; @@ -296,7 +297,9 @@ sub _init_menubar { $fileMenu->AppendSeparator(); # Cmd+, is standard on OS X - what about other operating systems? $self->_append_menu_item($fileMenu, L("Preferences…\tCtrl+,"), L('Application preferences'), sub { - Slic3r::GUI::Preferences->new($self)->ShowModal; + # Slic3r::GUI::Preferences->new($self)->ShowModal; + # It's in C++ part now + Slic3r::GUI::open_preferences_dialog($self->{preferences_event}); }, wxID_PREFERENCES); $fileMenu->AppendSeparator(); $self->_append_menu_item($fileMenu, L("&Quit"), L('Quit Slic3r'), sub { diff --git a/resources/localization/uk/Slic3rPE.mo b/resources/localization/uk/Slic3rPE.mo index ff041bdeef0d4cf4cf4fe172dd2e18788bf1d95f..1aea462833e31f4e0adc99c4c41cd1dbb21ac2eb 100644 GIT binary patch delta 12006 zcmb8!34Bf0zQFOd4GA%eAXFSfBq0)0&GS6R)YeoL$%%vvoFpWulbB~Eh$>YzYY`&E zkf1F^ul5|Fs2WR)s-m>LZMEyon94M37Q-u^HCFVJL@A#hJJU`=MWbr93ef zi(wMlG1V%+jwO_Gs_#hnu;UR@2j#(CN@5Aj$BHNya$8=;n&fZdJT!up+K3BqJccwh zFRa#}FZqpF6!Wb7aqLX~3RdF&$}dD8*c9c!ekc_fXgLDu6lKS$n2go%F-pZshbmPW zD`6vSfF3v!y)nYdPsR%5r=y(rmgKp=T1}!X?!at3h|*MMaOXDo8j?1tO z?nJs$-NP#Q1dF3rV`-sM<*^3(qg1Gim46MLa-n2v$142vQuF6l zdGRK?qE)dk5NGdH5DeMf*3U|K)_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oYVWr1ui~*3g!L^m~N1gG4qrW&imYw*M!;g!Bla6~`CC zBbW!%;R6gL4v@~OkF%U)wB;wR5;uvbL>J;2k+gMo-z#%DP1|5kKbtix@i=8s#4yrr zz49cMlbFiB*I1nxM9lZDLDKylAXogStO@xWfn(zDDFDKLlrCHDUni+&Bq?iFu?~693m5#odhkRJC=(e`IzDV$!(_?xURe=4_i<2su3fz|#K$F!$Q~bh v>vsCME#;jY@gow?gdCXU=NwFapl)jCZtQ{L%bh`44m{oEG;)%k+-3d;z&E?% diff --git a/xs/src/slic3r/GUI/GUI.cpp b/xs/src/slic3r/GUI/GUI.cpp index 394aca9ad..8c0f696e9 100644 --- a/xs/src/slic3r/GUI/GUI.cpp +++ b/xs/src/slic3r/GUI/GUI.cpp @@ -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; +} + } } diff --git a/xs/src/slic3r/GUI/GUI.hpp b/xs/src/slic3r/GUI/GUI.hpp index 2ffacbc28..69a0f342c 100644 --- a/xs/src/slic3r/GUI/GUI.hpp +++ b/xs/src/slic3r/GUI/GUI.hpp @@ -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(); diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index db23a1874..95eb83e87 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -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) diff --git a/xs/xsp/GUI.xsp b/xs/xsp/GUI.xsp index ad4dd7550..cae480c2f 100644 --- a/xs/xsp/GUI.xsp +++ b/xs/xsp/GUI.xsp @@ -58,3 +58,6 @@ int combochecklist_get_flags(SV *ui) void set_app_config(AppConfig *app_config) %code%{ Slic3r::GUI::set_app_config(app_config); %}; + +void open_preferences_dialog(int preferences_event) + %code%{ Slic3r::GUI::open_preferences_dialog(preferences_event); %};