1
0
Fork 0

Launcher: allow different texts for Fly! button

Requested by Michael Danilov for Russian translation
This commit is contained in:
Automatic Release Builder 2020-12-06 18:47:38 +00:00 committed by James Turner
parent 0d0b8d01d2
commit a85a02069f
3 changed files with 17 additions and 2 deletions

View file

@ -891,6 +891,19 @@ QUrl LauncherController::flyIconUrl() const
return QUrl{"qrc:///svg/toolbox-fly"};
}
QString LauncherController::flyButtonLabel() const
{
if (m_aircraftType == Helicopter) {
return tr("Fly!", "For a helicopter");
} else if (m_selectedAircraftInfo) {
if (m_selectedAircraftInfo->hasTag("spaceship")) {
return tr("Fly!", "For a spaceship");
}
}
return tr("Fly!");
}
QUrl LauncherController::urlToDataPath(QString relPath) const
{
QString absFilePath = QString::fromStdString(globals->get_fg_root().utf8Str());

View file

@ -87,7 +87,8 @@ class LauncherController : public QObject
Q_PROPERTY(QSize minimumWindowSize READ minWindowSize WRITE setMinWindowSize NOTIFY minWindowSizeChanged)
Q_PROPERTY(QUrl flyIconUrl READ flyIconUrl NOTIFY selectedAircraftChanged)
Q_PROPERTY(QUrl flyButtonLabel READ flyButtonLabel NOTIFY selectedAircraftChanged)
Q_PROPERTY(bool inAppMode READ inApp NOTIFY inAppChanged)
Q_PROPERTY(bool aircraftGridMode READ aircraftGridMode WRITE setAircraftGridMode NOTIFY aircraftGridModeChanged)
@ -224,6 +225,7 @@ public:
return m_versionLaunchCount;
}
QString flyButtonLabel() const;
signals:
void selectedAircraftChanged(QUrl selectedAircraft);

View file

@ -70,7 +70,7 @@ Rectangle {
SidebarButton {
id: flyButton
label: qsTr("Fly!")
label: _launcher.flyButtonLabel
anchors.bottom: parent.bottom
enabled: _launcher.canFly
disabledText: qsTr("The selected aircraft is not installed or has updates pending")