Esempio n. 1
0
        private void bnActionBTSearch_Click(object sender, System.EventArgs e)
        {
            LVResults lvr = new LVResults(this.lvAction, false);

            if (lvr.Count == 0)
                return;

            foreach (Item i in lvr.FlatList)
            {
                ScanListItem sli = i as ScanListItem;
                if ((sli != null) && (sli.Episode != null))
                    this.mDoc.DoBTSearch(sli.Episode);
            }
        }
Esempio n. 2
0
 private void IgnoreSelected()
 {
     LVResults lvr = new LVResults(this.lvAction, false);
     bool added = false;
     foreach (ScanListItem Action in lvr.FlatList)
     {
         IgnoreItem ii = Action.Ignore;
         if (ii != null)
         {
             this.mDoc.Ignore.Add(ii);
             added = true;
         }
     }
     if (added)
     {
         this.mDoc.SetDirty();
         this.mDoc.RemoveIgnored();
         this.FillActionList();
     }
 }
Esempio n. 3
0
        private void UpdateActionCheckboxes()
        {
            if (this.InternalCheckChange)
                return;

            LVResults all = new LVResults(this.lvAction, LVResults.WhichResults.All);
            LVResults chk = new LVResults(this.lvAction, LVResults.WhichResults.Checked);

            if (chk.Rename.Count == 0)
                this.cbRename.CheckState = CheckState.Unchecked;
            else
                this.cbRename.CheckState = (chk.Rename.Count == all.Rename.Count) ? CheckState.Checked : CheckState.Indeterminate;

            if (chk.CopyMove.Count == 0)
                this.cbCopyMove.CheckState = CheckState.Unchecked;
            else
                this.cbCopyMove.CheckState = (chk.CopyMove.Count == all.CopyMove.Count) ? CheckState.Checked : CheckState.Indeterminate;

            if (chk.RSS.Count == 0)
                this.cbRSS.CheckState = CheckState.Unchecked;
            else
                this.cbRSS.CheckState = (chk.RSS.Count == all.RSS.Count) ? CheckState.Checked : CheckState.Indeterminate;

            if (chk.Download.Count == 0)
                this.cbDownload.CheckState = CheckState.Unchecked;
            else
                this.cbDownload.CheckState = (chk.Download.Count == all.Download.Count) ? CheckState.Checked : CheckState.Indeterminate;

            if (chk.NFO.Count == 0)
                this.cbNFO.CheckState = CheckState.Unchecked;
            else
                this.cbNFO.CheckState = (chk.NFO.Count == all.NFO.Count) ? CheckState.Checked : CheckState.Indeterminate;

            if (chk.PyTivoMeta.Count == 0)
                this.cbMeta.CheckState = CheckState.Unchecked;
            else
                this.cbMeta.CheckState = (chk.PyTivoMeta.Count == all.PyTivoMeta.Count) ? CheckState.Checked : CheckState.Indeterminate;

            int total1 = all.Rename.Count + all.CopyMove.Count + all.RSS.Count + all.Download.Count + all.NFO.Count + all.PyTivoMeta.Count;
            int total2 = chk.Rename.Count + chk.CopyMove.Count + chk.RSS.Count + chk.Download.Count + chk.NFO.Count + chk.PyTivoMeta.Count;

            if (total2 == 0)
                this.cbAll.CheckState = CheckState.Unchecked;
            else
                this.cbAll.CheckState = (total2 == total1) ? CheckState.Checked : CheckState.Indeterminate;
        }
