From bf12d3841c020d2b0664cd04c1bfb3302651b6b6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 9 May 2015 22:42:59 +0100 Subject: [PATCH] 711c36c150f3efffd64875399ada94baafb87cb1 from master; ok button disabling in downloade dialogs. --- ChangeLog | 5 +++++ TO_PORT | 1 - src/wx/dolby_certificate_dialog.cc | 4 +++- src/wx/doremi_certificate_dialog.cc | 4 +++- src/wx/download_certificate_dialog.cc | 16 ++++++++++++++-- src/wx/download_certificate_dialog.h | 1 + 6 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d7404239..9972399c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-05-09 Carl Hetherington + + * Disable OK until a download succeeds in the certificate + downloader (#404). + 2015-05-07 Carl Hetherington * Version 2.0.43 released. diff --git a/TO_PORT b/TO_PORT index 100665a2c..8db0f7a26 100644 --- a/TO_PORT +++ b/TO_PORT @@ -1,4 +1,3 @@ -add9a03356d3d392e234354df4800b9042e0f426 01919a9e691375de4eb0069bc8cf179bee4dd7b6 1d63d0309d071254fcf4da65d3710e94fadd38e8 0c0211871d0be5b3409adfc88d2979ca5b439b0a diff --git a/src/wx/dolby_certificate_dialog.cc b/src/wx/dolby_certificate_dialog.cc index 5e094844d..15551a424 100644 --- a/src/wx/dolby_certificate_dialog.cc +++ b/src/wx/dolby_certificate_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2015 Carl Hetherington 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 @@ -154,6 +154,7 @@ DolbyCertificateDialog::serial_selected () void DolbyCertificateDialog::download () { + downloaded (false); _message->SetLabel (_("Downloading certificate")); #ifdef DCPOMATIC_OSX @@ -189,5 +190,6 @@ DolbyCertificateDialog::finish_download () _message->SetLabel (std_to_wx (error.get ())); } else { _message->SetLabel (_("Certificate downloaded")); + downloaded (true); } } diff --git a/src/wx/doremi_certificate_dialog.cc b/src/wx/doremi_certificate_dialog.cc index 4b5d58b37..105555da9 100644 --- a/src/wx/doremi_certificate_dialog.cc +++ b/src/wx/doremi_certificate_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2015 Carl Hetherington 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 @@ -51,6 +51,7 @@ DoremiCertificateDialog::download () return; } + downloaded (false); _message->SetLabel (_("Downloading certificate")); #ifdef DCPOMATIC_OSX @@ -101,6 +102,7 @@ DoremiCertificateDialog::finish_download (string serial) error_dialog (this, std_to_wx (error.get ())); } else { _message->SetLabel (_("Certificate downloaded")); + downloaded (true); } } diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc index a8a712334..a0c41fd76 100644 --- a/src/wx/download_certificate_dialog.cc +++ b/src/wx/download_certificate_dialog.cc @@ -17,9 +17,9 @@ */ -#include -#include "download_certificate_dialog.h" #include "wx_util.h" +#include "download_certificate_dialog.h" +#include using boost::function; @@ -50,4 +50,16 @@ DownloadCertificateDialog::add_common_widgets () _download->Enable (false); layout (); + + wxButton* ok = dynamic_cast (FindWindowById (wxID_OK, this)); + ok->Enable (false); } + +void +DownloadCertificateDialog::downloaded (bool done) +{ + wxButton* ok = dynamic_cast (FindWindowById (wxID_OK, this)); + ok->Enable (done); +} + + diff --git a/src/wx/download_certificate_dialog.h b/src/wx/download_certificate_dialog.h index 804c0c762..40e11de45 100644 --- a/src/wx/download_certificate_dialog.h +++ b/src/wx/download_certificate_dialog.h @@ -32,6 +32,7 @@ public: protected: void add_common_widgets (); + void downloaded (bool done); boost::function _load; wxStaticText* _message; -- 2.30.2