Allow trayicon without server
This adds support for starting the trayicon even if there is no server. The trayicon will start up in a disconnected state and stay like that until it manages to connect. This fixes Support TrayIcon running with no connection #5993
This commit is contained in:
@@ -102,7 +102,7 @@ namespace Duplicati.GUI.TrayIcon
|
||||
private long m_lastDataUpdateId = -1;
|
||||
private bool m_disableTrayIconLogin;
|
||||
|
||||
private volatile IServerStatus m_status;
|
||||
private volatile IServerStatus m_status = new ServerStatusImpl(LiveControlState.Paused, SuggestedStatusIcon.Disconnected, 0, 0, 0);
|
||||
|
||||
private volatile bool m_shutdown = false;
|
||||
private volatile Thread m_requestThread;
|
||||
|
||||
@@ -214,10 +214,8 @@ No password provided, unable to connect to server, exiting");
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault;
|
||||
using (Connection = new HttpServerConnection(serverURL, password, passwordSource, disableTrayIconLogin, acceptedHostCertificate, options))
|
||||
{
|
||||
// Make sure we have the latest status
|
||||
// This will throw an exception if the server is not running,
|
||||
// or the password is incorrect
|
||||
Connection.UpdateStatus().Await();
|
||||
// Make sure we have the latest status, but don't care if it fails
|
||||
Connection.UpdateStatus().FireAndForget();
|
||||
|
||||
using (var tk = RunTrayIcon())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user