Don't use std:: in the code directly (where possible).
[pulseview.git] / pv / dialogs / settings.cpp
index 214ac9cf26e862aefd4208a4da84d685709d2655..cf4757336e333044b053895ef916332ad05718dd 100644 (file)
@@ -40,6 +40,8 @@
 #include <libsigrokdecode/libsigrokdecode.h>
 #endif
 
+using std::shared_ptr;
+
 namespace pv {
 namespace dialogs {
 
@@ -133,6 +135,11 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const
        connect(sticky_scrolling_cb, SIGNAL(stateChanged(int)), this, SLOT(on_view_stickyScrolling_changed(int)));
        trace_view_layout->addRow(tr("Always keep &newest samples at the right edge during capture"), sticky_scrolling_cb);
 
+       QCheckBox *show_sampling_points_cb = new QCheckBox();
+       show_sampling_points_cb->setChecked(settings.value(GlobalSettings::Key_View_ShowSamplingPoints).toBool());
+       connect(show_sampling_points_cb, SIGNAL(stateChanged(int)), this, SLOT(on_view_showSamplingPoints_changed(int)));
+       trace_view_layout->addRow(tr("Show data &sampling points"), show_sampling_points_cb);
+
        return form;
 }
 
@@ -154,7 +161,7 @@ QWidget *Settings::get_about_page(QWidget *parent) const
                QApplication::organizationDomain()));
        version_info->setOpenExternalLinks(true);
 
-       std::shared_ptr<sigrok::Context> context = device_manager_.context();
+       shared_ptr<sigrok::Context> context = device_manager_.context();
 
        QString s;
        s.append("<table>");
@@ -260,6 +267,11 @@ void Settings::on_view_stickyScrolling_changed(int state)
        settings.setValue(GlobalSettings::Key_View_StickyScrolling, state ? true : false);
 }
 
+void Settings::on_view_showSamplingPoints_changed(int state)
+{
+       GlobalSettings settings;
+       settings.setValue(GlobalSettings::Key_View_ShowSamplingPoints, state ? true : false);
+}
 
 } // namespace dialogs
 } // namespace pv