Esempio n. 4
0
        private void lvAction_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            UpdateSearchButton();

            LVResults lvr = new LVResults(this.lvAction, false);

            if (lvr.Count == 0)
            {
                // disable everything
                this.bnActionBTSearch.Enabled = false;
                return;
            }

            this.bnActionBTSearch.Enabled = lvr.Download.Count <= 0;

            this.mLastShowsClicked = null;
            this.mLastEpClicked = null;
            this.mLastSeasonClicked = null;
            this.mLastActionsClicked = null;

            this.showRightClickMenu.Items.Clear();
            this.mFoldersToOpen = new List<String>();
            this.mLastFL = new System.Collections.Generic.List<System.IO.FileInfo>();

            this.mLastActionsClicked = new ItemList();

            foreach (Item ai in lvr.FlatList)
                this.mLastActionsClicked.Add(ai);

            if ((lvr.Count == 1) && (this.lvAction.FocusedItem != null) && (this.lvAction.FocusedItem.Tag != null))
            {
                ScanListItem action = this.lvAction.FocusedItem.Tag as ScanListItem;
                if (action != null)
                {
                    this.mLastEpClicked = action.Episode;
                    if (action.Episode != null)
                    {
                        this.mLastSeasonClicked = action.Episode.TheSeason;
                        this.mLastShowsClicked = new List<ShowItem>() { action.Episode.SI };
                    }
                    else
                    {
                        this.mLastSeasonClicked = null;
                        this.mLastShowsClicked = null;
                    }

                    if ((this.mLastEpClicked != null) && (this.mDoc.Settings.AutoSelectShowInMyShows))
                        this.GotoEpguideFor(this.mLastEpClicked, false);
                }
            }
        }
Esempio n. 5
0
        private void lvAction_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (e.Button != System.Windows.Forms.MouseButtons.Right)
                return;

            // build the right click menu for the _selected_ items, and types of items
            LVResults lvr = new LVResults(this.lvAction, false);

            if (lvr.Count == 0)
                return; // nothing selected

            Point pt = this.lvAction.PointToScreen(new Point(e.X, e.Y));

            this.showRightClickMenu.Items.Clear();

            // Action related items
            ToolStripMenuItem tsi;
            if (lvr.Count > lvr.Missing.Count) // not just missing selected
            {
                tsi = new ToolStripMenuItem("Action Selected");
                tsi.Tag = (int)RightClickCommands.kActionAction;
                this.showRightClickMenu.Items.Add(tsi);
            }

            tsi = new ToolStripMenuItem("Ignore Selected");
            tsi.Tag = (int)RightClickCommands.kActionIgnore;
            this.showRightClickMenu.Items.Add(tsi);

            tsi = new ToolStripMenuItem("Ignore Entire Season");
            tsi.Tag = (int)RightClickCommands.kActionIgnoreSeason;
            this.showRightClickMenu.Items.Add(tsi);

            tsi = new ToolStripMenuItem("Remove Selected");
            tsi.Tag = (int)RightClickCommands.kActionDelete;
            this.showRightClickMenu.Items.Add(tsi);

            if (lvr.Count == lvr.Missing.Count) // only missing items selected?
            {
                this.showRightClickMenu.Items.Add(new ToolStripSeparator());

                tsi = new ToolStripMenuItem("Search");
                tsi.Tag = (int)RightClickCommands.kBTSearchFor;
                this.showRightClickMenu.Items.Add(tsi);

                if (lvr.Count == 1) // only one selected
                {
                    tsi = new ToolStripMenuItem("Browse For...");
                    tsi.Tag = (int)RightClickCommands.kActionBrowseForFile;
                    this.showRightClickMenu.Items.Add(tsi);
                }
            }

            this.MenuGuideAndTVDB(true);
            this.MenuFolders(lvr);

            this.showRightClickMenu.Show(pt);
        }
Esempio n. 6
0
        private void ActionAction(bool checkedNotSelected)
        {
            LVResults lvr = new LVResults(this.lvAction, checkedNotSelected);
            this.mDoc.DoActions(lvr.FlatList);
            // remove items from master list, unless it had an error
            foreach (Item i2 in (new LVResults(this.lvAction, checkedNotSelected)).FlatList)
            {
                ScanListItem sli = i2 as ScanListItem;

                if ((sli != null) && (!lvr.FlatList.Contains(sli)))
                    this.mDoc.TheActionList.Remove(i2);
            }

            this.FillActionList();
            this.RefreshWTW(false);
        }
