diff --git a/MANIFEST b/MANIFEST index 45612a57b..e7a70892a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -31,6 +31,7 @@ lib/Slic3r/GUI/AboutDialog.pm lib/Slic3r/GUI/ConfigWizard.pm lib/Slic3r/GUI/OptionsGroup.pm lib/Slic3r/GUI/Plater.pm +lib/Slic3r/GUI/Preferences.pm lib/Slic3r/GUI/SkeinPanel.pm lib/Slic3r/GUI/Tab.pm lib/Slic3r/Layer.pm diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index 737204926..7f2fab7fd 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -7,6 +7,7 @@ use FindBin; use Slic3r::GUI::AboutDialog; use Slic3r::GUI::ConfigWizard; use Slic3r::GUI::Plater; +use Slic3r::GUI::Preferences; use Slic3r::GUI::OptionsGroup; use Slic3r::GUI::SkeinPanel; use Slic3r::GUI::Tab; @@ -94,6 +95,8 @@ sub OnInit { $fileMenu->AppendSeparator(); $fileMenu->Append(MI_COMBINE_STLS, "Combine multi-material STL files…", 'Combine multiple STL files into a single multi-material AMF file'); $fileMenu->AppendSeparator(); + $fileMenu->Append(wxID_PREFERENCES, "Preferences…", 'Application preferences'); + $fileMenu->AppendSeparator(); $fileMenu->Append(wxID_EXIT, "&Quit", 'Quit Slic3r'); EVT_MENU($frame, MI_LOAD_CONF, sub { $self->{skeinpanel}->load_config_file }); EVT_MENU($frame, MI_EXPORT_CONF, sub { $self->{skeinpanel}->export_config }); @@ -104,6 +107,7 @@ sub OnInit { $repeat->Enable(defined $Slic3r::GUI::SkeinPanel::last_input_file) }); EVT_MENU($frame, MI_SLICE_SVG, sub { $self->{skeinpanel}->do_slice(save_as => 1, export_svg => 1) }); EVT_MENU($frame, MI_COMBINE_STLS, sub { $self->{skeinpanel}->combine_stls }); + EVT_MENU($frame, wxID_PREFERENCES, sub { Slic3r::GUI::Preferences->new($frame)->ShowModal }); EVT_MENU($frame, wxID_EXIT, sub {$_[0]->Close(0)}); } diff --git a/lib/Slic3r/GUI/Preferences.pm b/lib/Slic3r/GUI/Preferences.pm new file mode 100644 index 000000000..6a0f549a5 --- /dev/null +++ b/lib/Slic3r/GUI/Preferences.pm @@ -0,0 +1,40 @@ +package Slic3r::GUI::Preferences; +use Wx qw(:dialog :id :misc :sizer :systemsettings); +use Wx::Event qw(EVT_BUTTON EVT_TEXT_ENTER); +use base 'Wx::Dialog'; + +sub new { + my $class = shift; + my ($parent, %params) = @_; + my $self = $class->SUPER::new($parent, -1, "Preferences", wxDefaultPosition, [500,200]); + + my $optgroup = Slic3r::GUI::OptionsGroup->new( + parent => $self, + title => 'General', + options => [ + { + opt_key => 'mode', + type => 'select', + label => 'Mode', + tooltip => 'Choose between a simpler, basic mode and an expert mode with more options and more complicated interface.', + labels => ['Simple','Expert'], + values => ['simple','expert'], + default => 'simple', + }, + ], + label_width => 100, + ); + my $sizer = Wx::BoxSizer->new(wxVERTICAL); + $sizer->Add($optgroup->sizer, 0, wxEXPAND | wxBOTTOM | wxLEFT | wxRIGHT, 10); + + my $buttons = $self->CreateStdDialogButtonSizer(wxOK | wxCANCEL); + EVT_BUTTON($self, wxID_OK, sub { $self->EndModal(wxID_OK); }); + $sizer->Add($buttons, 0, wxEXPAND | wxBOTTOM | wxLEFT | wxRIGHT, 10); + + $self->SetSizer($sizer); + $sizer->SetSizeHints($self); + + return $self; +} + +1;