Telemetry events

* Don't trace event on exit
change 'PowertoyModuleDeleter' to not call 'module->disable();' before 'module->destroy();' so the module can distinguish between being turned off and PowerToys exiting.
Code formatting.

* uppercase for event name

* Trace on/off event for ShortcutGuide module

* Trace the 'hide' event only if the guide was visible
'on_hide()' is invoked when the module is turned off, in that case don't trace the hide event.

* Remove spaces in data field names
Remove 'ShowGuide' event since it's not providing any useful data.

* Include build number in version number
This commit is contained in:
Enrico Giordani
2019-10-22 08:11:23 +02:00
committed by GitHub
parent 5fb59cd64a
commit a07a42624b
11 changed files with 79 additions and 49 deletions

View File

@@ -88,6 +88,7 @@ void OverlayWindow::set_config(const wchar_t * config) {
void OverlayWindow::enable() {
if (!_enabled) {
Trace::EnableShortcutGuide(true);
winkey_popup = new D2DOverlayWindow();
winkey_popup->apply_overlay_opacity(((float)overlayOpacity.value)/100.0f);
winkey_popup->set_theme(theme.value);
@@ -97,8 +98,11 @@ void OverlayWindow::enable() {
_enabled = true;
}
void OverlayWindow::disable() {
void OverlayWindow::disable(bool trace_event) {
if (_enabled) {
if (trace_event) {
Trace::EnableShortcutGuide(false);
}
winkey_popup->hide();
target_state->exit();
delete target_state;
@@ -109,6 +113,10 @@ void OverlayWindow::disable() {
_enabled = false;
}
void OverlayWindow::disable() {
this->disable(true);
}
bool OverlayWindow::is_enabled() {
return _enabled;
}
@@ -142,6 +150,7 @@ void OverlayWindow::was_hidden() {
}
void OverlayWindow::destroy() {
this->disable(false);
delete this;
instance = nullptr;
}