From f03b453c6f9167dc51e7a24aa8485b35a0354b43 Mon Sep 17 00:00:00 2001 From: "Jerry (Xinyu Hou)" Date: Thu, 29 Oct 2015 15:55:55 -0700 Subject: [PATCH] Pass Linux OS info during notification #4932 --- src/gui/src/CoreInterface.cpp | 11 ++++++++++- src/gui/src/CoreInterface.h | 2 +- src/gui/src/SetupWizard.cpp | 6 ++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/gui/src/CoreInterface.cpp b/src/gui/src/CoreInterface.cpp index 4705b8cc..9d24a3df 100644 --- a/src/gui/src/CoreInterface.cpp +++ b/src/gui/src/CoreInterface.cpp @@ -18,6 +18,7 @@ #include "CoreInterface.h" #include "CommandProcess.h" +#include "QUtility.h" #include #include @@ -73,9 +74,17 @@ QString CoreInterface::checkSubscription() return run(args); } -QString CoreInterface::notifyActivation(const QString& input) +QString CoreInterface::notifyActivation(const QString& action) { QStringList args("--notify-activation"); + + QString input(action + ":" + hash(getFirstMacAddress())); + QString os= getOSInformation(); + if (!os.isEmpty()) { + input.append(":").append(os); + } + input.append("\n"); + return run(args, input); } diff --git a/src/gui/src/CoreInterface.h b/src/gui/src/CoreInterface.h index 4949bddc..004a3928 100644 --- a/src/gui/src/CoreInterface.h +++ b/src/gui/src/CoreInterface.h @@ -31,6 +31,6 @@ public: QString getSubscriptionFilename(); QString activateSerial(const QString& serial); QString checkSubscription(); - QString notifyActivation(const QString& input); + QString notifyActivation(const QString& action); QString run(const QStringList& args, const QString& input = ""); }; diff --git a/src/gui/src/SetupWizard.cpp b/src/gui/src/SetupWizard.cpp index bbe14328..c45f30a0 100644 --- a/src/gui/src/SetupWizard.cpp +++ b/src/gui/src/SetupWizard.cpp @@ -217,16 +217,14 @@ void SetupWizard::accept() { appConfig.setSerialKey(m_pLineEditSerialKey->text()); - QString info("serial:" + hash(getFirstMacAddress()) + "\n"); CoreInterface coreInterface; - coreInterface.notifyActivation(info); + coreInterface.notifyActivation("serial"); } if (m_pRadioButtonSkip->isChecked()) { - QString info("skip:" + hash(getFirstMacAddress()) + "\n"); CoreInterface coreInterface; - coreInterface.notifyActivation(info); + coreInterface.notifyActivation("skip"); } m_MainWindow.setEdition(m_Edition);