Hand-apply d4470377df181b4d15fbac86c454a8372b1a0f3d; fix update checker.
[dcpomatic.git] / src / tools / dcpomatic.cc
index 6d27a4248cda0f2b3cb07fc031c1f24620d11eb7..614073947b4032e305ef26a0a2e90c1879f740a5 100644 (file)
@@ -896,29 +896,19 @@ class App : public wxApp
 
        void update_checker_state_changed ()
        {
-               switch (UpdateChecker::instance()->state ()) {
-               case UpdateChecker::YES:
-               {
-                       string test;
-                       if (Config::instance()->check_for_test_updates ()) {
-                               test = UpdateChecker::instance()->test ();
-                       }
-                       UpdateDialog* dialog = new UpdateDialog (_frame, UpdateChecker::instance()->stable (), test);
+               UpdateChecker* uc = UpdateChecker::instance ();
+               if (uc->state() == UpdateChecker::YES && (uc->stable() || uc->test())) {
+                       UpdateDialog* dialog = new UpdateDialog (_frame, uc->stable (), uc->test ());
                        dialog->ShowModal ();
                        dialog->Destroy ();
-                       break;
-               }
-               case UpdateChecker::NO:
+               } else if (uc->state() == UpdateChecker::FAILED) {
                        if (!UpdateChecker::instance()->last_emit_was_first ()) {
-                               error_dialog (_frame, _("There are no new versions of DCP-o-matic available."));
+                               error_dialog (_frame, _("The DCP-o-matic download server could not be contaced."));
                        }
-                       break;
-               case UpdateChecker::FAILED:
+               } else {
                        if (!UpdateChecker::instance()->last_emit_was_first ()) {
-                               error_dialog (_frame, _("The DCP-o-matic download server could not be contacted."));
+                               error_dialog (_frame, _("There are no new versions of DCP-o-matic available."));
                        }
-               default:
-                       break;
                }
        }