diff --git a/Dotnet/AppApi/Cef/AppApiCef.cs b/Dotnet/AppApi/Cef/AppApiCef.cs index 27efe3b6..50e64eae 100644 --- a/Dotnet/AppApi/Cef/AppApiCef.cs +++ b/Dotnet/AppApi/Cef/AppApiCef.cs @@ -221,5 +221,28 @@ namespace VRCX { MainForm.Instance.BeginInvoke(new MethodInvoker(() => { MainForm.Instance.SetTrayIconNotification(notify); })); } + + public override void OpenCalendarFile(string icsContent) + { + // validate content + if (!icsContent.StartsWith("BEGIN:VCALENDAR") || + !icsContent.EndsWith("END:VCALENDAR")) + throw new Exception("Invalid calendar file"); + + try + { + var tempPath = Path.Combine(Program.AppDataDirectory, "event.ics"); + File.WriteAllText(tempPath, icsContent); + Process.Start(new ProcessStartInfo + { + FileName = tempPath, + UseShellExecute = true + })?.Dispose(); + } + catch (Exception ex) + { + logger.Error(ex, "Failed to open calendar file"); + } + } } } \ No newline at end of file diff --git a/Dotnet/AppApi/Common/AppApiCommonBase.cs b/Dotnet/AppApi/Common/AppApiCommonBase.cs index 08da47eb..27336122 100644 --- a/Dotnet/AppApi/Common/AppApiCommonBase.cs +++ b/Dotnet/AppApi/Common/AppApiCommonBase.cs @@ -28,6 +28,7 @@ namespace VRCX public abstract void CopyImageToClipboard(string path); public abstract void FlashWindow(); public abstract void SetUserAgent(); + public abstract void OpenCalendarFile(string icsContent); // Folders public abstract string GetVRChatAppDataLocation(); diff --git a/Dotnet/AppApi/Electron/AppApiElectron.cs b/Dotnet/AppApi/Electron/AppApiElectron.cs index a491c1be..c59dab33 100644 --- a/Dotnet/AppApi/Electron/AppApiElectron.cs +++ b/Dotnet/AppApi/Electron/AppApiElectron.cs @@ -147,5 +147,9 @@ namespace VRCX public override void SetTrayIconNotification(bool notify) { } + + public override void OpenCalendarFile(string icsContent) + { + } } } \ No newline at end of file diff --git a/src/components/NavMenu.vue b/src/components/NavMenu.vue index 32f05b0a..6b075553 100644 --- a/src/components/NavMenu.vue +++ b/src/components/NavMenu.vue @@ -7,7 +7,8 @@ :width="50" :stroke-width="3" :percentage="updateProgress" - :format="updateProgressText"> + :format="updateProgressText" + style="padding: 7px">