swaroop: remove on-screen log from player.
authorCarl Hetherington <cth@carlh.net>
Fri, 5 Jul 2019 22:18:43 +0000 (23:18 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 5 Jul 2019 22:18:43 +0000 (23:18 +0100)
src/wx/swaroop_controls.cc
src/wx/swaroop_controls.h

index 34241078b0dfc1c54af93c38a59f63a8a70b2676..e7232e6f4d8b75b0d231066c2ed3ff9cfb1d63a3 100644 (file)
@@ -104,9 +104,6 @@ SwaroopControls::SwaroopControls (wxWindow* parent, shared_ptr<FilmViewer> viewe
 
        _v_sizer->Add (e_sizer, 1, wxEXPAND);
 
 
        _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));
        _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)
 {
 void
 SwaroopControls::log (wxString s)
 {
+       optional<boost::filesystem::path> log = Config::instance()->player_activity_log_file();
+       if (!log) {
+               return;
+       }
+
        struct timeval time;
        gettimeofday (&time, 0);
        char buffer[64];
        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_(": ");
        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<boost::filesystem::path> log = Config::instance()->player_activity_log_file();
-       if (!log) {
+       FILE* f = fopen_boost (*log, "a");
+       if (!f) {
                return;
        }
                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);
 }
        fprintf (f, "%s%s\n", wx_to_std(ts).c_str(), wx_to_std(s).c_str());
        fclose (f);
 }
index d8d39d4a0153d4292f1e2c4838e99936992116de..11dbcfc1013025fbec4329c65f91d702699e41ad 100644 (file)
@@ -77,7 +77,6 @@ private:
        wxListCtrl* _spl_view;
        wxButton* _refresh_spl_view;
        wxListCtrl* _current_spl_view;
        wxListCtrl* _spl_view;
        wxButton* _refresh_spl_view;
        wxListCtrl* _current_spl_view;
-       wxTextCtrl* _log;
 
        bool _current_disable_timeline;
        bool _current_disable_next;
 
        bool _current_disable_timeline;
        bool _current_disable_next;