Skip to content

Commit

Permalink
Merge pull request #290 from MarkSummerville/master
Browse files Browse the repository at this point in the history
Bug Fixes
  • Loading branch information
SirSparkles authored Jan 16, 2018
2 parents 4e4adf5 + 6ab8625 commit e85beb3
Show file tree
Hide file tree
Showing 16 changed files with 2,007 additions and 491 deletions.
227 changes: 180 additions & 47 deletions TVRename#/Forms/Preferences.Designer.cs

Large diffs are not rendered by default.

88 changes: 82 additions & 6 deletions TVRename#/Forms/Preferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
using System.Threading;
using System.Windows.Forms;
using System.Drawing;
using FileSystemInfo = Alphaleonis.Win32.Filesystem.FileSystemInfo;
using Directory = Alphaleonis.Win32.Filesystem.Directory;
using DirectoryInfo = Alphaleonis.Win32.Filesystem.DirectoryInfo;
using FileInfo = Alphaleonis.Win32.Filesystem.FileInfo;
using ColumnHeader = SourceGrid.Cells.ColumnHeader;

namespace TVRename
Expand Down Expand Up @@ -90,6 +87,16 @@ private void OKButton_Click(object sender, System.EventArgs e)
this.txtOtherExtensions.Focus();
return;
}
if (!TVSettings.OKExtensionsString(this.txtKeepTogether.Text))
{
MessageBox.Show(
"Extensions list must be separated by semicolons, and each extension must start with a dot.",
"Preferences", MessageBoxButtons.OK, MessageBoxIcon.Warning);
this.tabControl1.SelectedTab = tbFilesAndFolders;
this.txtKeepTogether.Focus();
return;
}

TVSettings S = TVSettings.Instance;

S.Replacements.Clear();
Expand Down Expand Up @@ -133,6 +140,9 @@ private void OKButton_Click(object sender, System.EventArgs e)
S.AutoSelectShowInMyShows = this.cbAutoSelInMyShows.Checked;
S.AutoCreateFolders = this.cbAutoCreateFolders.Checked ;
S.SpecialsFolderName = this.txtSpecialsFolderName.Text;
S.searchSeasonWordsString = this.tbSeasonSearchTerms.Text;
S.defaultSeasonWord = this.txtSeasonFolderName.Text;
S.keepTogetherExtensionsString = this.txtKeepTogether.Text;

S.ForceLowercaseFilenames = this.cbForceLower.Checked;
S.IgnoreSamples = this.cbIgnoreSamples.Checked;
Expand Down Expand Up @@ -199,6 +209,26 @@ private void OKButton_Click(object sender, System.EventArgs e)
else
S.SelectedKODIType = TVSettings.KODIType.Both;

if (this.cbMode.Text == "Beta")
{
S.mode = TVSettings.BetaMode.BetaToo;
}
else
{
S.mode = TVSettings.BetaMode.ProductionOnly;
}

if (this.cbKeepTogetherMode.Text == "all but")
{
S.keepTogetherMode = TVSettings.KeepTogetherModes.AllBut;
} else if (this.cbKeepTogetherMode.Text == "just")

{
S.keepTogetherMode = TVSettings.KeepTogetherModes.Just;
}
else
S.keepTogetherMode = TVSettings.KeepTogetherModes.All;


TheTVDB.Instance.GetLock("Preferences-OK");
foreach (Language l in TheTVDB.Instance.LanguageList)
Expand Down Expand Up @@ -226,6 +256,20 @@ private void OKButton_Click(object sender, System.EventArgs e)
S.SampleFileMaxSizeMB = 50;
}

try
{
S.upgradeDirtyPercent = float.Parse(this.tbPercentDirty.Text);
}
catch
{
S.upgradeDirtyPercent = 20;
}
if (S.upgradeDirtyPercent < 1)
S.upgradeDirtyPercent = 1;
else if (S.upgradeDirtyPercent > 100)
S.upgradeDirtyPercent = 100;


