]> sigrok.org Git - pulseview.git/commitdiff
Header: Added on_ungroup method
authorJoel Holdsworth <redacted>
Sun, 9 Nov 2014 10:26:27 +0000 (10:26 +0000)
committerJoel Holdsworth <redacted>
Wed, 19 Nov 2014 10:23:31 +0000 (10:23 +0000)
pv/view/header.cpp
pv/view/header.h

index 91a6ecfddc3415288ab2f9e0f6fd45305ec4c07a..23cbb0ffa79979d08c764e1809c8248cef406ae3 100644 (file)
@@ -39,6 +39,7 @@
 #include <pv/widgets/popup.h>
 
 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<RowItem> r : _view) {
+                       const shared_ptr<TraceGroup> tg =
+                               dynamic_pointer_cast<TraceGroup>(r);
+                       if (tg && tg->selected()) {
+                               tg->ungroup();
+                               restart = true;
+                               break;
+                       }
+               }
+       } while(restart);
+}
+
 } // namespace view
 } // namespace pv
index b982ad76c33370e8c3468e5cca917d11276fbdac..541430ab794c615be82084d03d4054db9426c772 100644 (file)
@@ -82,6 +82,8 @@ private Q_SLOTS:
 
        void on_group();
 
+       void on_ungroup();
+
 Q_SIGNALS:
        void signals_moved();