]> sigrok.org Git - pulseview.git/blobdiff - pv/dialogs/settings.cpp
about: Layout change to use space more efficiently.
[pulseview.git] / pv / dialogs / settings.cpp
index bde6f1676c8a4bdf61178e546e08e702697c5913..4c0715a8b936ae67a61abf2faf08c716c0f3de2c 100644 (file)
@@ -205,9 +205,9 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const
        QFormLayout *trace_view_layout = new QFormLayout();
        trace_view_group->setLayout(trace_view_layout);
 
-       cb = create_checkbox(GlobalSettings::Key_View_ColouredBG,
-               SLOT(on_view_colouredBG_changed(int)));
-       trace_view_layout->addRow(tr("Use coloured trace &background"), cb);
+       cb = create_checkbox(GlobalSettings::Key_View_ColoredBG,
+               SLOT(on_view_coloredBG_changed(int)));
+       trace_view_layout->addRow(tr("Use colored trace &background"), cb);
 
        cb = create_checkbox(GlobalSettings::Key_View_ZoomToFitDuringAcq,
                SLOT(on_view_zoomToFitDuringAcq_changed(int)));
@@ -233,6 +233,10 @@ QWidget *Settings::get_view_settings_form(QWidget *parent) const
                SLOT(on_view_showAnalogMinorGrid_changed(int)));
        trace_view_layout->addRow(tr("Show analog minor grid in addition to div grid"), cb);
 
+       cb = create_checkbox(GlobalSettings::Key_View_ShowHoverMarker,
+               SLOT(on_view_showHoverMarker_changed(int)));
+       trace_view_layout->addRow(tr("Highlight mouse cursor using a vertical marker line"), cb);
+
        QComboBox *thr_disp_mode_cb = new QComboBox();
        thr_disp_mode_cb->addItem(tr("None"), GlobalSettings::ConvThrDispMode_None);
        thr_disp_mode_cb->addItem(tr("Background"), GlobalSettings::ConvThrDispMode_Background);
@@ -310,14 +314,12 @@ QWidget *Settings::get_about_page(QWidget *parent) const
        QLabel *icon = new QLabel();
        icon->setPixmap(QPixmap(QString::fromUtf8(":/icons/pulseview.svg")));
 
-       /* Setup the version field */
-       QLabel *version_info = new QLabel();
-       version_info->setText(tr("%1 %2<br />%3<br /><a href=\"http://%4\">%4</a>")
-               .arg(QApplication::applicationName(),
-               QApplication::applicationVersion(),
+       /* Setup the license field, with the project homepage link. */
+       QLabel *gpl_home_info = new QLabel();
+       gpl_home_info->setText(tr("%1<br /><a href=\"http://%2\">%2</a>").arg(
                tr("GNU GPL, version 3 or later"),
                QApplication::organizationDomain()));
-       version_info->setOpenExternalLinks(true);
+       gpl_home_info->setOpenExternalLinks(true);
 
        shared_ptr<sigrok::Context> context = device_manager_.context();
 
@@ -327,10 +329,13 @@ QWidget *Settings::get_about_page(QWidget *parent) const
 
        s.append("<table>");
 
-       /* Library info */
+       /* Version, library, and feature info */
        s.append("<tr><td colspan=\"2\"><b>" +
-               tr("Libraries and features:") + "</b></td></tr>");
+               tr("Versions, libraries and features:") + "</b></td></tr>");
 
+       s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
+               .arg(QApplication::applicationName(),
+               QApplication::applicationVersion()));
        s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
                .arg(QString("Qt"), qVersion()));
        s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
@@ -460,10 +465,14 @@ QWidget *Settings::get_about_page(QWidget *parent) const
        QTextBrowser *support_list = new QTextBrowser();
        support_list->setDocument(supported_doc);
 
-       QGridLayout *layout = new QGridLayout();
-       layout->addWidget(icon, 0, 0, 1, 1);
-       layout->addWidget(version_info, 0, 1, 1, 1);
-       layout->addWidget(support_list, 1, 1, 1, 1);
+       QHBoxLayout *h_layout = new QHBoxLayout();
+       h_layout->setAlignment(Qt::AlignLeft);
+       h_layout->addWidget(icon);
+       h_layout->addWidget(gpl_home_info);
+
+       QVBoxLayout *layout = new QVBoxLayout();
+       layout->addLayout(h_layout);
+       layout->addWidget(support_list);
 
        QWidget *page = new QWidget(parent);
        page->setLayout(layout);
@@ -489,6 +498,7 @@ QWidget *Settings::get_logging_page(QWidget *parent) const
        // Background buffer size
        QSpinBox *buffersize_sb = new QSpinBox();
        buffersize_sb->setSuffix(tr(" lines"));
+       buffersize_sb->setMinimum(Logging::MIN_BUFFER_SIZE);
        buffersize_sb->setMaximum(Logging::MAX_BUFFER_SIZE);
        buffersize_sb->setValue(
                settings.value(GlobalSettings::Key_Log_BufferSize).toInt());
@@ -571,10 +581,10 @@ void Settings::on_view_triggerIsZero_changed(int state)
        settings.setValue(GlobalSettings::Key_View_TriggerIsZeroTime, state ? true : false);
 }
 
-void Settings::on_view_colouredBG_changed(int state)
+void Settings::on_view_coloredBG_changed(int state)
 {
        GlobalSettings settings;
-       settings.setValue(GlobalSettings::Key_View_ColouredBG, state ? true : false);
+       settings.setValue(GlobalSettings::Key_View_ColoredBG, state ? true : false);
 }
 
 void Settings::on_view_stickyScrolling_changed(int state)
@@ -595,6 +605,12 @@ void Settings::on_view_showAnalogMinorGrid_changed(int state)
        settings.setValue(GlobalSettings::Key_View_ShowAnalogMinorGrid, state ? true : false);
 }
 
+void Settings::on_view_showHoverMarker_changed(int state)
+{
+       GlobalSettings settings;
+       settings.setValue(GlobalSettings::Key_View_ShowHoverMarker, state ? true : false);
+}
+
 void Settings::on_view_conversionThresholdDispMode_changed(int state)
 {
        GlobalSettings settings;
@@ -670,7 +686,7 @@ void Settings::on_log_popOut_clicked(bool checked)
        (void)checked;
 
        // Create the window as a sub-window so it closes when the main window closes
-       QMainWindow *window = new QMainWindow(0, Qt::SubWindow);
+       QMainWindow *window = new QMainWindow(nullptr, Qt::SubWindow);
 
        window->setObjectName(QString::fromUtf8("Log Window"));
        window->setWindowTitle(tr("%1 Log").arg(PV_TITLE));