try
{
S.ParallelDownloads = int.Parse(this.txtParallelDownloads.Text);
Expand Down Expand Up @@ -270,12 +314,10 @@ private void Preferences_Load(object sender, System.EventArgs e)
this.SetupLanguages();

TVSettings S = TVSettings.Instance;
int r = 1;

foreach (Replacement R in S.Replacements)
{
this.AddNewReplacementRow(R.This, R.That, R.CaseInsensitive);
r++;
}

this.txtMaxSampleSize.Text = S.SampleFileMaxSizeMB.ToString();
Expand Down Expand Up @@ -308,6 +350,8 @@ private void Preferences_Load(object sender, System.EventArgs e)
this.cbNotificationIcon.Checked = S.NotificationAreaIcon;
this.txtVideoExtensions.Text = S.GetVideoExtensionsString();
this.txtOtherExtensions.Text = S.GetOtherExtensionsString();
this.txtKeepTogether.Text = S.GetKeepTogetherString();
this.tbSeasonSearchTerms.Text = S.GetSeasonSearchTermsString();

this.cbKeepTogether.Checked = S.KeepTogether;
this.cbKeepTogether_CheckedChanged(null, null);
Expand All @@ -328,6 +372,7 @@ private void Preferences_Load(object sender, System.EventArgs e)
this.cbCheckSABnzbd.Checked = S.CheckSABnzbd;

this.txtParallelDownloads.Text = S.ParallelDownloads.ToString();
this.tbPercentDirty.Text = S.upgradeDirtyPercent.ToString();

this.cbSearchRSS.Checked = S.SearchRSS;
this.cbEpTBNs.Checked = S.EpTBNs;
Expand All @@ -353,6 +398,7 @@ private void Preferences_Load(object sender, System.EventArgs e)
this.cbShrinkLarge.Checked = S.ShrinkLargeMede8erImages;
this.cbFantArtJpg.Checked = S.FanArtJpg;


#if DEBUG
System.Diagnostics.Debug.Assert(S.Tidyup != null);
#endif
Expand All @@ -364,6 +410,8 @@ private void Preferences_Load(object sender, System.EventArgs e)
this.txtEmptyIgnoreExtensions.Text = S.Tidyup.EmptyIgnoreExtensionList;
this.cbEmptyMaxSize.Checked = S.Tidyup.EmptyMaxSizeCheck;
this.txtEmptyMaxSize.Text = S.Tidyup.EmptyMaxSizeMB.ToString();
this.txtSeasonFolderName.Text = S.defaultSeasonWord;



switch (S.WTWDoubleClick)
Expand All @@ -376,6 +424,31 @@ private void Preferences_Load(object sender, System.EventArgs e)
this.rbWTWScan.Checked = true;
break;
}
switch(S.keepTogetherMode)
{
case TVSettings.KeepTogetherModes.All:
default:
this.cbKeepTogetherMode.Text = "All";
break;
case TVSettings.KeepTogetherModes.AllBut:
this.cbKeepTogetherMode.Text = "all but";
break;
case TVSettings.KeepTogetherModes.Just:
this.cbKeepTogetherMode.Text = "just";
break;
}

switch (S.mode)
{
case TVSettings.BetaMode.ProductionOnly:
default:
this.cbMode.Text = "Production";
break;
case TVSettings.BetaMode.BetaToo:
this.cbMode.Text = "Beta";
break;

}

this.EnableDisable(null, null);
this.ScanOptEnableDisable();
Expand Down Expand Up @@ -527,6 +600,9 @@ private void chkShowInTaskbar_CheckedChanged(object sender, System.EventArgs e)
private void cbKeepTogether_CheckedChanged(object sender, System.EventArgs e)
{
this.cbTxtToSub.Enabled = this.cbKeepTogether.Checked;
this.txtKeepTogether.Enabled = this.cbKeepTogether.Checked;
this.cbKeepTogetherMode.Enabled = this.cbKeepTogether.Checked;
this.label39.Enabled = this.cbKeepTogether.Checked;
}

private void bnBrowseMissingCSV_Click(object sender, System.EventArgs e)
Expand Down Expand Up @@ -1133,4 +1209,4 @@ private void bnMCPresets_Click(object sender, EventArgs e)
}

}
}
}
77 changes: 77 additions & 0 deletions TVRename#/Forms/ShowSummary.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e85beb3

Please sign in to comment.