X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_server.cc;h=37eeb1e8e20d8966b68788d979e7f7d33c20c905;hb=e60bb3e51bd1508b149e6b8f6608f09b5196ae26;hp=a82478dfdbd47fc3a9e27985bff669eddd8c678f;hpb=ad49361b303d1ceff7048fa0e89ba609ca9ce376;p=dcpomatic.git diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc index a82478dfd..37eeb1e8e 100644 --- a/src/tools/dcpomatic_server.cc +++ b/src/tools/dcpomatic_server.cc @@ -47,13 +47,21 @@ public: return _log; } + string head_and_tail (int amount = 1024) const { + if (int (_log.size ()) < (2 * amount)) { + return _log; + } + + return _log.substr (0, amount) + _log.substr (_log.size() - amount - 1, amount); + } + private: void do_log (string m) { _log = m; } - string _log; + string _log; }; static shared_ptr memory_log (new MemoryLog); @@ -95,24 +103,24 @@ class TaskBarIcon : public wxTaskBarIcon public: TaskBarIcon () { -#ifdef __WXMSW__ +#ifdef __WXMSW__ wxIcon icon (std_to_wx ("taskbar_icon")); #endif #ifdef __WXGTK__ wxInitAllImageHandlers(); - wxBitmap bitmap (wxString::Format (wxT ("%s/taskbar_icon.png"), POSIX_ICON_PREFIX), wxBITMAP_TYPE_PNG); + wxBitmap bitmap (wxString::Format (wxT ("%s/taskbar_icon.png"), LINUX_SHARE_PREFIX), wxBITMAP_TYPE_PNG); wxIcon icon; icon.CopyFromBitmap (bitmap); #endif #ifndef __WXOSX__ /* XXX: fix this for OS X */ SetIcon (icon, std_to_wx ("DCP-o-matic encode server")); -#endif +#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); } - + wxMenu* CreatePopupMenu () { wxMenu* menu = new wxMenu; @@ -143,14 +151,14 @@ public: , _icon (0) {} -private: - +private: + bool OnInit () { if (!wxApp::OnInit ()) { return false; } - + dcpomatic_setup (); _icon = new TaskBarIcon; @@ -159,7 +167,7 @@ private: Bind (wxEVT_TIMER, boost::bind (&App::check, this)); _timer.reset (new wxTimer (this)); _timer->Start (1000); - + return true; }