Fix a few warnings from Coverity; nothing dangerous, I don't think.
[dcpomatic.git] / src / wx / download_certificate_dialog.cc
index 44a366bfa77d13da401be8eda8fe8f7c6cee4073..a8a71233494c35b163bd42b1932d3f99266c9115 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 using boost::function;
 
 DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent, function<void (boost::filesystem::path)> load)
-       : wxDialog (parent, wxID_ANY, _("Download certificate"))
+       : TableDialog (parent, _("Download certificate"), 2, true)
        , _load (load)
+       , _message (0)
+       , _download (0)
 {
-       _overall_sizer = new wxBoxSizer (wxVERTICAL);
+
 }
 
 void
 DownloadCertificateDialog::add_common_widgets ()
 {
-       _download = new wxButton (this, wxID_ANY, _("Download"));
-       _overall_sizer->Add (_download, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP);
-       _gauge = new wxGauge (this, wxID_ANY, 100);
-       _overall_sizer->Add (_gauge, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP);
-       _message = new wxStaticText (this, wxID_ANY, wxT (""));
-       _overall_sizer->Add (_message, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP);
-       
-       wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
-       if (buttons) {
-               _overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
-       }
+       add_spacer ();
+       _download = add (new wxButton (this, wxID_ANY, _("Download")));
 
-       SetSizer (_overall_sizer);
-       _overall_sizer->Layout ();
-       _overall_sizer->SetSizeHints (this);
+       add_spacer ();
+       _message = add (new wxStaticText (this, wxID_ANY, wxT ("")));
 
+       wxFont font = _message->GetFont();
+       font.SetStyle (wxFONTSTYLE_ITALIC);
+       font.SetPointSize (font.GetPointSize() - 1);
+       _message->SetFont (font);
+       
        _download->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DownloadCertificateDialog::download, this));
        _download->Enable (false);
+
+       layout ();
 }