add some info texts, especialy for novice users to avoid some common misunderstandings. closes #46, closes #47

This commit is contained in:
Philipp Crocoll
2018-01-23 23:09:17 +01:00
parent c4f8af2311
commit b993be4658
15 changed files with 1257 additions and 996 deletions

View File

@@ -28,7 +28,12 @@ namespace keepass2android.Io
get { yield return "content"; }
}
public void Delete(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return true; }
}
public void Delete(IOConnectionInfo ioc)
{
throw new NotImplementedException();
}

View File

@@ -59,7 +59,12 @@ namespace keepass2android.Io
public abstract IEnumerable<string> SupportedProtocols { get; }
public void Delete(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return true; }
}
public void Delete(IOConnectionInfo ioc)
{
//todo check if directory
IOConnection.DeleteFile(ioc);

View File

@@ -84,7 +84,12 @@ namespace keepass2android.Io
public IEnumerable<string> SupportedProtocols { get { return _cachedStorage.SupportedProtocols; } }
public void DeleteFile(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return _cachedStorage.UserShouldBackup; }
}
public void DeleteFile(IOConnectionInfo ioc)
{
if (IsCached(ioc))
{

View File

@@ -10,7 +10,11 @@ namespace keepass2android.Io
{
}
public override bool UserShouldBackup
{
get { return false; }
}
}
public partial class DropboxAppFolderFileStorage: JavaFileStorage
@@ -20,8 +24,12 @@ namespace keepass2android.Io
{
}
}
public override bool UserShouldBackup
{
get { return false; }
}
}
}
#endif

View File

@@ -22,6 +22,10 @@ namespace keepass2android.Io
}
public override bool UserShouldBackup
{
get { return false; }
}
}
}
#endif

View File

@@ -46,9 +46,14 @@ namespace keepass2android.Io
/// <summary>
/// returns the protocol ids supported by this FileStorage. Can return pseudo-protocols like "dropbox" or real protocols like "ftp"
/// </summary>
IEnumerable<string> SupportedProtocols { get; }
IEnumerable<string> SupportedProtocols { get; }
/// <summary>
/// <summary>
/// returns true if users should backup files on this file storage (if the file is important). Can be false for cloud providers with built-in versioning or backups.
/// </summary>
bool UserShouldBackup { get; }
/// <summary>
/// Deletes the given file or directory.
/// </summary>
void Delete(IOConnectionInfo ioc);

View File

@@ -22,9 +22,10 @@ namespace keepass2android.Io
protected string Protocol { get { return _jfs.ProtocolId; } }
public virtual IEnumerable<string> SupportedProtocols { get { yield return Protocol; } }
public abstract bool UserShouldBackup { get; }
private readonly IJavaFileStorage _jfs;
private readonly IJavaFileStorage _jfs;
private readonly IKp2aApp _app;
public JavaFileStorage(IJavaFileStorage jfs, IKp2aApp app)

View File

@@ -161,7 +161,12 @@ namespace keepass2android.Io
}
}
public void Delete(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return true; }
}
public void Delete(IOConnectionInfo ioc)
{
try
{

View File

@@ -32,7 +32,12 @@ namespace keepass2android.Io
get { return _baseStorage.SupportedProtocols; }
}
public void Delete(IOConnectionInfo ioc)
public bool UserShouldBackup
{
get { return _baseStorage.UserShouldBackup; }
}
public void Delete(IOConnectionInfo ioc)
{
_baseStorage.Delete(ioc);
}

View File

@@ -33,6 +33,11 @@ namespace keepass2android.Io
yield return "onedrive";
}
}
public override bool UserShouldBackup
{
get { return false; }
}
}
}
#endif

View File

@@ -10,7 +10,11 @@ namespace keepass2android.Io
{
}
public override bool UserShouldBackup
{
get { return true; }
}
}

View File

@@ -33,7 +33,12 @@ namespace keepass2android.Io
}
}
public static string Owncloud2Webdav(string owncloudUrl)
public override bool UserShouldBackup
{
get { return true; }
}
public static string Owncloud2Webdav(string owncloudUrl)
{
string owncloudPrefix = "owncloud://";
if (owncloudUrl.StartsWith(owncloudPrefix))