diff --git a/src/GUI/LauncherController.cxx b/src/GUI/LauncherController.cxx index 877baf416..4a06f9560 100644 --- a/src/GUI/LauncherController.cxx +++ b/src/GUI/LauncherController.cxx @@ -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()); diff --git a/src/GUI/LauncherController.hxx b/src/GUI/LauncherController.hxx index 13a4d41a5..a453d8277 100644 --- a/src/GUI/LauncherController.hxx +++ b/src/GUI/LauncherController.hxx @@ -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); diff --git a/src/GUI/qml/Sidebar.qml b/src/GUI/qml/Sidebar.qml index 60a7520c2..08aaea242 100644 --- a/src/GUI/qml/Sidebar.qml +++ b/src/GUI/qml/Sidebar.qml @@ -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")