diff --git a/apps/kmix.cpp b/apps/kmix.cpp --- a/apps/kmix.cpp +++ b/apps/kmix.cpp @@ -1285,4 +1285,3 @@ action->setVisible(!view->isDynamic()); } } - diff --git a/core/GlobalConfig.h b/core/GlobalConfig.h --- a/core/GlobalConfig.h +++ b/core/GlobalConfig.h @@ -42,6 +42,7 @@ bool volumeOverdrive; // whether more than recommended volume (typically 0dB) is allowed bool beepOnVolumeChange; + QString VolumePercentageStep; // Startup bool allowAutostart; diff --git a/core/GlobalConfig.cpp b/core/GlobalConfig.cpp --- a/core/GlobalConfig.cpp +++ b/core/GlobalConfig.cpp @@ -31,6 +31,7 @@ addItemBool("Labels", data.showLabels, true); addItemBool("VolumeOverdrive", data.volumeOverdrive, false); addItemBool("VolumeFeedback", data.beepOnVolumeChange, true); + addItemString("VolumePercentageStep", data.VolumePercentageStep, "5"); // ItemString* is = addItemString("Orientation", data.orientationMainGUIString, "Vertical"); // qCDebug(KMIX_LOG) << is->name() << is->value(); diff --git a/gui/kmixprefdlg.h b/gui/kmixprefdlg.h --- a/gui/kmixprefdlg.h +++ b/gui/kmixprefdlg.h @@ -28,6 +28,7 @@ class QBoxLayout; class QCheckBox; +class QSpinBox; class QFrame; class QGridLayout; class QRadioButton; @@ -110,6 +111,7 @@ KMessageWidget *allowAutostartWarning; QCheckBox *m_beepOnVolumeChange; QCheckBox *m_volumeOverdrive; + QSpinBox *m_volumeStep; KMessageWidget *volumeFeedbackWarning; KMessageWidget *volumeOverdriveWarning; diff --git a/gui/kmixprefdlg.cpp b/gui/kmixprefdlg.cpp --- a/gui/kmixprefdlg.cpp +++ b/gui/kmixprefdlg.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -209,6 +210,7 @@ m_volumeOverdrive = new QCheckBox(i18n("Volume overdrive"), grp); addWidgetToLayout(m_volumeOverdrive, behaviorLayout, 10, i18nc("@info:tooltip", "Raise the maximum volume to 150%"), "VolumeOverdrive"); + // Volume Feedback Warning volumeFeedbackWarning = new KMessageWidget( i18n("Volume feedback and volume overdrive are only available for PulseAudio."), grp); volumeFeedbackWarning->setIcon(QIcon::fromTheme("dialog-warning")); @@ -218,8 +220,27 @@ volumeFeedbackWarning->setVisible(false); addWidgetToLayout(volumeFeedbackWarning, behaviorLayout, 2, "", ""); + // Volume Step Grid + QGridLayout* horizontalGrid = new QGridLayout(); + horizontalGrid->setHorizontalSpacing(DialogBase::horizontalSpacing()); + + // Volume Step SpinBox + m_volumeStep = new QSpinBox(grp); + m_volumeStep->setSuffix(" %"); + m_volumeStep->setRange(1, 50); + // Register SpinBox for KConfig + m_volumeStep->setObjectName("kcfg_VolumePercentageStep"); + + horizontalGrid->addWidget(new QLabel(i18n("Volume step:"), m_generalTab), 0, 0, Qt::AlignLeft); + horizontalGrid->addWidget(m_volumeStep, 0, 1, Qt::AlignLeft); + horizontalGrid->addItem(new QSpacerItem(1 ,1 , QSizePolicy::Expanding), 0, 2); + + // Add grid to behavior layout + behaviorLayout->addLayout(horizontalGrid); + + // Volume Step and Overdrive Warning volumeOverdriveWarning = new KMessageWidget( - i18n("KMix must be restarted for the Volume Overdrive setting to take effect."), grp); + i18n("KMix must be restarted for the Volume Step and Overdrive settings to take effect."), grp); volumeOverdriveWarning->setIcon(QIcon::fromTheme("dialog-information")); volumeOverdriveWarning->setMessageType(KMessageWidget::Information); volumeOverdriveWarning->setCloseButtonVisible(false); @@ -465,7 +486,3 @@ dvcSpacerBelow = new QSpacerItem(1,1); layoutControlsTab->addItem(dvcSpacerBelow); } - - - -