diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-02-01 23:26:09 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-02-02 12:59:34 +0100 |
| commit | 941eeb3ab5dbf0bbc23f60b43d9361b7b52969a5 (patch) | |
| tree | 0705a2926543b917e156ab8f1232c2ec6bfb11c6 /src/wx | |
| parent | 7536019a318b3db7c6cc1dd5d1fd695cef89c9b6 (diff) | |
White space: config.{cc,h} player.{cc,h} about_dialog.{cc,h} hints_dialog.{cc,h}
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/about_dialog.cc | 85 | ||||
| -rw-r--r-- | src/wx/about_dialog.h | 4 | ||||
| -rw-r--r-- | src/wx/hints_dialog.cc | 122 | ||||
| -rw-r--r-- | src/wx/hints_dialog.h | 18 |
4 files changed, 115 insertions, 114 deletions
diff --git a/src/wx/about_dialog.cc b/src/wx/about_dialog.cc index 7a74dcd97..7b4a8453d 100644 --- a/src/wx/about_dialog.cc +++ b/src/wx/about_dialog.cc @@ -32,42 +32,42 @@ #include "lib/version.h" #include <dcp/warnings.h> LIBDCP_DISABLE_WARNINGS -#include <wx/notebook.h> #include <wx/hyperlink.h> +#include <wx/notebook.h> LIBDCP_ENABLE_WARNINGS using std::vector; -AboutDialog::AboutDialog (wxWindow* parent) +AboutDialog::AboutDialog(wxWindow* parent) : wxDialog(parent, wxID_ANY, variant::wx::insert_dcpomatic(_("About %s"))) { - auto overall_sizer = new wxBoxSizer (wxVERTICAL); - auto sizer = new wxBoxSizer (wxVERTICAL); + auto overall_sizer = new wxBoxSizer(wxVERTICAL); + auto sizer = new wxBoxSizer(wxVERTICAL); - wxFont title_font (*wxNORMAL_FONT); - title_font.SetPointSize (title_font.GetPointSize() + 12); - title_font.SetWeight (wxFONTWEIGHT_BOLD); + wxFont title_font(*wxNORMAL_FONT); + title_font.SetPointSize(title_font.GetPointSize() + 12); + title_font.SetWeight(wxFONTWEIGHT_BOLD); - wxFont subtitle_font (*wxNORMAL_FONT); - subtitle_font.SetPointSize (subtitle_font.GetPointSize() + 2); + wxFont subtitle_font(*wxNORMAL_FONT); + subtitle_font.SetPointSize(subtitle_font.GetPointSize() + 2); - wxFont version_font (*wxNORMAL_FONT); - version_font.SetWeight (wxFONTWEIGHT_BOLD); + wxFont version_font(*wxNORMAL_FONT); + version_font.SetWeight(wxFONTWEIGHT_BOLD); auto t = new StaticText(this, variant::wx::dcpomatic()); - t->SetFont (title_font); - sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 16)); + t->SetFont(title_font); + sizer->Add(t, wxSizerFlags().Centre().Border(wxALL, 16)); wxString s; - if (strcmp (dcpomatic_git_commit, "release") == 0) { - t = new StaticText (this, std_to_wx(String::compose("Version %1", dcpomatic_version))); + if (strcmp(dcpomatic_git_commit, "release") == 0) { + t = new StaticText(this, std_to_wx(String::compose("Version %1", dcpomatic_version))); } else { - t = new StaticText (this, std_to_wx(String::compose("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit))); + t = new StaticText(this, std_to_wx(String::compose("Version %1 git %2", dcpomatic_version, dcpomatic_git_commit))); } - t->SetFont (version_font); - sizer->Add (t, wxSizerFlags().Centre().Border(wxALL, 2)); - sizer->AddSpacer (12); + t->SetFont(version_font); + sizer->Add(t, wxSizerFlags().Centre().Border(wxALL, 2)); + sizer->AddSpacer(12); if (variant::show_tagline()) { @@ -92,15 +92,15 @@ AboutDialog::AboutDialog (wxWindow* parent) if (variant::show_credits()) { - t = new StaticText ( + t = new StaticText( this, _("(C) 2012-2025 Carl Hetherington, Terrence Meiczinger\nOle Laursen, Aaron Boxer"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER ); - sizer->Add (t, wxSizerFlags().Centre().Border(wxLEFT | wxRIGHT, 16)); + sizer->Add(t, wxSizerFlags().Centre().Border(wxLEFT | wxRIGHT, 16)); - _notebook = new wxNotebook (this, wxID_ANY); + _notebook = new wxNotebook(this, wxID_ANY); wxArrayString written_by; written_by.Add(char_to_wx("Carl Hetherington")); @@ -109,7 +109,7 @@ AboutDialog::AboutDialog (wxWindow* parent) written_by.Add(char_to_wx("Ole Laursen")); written_by.Add(char_to_wx("Aaron Boxer")); written_by.Add(char_to_wx("Benjamin Radel")); - add_section (_("Written by"), written_by); + add_section(_("Written by"), written_by); wxArrayString with_help_from; with_help_from.Add(char_to_wx("David Vignoni")); @@ -118,7 +118,7 @@ AboutDialog::AboutDialog (wxWindow* parent) with_help_from.Add(char_to_wx("Gérald Maruccia")); with_help_from.Add(char_to_wx("Julian van Mil")); with_help_from.Add(char_to_wx("Lilian Lefranc")); - add_section (_("With help from"), with_help_from); + add_section(_("With help from"), with_help_from); wxArrayString translated_by; translated_by.Add(char_to_wx("Manuel AC")); @@ -169,19 +169,19 @@ AboutDialog::AboutDialog (wxWindow* parent) translated_by.Add(char_to_wx("Rov (若文)")); translated_by.Add(char_to_wx("刘汉源")); translated_by.Add(char_to_wx("poppinzhang")); - add_section (_("Translated by"), translated_by); + add_section(_("Translated by"), translated_by); wxArrayString patrons; patrons.Add(char_to_wx("Lightbender Post")); - add_section (_("Patrons"), patrons); + add_section(_("Patrons"), patrons); wxArrayString subscribers; #include "subscribers.cc" - add_section (_("Subscribers"), subscribers); + add_section(_("Subscribers"), subscribers); wxArrayString supported_by; #include "supporters.cc" - add_section (_("Also supported by"), supported_by); + add_section(_("Also supported by"), supported_by); wxArrayString tested_by; tested_by.Add(char_to_wx("Manuel AC")); @@ -248,37 +248,38 @@ AboutDialog::AboutDialog (wxWindow* parent) tested_by.Add(char_to_wx("Wolfgang Woehl")); tested_by.Add(char_to_wx("Benno Zwanenburg")); tested_by.Add(char_to_wx("Дима Агатов")); - add_section (_("Tested by"), tested_by); + add_section(_("Tested by"), tested_by); - sizer->Add (_notebook, wxSizerFlags().Centre().Border(wxALL, 16)); - overall_sizer->Add (sizer); + sizer->Add(_notebook, wxSizerFlags().Centre().Border(wxALL, 16)); + overall_sizer->Add(sizer); } else { overall_sizer->Add(sizer, 0, wxALL, DCPOMATIC_DIALOG_BORDER); } - wxSizer* buttons = CreateButtonSizer (wxOK); + auto buttons = CreateButtonSizer(wxOK); if (buttons) { - overall_sizer->Add (buttons, 1, wxEXPAND | wxALL, 4); + overall_sizer->Add(buttons, 1, wxEXPAND | wxALL, 4); } - SetSizerAndFit (overall_sizer); + SetSizerAndFit(overall_sizer); } + /** Add a section of credits. * @param name Name of section. * @param credits List of names. */ void -AboutDialog::add_section (wxString name, wxArrayString credits) +AboutDialog::add_section(wxString name, wxArrayString credits) { static auto first = true; int const N = 3; - auto panel = new wxScrolledWindow (_notebook); - panel->SetMaxSize (wxSize (-1, 380)); - panel->EnableScrolling (false, true); - panel->SetScrollRate (0, 32); - auto overall_sizer = new wxBoxSizer (wxHORIZONTAL); + auto panel = new wxScrolledWindow(_notebook); + panel->SetMaxSize(wxSize(-1, 380)); + panel->EnableScrolling(false, true); + panel->SetScrollRate(0, 32); + auto overall_sizer = new wxBoxSizer(wxHORIZONTAL); vector<wxString> strings(N); int c = 0; @@ -297,7 +298,7 @@ AboutDialog::add_section (wxString name, wxArrayString credits) overall_sizer->Add(sizer, 1, wxEXPAND | wxALL, 6); } - panel->SetSizerAndFit (overall_sizer); - _notebook->AddPage (panel, name, first); + panel->SetSizerAndFit(overall_sizer); + _notebook->AddPage(panel, name, first); first = false; } diff --git a/src/wx/about_dialog.h b/src/wx/about_dialog.h index f9b60ccc6..a8a9ec47a 100644 --- a/src/wx/about_dialog.h +++ b/src/wx/about_dialog.h @@ -37,10 +37,10 @@ class wxNotebook; class AboutDialog : public wxDialog { public: - explicit AboutDialog (wxWindow *); + explicit AboutDialog(wxWindow *); private: - void add_section (wxString, wxArrayString); + void add_section(wxString, wxArrayString); wxNotebook* _notebook; ///< notebook used to keep each list of names for the credits }; diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc index 65a594ef8..974d6f4cf 100644 --- a/src/wx/hints_dialog.cc +++ b/src/wx/hints_dialog.cc @@ -45,30 +45,30 @@ using namespace boost::placeholders; #endif -HintsDialog::HintsDialog (wxWindow* parent, std::weak_ptr<Film> film, bool ok) - : wxDialog (parent, wxID_ANY, _("Hints")) - , _film (film) - , _hints (0) - , _finished (false) +HintsDialog::HintsDialog(wxWindow* parent, std::weak_ptr<Film> film, bool ok) + : wxDialog(parent, wxID_ANY, _("Hints")) + , _film(film) + , _hints(0) + , _finished(false) { - auto sizer = new wxBoxSizer (wxVERTICAL); + auto sizer = new wxBoxSizer(wxVERTICAL); - _gauge = new wxGauge (this, wxID_ANY, 100); - sizer->Add (_gauge, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); + _gauge = new wxGauge(this, wxID_ANY, 100); + sizer->Add(_gauge, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); _gauge_message = new StaticText(this, {}); - sizer->Add (_gauge_message, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); + sizer->Add(_gauge_message, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); - _text = new wxRichTextCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (400, 300), wxRE_READONLY); - sizer->Add (_text, 1, wxEXPAND | wxALL, 6); + _text = new wxRichTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(400, 300), wxRE_READONLY); + sizer->Add(_text, 1, wxEXPAND | wxALL, 6); if (!ok) { auto b = new CheckBox(this, _("Don't show hints again")); - sizer->Add (b, 0, wxALL, 6); + sizer->Add(b, 0, wxALL, 6); b->bind(&HintsDialog::shut_up, this, _1); } - auto buttons = CreateStdDialogButtonSizer (0); - sizer->Add (CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder()); + auto buttons = CreateStdDialogButtonSizer(0); + sizer->Add(CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder()); wxButton* default_button = nullptr; if (ok) { default_button = new wxButton(this, wxID_OK); @@ -76,122 +76,122 @@ HintsDialog::HintsDialog (wxWindow* parent, std::weak_ptr<Film> film, bool ok) } else { default_button = new wxButton(this, wxID_OK, _("Make DCP")); buttons->SetAffirmativeButton(default_button); - buttons->SetNegativeButton (new wxButton (this, wxID_CANCEL, _("Go back"))); + buttons->SetNegativeButton(new wxButton(this, wxID_CANCEL, _("Go back"))); } - buttons->Realize (); + buttons->Realize(); default_button->SetFocus(); - SetSizer (sizer); - sizer->Layout (); - sizer->SetSizeHints (this); + SetSizer(sizer); + sizer->Layout(); + sizer->SetSizeHints(this); - _text->GetCaret()->Hide (); + _text->GetCaret()->Hide(); - auto locked_film = _film.lock (); + auto locked_film = _film.lock(); if (locked_film) { - _film_change_connection = locked_film->Change.connect (boost::bind (&HintsDialog::film_change, this, _1)); - _film_content_change_connection = locked_film->ContentChange.connect (boost::bind (&HintsDialog::film_content_change, this, _1)); + _film_change_connection = locked_film->Change.connect(boost::bind(&HintsDialog::film_change, this, _1)); + _film_content_change_connection = locked_film->ContentChange.connect(boost::bind(&HintsDialog::film_content_change, this, _1)); } - film_change (ChangeType::DONE); + film_change(ChangeType::DONE); } void -HintsDialog::film_change (ChangeType type) +HintsDialog::film_change(ChangeType type) { if (type != ChangeType::DONE) { return; } - _text->Clear (); - _current.clear (); + _text->Clear(); + _current.clear(); - auto film = _film.lock (); + auto film = _film.lock(); if (!film) { return; } - _gauge->Show (); - _gauge_message->Show (); - Layout (); - _gauge->SetValue (0); - update (); + _gauge->Show(); + _gauge_message->Show(); + Layout(); + _gauge->SetValue(0); + update(); _finished = false; - _hints.reset (new Hints (_film)); + _hints.reset(new Hints(_film)); _hints_hint_connection = _hints->Hint.connect(bind(&HintsDialog::hint, this, _1)); _hints_progress_connection = _hints->Progress.connect(bind(&HintsDialog::progress, this, _1)); _hints_pulse_connection = _hints->Pulse.connect(bind(&HintsDialog::pulse, this)); _hints_finished_connection = _hints->Finished.connect(bind(&HintsDialog::finished, this)); - _hints->start (); + _hints->start(); } void -HintsDialog::film_content_change (ChangeType type) +HintsDialog::film_content_change(ChangeType type) { - film_change (type); + film_change(type); } void -HintsDialog::update () +HintsDialog::update() { - _text->Clear (); - if (_current.empty ()) { + _text->Clear(); + if (_current.empty()) { if (_finished) { - _text->WriteText (_("There are no hints: everything looks good!")); + _text->WriteText(_("There are no hints: everything looks good!")); } else { - _text->WriteText (_("There are no hints yet: project check in progress.")); + _text->WriteText(_("There are no hints yet: project check in progress.")); } } else { _text->BeginStandardBullet(char_to_wx("standard/circle"), 1, 50); for (auto i: _current) { - _text->WriteText (std_to_wx (i)); - _text->Newline (); + _text->WriteText(std_to_wx(i)); + _text->Newline(); } - _text->EndSymbolBullet (); + _text->EndSymbolBullet(); } } void -HintsDialog::hint (string text) +HintsDialog::hint(string text) { - _current.push_back (text); - update (); + _current.push_back(text); + update(); } void -HintsDialog::shut_up (wxCommandEvent& ev) +HintsDialog::shut_up(wxCommandEvent& ev) { - Config::instance()->set_show_hints_before_make_dcp (!ev.IsChecked()); + Config::instance()->set_show_hints_before_make_dcp(!ev.IsChecked()); } void -HintsDialog::pulse () +HintsDialog::pulse() { - _gauge->Pulse (); + _gauge->Pulse(); } void -HintsDialog::finished () +HintsDialog::finished() { try { - _hints->rethrow (); + _hints->rethrow(); } catch (std::exception& e) { - error_dialog (this, wxString::Format(_("A problem occurred when looking for hints (%s)"), std_to_wx(e.what()))); + error_dialog(this, wxString::Format(_("A problem occurred when looking for hints (%s)"), std_to_wx(e.what()))); } _finished = true; - update (); - _gauge->Hide (); - _gauge_message->Hide (); - Layout (); + update(); + _gauge->Hide(); + _gauge_message->Hide(); + Layout(); } void -HintsDialog::progress (string m) +HintsDialog::progress(string m) { - _gauge_message->SetLabel (std_to_wx(m)); + _gauge_message->SetLabel(std_to_wx(m)); } diff --git a/src/wx/hints_dialog.h b/src/wx/hints_dialog.h index 1c77faf3e..44420405a 100644 --- a/src/wx/hints_dialog.h +++ b/src/wx/hints_dialog.h @@ -34,17 +34,17 @@ class Hints; class HintsDialog : public wxDialog { public: - HintsDialog (wxWindow* parent, std::weak_ptr<Film>, bool ok); + HintsDialog(wxWindow* parent, std::weak_ptr<Film>, bool ok); private: - void film_change (ChangeType); - void film_content_change (ChangeType type); - void shut_up (wxCommandEvent& ev); - void update (); - void hint (std::string text); - void pulse (); - void finished (); - void progress (std::string m); + void film_change(ChangeType); + void film_content_change(ChangeType type); + void shut_up(wxCommandEvent& ev); + void update(); + void hint(std::string text); + void pulse(); + void finished(); + void progress(std::string m); std::weak_ptr<Film> _film; wxGauge* _gauge; |
