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 "lib/config.h"
23 #include <boost/bind.hpp>
25 InitialSetupDialog::InitialSetupDialog ()
26 : wxDialog (0, wxID_ANY, _("DCP-o-matic setup"))
28 wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
29 wxStaticText* text1 = new wxStaticText (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(600, -1));
30 sizer->Add (text1, 1, wxEXPAND | wxALL, 12);
32 text1->SetLabelMarkup (
34 "<span weight=\"bold\" size=\"larger\">Welcome to DCP-o-matic!</span>\n\n"
35 "DCP-o-matic can work in two modes: '<i>simple</i>' or '<i>full</i>'.\n\n"
36 "<i>Simple mode</i> is ideal for producing straightforward DCPs without too many confusing "
38 "<i>Full mode</i> gives you the most control over the DCPs you make.\n\n"
39 "Please choose which mode you would like to start DCP-o-matic in:"
43 wxBoxSizer* mode_sizer = new wxBoxSizer (wxVERTICAL);
45 _simple = new wxRadioButton (this, wxID_ANY, _("Simple mode"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
46 mode_sizer->Add (_simple, 0, wxTOP, 12);
47 _full = new wxRadioButton (this, wxID_ANY, _("Full mode"));
48 mode_sizer->Add (_full, 0, wxTOP, 8);
50 sizer->Add (mode_sizer, 0, wxLEFT, 24);
52 if (Config::instance()->interface_complexity() == Config::INTERFACE_SIMPLE) {
53 _simple->SetValue (true);
55 _full->SetValue (true);
58 wxStaticText* text2 = new wxStaticText (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(400, -1));
59 sizer->Add (text2, 0, wxEXPAND | wxALL, 12);
61 text2->SetLabelMarkup (_("\nYou can change the mode at any time from the General page of Preferences."));
63 _simple->Bind (wxEVT_RADIOBUTTON, boost::bind(&InitialSetupDialog::interface_complexity_changed, this));
64 _full->Bind (wxEVT_RADIOBUTTON, boost::bind(&InitialSetupDialog::interface_complexity_changed, this));
66 wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
68 sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
72 SetSizerAndFit (sizer);
76 InitialSetupDialog::interface_complexity_changed ()
78 if (_simple->GetValue()) {
79 Config::instance()->set_interface_complexity (Config::INTERFACE_SIMPLE);
81 Config::instance()->set_interface_complexity (Config::INTERFACE_FULL);