Pass Linux OS info during notification #4932

This commit is contained in:
Jerry (Xinyu Hou) 2015-10-29 15:55:55 -07:00
parent b4563a42c4
commit f03b453c6f
3 changed files with 13 additions and 6 deletions

View File

@ -18,6 +18,7 @@
#include "CoreInterface.h" #include "CoreInterface.h"
#include "CommandProcess.h" #include "CommandProcess.h"
#include "QUtility.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QProcess> #include <QProcess>
@ -73,9 +74,17 @@ QString CoreInterface::checkSubscription()
return run(args); return run(args);
} }
QString CoreInterface::notifyActivation(const QString& input) QString CoreInterface::notifyActivation(const QString& action)
{ {
QStringList args("--notify-activation"); 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); return run(args, input);
} }

View File

@ -31,6 +31,6 @@ public:
QString getSubscriptionFilename(); QString getSubscriptionFilename();
QString activateSerial(const QString& serial); QString activateSerial(const QString& serial);
QString checkSubscription(); QString checkSubscription();
QString notifyActivation(const QString& input); QString notifyActivation(const QString& action);
QString run(const QStringList& args, const QString& input = ""); QString run(const QStringList& args, const QString& input = "");
}; };

View File

@ -217,16 +217,14 @@ void SetupWizard::accept()
{ {
appConfig.setSerialKey(m_pLineEditSerialKey->text()); appConfig.setSerialKey(m_pLineEditSerialKey->text());
QString info("serial:" + hash(getFirstMacAddress()) + "\n");
CoreInterface coreInterface; CoreInterface coreInterface;
coreInterface.notifyActivation(info); coreInterface.notifyActivation("serial");
} }
if (m_pRadioButtonSkip->isChecked()) if (m_pRadioButtonSkip->isChecked())
{ {
QString info("skip:" + hash(getFirstMacAddress()) + "\n");
CoreInterface coreInterface; CoreInterface coreInterface;
coreInterface.notifyActivation(info); coreInterface.notifyActivation("skip");
} }
m_MainWindow.setEdition(m_Edition); m_MainWindow.setEdition(m_Edition);