From bf5954132b776b19b20586b0a4b2b622ab0642ea Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 7 Apr 2017 21:34:40 +0200 Subject: proto/flightgear: dialog fixes - add "help" button opening the right contrib directory with readme in it - use layouts in the dialog Issue: #590 --- proto-fg/ftnoir_protocol_fg_dialog.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'proto-fg/ftnoir_protocol_fg_dialog.cpp') diff --git a/proto-fg/ftnoir_protocol_fg_dialog.cpp b/proto-fg/ftnoir_protocol_fg_dialog.cpp index 50ca2a73..43a702f6 100644 --- a/proto-fg/ftnoir_protocol_fg_dialog.cpp +++ b/proto-fg/ftnoir_protocol_fg_dialog.cpp @@ -9,9 +9,13 @@ * copyright notice and this permission notice appear in all copies. * */ #include "ftnoir_protocol_fg.h" -#include -#include #include "api/plugin-api.hpp" +#include "opentrack-library-path.h" + +#include +#include +#include +#include //******************************************************************************************************* // FaceTrackNoIR Client Settings-dialog. @@ -32,14 +36,23 @@ FGControls::FGControls() connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); + connect(ui.buttonBox, &QDialogButtonBox::helpRequested, + ui.buttonBox, []() + { + static const QString contrib_dir = "file:///" + QDir::toNativeSeparators(QStringLiteral("%1/%2/%3"). + arg(OPENTRACK_BASE_PATH, OPENTRACK_CONTRIB_PATH, "FlightGear")); + QDesktopServices::openUrl(contrib_dir); + }); } -void FGControls::doOK() { +void FGControls::doOK() +{ s.b->save(); close(); } -void FGControls::doCancel() { +void FGControls::doCancel() +{ close(); } -- cgit v1.2.3