2 Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 #include "initial_setup_dialog.h"
22 #include "static_text.h"
23 #include "lib/config.h"
24 #include <boost/bind.hpp>
26 InitialSetupDialog::InitialSetupDialog ()
27 : wxDialog (0, wxID_ANY, _("DCP-o-matic setup"))
29 wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
30 wxStaticText* text1 = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(600, -1));
31 sizer->Add (text1, 1, wxEXPAND | wxALL, 12);
33 text1->SetLabelMarkup (
35 "<span weight=\"bold\" size=\"larger\">Welcome to DCP-o-matic!</span>\n\n"
36 "DCP-o-matic can work in two modes: '<i>simple</i>' or '<i>full</i>'.\n\n"
37 "<i>Simple mode</i> is ideal for producing straightforward DCPs without too many confusing "
39 "<i>Full mode</i> gives you the most control over the DCPs you make.\n\n"
40 "Please choose which mode you would like to start DCP-o-matic in:"
44 wxBoxSizer* mode_sizer = new wxBoxSizer (wxVERTICAL);
46 _simple = new wxRadioButton (this, wxID_ANY, _("Simple mode"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
47 mode_sizer->Add (_simple, 0, wxTOP, 12);
48 _full = new wxRadioButton (this, wxID_ANY, _("Full mode"));
49 mode_sizer->Add (_full, 0, wxTOP, 8);
51 sizer->Add (mode_sizer, 0, wxLEFT, 24);
53 if (Config::instance()->interface_complexity() == Config::INTERFACE_SIMPLE) {
54 _simple->SetValue (true);
56 _full->SetValue (true);
59 wxStaticText* text2 = new StaticText (this, wxEmptyString, wxDefaultPosition, wxSize(400, -1));
60 sizer->Add (text2, 0, wxEXPAND | wxALL, 12);
62 text2->SetLabel (_("\nYou can change the mode at any time from the General page of Preferences."));
64 _simple->Bind (wxEVT_RADIOBUTTON, boost::bind(&InitialSetupDialog::interface_complexity_changed, this));
65 _full->Bind (wxEVT_RADIOBUTTON, boost::bind(&InitialSetupDialog::interface_complexity_changed, this));
67 wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
69 sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
73 SetSizerAndFit (sizer);
77 InitialSetupDialog::interface_complexity_changed ()
79 if (_simple->GetValue()) {
80 Config::instance()->set_interface_complexity (Config::INTERFACE_SIMPLE);
82 Config::instance()->set_interface_complexity (Config::INTERFACE_FULL);