Retranslate "Follow stop point" combo box
This commit is contained in:
parent
7c9ea14a9e
commit
7a0990c433
|
@ -32,6 +32,8 @@
|
|||
#include <QStringBuilder>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "GuiPreferencesDialog.h"
|
||||
#include "GlView.h"
|
||||
|
||||
|
@ -158,10 +160,21 @@ void GuiPreferencesOptionPage::reset()
|
|||
|
||||
QWidget *GuiPreferencesOptionPage::setupWidget()
|
||||
{
|
||||
auto *widget = GuiPreferencesOptionPageBase::setupWidget();
|
||||
ui()->followStopPointCombo->addItem(tr("Automatic (Recommended)"));
|
||||
ui()->followStopPointCombo->addItem(tr("On the Beat"));
|
||||
ui()->followStopPointCombo->addItem(tr("After the Beat"));
|
||||
auto *widget = static_cast<QtUtilities::OptionPageWidget *>(GuiPreferencesOptionPageBase::setupWidget());
|
||||
initFollowStopPointCombo();
|
||||
initLanguageCombo();
|
||||
QObject::connect(widget, &QtUtilities::OptionPageWidget::retranslationRequired, widget, std::bind(&GuiPreferencesOptionPage::initFollowStopPointCombo, this));
|
||||
return widget;
|
||||
}
|
||||
|
||||
void GuiPreferencesOptionPage::initFollowStopPointCombo()
|
||||
{
|
||||
auto *const combo = ui()->followStopPointCombo;
|
||||
const auto index = combo->currentIndex();
|
||||
combo->clear();
|
||||
combo->addItem(tr("Automatic (Recommended)"));
|
||||
combo->addItem(tr("On the Beat"));
|
||||
combo->addItem(tr("After the Beat"));
|
||||
combo->setCurrentIndex(index);
|
||||
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ protected:
|
|||
QWidget *setupWidget() override;
|
||||
|
||||
private:
|
||||
void initFollowStopPointCombo();
|
||||
void initLanguageCombo();
|
||||
|
||||
CSettings* m_settings;
|
||||
|
|
Loading…
Reference in New Issue