display reason why file is read only when first opening a database

This commit is contained in:
Philipp Crocoll
2016-01-13 05:13:02 +01:00
parent cd5fc13939
commit 64e265b2be
10 changed files with 86 additions and 13 deletions

View File

@@ -370,14 +370,24 @@ namespace keepass2android.Io
}
public bool IsReadOnly(IOConnectionInfo ioc)
public bool IsReadOnly(IOConnectionInfo ioc, OptionalOut<UiStringKey> reason = null)
{
if (ioc.IsLocalFile())
{
if (IsLocalFileFlaggedReadOnly(ioc))
{
if (reason != null)
reason.Result = UiStringKey.ReadOnlyReason_ReadOnlyFlag;
return true;
}
if (IsReadOnlyBecauseKitkatRestrictions(ioc))
{
if (reason != null)
reason.Result = UiStringKey.ReadOnlyReason_ReadOnlyKitKat;
return true;
}
return false;
}