Initial nag for interface complexity.
[dcpomatic.git] / src / wx / initial_setup_dialog.cc
1 /*
2     Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
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.
10
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.
15
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/>.
18
19 */
20
21 #include "initial_setup_dialog.h"
22 #include "lib/config.h"
23 #include <boost/bind.hpp>
24
25 InitialSetupDialog::InitialSetupDialog ()
26         : wxDialog (0, wxID_ANY, _("DCP-o-matic setup"))
27 {
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);
31
32         text1->SetLabelMarkup (
33                 _(
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 "
37                         "options.\n\n"
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:\n\n"
40                         )
41                 );
42
43         _simple = new wxRadioButton (this, wxID_ANY, _("Simple mode"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
44         sizer->Add (_simple, 0, wxLEFT, 24);
45         _full = new wxRadioButton (this, wxID_ANY, _("Full mode"));
46         sizer->Add (_full, 0, wxLEFT, 24);
47
48         if (Config::instance()->interface_complexity() == Config::INTERFACE_SIMPLE) {
49                 _simple->SetValue (true);
50         } else {
51                 _full->SetValue (true);
52         }
53
54         wxStaticText* text2 = new wxStaticText (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(400, -1));
55         sizer->Add (text2, 0, wxEXPAND | wxALL, 12);
56
57         text2->SetLabelMarkup (_("\nYou can change the mode at any time from the General page of Preferences."));
58
59         _simple->Bind (wxEVT_RADIOBUTTON, boost::bind(&InitialSetupDialog::interface_complexity_changed, this));
60         _full->Bind (wxEVT_RADIOBUTTON, boost::bind(&InitialSetupDialog::interface_complexity_changed, this));
61
62         wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
63         if (buttons) {
64                 sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
65         }
66
67         sizer->Layout ();
68         SetSizerAndFit (sizer);
69 }
70
71 void
72 InitialSetupDialog::interface_complexity_changed ()
73 {
74         if (_simple->GetValue()) {
75                 Config::instance()->set_interface_complexity (Config::INTERFACE_SIMPLE);
76         } else {
77                 Config::instance()->set_interface_complexity (Config::INTERFACE_FULL);
78         }
79 }