Launcher: allow different texts for Fly! button
Requested by Michael Danilov for Russian translation
This commit is contained in:
parent
0d0b8d01d2
commit
a85a02069f
3 changed files with 17 additions and 2 deletions
|
@ -891,6 +891,19 @@ QUrl LauncherController::flyIconUrl() const
|
||||||
return QUrl{"qrc:///svg/toolbox-fly"};
|
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
|
QUrl LauncherController::urlToDataPath(QString relPath) const
|
||||||
{
|
{
|
||||||
QString absFilePath = QString::fromStdString(globals->get_fg_root().utf8Str());
|
QString absFilePath = QString::fromStdString(globals->get_fg_root().utf8Str());
|
||||||
|
|
|
@ -87,6 +87,7 @@ class LauncherController : public QObject
|
||||||
Q_PROPERTY(QSize minimumWindowSize READ minWindowSize WRITE setMinWindowSize NOTIFY minWindowSizeChanged)
|
Q_PROPERTY(QSize minimumWindowSize READ minWindowSize WRITE setMinWindowSize NOTIFY minWindowSizeChanged)
|
||||||
|
|
||||||
Q_PROPERTY(QUrl flyIconUrl READ flyIconUrl NOTIFY selectedAircraftChanged)
|
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 inAppMode READ inApp NOTIFY inAppChanged)
|
||||||
|
|
||||||
|
@ -224,6 +225,7 @@ public:
|
||||||
return m_versionLaunchCount;
|
return m_versionLaunchCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString flyButtonLabel() const;
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void selectedAircraftChanged(QUrl selectedAircraft);
|
void selectedAircraftChanged(QUrl selectedAircraft);
|
||||||
|
|
|
@ -70,7 +70,7 @@ Rectangle {
|
||||||
|
|
||||||
SidebarButton {
|
SidebarButton {
|
||||||
id: flyButton
|
id: flyButton
|
||||||
label: qsTr("Fly!")
|
label: _launcher.flyButtonLabel
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
enabled: _launcher.canFly
|
enabled: _launcher.canFly
|
||||||
disabledText: qsTr("The selected aircraft is not installed or has updates pending")
|
disabledText: qsTr("The selected aircraft is not installed or has updates pending")
|
||||||
|
|
Loading…
Reference in a new issue