From: Joel Holdsworth Date: Sun, 9 Nov 2014 10:26:27 +0000 (+0000) Subject: Header: Added on_ungroup method X-Git-Tag: pulseview-0.3.0~444 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bb419fdd96efe5a08667e6787a55dfbcd2e720a1;p=pulseview.git Header: Added on_ungroup method --- diff --git a/pv/view/header.cpp b/pv/view/header.cpp index 91a6ecfd..23cbb0ff 100644 --- a/pv/view/header.cpp +++ b/pv/view/header.cpp @@ -39,6 +39,7 @@ #include using boost::make_filter_iterator; +using std::dynamic_pointer_cast; using std::max; using std::make_pair; using std::min; @@ -348,5 +349,22 @@ void Header::on_group() } } +void Header::on_ungroup() +{ + bool restart; + do { + restart = false; + for (const shared_ptr r : _view) { + const shared_ptr tg = + dynamic_pointer_cast(r); + if (tg && tg->selected()) { + tg->ungroup(); + restart = true; + break; + } + } + } while(restart); +} + } // namespace view } // namespace pv diff --git a/pv/view/header.h b/pv/view/header.h index b982ad76..541430ab 100644 --- a/pv/view/header.h +++ b/pv/view/header.h @@ -82,6 +82,8 @@ private Q_SLOTS: void on_group(); + void on_ungroup(); + Q_SIGNALS: void signals_moved();