summaryrefslogtreecommitdiff
path: root/src/wx/update_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-24 00:12:45 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-24 00:12:45 +0000
commit1e4f8cc123ccf1661ea4d23a51625614c2cf2e59 (patch)
tree0abbbfac2097b52640ce447bc8fdc93e1939233e /src/wx/update_dialog.cc
parent68f662ac50a00ad986e3bd258c3f7daac374ab26 (diff)
Hand-apply d4470377df181b4d15fbac86c454a8372b1a0f3d; fix update checker.
Diffstat (limited to 'src/wx/update_dialog.cc')
-rw-r--r--src/wx/update_dialog.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/wx/update_dialog.cc b/src/wx/update_dialog.cc
index 271c4174c..c8c90d86e 100644
--- a/src/wx/update_dialog.cc
+++ b/src/wx/update_dialog.cc
@@ -22,15 +22,16 @@
#include "wx_util.h"
using std::string;
+using boost::optional;
-UpdateDialog::UpdateDialog (wxWindow* parent, string stable, string test)
+UpdateDialog::UpdateDialog (wxWindow* parent, optional<string> stable, optional<string> test)
: wxDialog (parent, wxID_ANY, _("Update"))
{
wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
wxStaticText* message;
- if (test.empty ()) {
+ if ((stable || test) && !(stable && test)) {
message = new wxStaticText (this, wxID_ANY, _("A new version of DCP-o-matic is available."));
} else {
message = new wxStaticText (this, wxID_ANY, _("New versions of DCP-o-matic are available."));
@@ -40,17 +41,19 @@ UpdateDialog::UpdateDialog (wxWindow* parent, string stable, string test)
wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
- add_label_to_sizer (table, this, _("Stable version ") + std_to_wx (stable), true);
- wxHyperlinkCtrl* h = new wxHyperlinkCtrl (this, wxID_ANY, "dcpomatic.com/download", "http://dcpomatic.com/download");
- table->Add (h);
+ 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);
+ }
- if (!test.empty ()) {
- add_label_to_sizer (table, this, _("Test version ") + std_to_wx (test), true);
+ 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);
}
- overall_sizer->Add (table, 1, wxEXPAND | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER);
+ overall_sizer->Add (table, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, DCPOMATIC_DIALOG_BORDER);
wxSizer* buttons = CreateButtonSizer (wxOK);
if (buttons) {