mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 13:33:27 +02:00
Make activity logging from scripts only available for certain events
This commit is contained in:
parent
bce05df56b
commit
c2ebcd1f77
4 changed files with 22 additions and 8 deletions
|
@ -12,8 +12,16 @@
|
||||||
#include "UserActivityLoggerScriptingInterface.h"
|
#include "UserActivityLoggerScriptingInterface.h"
|
||||||
#include "UserActivityLogger.h"
|
#include "UserActivityLogger.h"
|
||||||
|
|
||||||
void UserActivityLoggerScriptingInterface::logAction(QString action, QVariantMap details) const {
|
void UserActivityLoggerScriptingInterface::enabledEdit() {
|
||||||
|
logAction("enabled_edit");
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserActivityLoggerScriptingInterface::openedMarketplace() {
|
||||||
|
logAction("opened_marketplace");
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserActivityLoggerScriptingInterface::logAction(QString action, QJsonObject details) {
|
||||||
QMetaObject::invokeMethod(&UserActivityLogger::getInstance(), "logAction",
|
QMetaObject::invokeMethod(&UserActivityLogger::getInstance(), "logAction",
|
||||||
Q_ARG(QString, action),
|
Q_ARG(QString, action),
|
||||||
Q_ARG(QJsonObject, QJsonObject::fromVariantMap(details)));
|
Q_ARG(QJsonObject, details));
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,14 +13,18 @@
|
||||||
#define hifi_UserActivityLoggerScriptingInterface_h
|
#define hifi_UserActivityLoggerScriptingInterface_h
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVariantMap>
|
#include <QJsonObject>
|
||||||
|
|
||||||
class QScriptValue;
|
#include <DependencyManager.h>
|
||||||
|
|
||||||
class UserActivityLoggerScriptingInterface : public QObject {
|
class UserActivityLoggerScriptingInterface : public QObject, public Dependency {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void logAction(QString action, QVariantMap details) const;
|
Q_INVOKABLE void enabledEdit();
|
||||||
|
Q_INVOKABLE void openedMarketplace();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void logAction(QString action, QJsonObject details = {});
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_UserActivityLoggerScriptingInterface_h
|
#endif // hifi_UserActivityLoggerScriptingInterface_h
|
||||||
|
|
|
@ -340,7 +340,7 @@ var toolBar = (function() {
|
||||||
Messages.sendLocalMessage("edit-events", JSON.stringify({
|
Messages.sendLocalMessage("edit-events", JSON.stringify({
|
||||||
enabled: active
|
enabled: active
|
||||||
}));
|
}));
|
||||||
UserActivityLogger.logAction("enabled_edit");
|
UserActivityLogger.enabledEdit();
|
||||||
isActive = active;
|
isActive = active;
|
||||||
if (!isActive) {
|
if (!isActive) {
|
||||||
entityListTool.setVisible(false);
|
entityListTool.setVisible(false);
|
||||||
|
|
|
@ -37,6 +37,8 @@ function showExamples(marketplaceID) {
|
||||||
print("setting examples URL to " + url);
|
print("setting examples URL to " + url);
|
||||||
examplesWindow.setURL(url);
|
examplesWindow.setURL(url);
|
||||||
examplesWindow.setVisible(true);
|
examplesWindow.setVisible(true);
|
||||||
|
|
||||||
|
UserActivityLogger.openedMarketplace();
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideExamples() {
|
function hideExamples() {
|
||||||
|
|
Loading…
Reference in a new issue