mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Settings telemetry for PT Run (#10328)
This commit is contained in:
@@ -21,7 +21,7 @@ namespace PowerLauncher.Helper
|
||||
{
|
||||
if (eventHandle.WaitOne())
|
||||
{
|
||||
Log.Info("Successfully waited for POWER_LAUNCHER_SHARED_EVENT", MethodBase.GetCurrentMethod().DeclaringType);
|
||||
Log.Info($"Successfully waited for {eventName}", MethodBase.GetCurrentMethod().DeclaringType);
|
||||
Application.Current.Dispatcher.Invoke(callback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,18 @@
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using System.Windows.Automation.Peers;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using interop;
|
||||
using Microsoft.PowerLauncher.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using PowerLauncher.Helper;
|
||||
using PowerLauncher.Plugin;
|
||||
using PowerLauncher.Telemetry.Events;
|
||||
using PowerLauncher.ViewModel;
|
||||
using Wox.Infrastructure.UserSettings;
|
||||
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
|
||||
@@ -40,6 +44,21 @@ namespace PowerLauncher
|
||||
|
||||
_firstDeleteTimer.Elapsed += CheckForFirstDelete;
|
||||
_firstDeleteTimer.Interval = 1000;
|
||||
NativeEventWaiter.WaitForEventLoop(Constants.RunSendSettingsTelemetryEvent(), SendSettingsTelemetry);
|
||||
}
|
||||
|
||||
private void SendSettingsTelemetry()
|
||||
{
|
||||
Log.Info("Send Run settings telemetry", this.GetType());
|
||||
var plugins = PluginManager.AllPlugins.ToDictionary(x => x.Metadata.Name, x => new PluginModel()
|
||||
{
|
||||
Disabled = x.Metadata.Disabled,
|
||||
ActionKeyword = x.Metadata.ActionKeyword,
|
||||
IsGlobal = x.Metadata.IsGlobal,
|
||||
});
|
||||
|
||||
var telemetryEvent = new RunPluginsSettingsEvent(plugins);
|
||||
PowerToysTelemetry.Log.WriteEvent(telemetryEvent);
|
||||
}
|
||||
|
||||
private void CheckForFirstDelete(object sender, ElapsedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user