From 1171842c5df3ed1c396d572b1022018250b1926c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 13 Apr 2019 19:02:25 +0200 Subject: tracker/kinect: display license terms --- tracker-kinect-face/kinect_face_settings.cpp | 27 +++++++++++++-------------- tracker-kinect-face/kinect_face_settings.h | 5 +---- tracker-kinect-face/lang/nl_NL.ts | 7 +++++++ tracker-kinect-face/lang/ru_RU.ts | 7 +++++++ tracker-kinect-face/lang/stub.ts | 7 +++++++ tracker-kinect-face/lang/zh_CN.ts | 7 +++++++ 6 files changed, 42 insertions(+), 18 deletions(-) diff --git a/tracker-kinect-face/kinect_face_settings.cpp b/tracker-kinect-face/kinect_face_settings.cpp index ebdf22cc..d8012aa3 100644 --- a/tracker-kinect-face/kinect_face_settings.cpp +++ b/tracker-kinect-face/kinect_face_settings.cpp @@ -10,30 +10,29 @@ #include "kinect_face_tracker.h" #include "api/plugin-api.hpp" #include "compat/math-imports.hpp" - -#include +#include "compat/library-path.hpp" #include -#include +#include +#include +#include +#include KinectFaceSettings::KinectFaceSettings() { ui.setupUi(this); - connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); - connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); -} + connect(ui.buttonBox, &QDialogButtonBox::accepted, this, &KinectFaceSettings::close); + connect(ui.buttonBox, &QDialogButtonBox::rejected, this, &KinectFaceSettings::close); -void KinectFaceSettings::doOK() -{ - //s.b->save(); - close(); -} + static const QUrl path {"file:///" + application_base_path() + OPENTRACK_DOC_PATH "/3rdparty-notices/Kinect-V2-SDK-Eula.rtf" }; -void KinectFaceSettings::doCancel() -{ - close(); + connect(ui.buttonBox, &QDialogButtonBox::helpRequested, [] { + QDesktopServices::openUrl(path); + }); + + ui.buttonBox->addButton(tr("Kinect license"), QDialogButtonBox::HelpRole); } OPENTRACK_DECLARE_TRACKER(KinectFaceTracker, KinectFaceSettings, KinectFaceMetadata) diff --git a/tracker-kinect-face/kinect_face_settings.h b/tracker-kinect-face/kinect_face_settings.h index 6a828969..40af1eb7 100644 --- a/tracker-kinect-face/kinect_face_settings.h +++ b/tracker-kinect-face/kinect_face_settings.h @@ -11,19 +11,16 @@ #include "compat/macros.hpp" #include "api/plugin-api.hpp" - class KinectFaceSettings : public ITrackerDialog { Q_OBJECT Ui::KinectFaceUi ui; + public: KinectFaceSettings(); void register_tracker(ITracker *) override {} void unregister_tracker() override {} -private slots: - void doOK(); - void doCancel(); }; class KinectFaceMetadata : public Metadata diff --git a/tracker-kinect-face/lang/nl_NL.ts b/tracker-kinect-face/lang/nl_NL.ts index 9d0a713b..fb421cd4 100644 --- a/tracker-kinect-face/lang/nl_NL.ts +++ b/tracker-kinect-face/lang/nl_NL.ts @@ -8,6 +8,13 @@ + + KinectFaceSettings + + Kinect license + + + KinectFaceUi diff --git a/tracker-kinect-face/lang/ru_RU.ts b/tracker-kinect-face/lang/ru_RU.ts index 2d5fc446..47531728 100644 --- a/tracker-kinect-face/lang/ru_RU.ts +++ b/tracker-kinect-face/lang/ru_RU.ts @@ -8,6 +8,13 @@ + + KinectFaceSettings + + Kinect license + + + KinectFaceUi diff --git a/tracker-kinect-face/lang/stub.ts b/tracker-kinect-face/lang/stub.ts index 6ebeb02c..37ac0d60 100644 --- a/tracker-kinect-face/lang/stub.ts +++ b/tracker-kinect-face/lang/stub.ts @@ -8,6 +8,13 @@ + + KinectFaceSettings + + Kinect license + + + KinectFaceUi diff --git a/tracker-kinect-face/lang/zh_CN.ts b/tracker-kinect-face/lang/zh_CN.ts index 6ebeb02c..37ac0d60 100644 --- a/tracker-kinect-face/lang/zh_CN.ts +++ b/tracker-kinect-face/lang/zh_CN.ts @@ -8,6 +8,13 @@ + + KinectFaceSettings + + Kinect license + + + KinectFaceUi -- cgit v1.2.3