X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdialogs%2Fsettings.cpp;h=068d99b3108ead8c35a5c2dce0e1884a096f6d9d;hp=5346e5c91fc2b16ba1fcdecda2a3e8c8241a06c1;hb=051ba3b399abbd83fea8b7ef6f8876884ac0786c;hpb=33a94f9bf233bbb3cfe9b407df303bbcd95d37df diff --git a/pv/dialogs/settings.cpp b/pv/dialogs/settings.cpp index 5346e5c9..068d99b3 100644 --- a/pv/dialogs/settings.cpp +++ b/pv/dialogs/settings.cpp @@ -60,6 +60,7 @@ Settings::Settings(DeviceManager &device_manager, QWidget *parent) : pages = new QStackedWidget; create_pages(); + page_list->setCurrentIndex(page_list->model()->index(0, 0)); QHBoxLayout *tab_layout = new QHBoxLayout; tab_layout->addWidget(page_list); @@ -88,7 +89,7 @@ void Settings::create_pages() pages->addWidget(get_view_settings_form(pages)); QListWidgetItem *viewButton = new QListWidgetItem(page_list); - viewButton->setIcon(QIcon(":/icons/sigrok-logo-notext.svg")); + viewButton->setIcon(QIcon(":/icons/settings-views.svg")); viewButton->setText(tr("Views")); viewButton->setTextAlignment(Qt::AlignHCenter); viewButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); @@ -125,7 +126,17 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const QCheckBox *always_zoom_to_fit_cb = new QCheckBox(); always_zoom_to_fit_cb->setChecked(settings.value(GlobalSettings::Key_View_AlwaysZoomToFit).toBool()); connect(always_zoom_to_fit_cb, SIGNAL(stateChanged(int)), this, SLOT(on_view_alwaysZoomToFit_changed(int))); - trace_view_layout->addRow(tr("&Always zoom-to-fit during capture"), always_zoom_to_fit_cb); + trace_view_layout->addRow(tr("Constantly perform &zoom-to-fit during capture"), always_zoom_to_fit_cb); + + QCheckBox *sticky_scrolling_cb = new QCheckBox(); + sticky_scrolling_cb->setChecked(settings.value(GlobalSettings::Key_View_StickyScrolling).toBool()); + 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; } @@ -248,5 +259,17 @@ void Settings::on_view_colouredBG_changed(int state) settings.setValue(GlobalSettings::Key_View_ColouredBG, state ? true : false); } +void Settings::on_view_stickyScrolling_changed(int state) +{ + GlobalSettings settings; + 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