From 82fcadc063b286db72b3350923f3a9ba52a029f9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 9 Oct 2015 01:42:05 +0100 Subject: [PATCH] Try to improve _server on OSX. --- run/dcpomatic_server | 2 +- src/tools/dcpomatic_server.cc | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/run/dcpomatic_server b/run/dcpomatic_server index 7f2aaac3a..212b599d9 100755 --- a/run/dcpomatic_server +++ b/run/dcpomatic_server @@ -1,6 +1,6 @@ #!/bin/bash -export LD_LIBRARY_PATH=build/src/lib:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=build/src/lib:build/src/wx:$LD_LIBRARY_PATH if [ "$1" == "--debug" ]; then gdb --args build/src/tools/dcpomatic2_server elif [ "$1" == "--valgrind" ]; then diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc index 72ac66706..978f600b2 100644 --- a/src/tools/dcpomatic_server.cc +++ b/src/tools/dcpomatic_server.cc @@ -68,11 +68,19 @@ private: static shared_ptr memory_log (new MemoryLog); +#ifdef DCPOMATIC_OSX +class StatusDialog : public wxFrame +#else class StatusDialog : public wxDialog +#endif { public: StatusDialog () +#ifdef DCPOMATIC_OSX + : wxFrame (0, wxID_ANY, _("DCP-o-matic encode server"), wxDefaultPosition, wxSize (600, 80), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +#else : wxDialog (0, wxID_ANY, _("DCP-o-matic encode server"), wxDefaultPosition, wxSize (600, 80), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +#endif , _timer (this, ID_timer) { _sizer = new wxFlexGridSizer (1, 6, 6); @@ -115,10 +123,19 @@ public: icon.CopyFromBitmap (bitmap); #endif #ifndef DCPOMATIC_OSX - /* XXX: fix this for OS X */ SetIcon (icon, std_to_wx ("DCP-o-matic encode server")); #endif +#ifdef DCPOMATIC_OSX + wxMenu* file = new wxMenu; + file->Append (wxID_EXIT, _("&Exit")); + wxMenuBar* bar = new wxMenuBar; + bar->Append (file, _("&File")); + SetMenuBar (bar); + + status (); +#endif + Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::status, this), ID_status); Bind (wxEVT_COMMAND_MENU_SELECTED, boost::bind (&TaskBarIcon::quit, this), ID_quit); } @@ -162,7 +179,9 @@ private: } dcpomatic_setup_path_encoding (); + dcpomatic_setup_i18n (); dcpomatic_setup (); + Config::drop (); _icon = new TaskBarIcon; _thread = new thread (bind (&App::main_thread, this)); -- 2.30.2