do not allow to change storage folder as long as monitoring is active

This commit is contained in:
rootdarkarchon
2024-02-13 01:02:25 +01:00
committed by Loporrit
parent 739c02cf0b
commit 9122460801
2 changed files with 29 additions and 27 deletions

View File

@@ -783,7 +783,6 @@ public class SettingsUi : WindowMediatorSubscriberBase
+ UiSharedService.TooltipSeparator + "Hold CTRL to enable this button");
}
_uiShared.DrawCacheDirectorySetting();
ImGui.TextUnformatted($"Currently utilized local storage: {UiSharedService.ByteToString(_uiShared.FileCacheSize)}");
bool isLinux = Util.IsWine();

View File

@@ -594,9 +594,9 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
ImGui.InputText("Storage Folder##cache", ref cacheDirectory, 255, ImGuiInputTextFlags.ReadOnly);
ImGui.SameLine();
ImGui.PushFont(UiBuilder.IconFont);
string folderIcon = FontAwesomeIcon.Folder.ToIconString();
if (ImGui.Button(folderIcon + "##chooseCacheFolder"))
using (ImRaii.Disabled(_cacheMonitor.MareWatcher != null))
{
if (NormalizedIconButton(FontAwesomeIcon.Folder))
{
FileDialogManager.OpenFolderDialog("Pick Loporrit Storage Folder", (success, path) =>
{
@@ -612,7 +612,6 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
&& Directory.Exists(path)
&& _isDirectoryWritable
&& !_isPenumbraDirectory
&& !_isOneDrive
&& !_cacheDirectoryHasOtherFilesThanCache
&& _cacheDirectoryIsValidPath)
{
@@ -623,7 +622,11 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
}
});
}
ImGui.PopFont();
}
if (_cacheMonitor.MareWatcher != null)
{
AttachToolTip("Stop the Monitoring before changing the Storage folder. As long as monitoring is active, you cannot change the Storage folder location.");
}
if (_isPenumbraDirectory)
{