From 632d5bc836aec91f9a88e58ce4d553bbaa475d2c Mon Sep 17 00:00:00 2001 From: Automatic Release Builder <build@flightgear.org> Date: Mon, 5 Oct 2020 11:18:55 +0100 Subject: [PATCH] Launcher: first-run & help updates Adjust the wording and links for these pages, after a review session with Stuart and others. Include a link to the manual and short-ref from the local installation. --- src/GUI/LauncherController.cxx | 9 ++++++ src/GUI/LauncherController.hxx | 7 +++++ src/GUI/qml/FirstRun.qml | 8 ++--- src/GUI/qml/HelpSupport.qml | 56 ++++++++++++++++++++-------------- 4 files changed, 53 insertions(+), 27 deletions(-) diff --git a/src/GUI/LauncherController.cxx b/src/GUI/LauncherController.cxx index 20a9ac383..6d51bed12 100644 --- a/src/GUI/LauncherController.cxx +++ b/src/GUI/LauncherController.cxx @@ -880,3 +880,12 @@ QUrl LauncherController::flyIconUrl() const return QUrl{"qrc:///svg/toolbox-fly"}; } + +QUrl LauncherController::urlToDataPath(QString relPath) const +{ + QString absFilePath = QString::fromStdString(globals->get_fg_root().utf8Str()); + if (!relPath.startsWith("/")) { + relPath.prepend("/"); + } + return QUrl::fromLocalFile(absFilePath + relPath); +} diff --git a/src/GUI/LauncherController.hxx b/src/GUI/LauncherController.hxx index 8dfa15fb2..0c307f889 100644 --- a/src/GUI/LauncherController.hxx +++ b/src/GUI/LauncherController.hxx @@ -153,6 +153,13 @@ public: Q_INVOKABLE QVariant loadUISetting(QString name, QVariant defaultValue) const; Q_INVOKABLE void saveUISetting(QString name, QVariant value) const; + /** + * @brief urlToDataPath - convetr a FGData path into a gloabl file:/// URL suitable for Qt.openExternally() + * @param relPath - the path rlative to FG_ROOT + * @return a file QUrl + */ + Q_INVOKABLE QUrl urlToDataPath(QString relPath) const; + LaunchConfig* config() const { return m_config; } diff --git a/src/GUI/qml/FirstRun.qml b/src/GUI/qml/FirstRun.qml index 0a2bc73f7..2e1be7ae9 100644 --- a/src/GUI/qml/FirstRun.qml +++ b/src/GUI/qml/FirstRun.qml @@ -93,10 +93,10 @@ Item { readonly property string forumLink: "href=\"http://forum.flightgear.org\""; - text: qsTr("Welcome to FlightGear, the open-source flight simulator. " + - "Everything in this software is the work of volunteers; we hope " + - "you enjoy it. If you find problems, or would like to contribute, " + - "please <a %1>visit our user forum</a>.").arg(forumLink) + text: qsTr("Welcome to FlightGear, the open source flight simulator. " + + "This software is the work of volunteers. we hope you enjoy it. " + + "If you find problems, or would like to contribute, " + + "please <a %1>visit our forum</a>.").arg(forumLink) onLinkActivated: { Qt.openUrlExternally(link) diff --git a/src/GUI/qml/HelpSupport.qml b/src/GUI/qml/HelpSupport.qml index b6c89fa6f..0d51c8d2e 100644 --- a/src/GUI/qml/HelpSupport.qml +++ b/src/GUI/qml/HelpSupport.qml @@ -6,7 +6,9 @@ Item { id: root readonly property string forumLink: "href=\"http://forum.flightgear.org\""; - readonly property string wikiLink: "href=\"http://wiki.flightgear.org\""; + readonly property string forumHelpLink: "href=\"https://forum.flightgear.org/viewforum.php?f=17\""; + + readonly property string wikiLink: "href=\"http://wiki.flightgear.org/Portal:User\""; Flickable { @@ -30,16 +32,21 @@ Item { color: Style.baseTextColor wrapMode: Text.WordWrap - text: qsTr("<p>FlightGear is open-source software, developed entirely by volunteers. This means " + - "we can't offer the same kind of support as a commercial product, but we have " + - "an excellent user community, many of whom are willing to help out " + - "other users. The easiest place to ask questions and get support is at <a %1>our forums</a>.</p>\n" + + readonly property var pdfManualLink: "href=\"" + _launcher.urlToDataPath("Docs/getstart.pdf") + "\"" + readonly property var shortRefLink: "href=\"" + _launcher.urlToDataPath("Docs/FGShortRef.html") + "\"" + + text: qsTr("<p>FlightGear is open source software, developed entirely by volunteers. " + + "Support is provided by our excellent user community. " + + "The easiest place to ask questions and get support is on <a %1>our forums</a>.</p>\n" + "<p>To get started with the simulator, please use our tutorial system: " + - "this is available from the 'Help' menu in the simulator, and teaches the basics of " + - "getting the Cessna 172 airborne and flying a standard circuit.</p>\n" + - "<p>Another good source of information is <a %2>the official wiki</a>, which contains " + - "FAQs, tutorials and information on individual aircraft, scenery areas and more." - ).arg(root.forumLink).arg(root.wikiLink) + "this is available from the 'Help' menu in the simulator. We recommend " + + "starting with the Cessna 172 to learn how to get airborne.</p>\n" + + "<p>Other good resources:<ul>" + + "<li><a %2>the official manual (PDF)</a></li>\n" + + "<li><a %3>key commands reference</a></li>\n" + + "<li><a %4>our wiki</a> (which includes FAQs)</li>\n" + + "</ul></p>" + ).arg(root.forumLink).arg(pdfManualLink).arg(shortRefLink).arg(root.wikiLink) onLinkActivated: { Qt.openUrlExternally(link) @@ -52,24 +59,27 @@ Item { color: Style.baseTextColor wrapMode: Text.WordWrap - readonly property string bugTrackerLink: "href=\"https://sourceforge.net/p/flightgear/codetickets/new/\""; - readonly property string sceneryDBLink: "href=\"https://scenery.flightgear.org\""; - - text: qsTr("<p>If you've found a bug, please consider if it's in a particular aircraft, " + - "the scenery, or in the main program. Aircraft are developed by many different people, " + - "so <a %1>our forums</a> are the best way to identify the author(s) and contact them. For bugs in the " + - "program, please check our <a %2>bug tracker</a>; first by searching for existing bugs, and " + - "then creating a new ticket if necessary.</p>\n" + - "<p>Due to the automated way we generate our world scenery, it's usually not possible " + - "to fix individual data issues, such as missing roads or misplaced coastlines. For 3D models " + - "placed in the scenery, you can submit improvements to <a %3>our scenery database.</a>" + - "</p>" - ).arg(root.forumLink).arg(bugTrackerLink).arg(sceneryDBLink) + text: qsTr("<p>If you find an issue, please use <a %1>our help forum</a>.</p>\n").arg(root.forumHelpLink); onLinkActivated: { Qt.openUrlExternally(link) } } + + Text { + width: parent.width + font.pixelSize: Style.baseFontPixelSize * 1.5 + color: Style.baseTextColor + wrapMode: Text.WordWrap + + text: qsTr("<p>FlightGear is the result of twenty-five years of work " + + "by hundreds of contributors around the world. We'd be " + + "delighted if you would join us.</p>\n") + +// onLinkActivated: { +// Qt.openUrlExternally(link) +// } + } } } // of flickable