Esempio n. 7
0
        public void MenuFolders(LVResults lvr)
        {
            if (mLastShowsClicked == null || mLastShowsClicked.Count != 1)
                return;

            ShowItem si = (this.mLastShowsClicked != null) && (this.mLastShowsClicked.Count > 0) ? this.mLastShowsClicked[0] : null;
            Season seas = this.mLastSeasonClicked;
            ProcessedEpisode ep = this.mLastEpClicked;
            ToolStripMenuItem tsi;
            List<string> added = new List<String>();

            if (ep != null)
            {
                if (ep.SI.AllFolderLocations(this.mDoc.Settings).ContainsKey(ep.SeasonNumber))
                {
                    int n = this.mFoldersToOpen.Count;
                    bool first = true;
                    foreach (string folder in ep.SI.AllFolderLocations(this.mDoc.Settings)[ep.SeasonNumber])
                    {
                        if ((!string.IsNullOrEmpty(folder)) && Directory.Exists(folder))
                        {
                            if (first)
                            {
                                ToolStripSeparator tss = new ToolStripSeparator();
                                this.showRightClickMenu.Items.Add(tss);
                                first = false;
                            }

                            tsi = new ToolStripMenuItem("Open: " + folder);
                            added.Add(folder);
                            this.mFoldersToOpen.Add(folder);
                            tsi.Tag = (int)RightClickCommands.kOpenFolderBase + n;
                            n++;
                            this.showRightClickMenu.Items.Add(tsi);
                        }
                    }
                }
            }
            else if ((seas != null) && (si != null) && (si.AllFolderLocations(this.mDoc.Settings).ContainsKey(seas.SeasonNumber)))
            {
                int n = this.mFoldersToOpen.Count;
                bool first = true;
                foreach (string folder in si.AllFolderLocations(this.mDoc.Settings)[seas.SeasonNumber])
                {
                    if ((!string.IsNullOrEmpty(folder)) && Directory.Exists(folder) && !added.Contains(folder))
                    {
                        added.Add(folder); // don't show the same folder more than once
                        if (first)
                        {
                            ToolStripSeparator tss = new ToolStripSeparator();
                            this.showRightClickMenu.Items.Add(tss);
                            first = false;
                        }

                        tsi = new ToolStripMenuItem("Open: " + folder);
                        this.mFoldersToOpen.Add(folder);
                        tsi.Tag = (int)RightClickCommands.kOpenFolderBase + n;
                        n++;
                        this.showRightClickMenu.Items.Add(tsi);
                    }
                }
            }
            else if (si != null)
            {
                int n = this.mFoldersToOpen.Count;
                bool first = true;

                foreach (System.Collections.Generic.KeyValuePair<int, List<string>> kvp in si.AllFolderLocations(this.mDoc.Settings))
                {
                    foreach (string folder in kvp.Value)
                    {
                        if ((!string.IsNullOrEmpty(folder)) && Directory.Exists(folder) && !added.Contains(folder))
                        {
                            added.Add(folder); // don't show the same folder more than once
                            if (first)
                            {
                                ToolStripSeparator tss = new ToolStripSeparator();
                                this.showRightClickMenu.Items.Add(tss);
                                first = false;
                            }

                            tsi = new ToolStripMenuItem("Open: " + folder);
                            this.mFoldersToOpen.Add(folder);
                            tsi.Tag = (int)RightClickCommands.kOpenFolderBase + n;
                            n++;
                            this.showRightClickMenu.Items.Add(tsi);
                        }
                    }
                }
            }

            if (lvr != null) // add folders for selected Scan items
            {
                int n = this.mFoldersToOpen.Count;
                bool first = true;

                foreach (ScanListItem sli in lvr.FlatList)
                {
                    string folder = sli.TargetFolder;

                    if (string.IsNullOrEmpty(folder) || !Directory.Exists(folder) || added.Contains(folder))
                        continue;

                    added.Add(folder); // don't show the same folder more than once
                    if (first)
                    {
                        ToolStripSeparator tss = new ToolStripSeparator();
                        this.showRightClickMenu.Items.Add(tss);
                        first = false;
                    }

                    tsi = new ToolStripMenuItem("Open: " + folder);
                    this.mFoldersToOpen.Add(folder);
                    tsi.Tag = (int)RightClickCommands.kOpenFolderBase + n;
                    n++;
                    this.showRightClickMenu.Items.Add(tsi);
                }
            }
        }