summaryrefslogtreecommitdiffhomepage
path: root/proto-fg/ftnoir_protocol_fg_dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-04-07 21:34:40 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-04-07 21:35:02 +0200
commitbf5954132b776b19b20586b0a4b2b622ab0642ea (patch)
tree6604b65af58d37a845ecc02f62ad68eb0393c151 /proto-fg/ftnoir_protocol_fg_dialog.cpp
parentdb7248a6de07e7dacac24e1f59afe7e6fe45ba9c (diff)
proto/flightgear: dialog fixes
- add "help" button opening the right contrib directory with readme in it - use layouts in the dialog Issue: #590
Diffstat (limited to 'proto-fg/ftnoir_protocol_fg_dialog.cpp')
-rw-r--r--proto-fg/ftnoir_protocol_fg_dialog.cpp21
1 files changed, 17 insertions, 4 deletions
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 <QObject>
-#include <QFile>
#include "api/plugin-api.hpp"
+#include "opentrack-library-path.h"
+
+#include <QString>
+#include <QUrl>
+#include <QDir>
+#include <QDesktopServices>
//*******************************************************************************************************
// 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();
}