Fixed issue #39.
Fixed issue #41. Fixed issue #11. Refactored the way settings are stored, this means that you cannot go back to a previous version if you have used this one. A backup of the old database will be created, if you need to use a previous version. Fixed a bug in the S3 backend where the filenames would be prefixed with a slash. Moved the file time seperator char out of the file backend, and into common settings. git-svn-id: https://duplicati.googlecode.com/svn/trunk@134 59da171f-624f-0410-aa54-27559c288bec
This commit is contained in:
@@ -8,4 +8,5 @@
|
||||
<BackupTimeOffset>13h</BackupTimeOffset>
|
||||
<EncodedFilters>e:.*\\Thumbs.db</EncodedFilters>
|
||||
<IncludeSetup>true</IncludeSetup>
|
||||
<FileTimeSeperator>'</FileTimeSeperator>
|
||||
</settings>
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
-- TaskSettings becomes BackendSetting
|
||||
ALTER TABLE TaskSetting RENAME TO BackendSetting;
|
||||
|
||||
-- TaskSetting is now extensions
|
||||
CREATE TABLE "TaskExtension" (
|
||||
"ID" INTEGER PRIMARY KEY,
|
||||
"TaskID" INTEGER NULL,
|
||||
"Name" TEXT NULL,
|
||||
"Value" TEXT NULL
|
||||
);
|
||||
|
||||
-- Copy values from the Task table
|
||||
INSERT INTO TaskExtension ([TaskID], [Name], [Value]) SELECT [ID], 'Max Upload Size', [MaxUploadSize] FROM Task;
|
||||
INSERT INTO TaskExtension ([TaskID], [Name], [Value]) SELECT [ID], 'Upload bandwidth', [UploadBandwidth] FROM Task;
|
||||
INSERT INTO TaskExtension ([TaskID], [Name], [Value]) SELECT [ID], 'Download Bandwidth', [DownloadBandwidth] FROM Task;
|
||||
INSERT INTO TaskExtension ([TaskID], [Name], [Value]) SELECT [ID], 'Volume Size', [VolumeSize] FROM Task;
|
||||
INSERT INTO TaskExtension ([TaskID], [Name], [Value]) SELECT [ID], 'Thread Priority', [ThreadPriority] FROM Task;
|
||||
INSERT INTO TaskExtension ([TaskID], [Name], [Value]) SELECT [ID], 'Async Transfer', [AsyncTransfer] FROM Task;
|
||||
INSERT INTO TaskExtension ([TaskID], [Name], [Value]) SELECT [ID], 'Include Setup', [IncludeSetup] FROM Task;
|
||||
INSERT INTO TaskExtension ([TaskID], [Name], [Value]) SELECT [ID], 'Ignore Timestamps', [IgnoreTimestamps] FROM Task;
|
||||
|
||||
-- Move FileTimeSeperator into extensions
|
||||
INSERT INTO TaskExtension ([TaskID], [Name], [Value]) SELECT [TaskID], 'File Time Seperator', Value FROM BackendSetting WHERE [Name] = 'TimeSeparator';
|
||||
DELETE FROM BackendSetting WHERE [Name] = 'TimeSeparator';
|
||||
|
||||
-- Create a reduced Task table
|
||||
CREATE TABLE "TempTask" (
|
||||
"ID" INTEGER PRIMARY KEY,
|
||||
"ScheduleID" INTEGER NULL,
|
||||
"Service" TEXT NULL,
|
||||
"Encryptionkey" TEXT NULL,
|
||||
"Signaturekey" TEXT NULL,
|
||||
"SourcePath" TEXT NULL,
|
||||
"KeepFull" INTEGER NULL,
|
||||
"KeepTime" TEXT NULL,
|
||||
"FullAfter" TEXT NULL,
|
||||
"GPGEncryption" BOOLEAN NULL,
|
||||
"IncludeSetup" BOOLEAN NULL
|
||||
);
|
||||
|
||||
-- Copy values
|
||||
INSERT INTO TempTask ([ID], [ScheduleID], [Service], [EncryptionKey], [SignatureKey], [SourcePath], [KeepFull], [KeepTime], [FullAfter], [GPGEncryption], [IncludeSetup]) SELECT [ID], [ScheduleID], [Service], [EncryptionKey], [SignatureKey], [SourcePath], [KeepFull], [KeepTime], [FullAfter], [GPGEncryption], [IncludeSetup] FROM Task;
|
||||
DROP TABLE Task;
|
||||
|
||||
-- Use the new reduced table
|
||||
ALTER TABLE "TempTask" RENAME TO "Task";
|
||||
|
||||
-- Add the override table
|
||||
CREATE TABLE "TaskOverride" (
|
||||
"ID" INTEGER PRIMARY KEY,
|
||||
"TaskID" INTEGER NULL,
|
||||
"Name" TEXT NULL,
|
||||
"Value" TEXT NULL
|
||||
);
|
||||
|
||||
-- Reduce database size
|
||||
VACUUM;
|
||||
@@ -1,22 +1,15 @@
|
||||
CREATE TABLE "Task" (
|
||||
"ID" INTEGER PRIMARY KEY,
|
||||
"ScheduleID" INTEGER NULL,
|
||||
"Service" TEXT NULL,
|
||||
"Encryptionkey" TEXT NULL,
|
||||
"Signaturekey" TEXT NULL,
|
||||
"SourcePath" TEXT NULL,
|
||||
"ScheduleID" INTEGER NULL,
|
||||
"KeepFull" INTEGER NULL,
|
||||
"KeepTime" TEXT NULL,
|
||||
"MaxUploadsize" TEXT NULL,
|
||||
"UploadBandwidth" TEXT NULL,
|
||||
"DownloadBandwidth" TEXT NULL,
|
||||
"VolumeSize" TEXT NULL,
|
||||
"FullAfter" TEXT NULL,
|
||||
"ThreadPriority" TEXT NULL,
|
||||
"AsyncTransfer" BOOLEAN NULL,
|
||||
"GPGEncryption" BOOLEAN NULL,
|
||||
"IncludeSetup" BOOLEAN NULL,
|
||||
"IgnoreTimestamps" BOOLEAN NULL
|
||||
"IncludeSetup" BOOLEAN NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "Schedule" (
|
||||
@@ -28,8 +21,21 @@ CREATE TABLE "Schedule" (
|
||||
"Weekdays" TEXT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "BackendSetting" (
|
||||
"ID" INTEGER PRIMARY KEY,
|
||||
"TaskID" INTEGER NULL,
|
||||
"Name" TEXT NULL,
|
||||
"Value" TEXT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "TaskSetting" (
|
||||
CREATE TABLE "TaskExtension" (
|
||||
"ID" INTEGER PRIMARY KEY,
|
||||
"TaskID" INTEGER NULL,
|
||||
"Name" TEXT NULL,
|
||||
"Value" TEXT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE "TaskOverride" (
|
||||
"ID" INTEGER PRIMARY KEY,
|
||||
"TaskID" INTEGER NULL,
|
||||
"Name" TEXT NULL,
|
||||
@@ -80,4 +86,4 @@ CREATE TABLE "TaskFilter" (
|
||||
);
|
||||
|
||||
|
||||
INSERT INTO "Version" ("Version") VALUES (1);
|
||||
INSERT INTO "Version" ("Version") VALUES (2);
|
||||
@@ -0,0 +1,92 @@
|
||||
#region Disclaimer / License
|
||||
// Copyright (C) 2009, Kenneth Skovhede
|
||||
// http://www.hexad.dk, opensource@hexad.dk
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
#endregion
|
||||
/// <metadata>
|
||||
/// <creator>This class was created by DataClassFileBuilder (LightDatamodel)</creator>
|
||||
/// <provider name="System.Data.LightDatamodel.SQLiteDataProvider" connectionstring="Version=3;Data Source=D:\Dokumenter\duplicati\Duplicati\GUI\Datamodel\Duplicati.sqlite;" />
|
||||
/// <type>Table</type>
|
||||
/// <namespace>Duplicati.Datamodel</namespace>
|
||||
/// <name>BackendSetting</name>
|
||||
/// <sql></sql>
|
||||
/// </metadata>
|
||||
|
||||
using System.Data.LightDatamodel;
|
||||
using System.Data.LightDatamodel.DataClassAttributes;
|
||||
|
||||
namespace Duplicati.Datamodel
|
||||
{
|
||||
|
||||
[DatabaseTable("BackendSetting")]
|
||||
public partial class BackendSetting : DataClassBase
|
||||
{
|
||||
|
||||
#region " private members "
|
||||
|
||||
[AutoIncrement, PrimaryKey, DatabaseField("ID")]
|
||||
private System.Int64 m_ID = long.MinValue;
|
||||
[Relation("BackendSettingTask", typeof(Task), "ID"), DatabaseField("TaskID")]
|
||||
private System.Int64 m_TaskID = long.MinValue;
|
||||
[DatabaseField("Name")]
|
||||
private System.String m_Name = "";
|
||||
[DatabaseField("Value")]
|
||||
private System.String m_Value = "";
|
||||
#endregion
|
||||
|
||||
#region " properties "
|
||||
|
||||
public System.Int64 ID
|
||||
{
|
||||
get{return m_ID;}
|
||||
set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.Int64 TaskID
|
||||
{
|
||||
get{return m_TaskID;}
|
||||
set{object oldvalue = m_TaskID;OnBeforeDataChange(this, "TaskID", oldvalue, value);m_TaskID = value;OnAfterDataChange(this, "TaskID", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Name
|
||||
{
|
||||
get{return m_Name;}
|
||||
set{object oldvalue = m_Name;OnBeforeDataChange(this, "Name", oldvalue, value);m_Name = value;OnAfterDataChange(this, "Name", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Value
|
||||
{
|
||||
get{return m_Value;}
|
||||
set{object oldvalue = m_Value;OnBeforeDataChange(this, "Value", oldvalue, value);m_Value = value;OnAfterDataChange(this, "Value", oldvalue, value);}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region " referenced properties "
|
||||
|
||||
[Affects(typeof(Task))]
|
||||
public Task Task
|
||||
{
|
||||
get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject<Task>("BackendSettingTask", this); }
|
||||
set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("BackendSettingTask", this, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -42,20 +42,20 @@ namespace Duplicati.Datamodel.Backends
|
||||
|
||||
public string Username
|
||||
{
|
||||
get { return m_owner.Settings[USERNAME]; }
|
||||
set { m_owner.Settings[USERNAME] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[USERNAME]; }
|
||||
set { m_owner.BackendSettingsLookup[USERNAME] = value; }
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get { return m_owner.Settings[PASSWORD]; }
|
||||
set { m_owner.Settings[PASSWORD] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[PASSWORD]; }
|
||||
set { m_owner.BackendSettingsLookup[PASSWORD] = value; }
|
||||
}
|
||||
|
||||
public string Host
|
||||
{
|
||||
get { return m_owner.Settings[HOST]; }
|
||||
set { m_owner.Settings[HOST] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[HOST]; }
|
||||
set { m_owner.BackendSettingsLookup[HOST] = value; }
|
||||
}
|
||||
|
||||
public int Port
|
||||
@@ -63,29 +63,22 @@ namespace Duplicati.Datamodel.Backends
|
||||
get
|
||||
{
|
||||
int portn = 21;
|
||||
int.TryParse(m_owner.Settings[PORT], out portn);
|
||||
int.TryParse(m_owner.BackendSettingsLookup[PORT], out portn);
|
||||
return portn;
|
||||
}
|
||||
set { m_owner.Settings[PORT] = value.ToString(); }
|
||||
set { m_owner.BackendSettingsLookup[PORT] = value.ToString(); }
|
||||
}
|
||||
|
||||
public string Folder
|
||||
{
|
||||
get { return m_owner.Settings[FOLDER]; }
|
||||
set { m_owner.Settings[FOLDER] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[FOLDER]; }
|
||||
set { m_owner.BackendSettingsLookup[FOLDER] = value; }
|
||||
}
|
||||
|
||||
public bool Passive
|
||||
{
|
||||
get
|
||||
{
|
||||
bool res = false;
|
||||
if (!bool.TryParse(m_owner.Settings[PASSIVE], out res))
|
||||
return true;
|
||||
else
|
||||
return res;
|
||||
}
|
||||
set { m_owner.Settings[PASSIVE] = value.ToString(); }
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.BackendSettingsLookup[PASSIVE], false); }
|
||||
set { m_owner.BackendSettingsLookup[PASSIVE] = value.ToString(); }
|
||||
}
|
||||
|
||||
#region IBackend Members
|
||||
|
||||
@@ -27,8 +27,6 @@ namespace Duplicati.Datamodel.Backends
|
||||
public class File : IBackend
|
||||
{
|
||||
private const string DESTINATION_FOLDER = "Destination";
|
||||
private const string TIME_SEPARATOR = "TimeSeparator";
|
||||
|
||||
private const string USERNAME = "Username";
|
||||
private const string PASSWORD = "Password";
|
||||
|
||||
@@ -37,32 +35,26 @@ namespace Duplicati.Datamodel.Backends
|
||||
public File(Task owner)
|
||||
{
|
||||
m_owner = owner;
|
||||
if (this.TimeSeparator == null)
|
||||
this.TimeSeparator = "'";
|
||||
if (m_owner.Extensions.FileTimeSeperator == null)
|
||||
m_owner.Extensions.FileTimeSeperator = "'";
|
||||
}
|
||||
|
||||
public string DestinationFolder
|
||||
{
|
||||
get { return m_owner.Settings[DESTINATION_FOLDER]; }
|
||||
set { m_owner.Settings[DESTINATION_FOLDER] = value; }
|
||||
}
|
||||
|
||||
public string TimeSeparator
|
||||
{
|
||||
get { return m_owner.Settings[TIME_SEPARATOR]; }
|
||||
set { m_owner.Settings[TIME_SEPARATOR] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[DESTINATION_FOLDER]; }
|
||||
set { m_owner.BackendSettingsLookup[DESTINATION_FOLDER] = value; }
|
||||
}
|
||||
|
||||
public string Username
|
||||
{
|
||||
get { return m_owner.Settings[USERNAME]; }
|
||||
set { m_owner.Settings[USERNAME] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[USERNAME]; }
|
||||
set { m_owner.BackendSettingsLookup[USERNAME] = value; }
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get { return m_owner.Settings[PASSWORD]; }
|
||||
set { m_owner.Settings[PASSWORD] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[PASSWORD]; }
|
||||
set { m_owner.BackendSettingsLookup[PASSWORD] = value; }
|
||||
}
|
||||
|
||||
#region IBackend Members
|
||||
@@ -77,7 +69,6 @@ namespace Duplicati.Datamodel.Backends
|
||||
|
||||
public void GetOptions(Dictionary<string, string> options)
|
||||
{
|
||||
options["time-separator"] = this.TimeSeparator;
|
||||
if (!string.IsNullOrEmpty(this.Password))
|
||||
options["ftp-password"] = this.Password;
|
||||
}
|
||||
|
||||
@@ -45,58 +45,44 @@ namespace Duplicati.Datamodel.Backends
|
||||
|
||||
public string AccessID
|
||||
{
|
||||
get { return m_owner.Settings[ACCESS_ID]; }
|
||||
set { m_owner.Settings[ACCESS_ID] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[ACCESS_ID]; }
|
||||
set { m_owner.BackendSettingsLookup[ACCESS_ID] = value; }
|
||||
}
|
||||
|
||||
public string AccessKey
|
||||
{
|
||||
get { return m_owner.Settings[ACCESS_KEY]; }
|
||||
set { m_owner.Settings[ACCESS_KEY] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[ACCESS_KEY]; }
|
||||
set { m_owner.BackendSettingsLookup[ACCESS_KEY] = value; }
|
||||
}
|
||||
|
||||
public string BucketName
|
||||
{
|
||||
get { return m_owner.Settings[BUCKET_NAME]; }
|
||||
set { m_owner.Settings[BUCKET_NAME] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[BUCKET_NAME]; }
|
||||
set { m_owner.BackendSettingsLookup[BUCKET_NAME] = value; }
|
||||
}
|
||||
|
||||
public string ServerUrl
|
||||
{
|
||||
get { return m_owner.Settings[SERVER_URL]; }
|
||||
set { m_owner.Settings[SERVER_URL] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[SERVER_URL]; }
|
||||
set { m_owner.BackendSettingsLookup[SERVER_URL] = value; }
|
||||
}
|
||||
|
||||
public string Prefix
|
||||
{
|
||||
get { return m_owner.Settings[PREFIX]; }
|
||||
set { m_owner.Settings[PREFIX] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[PREFIX]; }
|
||||
set { m_owner.BackendSettingsLookup[PREFIX] = value; }
|
||||
}
|
||||
|
||||
public bool UseEuroBucket
|
||||
{
|
||||
get
|
||||
{
|
||||
bool v;
|
||||
if (bool.TryParse(m_owner.Settings[EUROBUCKET], out v))
|
||||
return v;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set { m_owner.Settings[EUROBUCKET] = value.ToString(); }
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.BackendSettingsLookup[EUROBUCKET], false); }
|
||||
set { m_owner.BackendSettingsLookup[EUROBUCKET] = value.ToString(); }
|
||||
}
|
||||
|
||||
public bool UseSubdomainStrategy
|
||||
{
|
||||
get
|
||||
{
|
||||
bool v;
|
||||
if (bool.TryParse(m_owner.Settings[SUBDOMAIN], out v))
|
||||
return v;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set { m_owner.Settings[SUBDOMAIN] = value.ToString(); }
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.BackendSettingsLookup[SUBDOMAIN], false); }
|
||||
set { m_owner.BackendSettingsLookup[SUBDOMAIN] = value.ToString(); }
|
||||
}
|
||||
|
||||
#region IBackend Members
|
||||
|
||||
@@ -42,52 +42,45 @@ namespace Duplicati.Datamodel.Backends
|
||||
|
||||
public string Username
|
||||
{
|
||||
get { return m_owner.Settings[USERNAME]; }
|
||||
set { m_owner.Settings[USERNAME] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[USERNAME]; }
|
||||
set { m_owner.BackendSettingsLookup[USERNAME] = value; }
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get { return m_owner.Settings[PASSWORD]; }
|
||||
set { m_owner.Settings[PASSWORD] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[PASSWORD]; }
|
||||
set { m_owner.BackendSettingsLookup[PASSWORD] = value; }
|
||||
}
|
||||
|
||||
public string Host
|
||||
{
|
||||
get { return m_owner.Settings[HOST]; }
|
||||
set { m_owner.Settings[HOST] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[HOST]; }
|
||||
set { m_owner.BackendSettingsLookup[HOST] = value; }
|
||||
}
|
||||
|
||||
public int Port
|
||||
{
|
||||
get
|
||||
{
|
||||
string port = m_owner.Settings[PORT];
|
||||
string port = m_owner.BackendSettingsLookup[PORT];
|
||||
int portn;
|
||||
if (!int.TryParse(port, out portn))
|
||||
portn = 22;
|
||||
return portn;
|
||||
}
|
||||
set { m_owner.Settings[PORT] = value.ToString(); }
|
||||
set { m_owner.BackendSettingsLookup[PORT] = value.ToString(); }
|
||||
}
|
||||
|
||||
public string Folder
|
||||
{
|
||||
get { return m_owner.Settings[FOLDER]; }
|
||||
set { m_owner.Settings[FOLDER] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[FOLDER]; }
|
||||
set { m_owner.BackendSettingsLookup[FOLDER] = value; }
|
||||
}
|
||||
|
||||
public bool Passwordless
|
||||
{
|
||||
get
|
||||
{
|
||||
bool v;
|
||||
if (bool.TryParse(m_owner.Settings[PASWORDLESS], out v))
|
||||
return v;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set { m_owner.Settings[PASWORDLESS] = value.ToString(); }
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.BackendSettingsLookup[PASWORDLESS], false);}
|
||||
set { m_owner.BackendSettingsLookup[PASWORDLESS] = value.ToString(); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
#region Disclaimer / License
|
||||
// Copyright (C) 2009, Kenneth Skovhede
|
||||
// http://www.hexad.dk, opensource@hexad.dk
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
#endregion
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -24,20 +43,20 @@ namespace Duplicati.Datamodel.Backends
|
||||
|
||||
public string Username
|
||||
{
|
||||
get { return m_owner.Settings[USERNAME]; }
|
||||
set { m_owner.Settings[USERNAME] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[USERNAME]; }
|
||||
set { m_owner.BackendSettingsLookup[USERNAME] = value; }
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get { return m_owner.Settings[PASSWORD]; }
|
||||
set { m_owner.Settings[PASSWORD] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[PASSWORD]; }
|
||||
set { m_owner.BackendSettingsLookup[PASSWORD] = value; }
|
||||
}
|
||||
|
||||
public string Host
|
||||
{
|
||||
get { return m_owner.Settings[HOST]; }
|
||||
set { m_owner.Settings[HOST] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[HOST]; }
|
||||
set { m_owner.BackendSettingsLookup[HOST] = value; }
|
||||
}
|
||||
|
||||
public int Port
|
||||
@@ -45,42 +64,28 @@ namespace Duplicati.Datamodel.Backends
|
||||
get
|
||||
{
|
||||
int portn = 80;
|
||||
int.TryParse(m_owner.Settings[PORT], out portn);
|
||||
int.TryParse(m_owner.BackendSettingsLookup[PORT], out portn);
|
||||
return portn;
|
||||
}
|
||||
set { m_owner.Settings[PORT] = value.ToString(); }
|
||||
set { m_owner.BackendSettingsLookup[PORT] = value.ToString(); }
|
||||
}
|
||||
|
||||
public string Folder
|
||||
{
|
||||
get { return m_owner.Settings[FOLDER]; }
|
||||
set { m_owner.Settings[FOLDER] = value; }
|
||||
get { return m_owner.BackendSettingsLookup[FOLDER]; }
|
||||
set { m_owner.BackendSettingsLookup[FOLDER] = value; }
|
||||
}
|
||||
|
||||
public bool IntegratedAuthentication
|
||||
{
|
||||
get
|
||||
{
|
||||
bool res = false;
|
||||
if (!bool.TryParse(m_owner.Settings[INTEGRATED_AUTHENTICATION], out res))
|
||||
return false;
|
||||
else
|
||||
return res;
|
||||
}
|
||||
set { m_owner.Settings[INTEGRATED_AUTHENTICATION] = value.ToString(); }
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.BackendSettingsLookup[INTEGRATED_AUTHENTICATION] , false); }
|
||||
set { m_owner.BackendSettingsLookup[INTEGRATED_AUTHENTICATION] = value.ToString(); }
|
||||
}
|
||||
|
||||
public bool ForceDigestAuthentication
|
||||
{
|
||||
get
|
||||
{
|
||||
bool res = false;
|
||||
if (!bool.TryParse(m_owner.Settings[FORCE_DIGEST_AUTHENTICATION], out res))
|
||||
return false;
|
||||
else
|
||||
return res;
|
||||
}
|
||||
set { m_owner.Settings[FORCE_DIGEST_AUTHENTICATION] = value.ToString(); }
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.BackendSettingsLookup[FORCE_DIGEST_AUTHENTICATION] , false);}
|
||||
set { m_owner.BackendSettingsLookup[FORCE_DIGEST_AUTHENTICATION] = value.ToString(); }
|
||||
}
|
||||
|
||||
#region IBackend Members
|
||||
|
||||
@@ -1,120 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{B60D0993-B0C5-457A-90D9-DB6EEB33CE47}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon />
|
||||
<AssemblyKeyContainerName />
|
||||
<AssemblyName>Datamodel</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile>LightDatamodel.snk</AssemblyOriginatorKeyFile>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Duplicati.Datamodel</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject />
|
||||
<FileUpgradeFlags />
|
||||
<UpgradeBackupLocation />
|
||||
<SignAssembly>true</SignAssembly>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>none</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.XML">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="Backends\File.cs" />
|
||||
<Compile Include="Backends\IBackend.cs" />
|
||||
<Compile Include="Backends\S3.cs" />
|
||||
<Compile Include="Backends\SSH.cs" />
|
||||
<Compile Include="SettingsHelper.cs" />
|
||||
<Compile Include="Task.Extension.cs" />
|
||||
<Compile Include="Task.cs" />
|
||||
<Compile Include="Schedule.cs" />
|
||||
<Compile Include="TaskSetting.cs" />
|
||||
<Compile Include="CommandQueue.cs" />
|
||||
<Compile Include="Log.cs" />
|
||||
<Compile Include="LogBlob.cs" />
|
||||
<Compile Include="ApplicationSettings.cs" />
|
||||
<Compile Include="ApplicationSetting.cs" />
|
||||
<Compile Include="TaskFilter.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="LightDatamodel.snk" />
|
||||
<Compile Include="Backends\FTP.cs" />
|
||||
<Compile Include="Backends\WEBDAV.cs" />
|
||||
<Compile Include="Log.Extension.cs" />
|
||||
<Compile Include="LogBlob.Extension.cs" />
|
||||
<Compile Include="Schedule.Extension.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\LightDatamodel\LightDatamodel\LightDatamodel.csproj">
|
||||
<Project>{CAE8433B-F013-474E-B7FC-4DE0D5933AD1}</Project>
|
||||
<Name>LightDatamodel</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Library\Core\Duplicati.Library.Core.csproj">
|
||||
<Project>{DE3E5D4C-51AB-4E5E-BEE8-E636CEBFBA65}</Project>
|
||||
<Name>Duplicati.Library.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
<?xml version="1.0" encoding="utf-8"?><Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><PropertyGroup><ProjectType>Local</ProjectType><ProductVersion>8.0.50727</ProductVersion><SchemaVersion>2.0</SchemaVersion><ProjectGuid>{B60D0993-B0C5-457A-90D9-DB6EEB33CE47}</ProjectGuid><Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration><Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform><ApplicationIcon /><AssemblyKeyContainerName /><AssemblyName>Datamodel</AssemblyName><AssemblyOriginatorKeyFile>LightDatamodel.snk</AssemblyOriginatorKeyFile><DefaultClientScript>JScript</DefaultClientScript><DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout><DefaultTargetSchema>IE50</DefaultTargetSchema><DelaySign>false</DelaySign><OutputType>Library</OutputType><RootNamespace>Duplicati.Datamodel</RootNamespace><RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent><StartupObject /><FileUpgradeFlags /><UpgradeBackupLocation /><SignAssembly>true</SignAssembly></PropertyGroup><PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "><OutputPath>bin\Debug\</OutputPath><AllowUnsafeBlocks>false</AllowUnsafeBlocks><BaseAddress>285212672</BaseAddress><CheckForOverflowUnderflow>false</CheckForOverflowUnderflow><ConfigurationOverrideFile></ConfigurationOverrideFile><DefineConstants>DEBUG;TRACE</DefineConstants><DocumentationFile></DocumentationFile><DebugSymbols>true</DebugSymbols><FileAlignment>4096</FileAlignment><NoStdLib>false</NoStdLib><NoWarn></NoWarn><Optimize>false</Optimize><RegisterForComInterop>false</RegisterForComInterop><RemoveIntegerChecks>false</RemoveIntegerChecks><TreatWarningsAsErrors>false</TreatWarningsAsErrors><WarningLevel>4</WarningLevel><DebugType>full</DebugType><ErrorReport>prompt</ErrorReport></PropertyGroup><PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "><OutputPath>bin\Release\</OutputPath><AllowUnsafeBlocks>false</AllowUnsafeBlocks><BaseAddress>285212672</BaseAddress><CheckForOverflowUnderflow>false</CheckForOverflowUnderflow><ConfigurationOverrideFile></ConfigurationOverrideFile><DefineConstants>TRACE</DefineConstants><DocumentationFile></DocumentationFile><DebugSymbols>false</DebugSymbols><FileAlignment>4096</FileAlignment><NoStdLib>false</NoStdLib><NoWarn></NoWarn><Optimize>true</Optimize><RegisterForComInterop>false</RegisterForComInterop><RemoveIntegerChecks>false</RemoveIntegerChecks><TreatWarningsAsErrors>false</TreatWarningsAsErrors><WarningLevel>4</WarningLevel><DebugType>none</DebugType><ErrorReport>prompt</ErrorReport></PropertyGroup><ItemGroup><Reference Include="System"><Name>System</Name></Reference><Reference Include="System.Data"><Name>System.Data</Name></Reference><Reference Include="System.XML"><Name>System.XML</Name></Reference></ItemGroup><ItemGroup><Compile Include="AssemblyInfo.cs" /><Compile Include="Backends\File.cs" /><Compile Include="Backends\IBackend.cs" /><Compile Include="Backends\S3.cs" /><Compile Include="Backends\SSH.cs" /><Compile Include="SettingsHelper.cs" /><Compile Include="Task.Extension.cs" /><Compile Include="Task.cs" /><Compile Include="Schedule.cs" /><Compile Include="CommandQueue.cs" /><Compile Include="Log.cs" /><Compile Include="LogBlob.cs" /><Compile Include="ApplicationSettings.cs" /><Compile Include="ApplicationSetting.cs" /><Compile Include="TaskFilter.cs" /><Compile Include="BackendSetting.cs" /><Compile Include="TaskExtension.cs" /><Compile Include="TaskOverride.cs" /></ItemGroup><ItemGroup><None Include="LightDatamodel.snk" /><Compile Include="Backends\FTP.cs" /><Compile Include="Backends\WEBDAV.cs" /><Compile Include="Log.Extension.cs" /><Compile Include="LogBlob.Extension.cs" /><Compile Include="Schedule.Extension.cs" /></ItemGroup><ItemGroup><ProjectReference Include="..\..\..\..\LightDatamodel\LightDatamodel\LightDatamodel.csproj"><Project>{CAE8433B-F013-474E-B7FC-4DE0D5933AD1}</Project><Name>LightDatamodel</Name></ProjectReference><ProjectReference Include="..\..\Library\Core\Duplicati.Library.Core.csproj"><Project>{DE3E5D4C-51AB-4E5E-BEE8-E636CEBFBA65}</Project><Name>Duplicati.Library.Core</Name></ProjectReference></ItemGroup><Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /></Project>
|
||||
Binary file not shown.
@@ -94,50 +94,6 @@
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>MaxUploadsize</Name>
|
||||
<Fieldname>MaxUploadsize</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>UploadBandwidth</Name>
|
||||
<Fieldname>UploadBandwidth</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>DownloadBandwidth</Name>
|
||||
<Fieldname>DownloadBandwidth</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>VolumeSize</Name>
|
||||
<Fieldname>VolumeSize</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>FullAfter</Name>
|
||||
@@ -149,28 +105,6 @@
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>ThreadPriority</Name>
|
||||
<Fieldname>ThreadPriority</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.Boolean</Typename>
|
||||
<Name>AsyncTransfer</Name>
|
||||
<Fieldname>AsyncTransfer</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.Boolean</Typename>
|
||||
<Name>GPGEncryption</Name>
|
||||
@@ -193,17 +127,6 @@
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.Boolean</Typename>
|
||||
<Name>IgnoreTimestamps</Name>
|
||||
<Fieldname>IgnoreTimestamps</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
</Columns>
|
||||
<Ignore>false</Ignore>
|
||||
<Relations>
|
||||
@@ -294,70 +217,6 @@
|
||||
<Ignore>false</Ignore>
|
||||
<Relations />
|
||||
</Table>
|
||||
<Table>
|
||||
<Name>TaskSetting</Name>
|
||||
<Classname>TaskSetting</Classname>
|
||||
<PrimaryKey>ID</PrimaryKey>
|
||||
<Columns>
|
||||
<Column>
|
||||
<Typename>System.Int64</Typename>
|
||||
<Name>ID</Name>
|
||||
<Fieldname>ID</Fieldname>
|
||||
<Autonumber>true</Autonumber>
|
||||
<PrimaryKey>true</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>true</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.Int64</Typename>
|
||||
<Name>TaskID</Name>
|
||||
<Fieldname>TaskID</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>Name</Name>
|
||||
<Fieldname>Name</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>Value</Name>
|
||||
<Fieldname>Value</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
</Columns>
|
||||
<Ignore>false</Ignore>
|
||||
<Relations>
|
||||
<Relation>
|
||||
<Name>TaskSettingTask</Name>
|
||||
<Databasefield>TaskID</Databasefield>
|
||||
<Propertyname>Task</Propertyname>
|
||||
<Type>OneToMany</Type>
|
||||
<ReverseTablename>Task</ReverseTablename>
|
||||
<ReverseDatabasefield>ID</ReverseDatabasefield>
|
||||
<ReversePropertyname>TaskSettings</ReversePropertyname>
|
||||
<Tablename>TaskSetting</Tablename>
|
||||
</Relation>
|
||||
</Relations>
|
||||
</Table>
|
||||
<Table>
|
||||
<Name>CommandQueue</Name>
|
||||
<Classname>CommandQueue</Classname>
|
||||
@@ -719,5 +578,197 @@
|
||||
</Relation>
|
||||
</Relations>
|
||||
</Table>
|
||||
<Table>
|
||||
<Name>BackendSetting</Name>
|
||||
<Classname>BackendSetting</Classname>
|
||||
<PrimaryKey>ID</PrimaryKey>
|
||||
<Columns>
|
||||
<Column>
|
||||
<Typename>System.Int64</Typename>
|
||||
<Name>ID</Name>
|
||||
<Fieldname>ID</Fieldname>
|
||||
<Autonumber>true</Autonumber>
|
||||
<PrimaryKey>true</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>true</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.Int64</Typename>
|
||||
<Name>TaskID</Name>
|
||||
<Fieldname>TaskID</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>Name</Name>
|
||||
<Fieldname>Name</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>Value</Name>
|
||||
<Fieldname>Value</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
</Columns>
|
||||
<Ignore>false</Ignore>
|
||||
<Relations>
|
||||
<Relation>
|
||||
<Name>BackendSettingTask</Name>
|
||||
<Databasefield>TaskID</Databasefield>
|
||||
<Propertyname>Task</Propertyname>
|
||||
<Type>OneToMany</Type>
|
||||
<ReverseTablename>Task</ReverseTablename>
|
||||
<ReverseDatabasefield>ID</ReverseDatabasefield>
|
||||
<ReversePropertyname>BackendSettings</ReversePropertyname>
|
||||
<Tablename>BackendSetting</Tablename>
|
||||
</Relation>
|
||||
</Relations>
|
||||
</Table>
|
||||
<Table>
|
||||
<Name>TaskExtension</Name>
|
||||
<Classname>TaskExtension</Classname>
|
||||
<PrimaryKey>ID</PrimaryKey>
|
||||
<Columns>
|
||||
<Column>
|
||||
<Typename>System.Int64</Typename>
|
||||
<Name>ID</Name>
|
||||
<Fieldname>ID</Fieldname>
|
||||
<Autonumber>true</Autonumber>
|
||||
<PrimaryKey>true</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>true</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.Int64</Typename>
|
||||
<Name>TaskID</Name>
|
||||
<Fieldname>TaskID</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>Name</Name>
|
||||
<Fieldname>Name</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>Value</Name>
|
||||
<Fieldname>Value</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
</Columns>
|
||||
<Ignore>false</Ignore>
|
||||
<Relations>
|
||||
<Relation>
|
||||
<Name>TaskExtensionTask</Name>
|
||||
<Databasefield>TaskID</Databasefield>
|
||||
<Propertyname>Task</Propertyname>
|
||||
<Type>OneToMany</Type>
|
||||
<ReverseTablename>Task</ReverseTablename>
|
||||
<ReverseDatabasefield>ID</ReverseDatabasefield>
|
||||
<ReversePropertyname>TaskExtensions</ReversePropertyname>
|
||||
<Tablename>TaskExtension</Tablename>
|
||||
</Relation>
|
||||
</Relations>
|
||||
</Table>
|
||||
<Table>
|
||||
<Name>TaskOverride</Name>
|
||||
<Classname>TaskOverride</Classname>
|
||||
<PrimaryKey>ID</PrimaryKey>
|
||||
<Columns>
|
||||
<Column>
|
||||
<Typename>System.Int64</Typename>
|
||||
<Name>ID</Name>
|
||||
<Fieldname>ID</Fieldname>
|
||||
<Autonumber>true</Autonumber>
|
||||
<PrimaryKey>true</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>true</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.Int64</Typename>
|
||||
<Name>TaskID</Name>
|
||||
<Fieldname>TaskID</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>Name</Name>
|
||||
<Fieldname>Name</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
<Column>
|
||||
<Typename>System.String</Typename>
|
||||
<Name>Value</Name>
|
||||
<Fieldname>Value</Fieldname>
|
||||
<Autonumber>false</Autonumber>
|
||||
<PrimaryKey>false</PrimaryKey>
|
||||
<IgnoreWithSelect>false</IgnoreWithSelect>
|
||||
<IgnoreWithUpdate>false</IgnoreWithUpdate>
|
||||
<IgnoreWithInsert>false</IgnoreWithInsert>
|
||||
<Index>false</Index>
|
||||
</Column>
|
||||
</Columns>
|
||||
<Ignore>false</Ignore>
|
||||
<Relations>
|
||||
<Relation>
|
||||
<Name>TaskOverrideTask</Name>
|
||||
<Databasefield>TaskID</Databasefield>
|
||||
<Propertyname>Task</Propertyname>
|
||||
<Type>OneToMany</Type>
|
||||
<ReverseTablename>Task</ReverseTablename>
|
||||
<ReverseDatabasefield>ID</ReverseDatabasefield>
|
||||
<ReversePropertyname>TaskOverrides</ReversePropertyname>
|
||||
<Tablename>TaskOverride</Tablename>
|
||||
</Relation>
|
||||
</Relations>
|
||||
</Table>
|
||||
</m_tables>
|
||||
</ConfigurationContainer>
|
||||
Binary file not shown.
@@ -17,92 +17,92 @@
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
#endregion
|
||||
/// <metadata>
|
||||
/// <creator>This class was created by DataClassFileBuilder (LightDatamodel)</creator>
|
||||
/// <provider name="System.Data.LightDatamodel.SQLiteDataProvider" connectionstring="Version=3;Data Source=D:\Dokumenter\duplicati\Duplicati\GUI\Datamodel\Duplicati.sqlite;" />
|
||||
/// <type>Table</type>
|
||||
/// <namespace>Duplicati.Datamodel</namespace>
|
||||
/// <name>Schedule</name>
|
||||
/// <sql></sql>
|
||||
/// </metadata>
|
||||
|
||||
using System.Data.LightDatamodel;
|
||||
using System.Data.LightDatamodel.DataClassAttributes;
|
||||
|
||||
namespace Duplicati.Datamodel
|
||||
{
|
||||
|
||||
[DatabaseTable("Schedule")]
|
||||
public partial class Schedule : DataClassBase
|
||||
{
|
||||
|
||||
#region " private members "
|
||||
|
||||
[AutoIncrement, PrimaryKey, Relation("TaskSchedule", typeof(Task), "ScheduleID", false), DatabaseField("ID")]
|
||||
private System.Int64 m_ID = long.MinValue;
|
||||
[DatabaseField("Name")]
|
||||
private System.String m_Name = "";
|
||||
[DatabaseField("Path")]
|
||||
private System.String m_Path = "";
|
||||
[DatabaseField("When")]
|
||||
private System.DateTime m_When = new System.DateTime(1, 1, 1);
|
||||
[DatabaseField("Repeat")]
|
||||
private System.String m_Repeat = "";
|
||||
[DatabaseField("Weekdays")]
|
||||
private System.String m_Weekdays = "";
|
||||
#endregion
|
||||
|
||||
#region " properties "
|
||||
|
||||
public System.Int64 ID
|
||||
{
|
||||
get{return m_ID;}
|
||||
set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Name
|
||||
{
|
||||
get{return m_Name;}
|
||||
set{object oldvalue = m_Name;OnBeforeDataChange(this, "Name", oldvalue, value);m_Name = value;OnAfterDataChange(this, "Name", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Path
|
||||
{
|
||||
get{return m_Path;}
|
||||
set{object oldvalue = m_Path;OnBeforeDataChange(this, "Path", oldvalue, value);m_Path = value;OnAfterDataChange(this, "Path", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.DateTime When
|
||||
{
|
||||
get{return m_When;}
|
||||
set{object oldvalue = m_When;OnBeforeDataChange(this, "When", oldvalue, value);m_When = value;OnAfterDataChange(this, "When", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Repeat
|
||||
{
|
||||
get{return m_Repeat;}
|
||||
set{object oldvalue = m_Repeat;OnBeforeDataChange(this, "Repeat", oldvalue, value);m_Repeat = value;OnAfterDataChange(this, "Repeat", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Weekdays
|
||||
{
|
||||
get{return m_Weekdays;}
|
||||
set{object oldvalue = m_Weekdays;OnBeforeDataChange(this, "Weekdays", oldvalue, value);m_Weekdays = value;OnAfterDataChange(this, "Weekdays", oldvalue, value);}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region " referenced properties "
|
||||
|
||||
[Affects(typeof(Task))]
|
||||
public Task Task
|
||||
{
|
||||
get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject<Task>("TaskSchedule", this); }
|
||||
set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskSchedule", this, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
/// <metadata>
|
||||
/// <creator>This class was created by DataClassFileBuilder (LightDatamodel)</creator>
|
||||
/// <provider name="System.Data.LightDatamodel.SQLiteDataProvider" connectionstring="Version=3;Data Source=D:\Dokumenter\duplicati\Duplicati\GUI\Datamodel\Duplicati.sqlite;" />
|
||||
/// <type>Table</type>
|
||||
/// <namespace>Duplicati.Datamodel</namespace>
|
||||
/// <name>Schedule</name>
|
||||
/// <sql></sql>
|
||||
/// </metadata>
|
||||
|
||||
using System.Data.LightDatamodel;
|
||||
using System.Data.LightDatamodel.DataClassAttributes;
|
||||
|
||||
namespace Duplicati.Datamodel
|
||||
{
|
||||
|
||||
[DatabaseTable("Schedule")]
|
||||
public partial class Schedule : DataClassBase
|
||||
{
|
||||
|
||||
#region " private members "
|
||||
|
||||
[AutoIncrement, PrimaryKey, Relation("TaskSchedule", typeof(Task), "ScheduleID", false), DatabaseField("ID")]
|
||||
private System.Int64 m_ID = long.MinValue;
|
||||
[DatabaseField("Name")]
|
||||
private System.String m_Name = "";
|
||||
[DatabaseField("Path")]
|
||||
private System.String m_Path = "";
|
||||
[DatabaseField("When")]
|
||||
private System.DateTime m_When = new System.DateTime(1, 1, 1);
|
||||
[DatabaseField("Repeat")]
|
||||
private System.String m_Repeat = "";
|
||||
[DatabaseField("Weekdays")]
|
||||
private System.String m_Weekdays = "";
|
||||
#endregion
|
||||
|
||||
#region " properties "
|
||||
|
||||
public System.Int64 ID
|
||||
{
|
||||
get{return m_ID;}
|
||||
set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Name
|
||||
{
|
||||
get{return m_Name;}
|
||||
set{object oldvalue = m_Name;OnBeforeDataChange(this, "Name", oldvalue, value);m_Name = value;OnAfterDataChange(this, "Name", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Path
|
||||
{
|
||||
get{return m_Path;}
|
||||
set{object oldvalue = m_Path;OnBeforeDataChange(this, "Path", oldvalue, value);m_Path = value;OnAfterDataChange(this, "Path", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.DateTime When
|
||||
{
|
||||
get{return m_When;}
|
||||
set{object oldvalue = m_When;OnBeforeDataChange(this, "When", oldvalue, value);m_When = value;OnAfterDataChange(this, "When", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Repeat
|
||||
{
|
||||
get{return m_Repeat;}
|
||||
set{object oldvalue = m_Repeat;OnBeforeDataChange(this, "Repeat", oldvalue, value);m_Repeat = value;OnAfterDataChange(this, "Repeat", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Weekdays
|
||||
{
|
||||
get{return m_Weekdays;}
|
||||
set{object oldvalue = m_Weekdays;OnBeforeDataChange(this, "Weekdays", oldvalue, value);m_Weekdays = value;OnAfterDataChange(this, "Weekdays", oldvalue, value);}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region " referenced properties "
|
||||
|
||||
[Affects(typeof(Task))]
|
||||
public Task Task
|
||||
{
|
||||
get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject<Task>("TaskSchedule", this); }
|
||||
set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskSchedule", this, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,7 +35,6 @@ namespace Duplicati.Datamodel
|
||||
|
||||
private PropertyInfo m_keyfield;
|
||||
private PropertyInfo m_valuefield;
|
||||
private TranslatoryEnumerator m_enum;
|
||||
|
||||
public SettingsHelper(IDataFetcher parent, IList<TBase> col, string keyfield, string valuefield)
|
||||
: this(parent, col, typeof(TBase).GetProperty(keyfield), typeof(TBase).GetProperty(valuefield))
|
||||
@@ -59,17 +58,36 @@ namespace Duplicati.Datamodel
|
||||
if (m_valuefield == null)
|
||||
throw new ArgumentNullException("valuefield");
|
||||
|
||||
m_settings = new Dictionary<TKey, TBase>();
|
||||
m_enum = new TranslatoryEnumerator(this, m_settings.GetEnumerator());
|
||||
parent.AfterDataConnection += new DataConnectionEventHandler(parent_AfterDataConnection);
|
||||
}
|
||||
|
||||
void parent_AfterDataConnection(object sender, DataActions action)
|
||||
{
|
||||
if (action != DataActions.Fetch)
|
||||
m_settings = null;
|
||||
|
||||
foreach (TBase item in m_col)
|
||||
if (!m_settings.ContainsKey((TKey)m_keyfield.GetValue(item, null)))
|
||||
m_settings.Add((TKey)m_keyfield.GetValue(item, null), item);
|
||||
}
|
||||
|
||||
public PropertyInfo KeyField { get { return m_keyfield; } }
|
||||
public PropertyInfo ValueField { get { return m_valuefield; } }
|
||||
|
||||
private Dictionary<TKey, TBase> InternalSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_settings == null)
|
||||
{
|
||||
m_settings = new Dictionary<TKey, TBase>();
|
||||
|
||||
foreach (TBase item in m_col)
|
||||
if (!m_settings.ContainsKey((TKey)m_keyfield.GetValue(item, null)))
|
||||
m_settings.Add((TKey)m_keyfield.GetValue(item, null), item);
|
||||
}
|
||||
|
||||
return m_settings;
|
||||
}
|
||||
}
|
||||
|
||||
#region IDictionary<TKey, TValue> Members
|
||||
|
||||
public void Add(TKey key, TValue value)
|
||||
@@ -78,36 +96,36 @@ namespace Duplicati.Datamodel
|
||||
m_keyfield.SetValue(item, key, null);
|
||||
m_valuefield.SetValue(item, value, null);
|
||||
|
||||
m_settings.Add(key, item);
|
||||
InternalSettings.Add(key, item);
|
||||
m_parent.Add(item);
|
||||
m_col.Add(item);
|
||||
}
|
||||
|
||||
public bool ContainsKey(TKey key)
|
||||
{
|
||||
return m_settings.ContainsKey(key);
|
||||
return InternalSettings.ContainsKey(key);
|
||||
}
|
||||
|
||||
public ICollection<TKey> Keys
|
||||
{
|
||||
get { return m_settings.Keys; }
|
||||
get { return InternalSettings.Keys; }
|
||||
}
|
||||
|
||||
public bool Remove(TKey key)
|
||||
{
|
||||
if (m_settings.ContainsKey(key))
|
||||
if (InternalSettings.ContainsKey(key))
|
||||
{
|
||||
m_col.Remove(m_settings[key]);
|
||||
m_parent.DeleteObject<TBase>(m_settings[key]);
|
||||
m_col.Remove(InternalSettings[key]);
|
||||
m_parent.DeleteObject<TBase>(InternalSettings[key]);
|
||||
}
|
||||
|
||||
return m_settings.Remove(key);
|
||||
return InternalSettings.Remove(key);
|
||||
}
|
||||
|
||||
public bool TryGetValue(TKey key, out TValue value)
|
||||
{
|
||||
TBase item;
|
||||
if (m_settings.TryGetValue(key, out item))
|
||||
if (InternalSettings.TryGetValue(key, out item))
|
||||
{
|
||||
value = (TValue)m_valuefield.GetValue(item, null);
|
||||
return true;
|
||||
@@ -125,7 +143,7 @@ namespace Duplicati.Datamodel
|
||||
get
|
||||
{
|
||||
List<TValue> lst = new List<TValue>();
|
||||
foreach (TBase item in m_settings.Values)
|
||||
foreach (TBase item in InternalSettings.Values)
|
||||
lst.Add((TValue)m_valuefield.GetValue(item, null));
|
||||
return lst;
|
||||
}
|
||||
@@ -135,27 +153,27 @@ namespace Duplicati.Datamodel
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_settings.ContainsKey(key))
|
||||
return (TValue)m_valuefield.GetValue(m_settings[key], null);
|
||||
if (InternalSettings.ContainsKey(key))
|
||||
return (TValue)m_valuefield.GetValue(InternalSettings[key], null);
|
||||
else
|
||||
return default(TValue);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == null && m_settings.ContainsKey(key))
|
||||
if (value == null && InternalSettings.ContainsKey(key))
|
||||
{
|
||||
//Remove
|
||||
this.Remove(key);
|
||||
}
|
||||
else if (value != null && !m_settings.ContainsKey(key))
|
||||
else if (value != null && !InternalSettings.ContainsKey(key))
|
||||
{
|
||||
//Add
|
||||
this.Add(key, value);
|
||||
}
|
||||
else if (value != null && m_settings.ContainsKey(key))
|
||||
else if (value != null && InternalSettings.ContainsKey(key))
|
||||
{
|
||||
//Update
|
||||
m_valuefield.SetValue(m_settings[key], value, null);
|
||||
m_valuefield.SetValue(InternalSettings[key], value, null);
|
||||
}
|
||||
//else: It should be removed, but does not exist
|
||||
|
||||
@@ -180,7 +198,7 @@ namespace Duplicati.Datamodel
|
||||
m_parent.DeleteObject<TBase>(item);
|
||||
}
|
||||
|
||||
m_settings.Clear();
|
||||
InternalSettings.Clear();
|
||||
}
|
||||
|
||||
public bool Contains(KeyValuePair<TKey, TValue> item)
|
||||
@@ -190,12 +208,12 @@ namespace Duplicati.Datamodel
|
||||
|
||||
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
|
||||
{
|
||||
((ICollection<KeyValuePair<TKey, TValue>>)(m_settings)).CopyTo(array, arrayIndex);
|
||||
((ICollection<KeyValuePair<TKey, TValue>>)(InternalSettings)).CopyTo(array, arrayIndex);
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return m_settings.Count; }
|
||||
get { return InternalSettings.Count; }
|
||||
}
|
||||
|
||||
public bool IsReadOnly
|
||||
@@ -214,7 +232,7 @@ namespace Duplicati.Datamodel
|
||||
|
||||
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
|
||||
{
|
||||
return m_enum;
|
||||
return new TranslatoryEnumerator(this, InternalSettings.GetEnumerator());
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -223,7 +241,7 @@ namespace Duplicati.Datamodel
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return ((System.Collections.IEnumerable)m_settings).GetEnumerator();
|
||||
return ((System.Collections.IEnumerable)InternalSettings).GetEnumerator();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -281,5 +299,8 @@ namespace Duplicati.Datamodel
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public IDataFetcher DataParent { get { return m_parent; } }
|
||||
public IList<TBase> Collection { get { return m_col; } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,19 +27,52 @@ namespace Duplicati.Datamodel
|
||||
{
|
||||
public partial class Task
|
||||
{
|
||||
private SettingsHelper<TaskSetting, string, string> m_settings;
|
||||
public Task()
|
||||
{
|
||||
this.AfterDataCommit += new System.Data.LightDatamodel.DataConnectionEventHandler(Task_AfterDataCommit);
|
||||
}
|
||||
|
||||
public IDictionary<string, string> Settings
|
||||
void Task_AfterDataCommit(object sender, System.Data.LightDatamodel.DataActions action)
|
||||
{
|
||||
if (action != System.Data.LightDatamodel.DataActions.Fetch)
|
||||
{
|
||||
m_backendSettings = null;
|
||||
m_extensionSettings = null;
|
||||
}
|
||||
}
|
||||
|
||||
private SettingsHelper<BackendSetting, string, string> m_backendSettings;
|
||||
private SettingsHelper<TaskExtension, string, string> m_extensionSettings;
|
||||
|
||||
public IDictionary<string, string> BackendSettingsLookup
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_settings == null)
|
||||
m_settings = new SettingsHelper<TaskSetting, string, string>(this.DataParent, this.TaskSettings, "Name", "Value");
|
||||
//Extra check because the datamodel copies the collection between contexts... not nice
|
||||
if (m_backendSettings == null || m_backendSettings.DataParent != this.DataParent || m_backendSettings.Collection != this.BackendSettings)
|
||||
m_backendSettings = new SettingsHelper<BackendSetting, string, string>(this.DataParent, this.BackendSettings, "Name", "Value");
|
||||
|
||||
return m_settings;
|
||||
return m_backendSettings;
|
||||
}
|
||||
}
|
||||
|
||||
public IDictionary<string, string> TaskExtensionsLookup
|
||||
{
|
||||
get
|
||||
{
|
||||
//Extra check because the datamodel copies the collection between contexts... not nice
|
||||
if (m_extensionSettings == null || m_extensionSettings.DataParent != this.DataParent || m_extensionSettings.Collection != this.TaskExtensions)
|
||||
m_extensionSettings = new SettingsHelper<TaskExtension, string, string>(this.DataParent, this.TaskExtensions, "Name", "Value");
|
||||
|
||||
return m_extensionSettings;
|
||||
}
|
||||
}
|
||||
|
||||
public TaskExtensionWrapper Extensions
|
||||
{
|
||||
get { return new TaskExtensionWrapper(this); }
|
||||
}
|
||||
|
||||
public Backends.IBackend Backend
|
||||
{
|
||||
get
|
||||
@@ -74,18 +107,6 @@ namespace Duplicati.Datamodel
|
||||
|
||||
if (this.Filters.Count > 0)
|
||||
options["filter"] = this.EncodedFilter; ;
|
||||
if (!string.IsNullOrEmpty(this.MaxUploadsize))
|
||||
options["totalsize"] = this.MaxUploadsize;
|
||||
if (!string.IsNullOrEmpty(this.VolumeSize))
|
||||
options["volsize"] = this.VolumeSize;
|
||||
if (!string.IsNullOrEmpty(this.DownloadBandwidth))
|
||||
options["max-download-pr-second"] = this.DownloadBandwidth;
|
||||
if (!string.IsNullOrEmpty(this.UploadBandwidth))
|
||||
options["max-upload-pr-second"] = this.UploadBandwidth;
|
||||
if (!string.IsNullOrEmpty(this.ThreadPriority))
|
||||
options["thread-priority"] = this.ThreadPriority;
|
||||
if (this.AsyncTransfer)
|
||||
options["asynchronous-upload"] = "";
|
||||
if (this.GPGEncryption)
|
||||
{
|
||||
options["gpg-encryption"] = "";
|
||||
@@ -101,8 +122,11 @@ namespace Duplicati.Datamodel
|
||||
if (!string.IsNullOrEmpty(set.TempPath))
|
||||
options["tempdir"] = System.Environment.ExpandEnvironmentVariables(set.TempPath);
|
||||
|
||||
if (this.IgnoreTimestamps)
|
||||
options["disable-filetime-check"] = "";
|
||||
this.Extensions.GetOptions(options);
|
||||
|
||||
//Override everything set in the overrides
|
||||
foreach (TaskOverride ov in this.TaskOverrides)
|
||||
options[ov.Name] = ov.Value;
|
||||
}
|
||||
|
||||
public string EncodedFilter
|
||||
@@ -124,7 +148,7 @@ namespace Duplicati.Datamodel
|
||||
this.SortedFilters = new TaskFilter[0];
|
||||
|
||||
List<TaskFilter> filters = new List<TaskFilter>();
|
||||
foreach(KeyValuePair<bool, string> f in Library.Core.FilenameFilter.DecodeFilter(value))
|
||||
foreach (KeyValuePair<bool, string> f in Library.Core.FilenameFilter.DecodeFilter(value))
|
||||
{
|
||||
TaskFilter tf = this.DataParent.Add<TaskFilter>();
|
||||
tf.Filter = f.Value;
|
||||
@@ -165,5 +189,120 @@ namespace Duplicati.Datamodel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class TaskExtensionWrapper
|
||||
{
|
||||
private const string MAX_UPLOAD_SIZE = "Max Upload Size";
|
||||
private const string UPLOAD_BANDWIDTH = "Upload Bandwidth";
|
||||
private const string DOWNLOAD_BANDWIDTH = "Download Bandwidth";
|
||||
private const string VOLUME_SIZE = "Volume Size";
|
||||
private const string THREAD_PRIORITY = "Thread Priority";
|
||||
private const string ASYNC_TRANSFER = "Async Transfer";
|
||||
private const string INCLUDE_SETUP = "Include Setup";
|
||||
private const string IGNORE_TIMESTAMPS = "Ignore Timestamps";
|
||||
private const string FILE_SIZE_LIMIT = "File Size Limit";
|
||||
private const string FILE_TIME_SEPERATOR = "File Time Seperator";
|
||||
private const string SHORT_FILENAMES = "Short Filenames";
|
||||
private const string FILENAME_PREFIX = "Filename Prefix";
|
||||
|
||||
private Task m_owner;
|
||||
|
||||
public TaskExtensionWrapper(Task owner)
|
||||
{
|
||||
m_owner = owner;
|
||||
}
|
||||
|
||||
public string MaxUploadSize
|
||||
{
|
||||
get { return m_owner.TaskExtensionsLookup[MAX_UPLOAD_SIZE]; }
|
||||
set { m_owner.TaskExtensionsLookup[MAX_UPLOAD_SIZE] = value; }
|
||||
}
|
||||
|
||||
public string UploadBandwidth
|
||||
{
|
||||
get { return m_owner.TaskExtensionsLookup[UPLOAD_BANDWIDTH]; }
|
||||
set { m_owner.TaskExtensionsLookup[UPLOAD_BANDWIDTH] = value; }
|
||||
}
|
||||
|
||||
public string DownloadBandwidth
|
||||
{
|
||||
get { return m_owner.TaskExtensionsLookup[DOWNLOAD_BANDWIDTH]; }
|
||||
set { m_owner.TaskExtensionsLookup[DOWNLOAD_BANDWIDTH] = value; }
|
||||
}
|
||||
|
||||
public string VolumeSize
|
||||
{
|
||||
get { return m_owner.TaskExtensionsLookup[VOLUME_SIZE]; }
|
||||
set { m_owner.TaskExtensionsLookup[VOLUME_SIZE] = value; }
|
||||
}
|
||||
|
||||
public string ThreadPriority
|
||||
{
|
||||
get { return m_owner.TaskExtensionsLookup[THREAD_PRIORITY]; }
|
||||
set { m_owner.TaskExtensionsLookup[THREAD_PRIORITY] = value; }
|
||||
}
|
||||
|
||||
public bool AsyncTransfer
|
||||
{
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.TaskExtensionsLookup[ASYNC_TRANSFER], false); }
|
||||
set { m_owner.TaskExtensionsLookup[ASYNC_TRANSFER] = value.ToString(); }
|
||||
}
|
||||
|
||||
public bool IncludeSetup
|
||||
{
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.TaskExtensionsLookup[INCLUDE_SETUP], true); }
|
||||
set { m_owner.TaskExtensionsLookup[INCLUDE_SETUP] = value.ToString(); }
|
||||
}
|
||||
|
||||
public bool IgnoreTimestamps
|
||||
{
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.TaskExtensionsLookup[IGNORE_TIMESTAMPS], true); }
|
||||
set { m_owner.TaskExtensionsLookup[IGNORE_TIMESTAMPS] = value.ToString(); }
|
||||
}
|
||||
|
||||
public string FileSizeLimit
|
||||
{
|
||||
get { return m_owner.TaskExtensionsLookup[FILE_SIZE_LIMIT]; }
|
||||
set { m_owner.TaskExtensionsLookup[FILE_SIZE_LIMIT] = value; }
|
||||
}
|
||||
|
||||
public string FileTimeSeperator
|
||||
{
|
||||
get { return m_owner.TaskExtensionsLookup[FILE_TIME_SEPERATOR]; }
|
||||
set { m_owner.TaskExtensionsLookup[FILE_TIME_SEPERATOR] = value; }
|
||||
}
|
||||
|
||||
public bool ShortFilenames
|
||||
{
|
||||
get { return Duplicati.Library.Core.Utility.ParseBool(m_owner.TaskExtensionsLookup[SHORT_FILENAMES], false); }
|
||||
set { m_owner.TaskExtensionsLookup[SHORT_FILENAMES] = value.ToString(); }
|
||||
}
|
||||
|
||||
public string FilenamePrefix
|
||||
{
|
||||
get { return m_owner.TaskExtensionsLookup[FILENAME_PREFIX]; }
|
||||
set { m_owner.TaskExtensionsLookup[FILENAME_PREFIX] = value; }
|
||||
}
|
||||
|
||||
public void GetOptions(Dictionary<string, string> options)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.MaxUploadSize))
|
||||
options["totalsize"] = this.MaxUploadSize;
|
||||
if (!string.IsNullOrEmpty(this.VolumeSize))
|
||||
options["volsize"] = this.VolumeSize;
|
||||
if (!string.IsNullOrEmpty(this.DownloadBandwidth))
|
||||
options["max-download-pr-second"] = this.DownloadBandwidth;
|
||||
if (!string.IsNullOrEmpty(this.UploadBandwidth))
|
||||
options["max-upload-pr-second"] = this.UploadBandwidth;
|
||||
if (!string.IsNullOrEmpty(this.ThreadPriority))
|
||||
options["thread-priority"] = this.ThreadPriority;
|
||||
if (this.AsyncTransfer)
|
||||
options["asynchronous-upload"] = "";
|
||||
if (this.IgnoreTimestamps)
|
||||
options["disable-filetime-check"] = "";
|
||||
if (!string.IsNullOrEmpty(this.FileTimeSeperator))
|
||||
options["time-separator"] = this.FileTimeSeperator;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Duplicati.Datamodel
|
||||
|
||||
#region " private members "
|
||||
|
||||
[AutoIncrement, PrimaryKey, Relation("TaskSettingTask", typeof(TaskSetting), "TaskID", false), Relation("LogTask", typeof(Log), "TaskID", false), Relation("TaskFilterTask", typeof(TaskFilter), "TaskID", false), DatabaseField("ID")]
|
||||
[AutoIncrement, PrimaryKey, Relation("LogTask", typeof(Log), "TaskID", false), Relation("TaskFilterTask", typeof(TaskFilter), "TaskID", false), Relation("BackendSettingTask", typeof(BackendSetting), "TaskID", false), Relation("TaskExtensionTask", typeof(TaskExtension), "TaskID", false), Relation("TaskOverrideTask", typeof(TaskOverride), "TaskID", false), DatabaseField("ID")]
|
||||
private System.Int64 m_ID = long.MinValue;
|
||||
[DatabaseField("Service")]
|
||||
private System.String m_Service = "";
|
||||
@@ -54,26 +54,12 @@ namespace Duplicati.Datamodel
|
||||
private System.Int64 m_KeepFull = long.MinValue;
|
||||
[DatabaseField("KeepTime")]
|
||||
private System.String m_KeepTime = "";
|
||||
[DatabaseField("MaxUploadsize")]
|
||||
private System.String m_MaxUploadsize = "";
|
||||
[DatabaseField("UploadBandwidth")]
|
||||
private System.String m_UploadBandwidth = "";
|
||||
[DatabaseField("DownloadBandwidth")]
|
||||
private System.String m_DownloadBandwidth = "";
|
||||
[DatabaseField("VolumeSize")]
|
||||
private System.String m_VolumeSize = "";
|
||||
[DatabaseField("FullAfter")]
|
||||
private System.String m_FullAfter = "";
|
||||
[DatabaseField("ThreadPriority")]
|
||||
private System.String m_ThreadPriority = "";
|
||||
[DatabaseField("AsyncTransfer")]
|
||||
private System.Boolean m_AsyncTransfer = false;
|
||||
[DatabaseField("GPGEncryption")]
|
||||
private System.Boolean m_GPGEncryption = false;
|
||||
[DatabaseField("IncludeSetup")]
|
||||
private System.Boolean m_IncludeSetup = false;
|
||||
[DatabaseField("IgnoreTimestamps")]
|
||||
private System.Boolean m_IgnoreTimestamps = false;
|
||||
#endregion
|
||||
|
||||
#region " properties "
|
||||
@@ -126,48 +112,12 @@ namespace Duplicati.Datamodel
|
||||
set{object oldvalue = m_KeepTime;OnBeforeDataChange(this, "KeepTime", oldvalue, value);m_KeepTime = value;OnAfterDataChange(this, "KeepTime", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String MaxUploadsize
|
||||
{
|
||||
get{return m_MaxUploadsize;}
|
||||
set{object oldvalue = m_MaxUploadsize;OnBeforeDataChange(this, "MaxUploadsize", oldvalue, value);m_MaxUploadsize = value;OnAfterDataChange(this, "MaxUploadsize", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String UploadBandwidth
|
||||
{
|
||||
get{return m_UploadBandwidth;}
|
||||
set{object oldvalue = m_UploadBandwidth;OnBeforeDataChange(this, "UploadBandwidth", oldvalue, value);m_UploadBandwidth = value;OnAfterDataChange(this, "UploadBandwidth", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String DownloadBandwidth
|
||||
{
|
||||
get{return m_DownloadBandwidth;}
|
||||
set{object oldvalue = m_DownloadBandwidth;OnBeforeDataChange(this, "DownloadBandwidth", oldvalue, value);m_DownloadBandwidth = value;OnAfterDataChange(this, "DownloadBandwidth", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String VolumeSize
|
||||
{
|
||||
get{return m_VolumeSize;}
|
||||
set{object oldvalue = m_VolumeSize;OnBeforeDataChange(this, "VolumeSize", oldvalue, value);m_VolumeSize = value;OnAfterDataChange(this, "VolumeSize", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String FullAfter
|
||||
{
|
||||
get{return m_FullAfter;}
|
||||
set{object oldvalue = m_FullAfter;OnBeforeDataChange(this, "FullAfter", oldvalue, value);m_FullAfter = value;OnAfterDataChange(this, "FullAfter", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String ThreadPriority
|
||||
{
|
||||
get{return m_ThreadPriority;}
|
||||
set{object oldvalue = m_ThreadPriority;OnBeforeDataChange(this, "ThreadPriority", oldvalue, value);m_ThreadPriority = value;OnAfterDataChange(this, "ThreadPriority", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.Boolean AsyncTransfer
|
||||
{
|
||||
get{return m_AsyncTransfer;}
|
||||
set{object oldvalue = m_AsyncTransfer;OnBeforeDataChange(this, "AsyncTransfer", oldvalue, value);m_AsyncTransfer = value;OnAfterDataChange(this, "AsyncTransfer", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.Boolean GPGEncryption
|
||||
{
|
||||
get{return m_GPGEncryption;}
|
||||
@@ -180,12 +130,6 @@ namespace Duplicati.Datamodel
|
||||
set{object oldvalue = m_IncludeSetup;OnBeforeDataChange(this, "IncludeSetup", oldvalue, value);m_IncludeSetup = value;OnAfterDataChange(this, "IncludeSetup", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.Boolean IgnoreTimestamps
|
||||
{
|
||||
get{return m_IgnoreTimestamps;}
|
||||
set{object oldvalue = m_IgnoreTimestamps;OnBeforeDataChange(this, "IgnoreTimestamps", oldvalue, value);m_IgnoreTimestamps = value;OnAfterDataChange(this, "IgnoreTimestamps", oldvalue, value);}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region " referenced properties "
|
||||
@@ -197,15 +141,6 @@ namespace Duplicati.Datamodel
|
||||
set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskSchedule", this, value); }
|
||||
}
|
||||
|
||||
[Affects(typeof(TaskSetting))]
|
||||
public System.Collections.Generic.IList<TaskSetting> TaskSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects<TaskSetting>("TaskSettingTask", this);
|
||||
}
|
||||
}
|
||||
|
||||
[Affects(typeof(Log))]
|
||||
public System.Collections.Generic.IList<Log> Logs
|
||||
{
|
||||
@@ -224,6 +159,33 @@ namespace Duplicati.Datamodel
|
||||
}
|
||||
}
|
||||
|
||||
[Affects(typeof(BackendSetting))]
|
||||
public System.Collections.Generic.IList<BackendSetting> BackendSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects<BackendSetting>("BackendSettingTask", this);
|
||||
}
|
||||
}
|
||||
|
||||
[Affects(typeof(TaskExtension))]
|
||||
public System.Collections.Generic.IList<TaskExtension> TaskExtensions
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects<TaskExtension>("TaskExtensionTask", this);
|
||||
}
|
||||
}
|
||||
|
||||
[Affects(typeof(TaskOverride))]
|
||||
public System.Collections.Generic.IList<TaskOverride> TaskOverrides
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((DataFetcherWithRelations)m_dataparent).GetRelatedObjects<TaskOverride>("TaskOverrideTask", this);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
#region Disclaimer / License
|
||||
// Copyright (C) 2009, Kenneth Skovhede
|
||||
// http://www.hexad.dk, opensource@hexad.dk
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
#endregion
|
||||
/// <metadata>
|
||||
/// <creator>This class was created by DataClassFileBuilder (LightDatamodel)</creator>
|
||||
/// <provider name="System.Data.LightDatamodel.SQLiteDataProvider" connectionstring="Version=3;Data Source=D:\Dokumenter\duplicati\Duplicati\GUI\Datamodel\Duplicati.sqlite;" />
|
||||
/// <type>Table</type>
|
||||
/// <namespace>Duplicati.Datamodel</namespace>
|
||||
/// <name>TaskExtension</name>
|
||||
/// <sql></sql>
|
||||
/// </metadata>
|
||||
|
||||
using System.Data.LightDatamodel;
|
||||
using System.Data.LightDatamodel.DataClassAttributes;
|
||||
|
||||
namespace Duplicati.Datamodel
|
||||
{
|
||||
|
||||
[DatabaseTable("TaskExtension")]
|
||||
public partial class TaskExtension : DataClassBase
|
||||
{
|
||||
|
||||
#region " private members "
|
||||
|
||||
[AutoIncrement, PrimaryKey, DatabaseField("ID")]
|
||||
private System.Int64 m_ID = long.MinValue;
|
||||
[Relation("TaskExtensionTask", typeof(Task), "ID"), DatabaseField("TaskID")]
|
||||
private System.Int64 m_TaskID = long.MinValue;
|
||||
[DatabaseField("Name")]
|
||||
private System.String m_Name = "";
|
||||
[DatabaseField("Value")]
|
||||
private System.String m_Value = "";
|
||||
#endregion
|
||||
|
||||
#region " properties "
|
||||
|
||||
public System.Int64 ID
|
||||
{
|
||||
get{return m_ID;}
|
||||
set{object oldvalue = m_ID;OnBeforeDataChange(this, "ID", oldvalue, value);m_ID = value;OnAfterDataChange(this, "ID", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.Int64 TaskID
|
||||
{
|
||||
get{return m_TaskID;}
|
||||
set{object oldvalue = m_TaskID;OnBeforeDataChange(this, "TaskID", oldvalue, value);m_TaskID = value;OnAfterDataChange(this, "TaskID", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Name
|
||||
{
|
||||
get{return m_Name;}
|
||||
set{object oldvalue = m_Name;OnBeforeDataChange(this, "Name", oldvalue, value);m_Name = value;OnAfterDataChange(this, "Name", oldvalue, value);}
|
||||
}
|
||||
|
||||
public System.String Value
|
||||
{
|
||||
get{return m_Value;}
|
||||
set{object oldvalue = m_Value;OnBeforeDataChange(this, "Value", oldvalue, value);m_Value = value;OnAfterDataChange(this, "Value", oldvalue, value);}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region " referenced properties "
|
||||
|
||||
[Affects(typeof(Task))]
|
||||
public Task Task
|
||||
{
|
||||
get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject<Task>("TaskExtensionTask", this); }
|
||||
set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskExtensionTask", this, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
/// <provider name="System.Data.LightDatamodel.SQLiteDataProvider" connectionstring="Version=3;Data Source=D:\Dokumenter\duplicati\Duplicati\GUI\Datamodel\Duplicati.sqlite;" />
|
||||
/// <type>Table</type>
|
||||
/// <namespace>Duplicati.Datamodel</namespace>
|
||||
/// <name>TaskSetting</name>
|
||||
/// <name>TaskOverride</name>
|
||||
/// <sql></sql>
|
||||
/// </metadata>
|
||||
|
||||
@@ -32,15 +32,15 @@ using System.Data.LightDatamodel.DataClassAttributes;
|
||||
namespace Duplicati.Datamodel
|
||||
{
|
||||
|
||||
[DatabaseTable("TaskSetting")]
|
||||
public partial class TaskSetting : DataClassBase
|
||||
[DatabaseTable("TaskOverride")]
|
||||
public partial class TaskOverride : DataClassBase
|
||||
{
|
||||
|
||||
#region " private members "
|
||||
|
||||
[AutoIncrement, PrimaryKey, DatabaseField("ID")]
|
||||
private System.Int64 m_ID = long.MinValue;
|
||||
[Relation("TaskSettingTask", typeof(Task), "ID"), DatabaseField("TaskID")]
|
||||
[Relation("TaskOverrideTask", typeof(Task), "ID"), DatabaseField("TaskID")]
|
||||
private System.Int64 m_TaskID = long.MinValue;
|
||||
[DatabaseField("Name")]
|
||||
private System.String m_Name = "";
|
||||
@@ -81,8 +81,8 @@ namespace Duplicati.Datamodel
|
||||
[Affects(typeof(Task))]
|
||||
public Task Task
|
||||
{
|
||||
get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject<Task>("TaskSettingTask", this); }
|
||||
set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskSettingTask", this, value); }
|
||||
get{ return ((DataFetcherWithRelations)m_dataparent).GetRelatedObject<Task>("TaskOverrideTask", this); }
|
||||
set{ ((DataFetcherWithRelations)m_dataparent).SetRelatedObject("TaskOverrideTask", this, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -195,6 +195,18 @@
|
||||
<Compile Include="Wizard pages\Add backup\FinishedAdd.Designer.cs">
|
||||
<DependentUpon>FinishedAdd.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Wizard pages\Add backup\GeneratedFilenameOptions.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Wizard pages\Add backup\GeneratedFilenameOptions.Designer.cs">
|
||||
<DependentUpon>GeneratedFilenameOptions.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Wizard pages\Add backup\SettingOverrides.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Wizard pages\Add backup\SettingOverrides.Designer.cs">
|
||||
<DependentUpon>SettingOverrides.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Wizard pages\RestoreSetup\FinishedRestoreSetup.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@@ -590,6 +602,17 @@
|
||||
<ItemGroup>
|
||||
<None Include="Resources\StatusMenuIcon.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Database schema\2. Refactor for easier extensions.sql" />
|
||||
<EmbeddedResource Include="Wizard pages\Add backup\GeneratedFilenameOptions.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>GeneratedFilenameOptions.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Wizard pages\Add backup\SettingOverrides.resx">
|
||||
<SubType>Designer</SubType>
|
||||
<DependentUpon>SettingOverrides.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Wizard pages\Rearrange\" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -48,13 +48,9 @@ namespace Duplicati.GUI.Service_controls
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.TimeSeperator = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.BrowseTargetFolder = new System.Windows.Forms.Button();
|
||||
this.DestinationFolder = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.panel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// button1
|
||||
@@ -67,32 +63,6 @@ namespace Duplicati.GUI.Service_controls
|
||||
this.button1.Text = "Advanced <<<";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.TimeSeperator);
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Location = new System.Drawing.Point(0, 24);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(264, 32);
|
||||
this.panel1.TabIndex = 3;
|
||||
//
|
||||
// TimeSeperator
|
||||
//
|
||||
this.TimeSeperator.Location = new System.Drawing.Point(112, 8);
|
||||
this.TimeSeperator.Name = "TimeSeperator";
|
||||
this.TimeSeperator.Size = new System.Drawing.Size(24, 20);
|
||||
this.TimeSeperator.TabIndex = 2;
|
||||
this.TimeSeperator.TextChanged += new System.EventHandler(this.TimeSeperator_TextChanged);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(8, 8);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(77, 13);
|
||||
this.label2.TabIndex = 0;
|
||||
this.label2.Text = "Time seperator";
|
||||
//
|
||||
// BrowseTargetFolder
|
||||
//
|
||||
this.BrowseTargetFolder.Location = new System.Drawing.Point(240, 0);
|
||||
@@ -125,14 +95,11 @@ namespace Duplicati.GUI.Service_controls
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.BrowseTargetFolder);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.DestinationFolder);
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "FileSettings";
|
||||
this.Size = new System.Drawing.Size(268, 96);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -141,9 +108,6 @@ namespace Duplicati.GUI.Service_controls
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.TextBox TimeSeperator;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button BrowseTargetFolder;
|
||||
private System.Windows.Forms.TextBox DestinationFolder;
|
||||
private System.Windows.Forms.Label label1;
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace Duplicati.GUI.Service_controls
|
||||
m_file = file;
|
||||
|
||||
DestinationFolder.Text = m_file.DestinationFolder;
|
||||
TimeSeperator.Text = m_file.TimeSeparator;
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -62,14 +61,6 @@ namespace Duplicati.GUI.Service_controls
|
||||
m_file.DestinationFolder = DestinationFolder.Text;
|
||||
}
|
||||
|
||||
private void TimeSeperator_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (m_isUpdating || m_file == null)
|
||||
return;
|
||||
|
||||
m_file.TimeSeparator = TimeSeperator.Text;
|
||||
}
|
||||
|
||||
private void BrowseTargetFolder_Click(object sender, EventArgs e)
|
||||
{
|
||||
FolderBrowserDialog dlg = new FolderBrowserDialog();
|
||||
|
||||
@@ -92,10 +92,10 @@ namespace Duplicati.GUI.Service_controls
|
||||
ForceFullBackup.Checked = !string.IsNullOrEmpty(m_schedule.Task.FullAfter);
|
||||
ForceFullBackupTimespan.Text = m_schedule.Task.FullAfter;
|
||||
|
||||
MaxUploaded.Text = m_schedule.Task.MaxUploadsize;
|
||||
VolumeSize.Text = m_schedule.Task.VolumeSize;
|
||||
DownloadBandwidth.Text = m_schedule.Task.DownloadBandwidth;
|
||||
UploadBandwidth.Text =m_schedule.Task.UploadBandwidth;
|
||||
MaxUploaded.Text = m_schedule.Task.Extensions.MaxUploadSize;
|
||||
VolumeSize.Text = m_schedule.Task.Extensions.VolumeSize;
|
||||
DownloadBandwidth.Text = m_schedule.Task.Extensions.DownloadBandwidth;
|
||||
UploadBandwidth.Text =m_schedule.Task.Extensions.UploadBandwidth;
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -234,7 +234,7 @@ namespace Duplicati.GUI.Service_controls
|
||||
try
|
||||
{
|
||||
Library.Core.Sizeparser.ParseSize(MaxUploaded.Text);
|
||||
m_schedule.Task.MaxUploadsize = MaxUploaded.Text;
|
||||
m_schedule.Task.Extensions.MaxUploadSize = MaxUploaded.Text;
|
||||
errorProvider.SetError(MaxUploaded, "");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -251,7 +251,7 @@ namespace Duplicati.GUI.Service_controls
|
||||
try
|
||||
{
|
||||
Library.Core.Sizeparser.ParseSize(VolumeSize.Text);
|
||||
m_schedule.Task.VolumeSize = VolumeSize.Text;
|
||||
m_schedule.Task.Extensions.VolumeSize = VolumeSize.Text;
|
||||
errorProvider.SetError(VolumeSize, "");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -268,7 +268,7 @@ namespace Duplicati.GUI.Service_controls
|
||||
try
|
||||
{
|
||||
Library.Core.Sizeparser.ParseSize(UploadBandwidth.Text);
|
||||
m_schedule.Task.UploadBandwidth = UploadBandwidth.Text;
|
||||
m_schedule.Task.Extensions.UploadBandwidth = UploadBandwidth.Text;
|
||||
errorProvider.SetError(UploadBandwidth, "");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -286,7 +286,7 @@ namespace Duplicati.GUI.Service_controls
|
||||
try
|
||||
{
|
||||
Library.Core.Sizeparser.ParseSize(DownloadBandwidth.Text);
|
||||
m_schedule.Task.DownloadBandwidth = DownloadBandwidth.Text;
|
||||
m_schedule.Task.Extensions.DownloadBandwidth = DownloadBandwidth.Text;
|
||||
errorProvider.SetError(DownloadBandwidth, "");
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -33,12 +33,14 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
this.ThrottleOptions = new System.Windows.Forms.CheckBox();
|
||||
this.EditFilters = new System.Windows.Forms.CheckBox();
|
||||
this.IncludeDuplicatiSetup = new System.Windows.Forms.CheckBox();
|
||||
this.EditVolumeFilenames = new System.Windows.Forms.CheckBox();
|
||||
this.EditOverrides = new System.Windows.Forms.CheckBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// SelectWhen
|
||||
//
|
||||
this.SelectWhen.AutoSize = true;
|
||||
this.SelectWhen.Location = new System.Drawing.Point(32, 32);
|
||||
this.SelectWhen.Location = new System.Drawing.Point(32, 8);
|
||||
this.SelectWhen.Name = "SelectWhen";
|
||||
this.SelectWhen.Size = new System.Drawing.Size(265, 17);
|
||||
this.SelectWhen.TabIndex = 0;
|
||||
@@ -48,7 +50,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
// SelectIncremental
|
||||
//
|
||||
this.SelectIncremental.AutoSize = true;
|
||||
this.SelectIncremental.Location = new System.Drawing.Point(32, 64);
|
||||
this.SelectIncremental.Location = new System.Drawing.Point(32, 40);
|
||||
this.SelectIncremental.Name = "SelectIncremental";
|
||||
this.SelectIncremental.Size = new System.Drawing.Size(439, 17);
|
||||
this.SelectIncremental.TabIndex = 1;
|
||||
@@ -59,7 +61,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
// ThrottleOptions
|
||||
//
|
||||
this.ThrottleOptions.AutoSize = true;
|
||||
this.ThrottleOptions.Location = new System.Drawing.Point(32, 96);
|
||||
this.ThrottleOptions.Location = new System.Drawing.Point(32, 72);
|
||||
this.ThrottleOptions.Name = "ThrottleOptions";
|
||||
this.ThrottleOptions.Size = new System.Drawing.Size(329, 17);
|
||||
this.ThrottleOptions.TabIndex = 3;
|
||||
@@ -69,7 +71,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
// EditFilters
|
||||
//
|
||||
this.EditFilters.AutoSize = true;
|
||||
this.EditFilters.Location = new System.Drawing.Point(32, 128);
|
||||
this.EditFilters.Location = new System.Drawing.Point(32, 104);
|
||||
this.EditFilters.Name = "EditFilters";
|
||||
this.EditFilters.Size = new System.Drawing.Size(316, 17);
|
||||
this.EditFilters.TabIndex = 4;
|
||||
@@ -81,17 +83,39 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
this.IncludeDuplicatiSetup.AutoSize = true;
|
||||
this.IncludeDuplicatiSetup.Checked = true;
|
||||
this.IncludeDuplicatiSetup.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.IncludeDuplicatiSetup.Location = new System.Drawing.Point(32, 160);
|
||||
this.IncludeDuplicatiSetup.Location = new System.Drawing.Point(32, 200);
|
||||
this.IncludeDuplicatiSetup.Name = "IncludeDuplicatiSetup";
|
||||
this.IncludeDuplicatiSetup.Size = new System.Drawing.Size(256, 17);
|
||||
this.IncludeDuplicatiSetup.TabIndex = 5;
|
||||
this.IncludeDuplicatiSetup.Text = "Include the current Duplicati setup in the backup";
|
||||
this.IncludeDuplicatiSetup.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// EditVolumeFilenames
|
||||
//
|
||||
this.EditVolumeFilenames.AutoSize = true;
|
||||
this.EditVolumeFilenames.Location = new System.Drawing.Point(32, 136);
|
||||
this.EditVolumeFilenames.Name = "EditVolumeFilenames";
|
||||
this.EditVolumeFilenames.Size = new System.Drawing.Size(369, 17);
|
||||
this.EditVolumeFilenames.TabIndex = 6;
|
||||
this.EditVolumeFilenames.Text = "Change the generated names for files stored on the backend (advanced)";
|
||||
this.EditVolumeFilenames.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// EditOverrides
|
||||
//
|
||||
this.EditOverrides.AutoSize = true;
|
||||
this.EditOverrides.Location = new System.Drawing.Point(32, 168);
|
||||
this.EditOverrides.Name = "EditOverrides";
|
||||
this.EditOverrides.Size = new System.Drawing.Size(228, 17);
|
||||
this.EditOverrides.TabIndex = 7;
|
||||
this.EditOverrides.Text = "Manually override settings (very advanced)";
|
||||
this.EditOverrides.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// AdvancedOptions
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.EditOverrides);
|
||||
this.Controls.Add(this.EditVolumeFilenames);
|
||||
this.Controls.Add(this.IncludeDuplicatiSetup);
|
||||
this.Controls.Add(this.EditFilters);
|
||||
this.Controls.Add(this.ThrottleOptions);
|
||||
@@ -111,5 +135,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
private System.Windows.Forms.CheckBox ThrottleOptions;
|
||||
private System.Windows.Forms.CheckBox EditFilters;
|
||||
private System.Windows.Forms.CheckBox IncludeDuplicatiSetup;
|
||||
private System.Windows.Forms.CheckBox EditVolumeFilenames;
|
||||
private System.Windows.Forms.CheckBox EditOverrides;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,10 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
{
|
||||
m_wrapper = new WizardSettingsWrapper(m_settings);
|
||||
if (!m_valuesAutoLoaded)
|
||||
{
|
||||
IncludeDuplicatiSetup.Checked = m_wrapper.IncludeSetup;
|
||||
EditOverrides.Checked = m_wrapper.Overrides.Count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
void AdvancedOptions_PageLeave(object sender, PageChangedArgs args)
|
||||
@@ -54,6 +57,8 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
m_settings["Advanced:Incremental"] = SelectIncremental.Checked;
|
||||
m_settings["Advanced:Throttle"] = ThrottleOptions.Checked;
|
||||
m_settings["Advanced:Filters"] = EditFilters.Checked;
|
||||
m_settings["Advanced:Filenames"] = EditVolumeFilenames.Checked;
|
||||
m_settings["Advanced:Overrides"] = EditOverrides.Checked;
|
||||
|
||||
if (args.Direction == PageChangedDirection.Back)
|
||||
return;
|
||||
@@ -68,6 +73,10 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
args.NextPage = new Wizard_pages.Add_backup.ThrottleOptions();
|
||||
else if (EditFilters.Checked)
|
||||
args.NextPage = new Wizard_pages.Add_backup.EditFilters();
|
||||
else if (EditVolumeFilenames.Checked)
|
||||
args.NextPage = new Wizard_pages.Add_backup.GeneratedFilenameOptions();
|
||||
else if (EditOverrides.Checked)
|
||||
args.NextPage = new Wizard_pages.Add_backup.SettingOverrides();
|
||||
else
|
||||
args.NextPage = new Wizard_pages.Add_backup.FinishedAdd();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,12 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
|
||||
m_wrapper.EncodedFilters = filterEditor1.Filter;
|
||||
|
||||
args.NextPage = new Wizard_pages.Add_backup.FinishedAdd();
|
||||
if ((bool)m_settings["Advanced:Filenames"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.GeneratedFilenameOptions();
|
||||
else if ((bool)m_settings["Advanced:Overrides"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.SettingOverrides();
|
||||
else
|
||||
args.NextPage = new Wizard_pages.Add_backup.FinishedAdd();
|
||||
}
|
||||
|
||||
void FilterEditor_PageEnter(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
{
|
||||
partial class GeneratedFilenameOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.FilePrefixEnabled = new System.Windows.Forms.CheckBox();
|
||||
this.UseShortFilenames = new System.Windows.Forms.CheckBox();
|
||||
this.FilePrefix = new System.Windows.Forms.TextBox();
|
||||
this.FileTimeSeperator = new System.Windows.Forms.ComboBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(40, 24);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(92, 13);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "File time seperator";
|
||||
//
|
||||
// FilePrefixEnabled
|
||||
//
|
||||
this.FilePrefixEnabled.AutoSize = true;
|
||||
this.FilePrefixEnabled.Location = new System.Drawing.Point(24, 56);
|
||||
this.FilePrefixEnabled.Name = "FilePrefixEnabled";
|
||||
this.FilePrefixEnabled.Size = new System.Drawing.Size(133, 17);
|
||||
this.FilePrefixEnabled.TabIndex = 1;
|
||||
this.FilePrefixEnabled.Text = "Change filename prefix";
|
||||
this.FilePrefixEnabled.UseVisualStyleBackColor = true;
|
||||
this.FilePrefixEnabled.CheckedChanged += new System.EventHandler(this.FilePrefixEnabled_CheckedChanged);
|
||||
//
|
||||
// UseShortFilenames
|
||||
//
|
||||
this.UseShortFilenames.AutoSize = true;
|
||||
this.UseShortFilenames.Location = new System.Drawing.Point(24, 88);
|
||||
this.UseShortFilenames.Name = "UseShortFilenames";
|
||||
this.UseShortFilenames.Size = new System.Drawing.Size(118, 17);
|
||||
this.UseShortFilenames.TabIndex = 2;
|
||||
this.UseShortFilenames.Text = "Use short filenames";
|
||||
this.UseShortFilenames.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// FilePrefix
|
||||
//
|
||||
this.FilePrefix.Enabled = false;
|
||||
this.FilePrefix.Location = new System.Drawing.Point(168, 56);
|
||||
this.FilePrefix.Name = "FilePrefix";
|
||||
this.FilePrefix.Size = new System.Drawing.Size(128, 20);
|
||||
this.FilePrefix.TabIndex = 3;
|
||||
//
|
||||
// FileTimeSeperator
|
||||
//
|
||||
this.FileTimeSeperator.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.FileTimeSeperator.FormattingEnabled = true;
|
||||
this.FileTimeSeperator.Items.AddRange(new object[] {
|
||||
"\'",
|
||||
":",
|
||||
"_"});
|
||||
this.FileTimeSeperator.Location = new System.Drawing.Point(168, 24);
|
||||
this.FileTimeSeperator.Name = "FileTimeSeperator";
|
||||
this.FileTimeSeperator.Size = new System.Drawing.Size(56, 22);
|
||||
this.FileTimeSeperator.TabIndex = 4;
|
||||
//
|
||||
// GeneratedFilenameOptions
|
||||
//
|
||||
this.Controls.Add(this.FileTimeSeperator);
|
||||
this.Controls.Add(this.FilePrefix);
|
||||
this.Controls.Add(this.UseShortFilenames);
|
||||
this.Controls.Add(this.FilePrefixEnabled);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "GeneratedFilenameOptions";
|
||||
this.Size = new System.Drawing.Size(506, 242);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.CheckBox FilePrefixEnabled;
|
||||
private System.Windows.Forms.CheckBox UseShortFilenames;
|
||||
private System.Windows.Forms.TextBox FilePrefix;
|
||||
private System.Windows.Forms.ComboBox FileTimeSeperator;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
#region Disclaimer / License
|
||||
// Copyright (C) 2009, Kenneth Skovhede
|
||||
// http://www.hexad.dk, opensource@hexad.dk
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
#endregion
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
{
|
||||
public partial class GeneratedFilenameOptions : System.Windows.Forms.Wizard.WizardControl
|
||||
{
|
||||
private WizardSettingsWrapper m_wrapper;
|
||||
|
||||
public GeneratedFilenameOptions()
|
||||
: base("Generated filenames", "On this page you can control how filenames are generated. This can be used if the remote server does not support the default filenames.")
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
base.PageEnter += new System.Windows.Forms.Wizard.PageChangeHandler(GeneratedFilenameOptions_PageEnter);
|
||||
base.PageLeave += new System.Windows.Forms.Wizard.PageChangeHandler(GeneratedFilenameOptions_PageLeave);
|
||||
}
|
||||
|
||||
void GeneratedFilenameOptions_PageLeave(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
|
||||
{
|
||||
if (args.Direction == System.Windows.Forms.Wizard.PageChangedDirection.Back)
|
||||
return;
|
||||
|
||||
m_wrapper.FileTimeSeperator = FileTimeSeperator.Text;
|
||||
m_wrapper.FilePrefix = FilePrefixEnabled.Checked ? "" : FilePrefix.Text;
|
||||
m_wrapper.ShortFilenames = UseShortFilenames.Checked;
|
||||
|
||||
if ((bool)m_settings["Advanced:Overrides"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.SettingOverrides();
|
||||
else
|
||||
args.NextPage = new Wizard_pages.Add_backup.FinishedAdd();
|
||||
|
||||
}
|
||||
|
||||
void GeneratedFilenameOptions_PageEnter(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
|
||||
{
|
||||
m_wrapper = new WizardSettingsWrapper(m_settings);
|
||||
if (!m_valuesAutoLoaded)
|
||||
{
|
||||
FileTimeSeperator.Text = m_wrapper.FileTimeSeperator;
|
||||
if (FileTimeSeperator.Text == "")
|
||||
FileTimeSeperator.Text = ":";
|
||||
FilePrefixEnabled.Checked = !string.IsNullOrEmpty(m_wrapper.FilePrefix);
|
||||
FilePrefix.Text = m_wrapper.FilePrefix;
|
||||
UseShortFilenames.Checked = m_wrapper.ShortFilenames;
|
||||
}
|
||||
}
|
||||
|
||||
private void FilePrefixEnabled_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
FilePrefix.Enabled = FilePrefixEnabled.Checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -131,6 +131,10 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
args.NextPage = new Wizard_pages.Add_backup.ThrottleOptions();
|
||||
else if ((bool)m_settings["Advanced:Filters"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.EditFilters();
|
||||
else if ((bool)m_settings["Advanced:Filenames"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.GeneratedFilenameOptions();
|
||||
else if ((bool)m_settings["Advanced:Overrides"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.SettingOverrides();
|
||||
else
|
||||
args.NextPage = new Wizard_pages.Add_backup.FinishedAdd();
|
||||
}
|
||||
|
||||
@@ -89,7 +89,9 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
m_owner.Cancelled -= new CancelEventHandler(m_owner_Cancelled);
|
||||
m_settings["Files:Sizes"] = m_sizes;
|
||||
m_settings["Files:WarnedFilters"] = m_warnedFiltersChanged;
|
||||
m_calculator.ClearQueue(true);
|
||||
|
||||
if (m_calculator != null)
|
||||
m_calculator.ClearQueue(true);
|
||||
|
||||
if (args.Direction == PageChangedDirection.Back)
|
||||
return;
|
||||
|
||||
@@ -105,6 +105,10 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
args.NextPage = new Wizard_pages.Add_backup.ThrottleOptions();
|
||||
else if ((bool)m_settings["Advanced:Filters"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.EditFilters();
|
||||
else if ((bool)m_settings["Advanced:Filenames"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.GeneratedFilenameOptions();
|
||||
else if ((bool)m_settings["Advanced:Overrides"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.SettingOverrides();
|
||||
else
|
||||
args.NextPage = new Wizard_pages.Add_backup.FinishedAdd();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
{
|
||||
partial class SettingOverrides
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.OptionsGrid = new System.Windows.Forms.DataGridView();
|
||||
this.InfoLabel = new System.Windows.Forms.Label();
|
||||
this.BaseDataSet = new System.Data.DataSet();
|
||||
this.OverrideTable = new System.Data.DataTable();
|
||||
this.EnabledDataColumn = new System.Data.DataColumn();
|
||||
this.NameDataColumn = new System.Data.DataColumn();
|
||||
this.ValueDataColumn = new System.Data.DataColumn();
|
||||
this.enabledDataGridViewCheckBoxColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.nameDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.valueDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.argumentDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.argumentDataColumn = new System.Data.DataColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.OptionsGrid)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BaseDataSet)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.OverrideTable)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// OptionsGrid
|
||||
//
|
||||
this.OptionsGrid.AllowUserToAddRows = false;
|
||||
this.OptionsGrid.AllowUserToDeleteRows = false;
|
||||
this.OptionsGrid.AutoGenerateColumns = false;
|
||||
this.OptionsGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.OptionsGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.enabledDataGridViewCheckBoxColumn,
|
||||
this.nameDataGridViewTextBoxColumn,
|
||||
this.valueDataGridViewTextBoxColumn,
|
||||
this.argumentDataGridViewTextBoxColumn});
|
||||
this.OptionsGrid.DataMember = "OverrideTable";
|
||||
this.OptionsGrid.DataSource = this.BaseDataSet;
|
||||
this.OptionsGrid.Location = new System.Drawing.Point(16, 16);
|
||||
this.OptionsGrid.MultiSelect = false;
|
||||
this.OptionsGrid.Name = "OptionsGrid";
|
||||
this.OptionsGrid.RowHeadersVisible = false;
|
||||
this.OptionsGrid.Size = new System.Drawing.Size(472, 144);
|
||||
this.OptionsGrid.TabIndex = 0;
|
||||
this.OptionsGrid.RowEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.OptionsGrid_RowEnter);
|
||||
this.OptionsGrid.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.OptionsGrid_CellEndEdit);
|
||||
//
|
||||
// InfoLabel
|
||||
//
|
||||
this.InfoLabel.Location = new System.Drawing.Point(16, 168);
|
||||
this.InfoLabel.Name = "InfoLabel";
|
||||
this.InfoLabel.Size = new System.Drawing.Size(472, 64);
|
||||
this.InfoLabel.TabIndex = 0;
|
||||
this.InfoLabel.Text = "Description panel";
|
||||
//
|
||||
// BaseDataSet
|
||||
//
|
||||
this.BaseDataSet.DataSetName = "BaseDataSet";
|
||||
this.BaseDataSet.Tables.AddRange(new System.Data.DataTable[] {
|
||||
this.OverrideTable});
|
||||
//
|
||||
// OverrideTable
|
||||
//
|
||||
this.OverrideTable.Columns.AddRange(new System.Data.DataColumn[] {
|
||||
this.EnabledDataColumn,
|
||||
this.NameDataColumn,
|
||||
this.ValueDataColumn,
|
||||
this.argumentDataColumn});
|
||||
this.OverrideTable.TableName = "OverrideTable";
|
||||
//
|
||||
// EnabledDataColumn
|
||||
//
|
||||
this.EnabledDataColumn.Caption = "Enabled";
|
||||
this.EnabledDataColumn.ColumnName = "Enabled";
|
||||
this.EnabledDataColumn.DataType = typeof(bool);
|
||||
//
|
||||
// NameDataColumn
|
||||
//
|
||||
this.NameDataColumn.Caption = "Name";
|
||||
this.NameDataColumn.ColumnName = "Name";
|
||||
//
|
||||
// ValueDataColumn
|
||||
//
|
||||
this.ValueDataColumn.Caption = "Value";
|
||||
this.ValueDataColumn.ColumnName = "Value";
|
||||
//
|
||||
// enabledDataGridViewCheckBoxColumn
|
||||
//
|
||||
this.enabledDataGridViewCheckBoxColumn.DataPropertyName = "Enabled";
|
||||
this.enabledDataGridViewCheckBoxColumn.HeaderText = "Enabled";
|
||||
this.enabledDataGridViewCheckBoxColumn.Name = "enabledDataGridViewCheckBoxColumn";
|
||||
this.enabledDataGridViewCheckBoxColumn.Width = 50;
|
||||
//
|
||||
// nameDataGridViewTextBoxColumn
|
||||
//
|
||||
this.nameDataGridViewTextBoxColumn.DataPropertyName = "Name";
|
||||
this.nameDataGridViewTextBoxColumn.HeaderText = "Name";
|
||||
this.nameDataGridViewTextBoxColumn.Name = "nameDataGridViewTextBoxColumn";
|
||||
this.nameDataGridViewTextBoxColumn.ReadOnly = true;
|
||||
this.nameDataGridViewTextBoxColumn.Width = 150;
|
||||
//
|
||||
// valueDataGridViewTextBoxColumn
|
||||
//
|
||||
this.valueDataGridViewTextBoxColumn.DataPropertyName = "Value";
|
||||
this.valueDataGridViewTextBoxColumn.HeaderText = "Value";
|
||||
this.valueDataGridViewTextBoxColumn.Name = "valueDataGridViewTextBoxColumn";
|
||||
this.valueDataGridViewTextBoxColumn.Width = 240;
|
||||
//
|
||||
// dataGridViewTextBoxColumn1
|
||||
//
|
||||
this.dataGridViewTextBoxColumn1.DataPropertyName = "argument";
|
||||
this.dataGridViewTextBoxColumn1.HeaderText = "argument";
|
||||
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
|
||||
this.dataGridViewTextBoxColumn1.Visible = false;
|
||||
this.dataGridViewTextBoxColumn1.Width = 5;
|
||||
//
|
||||
// argumentDataGridViewTextBoxColumn
|
||||
//
|
||||
this.argumentDataGridViewTextBoxColumn.DataPropertyName = "argument";
|
||||
this.argumentDataGridViewTextBoxColumn.HeaderText = "argument";
|
||||
this.argumentDataGridViewTextBoxColumn.Name = "argumentDataGridViewTextBoxColumn";
|
||||
this.argumentDataGridViewTextBoxColumn.Visible = false;
|
||||
this.argumentDataGridViewTextBoxColumn.Width = 5;
|
||||
//
|
||||
// argumentDataColumn
|
||||
//
|
||||
this.argumentDataColumn.Caption = "argument";
|
||||
this.argumentDataColumn.ColumnName = "argument";
|
||||
this.argumentDataColumn.DataType = typeof(object);
|
||||
//
|
||||
// SettingOverrides
|
||||
//
|
||||
this.Controls.Add(this.InfoLabel);
|
||||
this.Controls.Add(this.OptionsGrid);
|
||||
this.Name = "SettingOverrides";
|
||||
this.Size = new System.Drawing.Size(506, 242);
|
||||
((System.ComponentModel.ISupportInitialize)(this.OptionsGrid)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BaseDataSet)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.OverrideTable)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView OptionsGrid;
|
||||
private System.Windows.Forms.Label InfoLabel;
|
||||
private System.Data.DataSet BaseDataSet;
|
||||
private System.Data.DataTable OverrideTable;
|
||||
private System.Data.DataColumn EnabledDataColumn;
|
||||
private System.Data.DataColumn NameDataColumn;
|
||||
private System.Data.DataColumn ValueDataColumn;
|
||||
private System.Data.DataColumn argumentDataColumn;
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn enabledDataGridViewCheckBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn nameDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn valueDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn argumentDataGridViewTextBoxColumn;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
#region Disclaimer / License
|
||||
// Copyright (C) 2009, Kenneth Skovhede
|
||||
// http://www.hexad.dk, opensource@hexad.dk
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 2.1 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
//
|
||||
#endregion
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
{
|
||||
public partial class SettingOverrides : System.Windows.Forms.Wizard.WizardControl
|
||||
{
|
||||
private WizardSettingsWrapper m_wrapper;
|
||||
|
||||
public SettingOverrides()
|
||||
: base("Override settings", "On this page you can override all settings supported by Duplicati. This is very advanced, so be carefull!")
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
m_autoFillValues = false;
|
||||
base.PageEnter += new System.Windows.Forms.Wizard.PageChangeHandler(SettingOverrides_PageEnter);
|
||||
base.PageLeave += new System.Windows.Forms.Wizard.PageChangeHandler(SettingOverrides_PageLeave);
|
||||
}
|
||||
|
||||
void SettingOverrides_PageLeave(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
|
||||
{
|
||||
if (args.Direction == System.Windows.Forms.Wizard.PageChangedDirection.Back)
|
||||
return;
|
||||
|
||||
m_wrapper.Overrides.Clear();
|
||||
foreach (DataRow dr in OverrideTable.Rows)
|
||||
if ((bool)dr["Enabled"])
|
||||
m_wrapper.Overrides.Add((string)dr["Name"], (string)dr["Value"]);
|
||||
|
||||
args.NextPage = new Wizard_pages.Add_backup.FinishedAdd();
|
||||
}
|
||||
|
||||
void SettingOverrides_PageEnter(object sender, System.Windows.Forms.Wizard.PageChangedArgs args)
|
||||
{
|
||||
m_wrapper = new WizardSettingsWrapper(m_settings);
|
||||
|
||||
if (!m_settings.ContainsKey("Overrides:Table"))
|
||||
{
|
||||
OverrideTable.Rows.Clear();
|
||||
|
||||
Library.Main.Options opt = new Library.Main.Options(new Dictionary<string, string>());
|
||||
foreach (Library.Backend.ICommandLineArgument arg in opt.SupportedCommands)
|
||||
{
|
||||
DataRow dr = OverrideTable.NewRow();
|
||||
dr["Enabled"] = m_wrapper.Overrides.ContainsKey(arg.Name);
|
||||
dr["argument"] = arg;
|
||||
dr["Name"] = arg.Name;
|
||||
if (m_wrapper.Overrides.ContainsKey(arg.Name))
|
||||
dr["Value"] = m_wrapper.Overrides[arg.Name];
|
||||
OverrideTable.Rows.Add(dr);
|
||||
}
|
||||
|
||||
m_settings["Overrides:Table"] = BaseDataSet;
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseDataSet = (DataSet)m_settings["Overrides:Table"];
|
||||
OptionsGrid.DataSource = BaseDataSet;
|
||||
OverrideTable = BaseDataSet.Tables["OverrideTable"];
|
||||
OptionsGrid.DataMember = "OverrideTable";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OptionsGrid_RowEnter(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
DataRow r = OverrideTable.Rows[e.RowIndex];
|
||||
Library.Backend.ICommandLineArgument arg = (Library.Backend.ICommandLineArgument)r["argument"];
|
||||
InfoLabel.Text = string.Format("Type: {0}. {1}. {2}", arg.Type.ToString(), arg.ShortDescription, arg.LongDescription);
|
||||
}
|
||||
|
||||
private void OptionsGrid_CellEndEdit(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.ColumnIndex != 0)
|
||||
{
|
||||
DataRow r = OverrideTable.Rows[e.RowIndex];
|
||||
r["Enabled"] = r["Value"] != DBNull.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="BaseDataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -132,7 +132,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
// BackupLimitEnabled
|
||||
//
|
||||
this.BackupLimitEnabled.AutoSize = true;
|
||||
this.BackupLimitEnabled.Location = new System.Drawing.Point(32, 96);
|
||||
this.BackupLimitEnabled.Location = new System.Drawing.Point(32, 89);
|
||||
this.BackupLimitEnabled.Name = "BackupLimitEnabled";
|
||||
this.BackupLimitEnabled.Size = new System.Drawing.Size(134, 17);
|
||||
this.BackupLimitEnabled.TabIndex = 9;
|
||||
@@ -150,7 +150,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
"kb",
|
||||
"mb",
|
||||
"gb"});
|
||||
this.BackupLimitSuffix.Location = new System.Drawing.Point(281, 95);
|
||||
this.BackupLimitSuffix.Location = new System.Drawing.Point(281, 88);
|
||||
this.BackupLimitSuffix.Name = "BackupLimitSuffix";
|
||||
this.BackupLimitSuffix.Size = new System.Drawing.Size(72, 21);
|
||||
this.BackupLimitSuffix.TabIndex = 11;
|
||||
@@ -158,7 +158,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
// BackupLimitNumber
|
||||
//
|
||||
this.BackupLimitNumber.Enabled = false;
|
||||
this.BackupLimitNumber.Location = new System.Drawing.Point(185, 95);
|
||||
this.BackupLimitNumber.Location = new System.Drawing.Point(185, 88);
|
||||
this.BackupLimitNumber.Maximum = new decimal(new int[] {
|
||||
10000,
|
||||
0,
|
||||
@@ -178,14 +178,14 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
"kb",
|
||||
"mb",
|
||||
"gb"});
|
||||
this.VolumeSizeLimitSuffix.Location = new System.Drawing.Point(280, 128);
|
||||
this.VolumeSizeLimitSuffix.Location = new System.Drawing.Point(280, 120);
|
||||
this.VolumeSizeLimitSuffix.Name = "VolumeSizeLimitSuffix";
|
||||
this.VolumeSizeLimitSuffix.Size = new System.Drawing.Size(72, 21);
|
||||
this.VolumeSizeLimitSuffix.TabIndex = 14;
|
||||
//
|
||||
// VolumeSizeLimitNumber
|
||||
//
|
||||
this.VolumeSizeLimitNumber.Location = new System.Drawing.Point(184, 128);
|
||||
this.VolumeSizeLimitNumber.Location = new System.Drawing.Point(184, 120);
|
||||
this.VolumeSizeLimitNumber.Maximum = new decimal(new int[] {
|
||||
10000,
|
||||
0,
|
||||
@@ -199,7 +199,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
// AsyncEnabled
|
||||
//
|
||||
this.AsyncEnabled.AutoSize = true;
|
||||
this.AsyncEnabled.Location = new System.Drawing.Point(32, 168);
|
||||
this.AsyncEnabled.Location = new System.Drawing.Point(32, 160);
|
||||
this.AsyncEnabled.Name = "AsyncEnabled";
|
||||
this.AsyncEnabled.Size = new System.Drawing.Size(124, 17);
|
||||
this.AsyncEnabled.TabIndex = 15;
|
||||
@@ -209,7 +209,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(48, 128);
|
||||
this.label1.Location = new System.Drawing.Point(48, 120);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(103, 13);
|
||||
this.label1.TabIndex = 16;
|
||||
@@ -218,7 +218,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
// ThreadPriorityEnabled
|
||||
//
|
||||
this.ThreadPriorityEnabled.AutoSize = true;
|
||||
this.ThreadPriorityEnabled.Location = new System.Drawing.Point(32, 200);
|
||||
this.ThreadPriorityEnabled.Location = new System.Drawing.Point(32, 184);
|
||||
this.ThreadPriorityEnabled.Name = "ThreadPriorityEnabled";
|
||||
this.ThreadPriorityEnabled.Size = new System.Drawing.Size(108, 17);
|
||||
this.ThreadPriorityEnabled.TabIndex = 17;
|
||||
@@ -237,7 +237,7 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
"Normal",
|
||||
"Below normal",
|
||||
"Low"});
|
||||
this.ThreadPriority.Location = new System.Drawing.Point(184, 200);
|
||||
this.ThreadPriority.Location = new System.Drawing.Point(184, 184);
|
||||
this.ThreadPriority.Name = "ThreadPriority";
|
||||
this.ThreadPriority.Size = new System.Drawing.Size(168, 21);
|
||||
this.ThreadPriority.TabIndex = 18;
|
||||
|
||||
@@ -143,6 +143,10 @@ namespace Duplicati.GUI.Wizard_pages.Add_backup
|
||||
|
||||
if ((bool)m_settings["Advanced:Filters"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.EditFilters();
|
||||
else if ((bool)m_settings["Advanced:Filenames"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.GeneratedFilenameOptions();
|
||||
else if ((bool)m_settings["Advanced:Overrides"])
|
||||
args.NextPage = new Wizard_pages.Add_backup.SettingOverrides();
|
||||
else
|
||||
args.NextPage = new FinishedAdd();
|
||||
}
|
||||
|
||||
@@ -131,15 +131,24 @@ namespace Duplicati.GUI.Wizard_pages
|
||||
this.FullBackupInterval = schedule.Task.FullAfter;
|
||||
this.MaxFullBackups = (int)schedule.Task.KeepFull;
|
||||
this.BackupExpireInterval = schedule.Task.KeepTime;
|
||||
this.UploadSpeedLimit = schedule.Task.UploadBandwidth;
|
||||
this.DownloadSpeedLimit = schedule.Task.DownloadBandwidth;
|
||||
this.BackupSizeLimit = schedule.Task.MaxUploadsize;
|
||||
this.VolumeSize = schedule.Task.VolumeSize;
|
||||
this.ThreadPriority = schedule.Task.ThreadPriority;
|
||||
this.AsyncTransfer = schedule.Task.AsyncTransfer;
|
||||
this.UploadSpeedLimit = schedule.Task.Extensions.UploadBandwidth;
|
||||
this.DownloadSpeedLimit = schedule.Task.Extensions.DownloadBandwidth;
|
||||
this.BackupSizeLimit = schedule.Task.Extensions.MaxUploadSize;
|
||||
this.VolumeSize = schedule.Task.Extensions.VolumeSize;
|
||||
this.ThreadPriority = schedule.Task.Extensions.ThreadPriority;
|
||||
this.AsyncTransfer = schedule.Task.Extensions.AsyncTransfer;
|
||||
this.GPGEncryption = schedule.Task.GPGEncryption;
|
||||
this.IncludeSetup = schedule.Task.IncludeSetup;
|
||||
this.IgnoreFileTimestamps = schedule.Task.IgnoreTimestamps;
|
||||
this.IgnoreFileTimestamps = schedule.Task.Extensions.IgnoreTimestamps;
|
||||
this.FileSizeLimit = schedule.Task.Extensions.FileSizeLimit;
|
||||
|
||||
this.FilePrefix = schedule.Task.Extensions.FilenamePrefix;
|
||||
this.FileTimeSeperator = schedule.Task.Extensions.FileTimeSeperator;
|
||||
this.ShortFilenames = schedule.Task.Extensions.ShortFilenames;
|
||||
|
||||
this.Overrides = new Dictionary<string, string>();
|
||||
foreach (Datamodel.TaskOverride ov in schedule.Task.TaskOverrides)
|
||||
this.Overrides[ov.Name] = ov.Value;
|
||||
|
||||
this.PrimayAction = action;
|
||||
}
|
||||
@@ -156,7 +165,6 @@ namespace Duplicati.GUI.Wizard_pages
|
||||
if (schedule.Task == null)
|
||||
schedule.Task = schedule.DataParent.Add<Datamodel.Task>();
|
||||
schedule.Task.SourcePath = this.SourcePath;
|
||||
//TODO: This does not correctly erase the old filters?
|
||||
schedule.Task.EncodedFilter = this.EncodedFilters;
|
||||
schedule.Task.Encryptionkey = this.BackupPassword;
|
||||
|
||||
@@ -227,17 +235,44 @@ namespace Duplicati.GUI.Wizard_pages
|
||||
schedule.Task.KeepFull = this.MaxFullBackups;
|
||||
|
||||
schedule.Task.KeepTime = this.BackupExpireInterval;
|
||||
schedule.Task.UploadBandwidth = this.UploadSpeedLimit;
|
||||
schedule.Task.DownloadBandwidth = this.DownloadSpeedLimit;
|
||||
schedule.Task.MaxUploadsize = this.BackupSizeLimit;
|
||||
schedule.Task.Extensions.UploadBandwidth = this.UploadSpeedLimit;
|
||||
schedule.Task.Extensions.DownloadBandwidth = this.DownloadSpeedLimit;
|
||||
schedule.Task.Extensions.MaxUploadSize = this.BackupSizeLimit;
|
||||
|
||||
schedule.Task.VolumeSize = this.VolumeSize;
|
||||
schedule.Task.ThreadPriority = this.ThreadPriority;
|
||||
schedule.Task.AsyncTransfer = this.AsyncTransfer;
|
||||
schedule.Task.Extensions.VolumeSize = this.VolumeSize;
|
||||
schedule.Task.Extensions.ThreadPriority = this.ThreadPriority;
|
||||
schedule.Task.Extensions.AsyncTransfer = this.AsyncTransfer;
|
||||
|
||||
schedule.Task.GPGEncryption = this.GPGEncryption;
|
||||
schedule.Task.IncludeSetup = this.IncludeSetup;
|
||||
schedule.Task.IgnoreTimestamps = this.IgnoreFileTimestamps;
|
||||
schedule.Task.Extensions.IgnoreTimestamps = this.IgnoreFileTimestamps;
|
||||
schedule.Task.Extensions.FileSizeLimit = this.FileSizeLimit;
|
||||
|
||||
schedule.Task.Extensions.FilenamePrefix = this.FilePrefix;
|
||||
schedule.Task.Extensions.FileTimeSeperator = this.FileTimeSeperator;
|
||||
schedule.Task.Extensions.ShortFilenames = this.ShortFilenames;
|
||||
|
||||
//Synchronize the override collections, preserve existing items
|
||||
Dictionary<string, Datamodel.TaskOverride> ovs = new Dictionary<string, Duplicati.Datamodel.TaskOverride>();
|
||||
foreach (Datamodel.TaskOverride ov in schedule.Task.TaskOverrides)
|
||||
ovs[ov.Name] = ov;
|
||||
|
||||
foreach (string s in this.Overrides.Keys)
|
||||
if (ovs.ContainsKey(s))
|
||||
{
|
||||
ovs[s].Value = this.Overrides[s];
|
||||
ovs.Remove(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
Datamodel.TaskOverride ov = schedule.Task.DataParent.Add<Datamodel.TaskOverride>();
|
||||
ov.Name = s;
|
||||
ov.Value = this.Overrides[s];
|
||||
schedule.Task.TaskOverrides.Add(ov);
|
||||
}
|
||||
|
||||
foreach (Datamodel.TaskOverride ov in ovs.Values)
|
||||
ov.DataParent.DeleteObject(ov);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -390,7 +425,6 @@ namespace Duplicati.GUI.Wizard_pages
|
||||
set { SetItem("BackupExpireInterval", value); }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The interval at which to perform full backups
|
||||
/// </summary>
|
||||
@@ -427,6 +461,15 @@ namespace Duplicati.GUI.Wizard_pages
|
||||
set { SetItem("VolumeSize", value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The maximum size of files included in the backup
|
||||
/// </summary>
|
||||
public string FileSizeLimit
|
||||
{
|
||||
get { return GetItem<string>("FileSizeLimit", ""); }
|
||||
set { SetItem("FileSizeLimit", value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The size of each volume in the backup set
|
||||
/// </summary>
|
||||
@@ -544,6 +587,46 @@ namespace Duplicati.GUI.Wizard_pages
|
||||
set { SetItem("IgnoreFileTimestamps", value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A prefix to the volume filename
|
||||
/// </summary>
|
||||
public string FilePrefix
|
||||
{
|
||||
get { return GetItem<string>("FilePrefix", ""); }
|
||||
set { SetItem("FilePrefix", value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The character used to seperate time digits in the filename
|
||||
/// </summary>
|
||||
public string FileTimeSeperator
|
||||
{
|
||||
get { return GetItem<string>("FileTimeSeperator", ":"); }
|
||||
set { SetItem("FileTimeSeperator", value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// True if the filenames generated should be short
|
||||
/// </summary>
|
||||
public bool ShortFilenames
|
||||
{
|
||||
get { return GetItem<bool>("ShortFilenames", false); }
|
||||
set { SetItem("ShortFilenames", value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all the overrides present on the task
|
||||
/// </summary>
|
||||
public Dictionary<string, string> Overrides
|
||||
{
|
||||
get
|
||||
{
|
||||
if (GetItem<Dictionary<string, string>>("Overrides", null) == null)
|
||||
this.Overrides = new Dictionary<string, string>();
|
||||
return GetItem<Dictionary<string, string>>("Overrides", null);
|
||||
}
|
||||
set { SetItem("Overrides", value); }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -117,12 +117,7 @@ namespace Duplicati.GUI
|
||||
{
|
||||
Schedule schedule = Program.DataConnection.GetObjectById<Schedule>(wrapper.ScheduleID);
|
||||
List<IDataClass> items = new List<IDataClass>();
|
||||
items.Add(schedule);
|
||||
items.Add(schedule.Task);
|
||||
foreach(TaskSetting ts in schedule.Task.TaskSettings)
|
||||
items.Add(ts);
|
||||
foreach (TaskFilter tf in schedule.Task.Filters)
|
||||
items.Add(tf);
|
||||
items.AddRange(Program.DataConnection.FindObjectRelations(schedule));
|
||||
foreach(IDataClass o in items)
|
||||
Program.DataConnection.DeleteObject(o);
|
||||
Program.DataConnection.Commit(items.ToArray());
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace Duplicati.Library.Backend
|
||||
foreach (string s in System.IO.Directory.GetDirectories(path))
|
||||
{
|
||||
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(s);
|
||||
FileEntry fe = new FileEntry(di.Name,0, di.LastAccessTime, di.LastWriteTime);
|
||||
FileEntry fe = new FileEntry(di.Name, 0, di.LastAccessTime, di.LastWriteTime);
|
||||
fe.IsFolder = true;
|
||||
ls.Add(fe);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,9 @@ namespace Duplicati.Library.Backend
|
||||
m_bucket = m_host.Substring(0, m_host.Length - ".s3.amazonaws.com".Length);
|
||||
m_host = "s3.amazonaws.com";
|
||||
m_prefix = u.PathAndQuery;
|
||||
|
||||
|
||||
if (m_prefix.StartsWith("/"))
|
||||
m_prefix = m_prefix.Substring(1);
|
||||
}
|
||||
else
|
||||
throw new Exception("Unable to determine the bucket name for host: " + m_url);
|
||||
@@ -155,7 +157,13 @@ namespace Duplicati.Library.Backend
|
||||
|
||||
List<FileEntry> lst = con.ListBucket(m_bucket, m_prefix);
|
||||
for (int i = 0; i < lst.Count; i++)
|
||||
{
|
||||
lst[i].Name = lst[i].Name.Substring(m_prefix.Length);
|
||||
|
||||
//Fix for a bug in Duplicati 1.0 beta 3 and earlier, where filenames are incorrectly prefixed with a slash
|
||||
if (lst[i].Name.StartsWith("/") && !m_prefix.StartsWith("/"))
|
||||
lst[i].Name = lst[i].Name.Substring(1);
|
||||
}
|
||||
return lst;
|
||||
}
|
||||
catch (System.Net.WebException wex)
|
||||
|
||||
@@ -390,5 +390,34 @@ namespace Duplicati.Library.Core
|
||||
return System.Threading.ThreadPriority.Normal;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Parses a string into a boolean value
|
||||
/// </summary>
|
||||
/// <param name="value">The value to parse</param>
|
||||
/// <param name="default">The default value, in case the string is not a valid boolean value</param>
|
||||
/// <returns>The parsed value or the default value</returns>
|
||||
public static bool ParseBool(string value, bool @default)
|
||||
{
|
||||
if (value == null)
|
||||
value = "";
|
||||
|
||||
switch (value.Trim().ToLower())
|
||||
{
|
||||
case "1":
|
||||
case "on":
|
||||
case "true":
|
||||
case "yes":
|
||||
return true;
|
||||
case "0":
|
||||
case "off":
|
||||
case "false":
|
||||
case "no":
|
||||
return false;
|
||||
default:
|
||||
return @default;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +101,8 @@ namespace Duplicati.Library.Main
|
||||
m = m_shortRegExp.Match(fe.Name);
|
||||
if (!m.Success)
|
||||
return null;
|
||||
if (m.Value != fe.Name)
|
||||
return null; //Accept only full matches
|
||||
|
||||
BackupEntry.EntryType type;
|
||||
if (m.Groups["type"].Value == "manifest" || m.Groups["type"].Value == "M")
|
||||
|
||||
@@ -82,8 +82,6 @@ namespace Duplicati.Library.Main
|
||||
|
||||
OperationProgress(this, DuplicatiOperation.Backup, -1, -1, "Loading remote filelist", "");
|
||||
|
||||
FilenameStrategy fns = new FilenameStrategy(m_options);
|
||||
|
||||
bool full = m_options.Full;
|
||||
|
||||
backend = new BackendWrapper(bs, m_backend, m_options);
|
||||
@@ -127,7 +125,7 @@ namespace Duplicati.Library.Main
|
||||
dir.ProgressEvent += new Duplicati.Library.Main.RSync.RSyncDir.ProgressEventDelegate(BackupRSyncDir_ProgressEvent);
|
||||
|
||||
dir.DisableFiletimeCheck = m_options.DisableFiletimeCheck;
|
||||
dir.MaxFileSize = m_options.MaxFileSize;
|
||||
dir.MaxFileSize = m_options.SkipFilesLargerThan;
|
||||
using (new Logging.Timer("Initiating multipass"))
|
||||
dir.InitiateMultiPassDiff(full);
|
||||
|
||||
|
||||
@@ -119,14 +119,14 @@ namespace Duplicati.Library.Main
|
||||
/// <summary>
|
||||
/// Gets the maximum size of a single file
|
||||
/// </summary>
|
||||
public long MaxFileSize
|
||||
public long SkipFilesLargerThan
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!m_options.ContainsKey("totalsize") || string.IsNullOrEmpty(m_options["totalsize"]))
|
||||
if (!m_options.ContainsKey("skip-files-larger-than") || string.IsNullOrEmpty(m_options["skip-files-larger-than"]))
|
||||
return long.MaxValue;
|
||||
else
|
||||
return Math.Max(VolumeSize, Core.Sizeparser.ParseSize(m_options["totalsize"], "mb"));
|
||||
return Core.Sizeparser.ParseSize(m_options["skip-files-larger-than"], "mb");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
BIN
Binary file not shown.
Reference in New Issue
Block a user