X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fupdate_dialog.cc;h=0a7319704e6581af1fe54ff5fb4dd271cfaa1bcd;hb=3c29aa6531a4046a8db72dcac81189eb8893233c;hp=c88ddbff2f46cc026045585d688167ea52c3bc1f;hpb=3828baf56467224f5d44049bf1e7a7ed11f43a05;p=dcpomatic.git diff --git a/src/wx/update_dialog.cc b/src/wx/update_dialog.cc index c88ddbff2..0a7319704 100644 --- a/src/wx/update_dialog.cc +++ b/src/wx/update_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -18,47 +18,54 @@ */ -#include + +#include "static_text.h" #include "update_dialog.h" #include "wx_util.h" +#include +LIBDCP_DISABLE_WARNINGS +#include +LIBDCP_ENABLE_WARNINGS + using std::string; using boost::optional; + UpdateDialog::UpdateDialog (wxWindow* parent, optional stable, optional test) : wxDialog (parent, wxID_ANY, _("Update")) { - wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); + auto overall_sizer = new wxBoxSizer (wxVERTICAL); wxStaticText* message; if ((stable || test) && !(stable && test)) { - message = new wxStaticText (this, wxID_ANY, _("A new version of DCP-o-matic is available.")); + message = new StaticText (this, _("A new version of DCP-o-matic is available.")); } else { - message = new wxStaticText (this, wxID_ANY, _("New versions of DCP-o-matic are available.")); + message = new StaticText (this, _("New versions of DCP-o-matic are available.")); } - overall_sizer->Add (message, 1, wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER); + overall_sizer->Add (message, 0, wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER); - wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); + auto table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); if (stable) { - add_label_to_sizer (table, this, _("Stable version ") + std_to_wx (stable.get ()), true); - wxHyperlinkCtrl* h = new wxHyperlinkCtrl (this, wxID_ANY, "dcpomatic.com/download", "http://dcpomatic.com/download"); - table->Add (h); + add_label_to_sizer (table, this, _("Stable version ") + std_to_wx(stable.get()), true, 0, wxALIGN_CENTER_VERTICAL); + auto h = new wxHyperlinkCtrl (this, wxID_ANY, "dcpomatic.com/download", "https://dcpomatic.com/download"); + table->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_DIALOG_BORDER); } if (test) { - add_label_to_sizer (table, this, _("Test version ") + std_to_wx (test.get ()), true); - wxHyperlinkCtrl* h = new wxHyperlinkCtrl (this, wxID_ANY, "dcpomatic.com/test-download", "http://dcpomatic.com/test-download"); - table->Add (h); + add_label_to_sizer (table, this, _("Test version ") + std_to_wx(test.get()), true, 0, wxALIGN_CENTER_VERTICAL); + auto h = new wxHyperlinkCtrl (this, wxID_ANY, "dcpomatic.com/test-download", "https://dcpomatic.com/test-download"); + table->Add (h, 0, wxALIGN_CENTER_VERTICAL, DCPOMATIC_DIALOG_BORDER); } - overall_sizer->Add (table, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, DCPOMATIC_DIALOG_BORDER); + overall_sizer->Add (table, 0, wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER); - wxSizer* buttons = CreateButtonSizer (wxOK); + auto buttons = CreateButtonSizer (wxOK); if (buttons) { - overall_sizer->Add (buttons, 1, wxEXPAND | wxALL); + overall_sizer->Add (buttons, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); } SetSizerAndFit (overall_sizer);