Add comment.
[dcpomatic.git] / src / wx / hints_dialog.cc
index 2ab28fa6ca7d44b6b98d7d8c19b5a596577666ce..72a57740e4f2d024dede4d96608a0174a868a8d5 100644 (file)
 #include "lib/film.h"
 #include "lib/hints.h"
 #include "lib/config.h"
-#include "lib/warnings.h"
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/richtext/richtextctrl.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 
 
 using std::max;
@@ -62,22 +62,27 @@ HintsDialog::HintsDialog (wxWindow* parent, std::weak_ptr<Film> film, bool ok)
        sizer->Add (_text, 1, wxEXPAND | wxALL, 6);
 
        if (!ok) {
-               wxCheckBox* b = new CheckBox (this, _("Don't show hints again"));
+               auto b = new CheckBox(this, _("Don't show hints again"));
                sizer->Add (b, 0, wxALL, 6);
-               b->Bind (wxEVT_CHECKBOX, bind (&HintsDialog::shut_up, this, _1));
+               b->bind(&HintsDialog::shut_up, this, _1);
        }
 
        auto buttons = CreateStdDialogButtonSizer (0);
        sizer->Add (CreateSeparatedSizer(buttons), wxSizerFlags().Expand().DoubleBorder());
+       wxButton* default_button = nullptr;
        if (ok) {
-               buttons->SetAffirmativeButton (new wxButton (this, wxID_OK));
+               default_button = new wxButton(this, wxID_OK);
+               buttons->SetAffirmativeButton(default_button);
        } else {
-               buttons->SetAffirmativeButton (new wxButton (this, wxID_OK, _("Make DCP")));
+               default_button = new wxButton(this, wxID_OK, _("Make DCP"));
+               buttons->SetAffirmativeButton(default_button);
                buttons->SetNegativeButton (new wxButton (this, wxID_CANCEL, _("Go back")));
        }
 
        buttons->Realize ();
 
+       default_button->SetFocus();
+
        SetSizer (sizer);
        sizer->Layout ();
        sizer->SetSizeHints (this);