/*
- 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 ();
}