Skip to content

Commit

Permalink
Preferences: const shared warning icon string (html)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Oct 3, 2023
1 parent 17362a7 commit cd2fdb3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
7 changes: 7 additions & 0 deletions src/preferences/dialog/dlgpreferencepage.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ class DlgPreferencePage : public QWidget {
/// overriding this. The default implementation returns an invalid QUrl.
virtual QUrl helpUrl() const;

const QString kWarningIconHtmlString = QStringLiteral(
"<html>"
"<img "
"src=':/images/preferences/ic_preferences_warning.svg' "
"width='20' height='20'>"
"</html> ");

void setScrollSafeGuardForAllInputWidgets(QObject* obj);
/// Avoid undesired value changes when scrolling a preferences page while
/// the pointer is above an input widget (QSpinBox, QComboBox, QSlider):
Expand Down
7 changes: 1 addition & 6 deletions src/preferences/dialog/dlgprefinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ DlgPrefInterface::DlgPrefInterface(

if (pSkinLoader) {
// Skin configurations
QString sizeWarningString =
"<img src=\":/images/preferences/ic_preferences_warning.svg\") "
"width=16 height=16 /> " +
tr("The minimum size of the selected skin is bigger than your "
"screen resolution.");
warningLabel->setText(sizeWarningString);
warningLabel->setText(kWarningIconHtmlString);

ComboBoxSkinconf->clear();
// align left edge of preview image and skin description with comboboxes
Expand Down
34 changes: 18 additions & 16 deletions src/preferences/dialog/dlgprefsound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,27 +799,29 @@ void DlgPrefSound::checkLatencyCompensation() {
micMonitorModeComboBox->setEnabled(true);
if (configuredMicMonitorMode == EngineMixer::MicMonitorMode::DirectMonitor) {
latencyCompensationSpinBox->setEnabled(true);
QString warningIcon(
"<html>"
"<img "
"src=':/images/preferences/ic_preferences_warning.svg' "
"width='20' height='20'>"
"</html> ");
QString lineBreak("<br/>");
// TODO(Be): Make the "User Manual" text link to the manual.
if (m_pLatencyCompensation->get() == 0.0) {
latencyCompensationWarningLabel->setText(
warningIcon +
tr("Microphone inputs are out of time in the record & broadcast signal compared to what you hear.") + lineBreak +
tr("Measure round trip latency and enter it above for Microphone Latency Compensation to align microphone timing.") + lineBreak +
tr("Refer to the Mixxx User Manual for details.") + "</html>");
latencyCompensationWarningLabel->setText(kWarningIconHtmlString +
tr("Microphone inputs are out of time in the record & "
"broadcast signal compared to what you hear.") +
lineBreak +
tr("Measure round trip latency and enter it above for "
"Microphone Latency Compensation to align "
"microphone timing.") +
lineBreak +
tr("Refer to the Mixxx User Manual for details.") +
"</html>");
latencyCompensationWarningLabel->show();
} else if (m_bLatencyChanged) {
latencyCompensationWarningLabel->setText(
warningIcon +
tr("Configured latency has changed.") + lineBreak +
tr("Remeasure round trip latency and enter it above for Microphone Latency Compensation to align microphone timing.") + lineBreak +
tr("Refer to the Mixxx User Manual for details.") + "</html>");
latencyCompensationWarningLabel->setText(kWarningIconHtmlString +
tr("Configured latency has changed.") + lineBreak +
tr("Remeasure round trip latency and enter it above "
"for Microphone Latency Compensation to align "
"microphone timing.") +
lineBreak +
tr("Refer to the Mixxx User Manual for details.") +
"</html>");
latencyCompensationWarningLabel->show();
} else {
latencyCompensationWarningLabel->hide();
Expand Down

0 comments on commit cd2fdb3

Please sign in to comment.