From: Carl Hetherington Date: Fri, 5 Jul 2019 22:18:43 +0000 (+0100) Subject: swaroop: remove on-screen log from player. X-Git-Tag: v2.15.10~3 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=66e6d93921ef9ecca86d807be68f7cfb481cc4c6 swaroop: remove on-screen log from player. --- diff --git a/src/wx/swaroop_controls.cc b/src/wx/swaroop_controls.cc index 34241078b..e7232e6f4 100644 --- a/src/wx/swaroop_controls.cc +++ b/src/wx/swaroop_controls.cc @@ -104,9 +104,6 @@ SwaroopControls::SwaroopControls (wxWindow* parent, shared_ptr viewe _v_sizer->Add (e_sizer, 1, wxEXPAND); - _log = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, 200), wxTE_READONLY | wxTE_MULTILINE); - _v_sizer->Add (_log, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); - _play_button->Bind (wxEVT_BUTTON, boost::bind(&SwaroopControls::play_clicked, this)); _pause_button->Bind (wxEVT_BUTTON, boost::bind(&SwaroopControls::pause_clicked, this)); _stop_button->Bind (wxEVT_BUTTON, boost::bind(&SwaroopControls::stop_clicked, this)); @@ -295,6 +292,11 @@ SwaroopControls::next_clicked () void SwaroopControls::log (wxString s) { + optional log = Config::instance()->player_activity_log_file(); + if (!log) { + return; + } + struct timeval time; gettimeofday (&time, 0); char buffer[64]; @@ -302,14 +304,10 @@ SwaroopControls::log (wxString s) struct tm* t = localtime (&sec); strftime (buffer, 64, "%c", t); wxString ts = std_to_wx(string(buffer)) + N_(": "); - _log->SetValue(_log->GetValue() + ts + s + "\n"); - - optional log = Config::instance()->player_activity_log_file(); - if (!log) { + FILE* f = fopen_boost (*log, "a"); + if (!f) { return; } - - FILE* f = fopen_boost (*log, "a"); fprintf (f, "%s%s\n", wx_to_std(ts).c_str(), wx_to_std(s).c_str()); fclose (f); } diff --git a/src/wx/swaroop_controls.h b/src/wx/swaroop_controls.h index d8d39d4a0..11dbcfc10 100644 --- a/src/wx/swaroop_controls.h +++ b/src/wx/swaroop_controls.h @@ -77,7 +77,6 @@ private: wxListCtrl* _spl_view; wxButton* _refresh_spl_view; wxListCtrl* _current_spl_view; - wxTextCtrl* _log; bool _current_disable_timeline; bool _current_disable_next;