Use sqlite for cinema and DKDM recipient lists.
[dcpomatic.git] / src / tools / dcpomatic_batch.cc
index 273078b8922c6aa832ed2244058f2d39c82e3fc6..32e8dec084656bae1dd118b070b894e341d08455 100644 (file)
@@ -28,6 +28,7 @@
 #include "wx/wx_ptr.h"
 #include "wx/wx_signal_manager.h"
 #include "wx/wx_util.h"
+#include "wx/wx_variant.h"
 #include "lib/compose.hpp"
 #include "lib/config.h"
 #include "lib/dcpomatic_socket.h"
@@ -93,7 +94,7 @@ setup_menu (wxMenuBar* m)
 #endif
 
 #ifdef DCPOMATIC_OSX
-       file->Append (wxID_PREFERENCES, _("&Preferences...\tCtrl-P"));
+       file->Append(wxID_PREFERENCES, _("&Preferences...\tCtrl-,"));
 #else
        auto edit = new wxMenu;
        edit->Append (wxID_PREFERENCES, _("&Preferences...\tCtrl-P"));
@@ -357,31 +358,25 @@ private:
        void config_changed (Config::Property what)
        {
                /* Instantly save any config changes when using the DCP-o-matic GUI */
-               if (what == Config::CINEMAS) {
-                       try {
-                               Config::instance()->write_cinemas();
-                       } catch (exception& e) {
-                               error_dialog (
-                                       this,
-                                       wxString::Format(
-                                               _("Could not write to cinemas file at %s.  Your changes have not been saved."),
-                                               std_to_wx (Config::instance()->cinemas_file().string()).data()
-                                               )
-                                       );
-                       }
-               } else {
-                       try {
-                               Config::instance()->write_config();
-                       } catch (exception& e) {
-                               error_dialog (
-                                       this,
-                                       wxString::Format(
-                                               _("Could not write to config file at %s.  Your changes have not been saved."),
-                                               std_to_wx (Config::instance()->cinemas_file().string()).data()
-                                               )
-                                       );
-                       }
+               try {
+                       Config::instance()->write_config();
+               } catch (exception& e) {
+                       error_dialog (
+                               this,
+                               wxString::Format(
+                                       _("Could not write to config file at %s.  Your changes have not been saved."),
+                                       std_to_wx (Config::instance()->cinemas_file().string()).data()
+                                       )
+                               );
+               }
+
+#ifdef DCPOMATIC_GROK
+               if (what == Config::GROK) {
+                       setup_grok_library_path();
                }
+#else
+               LIBDCP_UNUSED(what);
+#endif
        }
 
        boost::optional<boost::filesystem::path> _last_parent;
@@ -430,7 +425,7 @@ class App : public wxApp
        {
                wxInitAllImageHandlers ();
 
-               SetAppName (_("DCP-o-matic Batch Converter"));
+               SetAppName(variant::wx::dcpomatic_batch_converter());
                is_batch_converter = true;
 
                Config::FailedToLoad.connect(boost::bind(&App::config_failed_to_load, this, _1));
@@ -466,7 +461,7 @@ class App : public wxApp
                */
                Config::drop ();
 
-               _frame = new DOMFrame (_("DCP-o-matic Batch Converter"));
+               _frame = new DOMFrame(variant::wx::dcpomatic_batch_converter());
                SetTopWindow (_frame);
                _frame->Maximize ();
                if (splash) {
@@ -479,7 +474,11 @@ class App : public wxApp
                        server->StartJob.connect(bind(&DOMFrame::start_job, _frame, _1));
                        new thread (boost::bind (&JobServer::run, server));
                } catch (boost::system::system_error& e) {
-                       error_dialog(_frame, _("Could not listen for new batch jobs.  Perhaps another instance of the DCP-o-matic Batch Converter is running."));
+                       error_dialog(
+                               _frame,
+                               variant::wx::insert_dcpomatic_batch_converter(
+                                       _("Could not listen for new batch jobs.  Perhaps another instance of the %s is running.")
+                                       ));
                }
 
                signal_manager = new wxSignalManager (this);
@@ -504,6 +503,7 @@ class App : public wxApp
 
 #ifdef DCPOMATIC_GROK
                grk_plugin::setMessengerLogger(new grk_plugin::GrokLogger("[GROK] "));
+               setup_grok_library_path();
 #endif
 
                return true;