White space: dkdm_output_panel.{cc,h}
authorCarl Hetherington <cth@carlh.net>
Wed, 26 Mar 2025 22:22:53 +0000 (23:22 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 26 Mar 2025 22:22:53 +0000 (23:22 +0100)
src/wx/dkdm_output_panel.cc
src/wx/dkdm_output_panel.h

index e85e292140d0ad95bac5a4e578011a625a78d8e6..495078a0e745ff46aec67c0b7a0abf8371afee1c 100644 (file)
@@ -56,62 +56,62 @@ using std::string;
 using std::vector;
 
 
-DKDMOutputPanel::DKDMOutputPanel (wxWindow* parent)
-       : wxPanel (parent, wxID_ANY)
+DKDMOutputPanel::DKDMOutputPanel(wxWindow* parent)
+       : wxPanel(parent, wxID_ANY)
 {
-       wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, 0);
-       table->AddGrowableCol (1);
+       auto table = new wxFlexGridSizer(2, DCPOMATIC_SIZER_X_GAP, 0);
+       table->AddGrowableCol(1);
 
-       add_label_to_sizer (table, this, _("Filename format"), true, 0, wxALIGN_TOP | wxTOP | wxLEFT | wxRIGHT);
+       add_label_to_sizer(table, this, _("Filename format"), true, 0, wxALIGN_TOP | wxTOP | wxLEFT | wxRIGHT);
        dcp::NameFormat::Map titles;
-       titles['f'] = wx_to_std (_("film name"));
-       titles['b'] = wx_to_std (_("from date/time"));
-       titles['e'] = wx_to_std (_("to date/time"));
+       titles['f'] = wx_to_std(_("film name"));
+       titles['b'] = wx_to_std(_("from date/time"));
+       titles['e'] = wx_to_std(_("to date/time"));
        dcp::NameFormat::Map ex;
        ex['f'] = "Bambi";
        ex['b'] = "2012/03/15 12:30";
        ex['e'] = "2012/03/22 02:30";
-       _filename_format = new NameFormatEditor (this, Config::instance()->dkdm_filename_format(), titles, ex, ".xml");
-       table->Add (_filename_format->panel(), 1, wxEXPAND);
+       _filename_format = new NameFormatEditor(this, Config::instance()->dkdm_filename_format(), titles, ex, ".xml");
+       table->Add(_filename_format->panel(), 1, wxEXPAND);
 
-       _write_to = new CheckBox (this, _("Write to"));
-       table->Add (_write_to, 1, wxEXPAND);
+       _write_to = new CheckBox(this, _("Write to"));
+       table->Add(_write_to, 1, wxEXPAND);
 
 #ifdef DCPOMATIC_USE_OWN_PICKER
-       _folder = new DirPickerCtrl (this);
+       _folder = new DirPickerCtrl(this);
 #else
-       _folder = new wxDirPickerCtrl (this, wxID_ANY, wxEmptyString, char_to_wx(wxDirSelectorPromptStr), wxDefaultPosition, wxSize (300, -1));
+       _folder = new wxDirPickerCtrl(this, wxID_ANY, wxEmptyString, char_to_wx(wxDirSelectorPromptStr), wxDefaultPosition, wxSize(300, -1));
 #endif
 
-       boost::optional<boost::filesystem::path> path = Config::instance()->default_kdm_directory ();
+       auto const path = Config::instance()->default_kdm_directory();
        if (path) {
-               _folder->SetPath (std_to_wx (path->string ()));
+               _folder->SetPath(std_to_wx(path->string()));
        } else {
-               _folder->SetPath (wxStandardPaths::Get().GetDocumentsDir());
+               _folder->SetPath(wxStandardPaths::Get().GetDocumentsDir());
        }
 
-       table->Add (_folder, 1, wxEXPAND);
+       table->Add(_folder, 1, wxEXPAND);
 
-       _email = new CheckBox (this, _("Send by email"));
-       table->Add (_email, 1, wxEXPAND);
-       table->AddSpacer (0);
+       _email = new CheckBox(this, _("Send by email"));
+       table->Add(_email, 1, wxEXPAND);
+       table->AddSpacer(0);
 
        _write_to->bind(&DKDMOutputPanel::setup_sensitivity, this);
        _email->bind(&DKDMOutputPanel::setup_sensitivity, this);
 
-       SetSizer (table);
+       SetSizer(table);
 }
 
 
 void
