瀏覽代碼

Update check mode parameter for testing + Logging balloon popups

Source commit: 1f40c4f6acdd23df7f0b38dfd98b20be84f9b2c6
Martin Prikryl 3 年之前
父節點
當前提交
a3c84907c1

+ 4 - 0
source/windows/Setup.cpp

@@ -916,6 +916,10 @@ static bool __fastcall DoQueryUpdates(TUpdatesConfiguration & Updates, bool Coll
     {
       URL += L"&package=" + EncodeUrlString(GetPackageName());
     }
+    if (!Updates.Mode.IsEmpty())
+    {
+      URL += L"&mode=" + EncodeUrlString(Updates.Mode);
+    }
 
     AppLogFmt(L"Updates check URL: %s", (URL));
     CheckForUpdatesHTTP->URL = URL;

+ 2 - 0
source/windows/WinConfiguration.cpp

@@ -674,6 +674,7 @@ void __fastcall TWinConfiguration::Default()
   FUpdates.BetaVersions = asAuto;
   FUpdates.ShowOnStartup = true;
   FUpdates.AuthenticationEmail = L"";
+  FUpdates.Mode = EmptyStr;
   // for backward compatibility the default is decided based on value of ProxyHost
   FUpdates.ConnectionType = (TConnectionType)-1;
   FUpdates.ProxyHost = L""; // keep empty (see above)
@@ -1126,6 +1127,7 @@ THierarchicalStorage * TWinConfiguration::CreateScpStorage(bool & SessionList)
     KEY(Integer,  FUpdates.BetaVersions); \
     KEY(Bool,     FUpdates.ShowOnStartup); \
     KEY(String,   FUpdates.AuthenticationEmail); \
+    KEY(String,   FUpdates.Mode); \
     KEY(Integer,  FUpdates.ConnectionType); \
     KEY(String,   FUpdates.ProxyHost); \
     KEY(Integer,  FUpdates.ProxyPort); \

+ 2 - 1
source/windows/WinConfiguration.h

@@ -222,6 +222,7 @@ struct TUpdatesConfiguration
   TAutoSwitch BetaVersions;
   bool ShowOnStartup;
   UnicodeString AuthenticationEmail;
+  UnicodeString Mode;
   bool HaveResults;
   bool ShownResults;
   UnicodeString DotNetVersion;
@@ -230,7 +231,7 @@ struct TUpdatesConfiguration
 
   bool __fastcall operator !=(TUpdatesConfiguration & rhc)
     { return C(Period) C(LastCheck) C(ConnectionType) C(ProxyHost) C(ProxyPort)
-        C(BetaVersions) C(ShowOnStartup) C(AuthenticationEmail)
+        C(BetaVersions) C(ShowOnStartup) C(AuthenticationEmail) C(Mode)
         C(HaveResults) C(ShownResults) C(DotNetVersion)
         C(ConsoleVersion) C(Results)  0; };
 

+ 1 - 0
source/windows/WinInterface.cpp

@@ -1691,6 +1691,7 @@ void __fastcall ::TTrayIcon::PopupBalloon(UnicodeString Title,
     Timeout = 30000;
   }
   FTrayIcon->uFlags |= NIF_INFO;
+  AppLogFmt("Tray popup balloon: %s - %s", (Title, Str));
   Title = Title + TitleSeparator + AppNameString();
   StrPLCopy(FTrayIcon->szInfoTitle, Title, LENOF(FTrayIcon->szInfoTitle) - 1);
   UnicodeString Info = Str;