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