X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Frating_dialog.h;h=97a56f52ec6c66fd8686e89e451282a03bde548d;hp=51869c0abd89041fa22df1d15bb74ac867625be0;hb=54141c7a9504e289d41af997067ca6b78a1d4b0a;hpb=14b8b29e6660f5a7fb21135fb5f90b4c1ce51a4b diff --git a/src/wx/rating_dialog.h b/src/wx/rating_dialog.h index 51869c0ab..97a56f52e 100644 --- a/src/wx/rating_dialog.h +++ b/src/wx/rating_dialog.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2019 Carl Hetherington + Copyright (C) 2019-2022 Carl Hetherington This file is part of DCP-o-matic. @@ -18,18 +18,88 @@ */ -#include "table_dialog.h" -#include -class RatingDialog : public TableDialog +#include +#include +LIBDCP_DISABLE_WARNINGS +#include +LIBDCP_ENABLE_WARNINGS +#include + + +class wxChoice; +class wxListView; +class wxNotebook; +class wxSearchCtrl; + + +class RatingDialogPage : public wxPanel +{ +public: + RatingDialogPage (wxNotebook* notebook); + virtual dcp::Rating get () const = 0; + virtual bool set (dcp::Rating rating) = 0; + + /** Emitted when the page has been changed, the parameter being true if OK + * should now be enabled in the main dialogue. + */ + boost::signals2::signal Changed; +}; + + +class StandardRatingDialogPage : public RatingDialogPage +{ +public: + StandardRatingDialogPage (wxNotebook* notebook); + + dcp::Rating get () const override; + bool set (dcp::Rating rating) override; + +private: + void search_changed (); + void found_systems_view_selection_changed (); + void update_found_system_selection (); + + wxSearchCtrl* _search; + wxListView* _found_systems_view; + boost::optional _selected_system; + wxChoice* _rating; + std::vector _found_systems; +}; + + +class CustomRatingDialogPage : public RatingDialogPage +{ +public: + CustomRatingDialogPage (wxNotebook* notebook); + + dcp::Rating get () const override; + bool set (dcp::Rating rating) override; + +private: + void changed (); + + wxTextCtrl* _agency; + wxTextCtrl* _rating; +}; + + +class RatingDialog : public wxDialog { public: RatingDialog (wxWindow* parent); void set (dcp::Rating r); - dcp::Rating get () const; + boost::optional get () const; private: - wxTextCtrl* _agency; - wxTextCtrl* _label; + void setup_sensitivity (bool ok_valid); + void page_changed (); + + wxNotebook* _notebook; + + StandardRatingDialogPage* _standard_page; + CustomRatingDialogPage* _custom_page; + RatingDialogPage* _active_page; }; +