#include "Presenter.hpp" #include "Model.hpp" #include "View.hpp" #include #include #include #include #include #include namespace Hardware { namespace Settings { Presenter::Presenter(Model& m, View& v, QObject* parent) : score::GlobalSettingsPresenter{m, v, parent} { { // view -> model con(v, &View::enabledChanged, this, [&](auto val) { if (val != m.getEnabled()) { m_disp.submit(this->model(this), val); } }); // model -> view con(m, &Model::EnabledChanged, &v, &View::setEnabled); // initial value v.setEnabled(m.getEnabled()); } } QString Presenter::settingsName() { return tr("Hardware"); } QIcon Presenter::settingsIcon() { return makeIcons( QStringLiteral(":/icons/settings_remote_control_on.png"), QStringLiteral(":/icons/settings_remote_control_off.png"), QStringLiteral(":/icons/settings_remote_control_off.png")); } } }