-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from MarkSummerville/master
Latest Changes
- Loading branch information
Showing
19 changed files
with
889 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using System; | ||
using System.Windows.Forms; | ||
|
||
namespace TVRename.Forms | ||
{ | ||
public partial class AutoAddShow : Form | ||
{ | ||
private ShowItem mSI; | ||
private readonly TheTVDBCodeFinder mTCCF; | ||
|
||
public AutoAddShow(string hint) | ||
{ | ||
InitializeComponent(); | ||
this.mSI = new ShowItem(); | ||
this.mTCCF = new TheTVDBCodeFinder("") {Dock = DockStyle.Fill}; | ||
this.mTCCF.SetHint(hint); | ||
this.mTCCF.SelectionChanged += MTCCF_SelectionChanged; | ||
this.pnlCF.SuspendLayout(); | ||
this.pnlCF.Controls.Add(this.mTCCF); | ||
this.pnlCF.ResumeLayout(); | ||
this.ActiveControl = this.mTCCF; // set initial focus to the code entry/show finder control | ||
|
||
this.cbDirectory.SuspendLayout(); | ||
this.cbDirectory.Items.Clear(); | ||
this.cbDirectory.Items.AddRange(TVSettings.Instance.MonitorFoldersNames.ToArray()); | ||
this.cbDirectory.SelectedIndex = 0; | ||
this.cbDirectory.ResumeLayout(); | ||
} | ||
|
||
private void MTCCF_SelectionChanged(object sender, EventArgs e) | ||
{ | ||
this.lblDirectoryName.Text = System.IO.Path.DirectorySeparatorChar + TVSettings.Instance.FilenameFriendly(FileHelper.MakeValidPath(this.mTCCF.SelectedShowName( ))); | ||
} | ||
|
||
public ShowItem ShowItem => this.mSI; | ||
|
||
private void SetShowItem() | ||
{ | ||
int code = this.mTCCF.SelectedCode(); | ||
|
||
|
||
this.mSI.TVDBCode = code; | ||
this.mSI.AutoAdd_FolderBase = this.cbDirectory.Text+this.lblDirectoryName.Text; | ||
|
||
} | ||
|
||
private void btnOK_Click(object sender, EventArgs e) | ||
{ | ||
if (!OkToClose()) | ||
{ | ||
this.DialogResult = DialogResult.None; | ||
return; | ||
} | ||
|
||
SetShowItem(); | ||
this.DialogResult = DialogResult.OK; | ||
Close(); | ||
} | ||
|
||
private bool OkToClose() | ||
{ | ||
if (TheTVDB.Instance.HasSeries(this.mTCCF.SelectedCode())) return true; | ||
|
||
DialogResult dr = MessageBox.Show("tvdb code unknown, close anyway?", "TVRename Add/Edit Show", | ||
MessageBoxButtons.YesNo, MessageBoxIcon.Warning); | ||
|
||
return dr != DialogResult.No; | ||
} | ||
|
||
private void AutoAddShow_Load(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.