diff --git a/src/gui/model/w-link.hpp b/src/gui/model/w-link.hpp index b1807fda5..a71e9b6f5 100644 --- a/src/gui/model/w-link.hpp +++ b/src/gui/model/w-link.hpp @@ -149,7 +149,7 @@ namespace model { explicit operator bool() const { - return bool(widget_); + return bool{widget_}; } TAR& @@ -167,6 +167,10 @@ namespace model { } + bool isValid() const { return bool{*this}; } + bool isActive() const { return bool{*this}; } + + /** detach and deactivate this link * @note EX_STRONG (but only under the assumption that also * sigc::trackable::remove_destroy_notify_cllback is EX_STRONG) diff --git a/src/gui/timeline/timeline-gui.cpp b/src/gui/timeline/timeline-gui.cpp index 8190b4d70..5ea8576d4 100644 --- a/src/gui/timeline/timeline-gui.cpp +++ b/src/gui/timeline/timeline-gui.cpp @@ -81,8 +81,12 @@ namespace timeline { void TimelineGui::buildMutator (lib::diff::TreeMutator::Handle buffer) { - if (*this) - UNIMPLEMENTED ("actually delegate diff application to the target"); + if (this->isActive()) + operator*().buildMutator (buffer); // delegate to TimelineController + else // else when no widget exists... + buffer.create( + TreeMutator::build() + .ignoreAllChanges()); // ...consume and ignore diff } diff --git a/src/gui/timeline/timeline-widget.cpp b/src/gui/timeline/timeline-widget.cpp index cbb72058c..7fcc6db8b 100644 --- a/src/gui/timeline/timeline-widget.cpp +++ b/src/gui/timeline/timeline-widget.cpp @@ -73,13 +73,15 @@ namespace timeline { UNIMPLEMENTED ("build the timeline UI"); } + TimelineWidget::~TimelineWidget() { } - TimelineWidget::~TimelineWidget() + + void + TimelineWidget::buildMutator (lib::diff::TreeMutator::Handle buff) { + control_->buildMutator (buff); } - - }}// namespace gui::timeline diff --git a/src/gui/timeline/timeline-widget.hpp b/src/gui/timeline/timeline-widget.hpp index f8c7a7181..cac87d043 100644 --- a/src/gui/timeline/timeline-widget.hpp +++ b/src/gui/timeline/timeline-widget.hpp @@ -113,12 +113,15 @@ namespace timeline { */ TimelineWidget (BusTerm::ID identity, BusTerm::ID trackID, BusTerm& nexus); - ~TimelineWidget(); + ~TimelineWidget(); public: /* ===== Control interface ===== */ + /** allow for diff mutation (delegated to TimelineController */ + void buildMutator (lib::diff::TreeMutator::Handle); + public: /* ===== Signals ===== */ private:/* ===== Events ===== */