summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-12-08 21:59:24 +0000
committerCarl Hetherington <cth@carlh.net>2018-12-08 21:59:24 +0000
commit29436ead35fbb6041fd24115623cad7638693d8e (patch)
tree5f5675b4e1d80d0a847bd9635ea73aa9143173b5 /src
parent92477aa8600f1d27fdc821a6d80e716cd89d6c55 (diff)
swaroop: refresh buttons for playlists / content.
Diffstat (limited to 'src')
-rw-r--r--src/wx/swaroop_controls.cc31
-rw-r--r--src/wx/swaroop_controls.h2
2 files changed, 31 insertions, 2 deletions
diff --git a/src/wx/swaroop_controls.cc b/src/wx/swaroop_controls.cc
index 2a1e7c69b..2f51fed3f 100644
--- a/src/wx/swaroop_controls.cc
+++ b/src/wx/swaroop_controls.cc
@@ -23,6 +23,7 @@
#include "wx_util.h"
#include "content_view.h"
#include "dcpomatic_button.h"
+#include "static_text.h"
#include "lib/player_video.h"
#include "lib/dcp_content.h"
#include <wx/listctrl.h>
@@ -52,10 +53,34 @@ SwaroopControls::SwaroopControls (wxWindow* parent, shared_ptr<FilmViewer> viewe
wxBoxSizer* left_sizer = new wxBoxSizer (wxVERTICAL);
wxBoxSizer* e_sizer = new wxBoxSizer (wxHORIZONTAL);
- left_sizer->Add (_spl_view, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
+ wxFont subheading_font (*wxNORMAL_FONT);
+ subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
+
+ wxBoxSizer* spl_header = new wxBoxSizer (wxHORIZONTAL);
+ {
+ wxStaticText* m = new StaticText (this, "Playlists");
+ m->SetFont (subheading_font);
+ spl_header->Add (m, 1, wxALIGN_CENTER_VERTICAL);
+ }
+ _refresh_spl_view = new Button (this, "Refresh");
+ spl_header->Add (_refresh_spl_view, 0, wxBOTTOM, DCPOMATIC_SIZER_GAP / 2);
+
+ left_sizer->Add (spl_header, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_GAP);
+ left_sizer->Add (_spl_view, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, DCPOMATIC_SIZER_GAP);
_content_view = new ContentView (this);
- left_sizer->Add (_content_view, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
+
+ wxBoxSizer* content_header = new wxBoxSizer (wxHORIZONTAL);
+ {
+ wxStaticText* m = new StaticText (this, "Content");
+ m->SetFont (subheading_font);
+ content_header->Add (m, 1, wxALIGN_CENTER_VERTICAL);
+ }
+ _refresh_content_view = new Button (this, "Refresh");
+ content_header->Add (_refresh_content_view, 0, wxBOTTOM, DCPOMATIC_SIZER_GAP / 2);
+
+ left_sizer->Add (content_header, 0, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_GAP);
+ left_sizer->Add (_content_view, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, DCPOMATIC_SIZER_GAP);
_current_spl_view = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER);
_current_spl_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 500);
@@ -74,6 +99,8 @@ SwaroopControls::SwaroopControls (wxWindow* parent, shared_ptr<FilmViewer> viewe
_spl_view->Bind (wxEVT_LIST_ITEM_SELECTED, boost::bind(&SwaroopControls::spl_selection_changed, this));
_spl_view->Bind (wxEVT_LIST_ITEM_DESELECTED, boost::bind(&SwaroopControls::spl_selection_changed, this));
_viewer->ImageChanged.connect (boost::bind(&SwaroopControls::image_changed, this, _1));
+ _refresh_spl_view->Bind (wxEVT_BUTTON, boost::bind(&SwaroopControls::update_playlist_directory, this));
+ _refresh_content_view->Bind (wxEVT_BUTTON, boost::bind(&ContentView::update, _content_view));
_content_view->update ();
update_playlist_directory ();
diff --git a/src/wx/swaroop_controls.h b/src/wx/swaroop_controls.h
index bd39f556d..54f77de17 100644
--- a/src/wx/swaroop_controls.h
+++ b/src/wx/swaroop_controls.h
@@ -53,7 +53,9 @@ private:
wxButton* _stop_button;
ContentView* _content_view;
+ wxButton* _refresh_content_view;
wxListCtrl* _spl_view;
+ wxButton* _refresh_spl_view;
wxListCtrl* _current_spl_view;
wxTextCtrl* _log;