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_fgcontrols.ui | 264 +++++++++++++++++++++------------ proto-fg/ftnoir_protocol_fg_dialog.cpp | 21 ++- 2 files changed, 185 insertions(+), 100 deletions(-) (limited to 'proto-fg') diff --git a/proto-fg/ftnoir_fgcontrols.ui b/proto-fg/ftnoir_fgcontrols.ui index bd5b95c7..4c0a8314 100644 --- a/proto-fg/ftnoir_fgcontrols.ui +++ b/proto-fg/ftnoir_fgcontrols.ui @@ -9,8 +9,8 @@ 0 0 - 415 - 112 + 342 + 100 @@ -22,111 +22,183 @@ false - - - - - IP-address remote PC - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - - 60 - 16777215 - - - - 255 - - - 1 - + + + 0 + + + 2 + + + + + QFrame::Raised + + + + 0 + + + + + + 0 + 0 + + + + IP address + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + 255 + + + 1 + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + 255 + + + 1 + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + 255 + + + 1 + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + 255 + + + 1 + + + + - - - - - 60 - 16777215 - - - - 255 - - - 1 - + + + + QFrame::Raised + + + + 4 + + + + + + 10 + 0 + + + + Port + + + + + + + + 3 + 0 + + + + 1000 + + + 10000 + + + + - - - - - 60 - 16777215 - - - - 255 - - - 1 - - - - - - - Port-number - - - - - - - 1000 - - - 10000 - - - - + + + + 0 + 0 + + - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok - - spinIPFirstNibble - spinIPSecondNibble - spinIPThirdNibble - spinIPFourthNibble - spinPortNumber - + startEngineClicked() 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