示例#1
0
 /// <summary>
 /// Set the values
 /// </summary>
 /// <param name="aRow">The job row</param>
 /// <param name="aDetails">Text description of the job trigger</param>
 public void SetSummary(Duplicati.Scheduler.Data.SchedulerDataSet.JobsRow aRow, string aDetails)
 {
     this.nameTextBox.Text = aRow.Name;
     this.DescriptionTextBox.Text = aDetails;
     this.sourceTextBox.Text = aRow.Source;
     this.destinationTextBox.Text = aRow.Destination;
     this.LastModLabel.Text = (aRow.IsLastModNull() || aRow.LastMod == DateTime.MinValue) ? "Never edited" : "Last edited: " + aRow.LastMod.ToString("ddd, dd MMMM yyyy hh:mm tt");
     if (aRow.FullOnly || (aRow.FullRepeatDays == 0 && aRow.FullAfterN == 0)) this.fullRepeatStrTextBox.Text = "Always do full backups";
     else this.fullRepeatStrTextBox.Text = aRow.FullRepeatDays > 0 ? aRow.FullRepeatDays + " days " : aRow.FullAfterN.ToString()+" incrementals";
     this.MaxFullTextBox.Text = aRow.MaxFulls > 0 ? "the last "+aRow.MaxFulls.ToString("N0") : "all" ;
     this.MaxAgeTextBox.Text = aRow.MaxAgeDays > 0 ? aRow.MaxAgeDays.ToString("N0") + " days" : "<no limit>" ;
     this.PassRichTextBox.Text = new string[] { "not password protected.", "protected by local password.", "protected by global password." }[aRow.GetCheckSrc()];
 }
示例#2
0
 /// <summary>
 /// Populate a JobsRow with results from the controls
 /// </summary>
 /// <param name="aRow">Row to fill</param>
 private void GetRow(Duplicati.Scheduler.Data.SchedulerDataSet.JobsRow aRow)
 {
     // Now, if User has been in the Destination tab, we may have a new
     // set of destination and options, fetch them.
     if (GuiControl != null && VisitedDestination)
     {
         Dictionary<string, string> Opts = new Dictionary<string, string>();
         Dictionary<string, string> GuiOpts = new Dictionary<string, string>();
         string Dest = string.Empty;
         if (GetConfiguration(out Opts, out GuiOpts, out Dest))
         {
             aRow.SetOptions(Opts);
             aRow.SetGuiOptions(GuiOpts);
             aRow.Destination = Dest;
         }
     }
     // Get stuff from the controls
     aRow.Source = string.Join(System.IO.Path.PathSeparator.ToString(), this.folderSelectControl1.SelectedFolders);
     aRow.FullOnly = this.FullAlwaysRadioButton.Checked;
     aRow.FullAfterN = this.FullAfterNRadioButton.Checked ? (int)this.FullAfterNNumericUpDown.Value : 0;
     aRow.FullRepeatDays = this.FullDaysRadioButton.Checked ? (int)this.FullDaysNumericUpDown.Value : 0;
     aRow.FilterLines = this.FilterList;
     aRow.MaxFulls = this.MaxFullsCheckBox.Checked ? (int)this.MaxFullsNumericUpDown.Value : 0;
     aRow.MaxAgeDays = this.MaxAgeCheckBox.Checked ? (int)this.MaxAgeNnumericUpDown.Value : 0;
     aRow.Enabled = this.TaskEditor.GetTrigger().Enabled;
     aRow.TriggerXML = TaskEditControl.TriggerToXml(this.TaskEditor.GetTrigger());
     if (itsAdvanced.DialogResult == DialogResult.OK)
     {
         aRow.AutoCleanup = itsAdvanced.AutoDelete;
         aRow.MapDrives = itsAdvanced.Map;
     }
     aRow.Checksum = Settings.Values.Checksum;
     aRow.CheckMod = Settings.Values.CheckMod;
     aRow.SetCheckSrc(this.PasswordMethodComboBox.SelectedIndex);
     // Never edited (?)
     if (aRow.IsLastModNull()) aRow.LastMod = DateTime.Now;
 }