private void ShowContextMenuSearch(TorrentLink torLink) { ContextMenu cmenu = new ContextMenu(Translation.Search); cmenu.AddAction(Translation.DownloadViaTorrent, () => { if (torLink != null) { MainWindow.uTorrent.AddTorrentFromURL(torLink.TorrentDownloadLink); LoadUTorrentListAsync(); } }); cmenu.AddAction(Translation.ManualSearch, () => { string criteria = ""; if (Utils.DialogText(ref criteria, GetID)) { MainWindow.currentDownloadSearch = new DownloadSearchCriteria(DownloadSearchType.Manual, criteria); PerformTorrentSearchAsync(); } }); cmenu.Add(Translation.RecentSearches + " >>>", ShowRecentSearches); cmenu.AddAction(Translation.ClearSearchHistory, () => { MainWindow.downloadSearchHistory.Clear(); MainWindow.downloadSearchResultsHistory.Clear(); ClearGUIProperty(GuiProperty.Search_ResultDescription); ClearGUIProperty(GuiProperty.Search_Summary); if (dummyPageSearch.Visible) m_Facade.Clear(); }); cmenu.Show(); }
protected override void OnShowContextMenu() { try { GUIListItem currentitem = m_Facade.SelectedListItem; if (currentitem == null || !(currentitem.TVTag is VM_TvDB_ImageWideBanner)) { return; } VM_TvDB_ImageWideBanner selectedBanner = currentitem.TVTag as VM_TvDB_ImageWideBanner; bool isDisabled = selectedBanner.Enabled == 0; ContextMenu cmenu = new ContextMenu(Translation.WideBanner); cmenu.AddAction(isDisabled ? Translation.Enable : Translation.Disable, () => { ShokoServerHelper.EnableDisableWideBanner(isDisabled, selectedBanner, AnimeID); ShowWideBanners(); }); if (!isDisabled) { cmenu.AddAction(selectedBanner.IsImageDefault ? Translation.RemoveAsDefault : Translation.SetAsDefault, () => { ShokoServerHelper.SetDefaultWideBanner(!selectedBanner.IsImageDefault, selectedBanner, AnimeID); ShowWideBanners(); }); } cmenu.Show(); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Exception in Wide Banner Chooser Context Menu: " + ex.Message); return; } }
protected override void OnShowContextMenu() { try { GUIListItem currentitem = m_Facade.SelectedListItem; if (currentitem == null || !(currentitem.TVTag is FanartContainer)) { return; } FanartContainer selectedFanart = currentitem.TVTag as FanartContainer; ContextMenu cmenu = new ContextMenu(Translation.Fanart); cmenu.AddAction(selectedFanart.IsImageEnabled ? Translation.Disable : Translation.Enable, () => { bool endis = !selectedFanart.IsImageEnabled; ShokoServerHelper.EnableDisableFanart(endis, selectedFanart, AnimeID); ShowFanart(); }); if (selectedFanart.IsImageEnabled) { cmenu.AddAction(selectedFanart.IsImageDefault ? Translation.RemoveAsDefault : Translation.SetAsDefault, () => { bool isdef = !selectedFanart.IsImageDefault; ShokoServerHelper.SetDefaultFanart(isdef, selectedFanart, AnimeID); ShowFanart(); }); } cmenu.Show(); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Exception in Fanart Chooser Context Menu: " + ex.Message + ex.StackTrace); } }
protected override void OnShowContextMenu() { try { AniDB_Vote userVote = MainAnime.UserVote; ContextMenu cmenu = new ContextMenu(MainAnime.FormattedTitle); cmenu.AddAction(Translation.UpdateSeriesInfo, () => { MainWindow.ServerHelper.UpdateAnime(MainAnime.AnimeID); SetGUIProperty(GuiProperty.AnimeInfo_DownloadStatus, Translation.WaitingOnServer + "..."); }); if (userVote == null && VM_ShokoServer.Instance.CurrentUser.IsAniDBUserBool()) { cmenu.AddAction(Translation.PermanentVote, () => { decimal rating = Utils.PromptAniDBRating(MainAnime.FormattedTitle); if (rating > 0) { VM_ShokoServer.Instance.ShokoServices.VoteAnime(MainAnime.AnimeID, rating, (int)AniDBVoteType.Anime); LoadInfo(); SetSkinProperties(); InfoPage(); } }); cmenu.AddAction(Translation.TemporaryVote, () => { decimal rating = Utils.PromptAniDBRating(MainAnime.FormattedTitle); if (rating > 0) { VM_ShokoServer.Instance.ShokoServices.VoteAnime(MainAnime.AnimeID, rating, (int)AniDBVoteType.AnimeTemp); LoadInfo(); SetSkinProperties(); InfoPage(); } }); } if (userVote != null && Commons.Extensions.Models.IsAniDBUserBool(VM_ShokoServer.Instance.CurrentUser)) { cmenu.AddAction(Translation.RevokeVote, () => { VM_ShokoServer.Instance.ShokoServices.VoteAnimeRevoke(MainAnime.AnimeID); LoadInfo(); SetSkinProperties(); InfoPage(); }); } cmenu.Show(); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Error in menu: {0}", ex); } }
private ContextMenuAction ShowMoreOptionsMenu() { ContextMenu cmenu = new ContextMenu(Translation.Options); cmenu.AddAction(Translation.ScanDropFolder, ScanDropFolder); cmenu.AddAction(Translation.RemoveRecordsWithoutFile, RemoveMissingFiles); cmenu.AddAction(Translation.SyncVotes, SyncVotes); cmenu.AddAction(Translation.SyncMyList, SyncMyList); return(cmenu.Show()); }
private void ShowContextMenuTorrentFiles(TorrentFile tor, int idx) { ContextMenu cmenu = new ContextMenu(tor.FileName); cmenu.AddAction(Translation.Priority + " - " + Translation.High, () => MainWindow.uTorrent.FileSetPriority(curTorrent.Hash, idx, TorrentFilePriority.High)); cmenu.AddAction(Translation.Priority + " - " + Translation.Medium, () => MainWindow.uTorrent.FileSetPriority(curTorrent.Hash, idx, TorrentFilePriority.Medium)); cmenu.AddAction(Translation.Priority + " - " + Translation.Low, () => MainWindow.uTorrent.FileSetPriority(curTorrent.Hash, idx, TorrentFilePriority.Low)); cmenu.AddAction(Translation.Priority + " - " + Translation.DontDownload, () => MainWindow.uTorrent.FileSetPriority(curTorrent.Hash, idx, TorrentFilePriority.DontDownload)); if (cmenu.Show() == ContextMenuAction.Exit) ShowPageTorrentFiles(); }
private void ShowContextMenuTorrents(Torrent tor) { ContextMenu cmenu = new ContextMenu(tor.Name); cmenu.AddAction(Translation.StopTorrent, () => MainWindow.uTorrent.StopTorrent(tor.Hash)); cmenu.AddAction(Translation.StartTorrent, () => MainWindow.uTorrent.StartTorrent(tor.Hash)); cmenu.AddAction(Translation.PauseTorrent, () => MainWindow.uTorrent.PauseTorrent(tor.Hash)); cmenu.AddAction(Translation.RemoveTorrent, () => MainWindow.uTorrent.RemoveTorrent(tor.Hash)); cmenu.AddAction(Translation.RemoveTorrentAndData, () => MainWindow.uTorrent.RemoveTorrentAndData(tor.Hash)); if (cmenu.Show() == ContextMenuAction.Exit) LoadUTorrentListAsync(); }
protected override void OnShowContextMenu() { GUIListItem currentitem = this.m_Facade.SelectedListItem; if (currentitem == null) { return; } if (currentitem.TVTag.GetType() == typeof(VM_Recommendation)) { VM_Recommendation rec = currentitem.TVTag as VM_Recommendation; if (rec != null) { ContextMenu cmenu = new ContextMenu(rec.Recommended_DisplayName); cmenu.AddAction(Translation.DontShowThisAnime, () => { int recType = 1; VM_ShokoServer.Instance.ShokoServices.IgnoreAnime(rec.RecommendedAnimeID, recType, VM_ShokoServer.Instance.CurrentUser.JMMUserID); LoadData(); }); cmenu.AddAction(Translation.BookmarkThisAnime, () => { VM_BookmarkedAnime bookmark = new VM_BookmarkedAnime(); bookmark.AnimeID = rec.RecommendedAnimeID; bookmark.Downloading = 0; bookmark.Notes = ""; bookmark.Priority = 1; if (bookmark.Save()) { Utils.DialogMsg(Translation.Sucess, Translation.BookmarkCreated); } }); cmenu.AddAction(Translation.CreateSeriesForAnime, () => { CL_Response <CL_AnimeSeries_User> resp = VM_ShokoServer.Instance.ShokoServices.CreateSeriesFromAnime( rec.RecommendedAnimeID, null, VM_ShokoServer.Instance.CurrentUser.JMMUserID); if (string.IsNullOrEmpty(resp.ErrorMessage)) { Utils.DialogMsg(Translation.Sucess, Translation.SeriesCreated); } else { Utils.DialogMsg(Translation.Error, resp.ErrorMessage); } }); cmenu.Show(); } } }
protected override void OnShowContextMenu() { try { GUIListItem currentitem = m_Facade.SelectedListItem; if (currentitem == null) { return; } VM_VideoLocal vid = currentitem.TVTag as VM_VideoLocal; if (vid == null) { return; } ContextMenu cmenu = new ContextMenu(Translation.FileOptions); cmenu.AddAction(Translation.PlayFile, () => MainWindow.vidHandler.ResumeOrPlay(vid)); cmenu.AddAction(Translation.RehashFile, () => { VM_ShokoServer.Instance.ShokoServices.RehashFile(vid.VideoLocalID); DialogProcess(); }); cmenu.AddAction(Translation.IgnoreFile, () => { VM_ShokoServer.Instance.ShokoServices.SetIgnoreStatusOnFile(vid.VideoLocalID, true); RefreshUnlinkedFiles(); }); cmenu.AddAction(Translation.DeleteFileFromDisk, () => { if (!Utils.DialogConfirm(Translation.AreYouSureYouWantDeleteFile)) { return; } foreach (CL_VideoLocal_Place p in vid.Places) { VM_ShokoServer.Instance.ShokoServices.DeleteVideoLocalPlaceAndFile(p.VideoLocal_Place_ID); } RefreshUnlinkedFiles(); }); cmenu.Show(); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Error in menu: {0}", ex); } }
protected override void OnShowContextMenu() { try { ContextMenu cmenu = new ContextMenu(Translation.Calendar); cmenu.AddAction(Translation.BookmarkThisAnime, () => { VM_AniDB_Anime anime3; if ((anime3 = m_Facade.SelectedListItem.TVTag as VM_AniDB_Anime) != null) { VM_BookmarkedAnime bookmark = new VM_BookmarkedAnime(); bookmark.AnimeID = anime3.AnimeID; bookmark.Downloading = 0; bookmark.Notes = string.Empty; bookmark.Priority = 1; if (bookmark.Save()) { Utils.DialogMsg(Translation.Sucess, Translation.BookmarkCreated); } } }); cmenu.AddAction(Translation.CreateSeriesForAnime, () => { VM_AniDB_Anime anime4; if ((anime4 = m_Facade.SelectedListItem.TVTag as VM_AniDB_Anime) != null) { CL_Response <CL_AnimeSeries_User> resp = VM_ShokoServer.Instance.ShokoServices.CreateSeriesFromAnime( anime4.AnimeID, null, VM_ShokoServer.Instance.CurrentUser.JMMUserID, false); if (string.IsNullOrEmpty(resp.ErrorMessage)) { Utils.DialogMsg(Translation.Sucess, Translation.SeriesCreated); } else { Utils.DialogMsg(Translation.Error, resp.ErrorMessage); } } }); cmenu.Show(); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Error in menu: {0}", ex); } }
private ContextMenuAction ShowContextMenuBrowse(TorrentLink torLink) { ContextMenu cmenu = new ContextMenu(Translation.Browse); cmenu.AddAction(Translation.DownloadViaTorrent, () => { MainWindow.uTorrent.AddTorrentFromURL(torLink.TorrentDownloadLink); LoadUTorrentListAsync(); }); cmenu.Add(Translation.SelectSource, () => ShowBrowseSources(torLink)); return cmenu.Show(); }
private ContextMenuAction ShowBrowseSources(TorrentLink torLink) { ContextMenu cmenu = new ContextMenu(Translation.SelectSource); cmenu.Add("<<< " + Translation.Browse, () => ShowContextMenuBrowse(torLink)); foreach (TorrentSource src in Enum.GetValues(typeof(TorrentSource))) { TorrentSource local = src; cmenu.AddAction(DownloadHelper.GetTorrentSourceDescription(src), () => { curBrowseSource = local; PerformTorrentBrowseAsync(); }); } return cmenu.Show(); }
private ContextMenuAction ShowRecentSearches() { if (MainWindow.downloadSearchHistory.Count == 0) { Utils.DialogMsg(Translation.Error, Translation.NoHistoryFound); return ContextMenuAction.Exit; } ContextMenu cmenu = new ContextMenu(Translation.SearchHistory); for (int i = MainWindow.downloadSearchHistory.Count - 1; i >= 0; i--) { int local = i; cmenu.AddAction(MainWindow.downloadSearchHistory[i].ToString(), () => ShowSearchResults(MainWindow.downloadSearchHistory[local], MainWindow.downloadSearchResultsHistory[local])); } return cmenu.Show(); }
protected override void OnShowContextMenu() { try { GUIListItem currentitem = m_Facade.SelectedListItem; if (currentitem == null || !(currentitem.TVTag is FanartContainer)) return; FanartContainer selectedFanart = currentitem.TVTag as FanartContainer; ContextMenu cmenu = new ContextMenu(Translation.Fanart); cmenu.AddAction(selectedFanart.IsImageEnabled ? Translation.Disable : Translation.Enable, () => { bool endis = !selectedFanart.IsImageEnabled; JMMServerHelper.EnableDisableFanart(endis, selectedFanart, AnimeID); ShowFanart(); }); if (selectedFanart.IsImageEnabled) { cmenu.AddAction(selectedFanart.IsImageDefault ? Translation.RemoveAsDefault : Translation.SetAsDefault, () => { bool isdef = !selectedFanart.IsImageDefault; JMMServerHelper.SetDefaultFanart(isdef, selectedFanart, AnimeID); ShowFanart(); }); } cmenu.Show(); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Exception in Fanart Chooser Context Menu: " + ex.Message + ex.StackTrace); } }
protected override void OnShowContextMenu() { GUIListItem currentitem = this.m_Facade.SelectedListItem; if (currentitem == null) return; if (currentitem.TVTag.GetType() == typeof(RecommendationVM)) { RecommendationVM rec = currentitem.TVTag as RecommendationVM; if (rec != null) { ContextMenu cmenu = new ContextMenu(rec.Recommended_DisplayName); cmenu.AddAction(Translation.DontShowThisAnime, () => { int recType = 1; if (dummyModeDownload != null && dummyModeDownload.Visible) recType = 2; JMMServerVM.Instance.clientBinaryHTTP.IgnoreAnime(rec.RecommendedAnimeID, recType, JMMServerVM.Instance.CurrentUser.JMMUserID); LoadData(); }); cmenu.AddAction(Translation.BookmarkThisAnime, () => { BookmarkedAnimeVM bookmark = new BookmarkedAnimeVM(); bookmark.AnimeID = rec.RecommendedAnimeID; bookmark.Downloading = 0; bookmark.Notes = ""; bookmark.Priority = 1; if (bookmark.Save()) Utils.DialogMsg(Translation.Sucess, Translation.BookmarkCreated); }); cmenu.AddAction(Translation.CreateSeriesForAnime, () => { JMMServerBinary.Contract_AnimeSeries_SaveResponse resp = JMMServerVM.Instance.clientBinaryHTTP.CreateSeriesFromAnime( rec.RecommendedAnimeID, null, JMMServerVM.Instance.CurrentUser.JMMUserID); if (string.IsNullOrEmpty(resp.ErrorMessage)) Utils.DialogMsg(Translation.Sucess, Translation.SeriesCreated); else Utils.DialogMsg(Translation.Error, resp.ErrorMessage); }); cmenu.Show(); } } }
protected override void OnShowContextMenu() { try { GUIListItem currentitem = m_Facade.SelectedListItem; if (currentitem == null) return; VideoLocalVM vid = currentitem.TVTag as VideoLocalVM; if (vid == null) return; ContextMenu cmenu = new ContextMenu(Translation.FileOptions); cmenu.AddAction(Translation.PlayFile, () => MainWindow.vidHandler.ResumeOrPlay(vid)); cmenu.AddAction(Translation.RehashFile, () => { JMMServerVM.Instance.clientBinaryHTTP.RehashFile(vid.VideoLocalID); DialogProcess(); }); cmenu.AddAction(Translation.IgnoreFile, () => { JMMServerVM.Instance.clientBinaryHTTP.SetIgnoreStatusOnFile(vid.VideoLocalID, true); RefreshUnlinkedFiles(); }); cmenu.AddAction(Translation.DeleteFileFromDisk, () => { if (!Utils.DialogConfirm(Translation.AreYouSureYouWantDeleteFile)) return; foreach(VideoLocal_PlaceVM p in vid.Places) JMMServerVM.Instance.clientBinaryHTTP.DeleteVideoLocalPlaceAndFile(p.VideoLocal_Place_ID); RefreshUnlinkedFiles(); }); cmenu.Show(); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Error in menu: {0}", ex); } }
protected override void OnShowContextMenu() { try { AniDB_VoteVM userVote = MainAnime.UserVote; ContextMenu cmenu = new ContextMenu(MainAnime.FormattedTitle); cmenu.AddAction(Translation.UpdateSeriesInfo, () => { MainWindow.ServerHelper.UpdateAnime(MainAnime.AnimeID); SetGUIProperty(GuiProperty.AnimeInfo_DownloadStatus, Translation.WaitingOnServer + "..."); }); cmenu.AddAction(Translation.SearchForTorrents, () => DownloadHelper.SearchAnime(MainAnime)); if (userVote == null && JMMServerVM.Instance.CurrentUser.IsAniDBUserBool) { cmenu.AddAction(Translation.PermanentVote, () => { decimal rating = Utils.PromptAniDBRating(MainAnime.FormattedTitle); if (rating > 0) { JMMServerVM.Instance.clientBinaryHTTP.VoteAnime(MainAnime.AnimeID, rating, (int)VoteType.AnimePermanent); LoadInfo(); SetSkinProperties(); InfoPage(); } }); cmenu.AddAction(Translation.TemporaryVote, () => { decimal rating = Utils.PromptAniDBRating(MainAnime.FormattedTitle); if (rating > 0) { JMMServerVM.Instance.clientBinaryHTTP.VoteAnime(MainAnime.AnimeID, rating, (int)VoteType.AnimeTemporary); LoadInfo(); SetSkinProperties(); InfoPage(); } }); } if (userVote != null && JMMServerVM.Instance.CurrentUser.IsAniDBUserBool) { cmenu.AddAction(Translation.RevokeVote, () => { JMMServerVM.Instance.clientBinaryHTTP.VoteAnimeRevoke(MainAnime.AnimeID); LoadInfo(); SetSkinProperties(); InfoPage(); }); } cmenu.Show(); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Error in menu: {0}", ex); } }
private ContextMenuAction ShowMoreOptionsMenu() { ContextMenu cmenu = new ContextMenu(Translation.Options); cmenu.AddAction(Translation.ScanDropFolder, ScanDropFolder); cmenu.AddAction(Translation.RemoveRecordsWithoutFile, RemoveMissingFiles); cmenu.AddAction(Translation.SyncVotes, SyncVotes); cmenu.AddAction(Translation.SyncMyList, SyncMyList); return cmenu.Show(); }
protected override void OnShowContextMenu() { try { ContextMenu cmenu = new ContextMenu(Translation.Relations); cmenu.AddAction(Translation.SearchForTorrents, () => { DownloadHelper.SearchAnime(mainAnime); }); cmenu.Show(); } catch (Exception ex) { BaseConfig.MyAnimeLog.Write("Error in menu: {0}", ex); } }