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:
parent
f67bf27db2
commit
527f3cab4c
Core
@ -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(){
|
||||
|
@ -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){
|
||||
|
@ -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()){
|
||||
|
Loading…
Reference in New Issue
Block a user