-DKDMOutputPanel::setup_sensitivity ()
+DKDMOutputPanel::setup_sensitivity()
 {
-       _folder->Enable (_write_to->GetValue());
+       _folder->Enable(_write_to->GetValue());
 }
 
 
 pair<shared_ptr<Job>, int>
-DKDMOutputPanel::make (
+DKDMOutputPanel::make(
        list<KDMWithMetadataPtr> kdms, string name, function<bool (boost::filesystem::path)> confirm_overwrite
        )
 {
@@ -123,7 +123,7 @@ DKDMOutputPanel::make (
 
                if (Config::instance()->mail_server().empty()) {
                        proceed = false;
-                       error_dialog (this, _("You must set up a mail server in Preferences before you can send emails."));
+                       error_dialog(this, _("You must set up a mail server in Preferences before you can send emails."));
                }
 
                bool kdms_with_no_email = false;
@@ -133,7 +133,7 @@ DKDMOutputPanel::make (
                        }
                }
 
-               if (proceed && kdms_with_no_email && !confirm_dialog (
+               if (proceed && kdms_with_no_email && !confirm_dialog(
                            this,
                            _("You have selected some cinemas that have no configured email address.  Do you want to continue?")
                            )) {
@@ -144,12 +144,12 @@ DKDMOutputPanel::make (
                        list<string> emails;
                        for (auto const& i: kdms) {
                                for (auto j: i->emails()) {
-                                       emails.push_back (j);
+                                       emails.push_back(j);
                                }
                        }
 
-                       if (!emails.empty ()) {
-                               ConfirmKDMEmailDialog* d = new ConfirmKDMEmailDialog (this, emails);
+                       if (!emails.empty()) {
+                               auto d = new ConfirmKDMEmailDialog(this, emails);
                                if (d->ShowModal() == wxID_CANCEL) {
                                        proceed = false;
                                }
@@ -158,23 +158,23 @@ DKDMOutputPanel::make (
        }
 
        if (!proceed) {
-               return make_pair (shared_ptr<Job>(), 0);
+               return make_pair(shared_ptr<Job>(), 0);
        }
 
-       Config::instance()->set_dkdm_filename_format (_filename_format->get());
+       Config::instance()->set_dkdm_filename_format(_filename_format->get());
 
        int written = 0;
        shared_ptr<Job> job;
 
        try {
-               written = write_files (
+               written = write_files(
                        kdms,
                        directory(),
                        _filename_format->get(),
                        confirm_overwrite
                        );
 
-               if (_email->GetValue ()) {
+               if (_email->GetValue()) {
                        job = make_shared<SendKDMEmailJob>(
                                kdms,
                                _filename_format->get(),
@@ -185,19 +185,19 @@ DKDMOutputPanel::make (
                }
 
        } catch (dcp::NotEncryptedError& e) {
-               error_dialog (this, _("CPL's content is not encrypted."));
+               error_dialog(this, _("CPL's content is not encrypted."));
        } catch (exception& e) {
-               error_dialog (this, std_to_wx(e.what()));
+               error_dialog(this, std_to_wx(e.what()));
        } catch (...) {
-               error_dialog (this, _("An unknown exception occurred."));
+               error_dialog(this, _("An unknown exception occurred."));
        }
 
-       return make_pair (job, written);
+       return make_pair(job, written);
 }
 
 
 boost::filesystem::path
-DKDMOutputPanel::directory () const
+DKDMOutputPanel::directory() const
 {
-       return wx_to_std (_folder->GetPath ());
+       return wx_to_std(_folder->GetPath());
 }
index 9bdbd5672153e6a7a854ac248f2cb72cd9b4552b..71a897c41b1ec869adec504233d2ff4c55b31c23 100644 (file)
@@ -42,13 +42,13 @@ class wxRadioButton;
 class DKDMOutputPanel : public wxPanel
 {
 public:
-       DKDMOutputPanel (wxWindow* parent);
+       DKDMOutputPanel(wxWindow* parent);
 
-       void setup_sensitivity ();
+       void setup_sensitivity();
 
-       boost::filesystem::path directory () const;
+       boost::filesystem::path directory() const;
 
-       std::pair<std::shared_ptr<Job>, int> make (
+       std::pair<std::shared_ptr<Job>, int> make(
                std::list<KDMWithMetadataPtr > kdms,
                std::string name,
                std::function<bool (boost::filesystem::path)> confirm_overwrite