1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-10 17:34:07 +02:00

Fix reinstantiating AnalyticsManager when restoring from tray & test stuff

This commit is contained in:
chylex 2017-12-31 05:01:23 +01:00
parent f67bf27db2
commit 527f3cab4c
3 changed files with 10 additions and 5 deletions

View File

@ -99,6 +99,10 @@ public FormBrowser(UpdaterSettings updaterSettings){
this.updates.UpdateAccepted += updates_UpdateAccepted;
this.updates.UpdateDismissed += updates_UpdateDismissed;
if (Config.AllowDataCollection){
analytics = new AnalyticsManager(this, plugins, Program.AnalyticsFilePath);
}
RestoreWindow();
}
@ -118,10 +122,6 @@ private void RestoreWindow(){
Config.BrowserWindow.Restore(this, true);
prevState = WindowState;
isLoaded = true;
if (Config.AllowDataCollection){
analytics = new AnalyticsManager(this, plugins, Program.AnalyticsFilePath);
}
}
private void UpdateTrayIcon(){

View File

@ -94,6 +94,11 @@ private void SendReport(){
Task.Factory.StartNew(() => {
AnalyticsReport report = AnalyticsReportGenerator.Create(File, info, plugins);
#if DEBUG
System.Diagnostics.Debugger.Break();
#endif
BrowserUtils.CreateWebClient().UploadValues(CollectionUrl, "POST", report.ToNameValueCollection());
}).ContinueWith(task => browser.InvokeAsyncSafe(() => {
if (task.Status == TaskStatus.RanToCompletion){

View File

@ -280,7 +280,7 @@ public static ExternalInfo From(Form form){
return new ExternalInfo();
}
else{
Screen screen = Screen.FromControl(form);
Screen screen = Screen.FromControl(form); // works on multi-monitor setups even in tray
int dpi;
using(Graphics graphics = form.CreateGraphics()){