Exemplo n.º 1
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();

            _lastArtist = Profile.MPSettings.Instance.GetValueAsString("last.fm.Radio", "lastArtist", "");
            _lastTag    = Profile.MPSettings.Instance.GetValueAsString("last.fm.Radio", "lastTag", "");

            PlaylistControl.CurrentLayout = Layout.List;
            PlaylistControl.Clear();
            LoadPlaylist();
        }
Exemplo n.º 2
0
 private void ShowPageTorrents()
 {
     setGUIProperty("Downloads.CurrentView", "Torrent Monitor");
     SelectedItem = m_Facade.SelectedListItemIndex;
     dummyPageTorrents.Visible     = true;
     dummyPageTorrentFiles.Visible = false;
     dummyPageSearch.Visible       = false;
     dummyPageBrowse.Visible       = false;
     dummyEpisodeSearch.Visible    = false;
     m_Facade.Clear();
     LoadUTorrentListAsync();
 }
Exemplo n.º 3
0
		private void ShowPageTorrents()
		{
            SetGUIProperty(GuiProperty.Downloads_CurrentView, Translation.TorrentMonitor);

            SelectedItem = m_Facade.SelectedListItemIndex;
			dummyPageTorrents.Visible = true;
			dummyPageTorrentFiles.Visible = false;
			dummyPageSearch.Visible = false;
			dummyPageBrowse.Visible = false;
			dummyEpisodeSearch.Visible = false;
			m_Facade.Clear();
			LoadUTorrentListAsync();
			

		}
Exemplo n.º 4
0
        void ShowBoutiques()
        {
            _Url      = "http://" + server;
            _UserName = "";
            _Password = "";

            //_ShowChannels = false;
            facadeview.Clear();

            //get bouquets
            Data _DBox = new Data(_Url, _UserName, _Password);

            _TV_Bouquets = _DBox.UserTVBouquets.Tables[0];

            foreach (DataRow row in _TV_Bouquets.Rows)
            {
                GUIListItem li = new GUIListItem();
                li.Label = row["Name"].ToString();
                facadeview.Add(li);
            }
        }
Exemplo n.º 5
0
        private void RefreshUnlinkedFiles()
        {
            if (!workerRefreshUnlinkedFiles.IsBusy)
            {
                if (m_Facade == null)
                {
                    return;
                }
                m_Facade.Clear();

                SetGUIProperty(GuiProperty.Utilities_UnlinkedFilesCount, Translation.Loading + "...");
                ClearGUIProperty(GuiProperty.Utilities_UnlinkedFile_Folder);
                ClearGUIProperty(GuiProperty.Utilities_UnlinkedFile_FileName);
                ClearGUIProperty(GuiProperty.Utilities_UnlinkedFile_Size);
                ClearGUIProperty(GuiProperty.Utilities_UnlinkedFile_Hash);
                ClearGUIProperty(GuiProperty.Utilities_UnlinkedFile_FileExists);

                workerRefreshUnlinkedFiles.RunWorkerAsync();
            }
        }
Exemplo n.º 6
0
        private void RefreshUnlinkedFiles()
        {
            if (!workerRefreshUnlinkedFiles.IsBusy)
            {
                if (m_Facade == null)
                {
                    return;
                }
                m_Facade.Clear();

                setGUIProperty("Utilities.UnlinkedFilesCount", "Loading...");

                clearGUIProperty("Utilities.UnlinkedFile.Folder");
                clearGUIProperty("Utilities.UnlinkedFile.FileName");
                clearGUIProperty("Utilities.UnlinkedFile.Size");
                clearGUIProperty("Utilities.UnlinkedFile.Hash");
                clearGUIProperty("Utilities.UnlinkedFile.FileExists");

                workerRefreshUnlinkedFiles.RunWorkerAsync();
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// Performs clear on the facade and all children lists
 /// </summary>
 /// <param name="self"></param>
 public static void ClearAll(this GUIFacadeControl self)
 {
     self.Clear();
     if (self.ListLayout() != null)
     {
         self.ListLayout().Clear();
     }
     if (self.ThumbnailLayout() != null)
     {
         self.ThumbnailLayout().Clear();
     }
     if (self.FilmstripLayout() != null)
     {
         self.FilmstripLayout().Clear();
     }
     if (self.AlbumListLayout() != null)
     {
         self.AlbumListLayout().Clear();
     }
     if (self.CoverFlowLayout != null)
     {
         self.CoverFlowLayout.Clear();
     }
 }
Exemplo n.º 8
0
        protected void LoadDirectory(string strNewDirectory)
        {
            if (m_Facade == null)
            {
                return;
            }

            GUIWaitCursor.Show();
            try
            {
                GUIListItem SelectedItem = m_Facade.SelectedListItem;
                if (SelectedItem != null)
                {
                    if (SelectedItem.IsFolder && SelectedItem.Label != "..")
                    {
                        m_history.Set(SelectedItem.Label, currentFolder);
                    }
                }
                currentFolder = strNewDirectory;
                m_Facade.Clear();

                string strObjects = string.Empty;

                ArrayList itemlist = new ArrayList();

                PlayList playlist = playlistPlayer.GetPlaylist(PlayListType.PLAYLIST_TVSERIES);
                /* copy playlist from general playlist*/
                int iCurrentItem = -1;
                if (playlistPlayer.CurrentPlaylistType == PlayListType.PLAYLIST_TVSERIES)
                {
                    iCurrentItem = playlistPlayer.CurrentItem;
                }

                string strFileName;
                for (int i = 0; i < playlist.Count; ++i)
                {
                    PlayListItem item = playlist[i];
                    strFileName = item.FileName;

                    GUIListItem pItem = new GUIListItem(item.EpisodeName);
                    pItem.Path     = strFileName;
                    pItem.IsFolder = false;
                    pItem.TVTag    = item.Episode;

                    // update images
                    pItem.ThumbnailImage = item.EpisodeThumb;
                    //pItem.IconImageBig = item.EpisodeThumb;
                    //pItem.IconImage = item.EpisodeThumb;

                    if (item.IsWatched)
                    {
                        pItem.IsPlayed  = true; // facade colours...dont seem to work!
                        pItem.IconImage = Helper.GetThemedSkinFile(ThemeType.Image, "tvseries_Watched.png");
                    }
                    else
                    {
                        pItem.IsPlayed  = false;
                        pItem.IconImage = Helper.GetThemedSkinFile(ThemeType.Image, "tvseries_UnWatched.png");
                    }

                    if (item.Duration > 0)
                    {
                        double nDuration = item.Duration;
                        if (nDuration > 0)
                        {
                            string str = Helper.MSToMMSS(nDuration);
                            pItem.Label2 = str;
                        }
                        else
                        {
                            pItem.Label2 = string.Empty;
                        }
                    }

                    itemlist.Add(pItem);
                    //MediaPortal.Util.Utils.SetDefaultIcons(pItem);
                }

                iCurrentItem = 0;
                strFileName  = string.Empty;
                //	Search current playlist item
                if ((m_nTempPlayListWindow == GetID && m_strTempPlayListDirectory.IndexOf(currentFolder) >= 0 && g_Player.Playing) ||
                    (GetID == (int)Window.WINDOW_VIDEO_PLAYLIST && playlistPlayer.CurrentPlaylistType == PlayListType.PLAYLIST_TVSERIES &&
                     g_Player.Playing))
                {
                    iCurrentItem = playlistPlayer.CurrentItem;
                    if (iCurrentItem >= 0)
                    {
                        playlist = playlistPlayer.GetPlaylist(playlistPlayer.CurrentPlaylistType);
                        if (iCurrentItem < playlist.Count)
                        {
                            PlayListItem item = playlist[iCurrentItem];
                            strFileName = item.FileName;
                        }
                    }
                }

                string strSelectedItem = m_history.Get(currentFolder);
                int    iItem           = 0;
                foreach (GUIListItem item in itemlist)
                {
                    m_Facade.Add(item);
                    item.OnItemSelected += new GUIListItem.ItemSelectedHandler(onFacadeItemSelected);

                    //	synchronize playlist with current directory
                    if (strFileName.Length > 0 && item.Path == strFileName)
                    {
                        item.Selected = true;
                    }
                }
                for (int i = 0; i < m_Facade.Count; ++i)
                {
                    GUIListItem item = m_Facade[i];
                    if (item.Label == strSelectedItem)
                    {
                        GUIControl.SelectItemControl(GetID, m_Facade.GetID, iItem);
                        break;
                    }
                    iItem++;
                }

                //set object count label
                int iTotalItems = itemlist.Count;
                GUIPropertyManager.SetProperty("#itemcount", Translation.Episodes + ": " + iTotalItems.ToString());
                GUIPropertyManager.SetProperty("#TVSeries.Playlist.Count", iTotalItems.ToString());

                if (currentSelectedItem >= 0)
                {
                    GUIControl.SelectItemControl(GetID, m_Facade.GetID, currentSelectedItem);
                }
                UpdateButtonStates();
                GUIWaitCursor.Hide();
            }
            catch (Exception ex)
            {
                GUIWaitCursor.Hide();
                MPTVSeriesLog.Write(string.Format("GUITVSeriesPlaylist: An error occured while loading the directory - {0}", ex.Message));
            }
        }
Exemplo n.º 9
0
        public void onFacadeClicked(MediaPortal.GUI.Library.Action.ActionType ButtonPressed)
        {
            ExtendedGUIListItem currentItem = (ExtendedGUIListItem)facade.SelectedListItem;

            //Show games for selected emulator
            if (currentEmulator == null && ButtonPressed != MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU)
            {
                if (ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_NEXT_ITEM)
                {
                    Executor.launchDocument(currentItem.AssociatedEmulator);
                }
                else
                {
                    currentEmulator = currentItem.AssociatedEmulator;
                    if (currentEmulator.isPc())
                    {
                        fillPCGames();
                    }
                    else
                    {
                        currentFolder = currentEmulator.PathToRoms;
                        fillGames();
                        facade.SelectedListItemIndex = 1;
                        onFacadeAction();
                    }
                }
            }

            //Dive into subdir
            else if (currentItem.AssociatedDirectory != null && ButtonPressed != MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU)
            {
                currentFolder = currentItem.AssociatedDirectory;
                fillGames();
                facade.SelectedListItemIndex = 1;
                onFacadeAction();
            }
            //Execute game
            else if (currentItem.AssociatedGame != null && ButtonPressed != MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU)
            {
                if (ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_NEXT_ITEM)
                {
                    Executor.launchDocument(currentItem.AssociatedGame);
                }
                else
                {
                    if (currentItem.AssociatedGame.ParentEmulator.EnableGoodmerge)
                    {
                        if (ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_MUSIC_PLAY)
                        {
                            currentItem.AssociatedGame.LaunchFile = "";
                            Executor.launchGame(currentItem.AssociatedGame);
                        }
                        else
                        {
                            if (ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_PAUSE)
                            {
                                currentItem.AssociatedGame.LaunchFile = "";
                            }

                            if (currentItem.AssociatedGame.LaunchFile.Trim() != "")
                            {
                                Executor.launchGame(currentItem.AssociatedGame);
                                fillGames();

                                for (int i = 0; i < facade.Count; i++)
                                {
                                    try
                                    {
                                        if (((ExtendedGUIListItem)facade[i]).AssociatedGame.Path == currentItem.AssociatedGame.Path)
                                        {
                                            facade.SelectedListItemIndex = i;
                                            onFacadeAction();
                                        }
                                    }
                                    catch { }
                                }
                            }
                            else
                            {
                                SevenZipCompressor.SetLibraryPath(Options.getStringOption("7zdllpath"));
                                using (SevenZipExtractor tmp = new SevenZipExtractor(currentItem.AssociatedGame.Path))
                                {
                                    string GoodmergeTempPath = "";

                                    if (currentItem.AssociatedGame.ParentEmulator.GoodmergeTempPath.EndsWith("\\"))
                                    {
                                        GoodmergeTempPath = currentItem.AssociatedGame.ParentEmulator.GoodmergeTempPath;
                                    }
                                    else
                                    {
                                        GoodmergeTempPath = currentItem.AssociatedGame.ParentEmulator.GoodmergeTempPath + "\\";
                                    }

                                    if (tmp.ArchiveFileNames.Count == 1)
                                    {
                                        Executor.launchGame(currentItem.AssociatedGame);
                                    }
                                    else
                                    {
                                        setView(0);
                                        facade.Clear();

                                        //prev selected
                                        facade.Add(ThumbsHandler.Instance.createBackDots(currentItem.AssociatedGame.Path));

                                        for (int i = 0; i < tmp.ArchiveFileNames.Count; i++)
                                        {
                                            Game RomListGame = DB.getGame(currentItem.AssociatedGame.Path, currentItem.AssociatedGame.ParentEmulator);
                                            RomListGame.LaunchFile = tmp.ArchiveFileNames[i];
                                            facade.Add(ThumbsHandler.Instance.createGameRomFacadeItem(RomListGame));

                                            Log.Error(new Exception("launch" + RomListGame.LaunchFile));
                                        }

                                        facade.SelectedListItemIndex = 1;
                                        onFacadeAction();
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        Executor.launchGame(currentItem.AssociatedGame);
                    }
                }
            }
            else if ((currentItem.IsBackDots || ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU) && !string.IsNullOrEmpty(currentItem.PrevSelected))
            {
                fillGames();

                for (int i = 0; i < facade.Count; i++)
                {
                    try
                    {
                        if (((ExtendedGUIListItem)facade[i]).AssociatedGame.Path == currentItem.PrevSelected)
                        {
                            facade.SelectedListItemIndex = i;
                            onFacadeAction();
                        }
                    }
                    catch { }
                }
            }
            //Go up one level
            else if ((currentItem.IsBackDots || ButtonPressed == MediaPortal.GUI.Library.Action.ActionType.ACTION_PREVIOUS_MENU))
            {
                //Go back to all emulators
                if (currentEmulator.isManyEmulators() || currentEmulator.isPc() || currentFolder.Equals(currentEmulator.PathToRoms))
                {
                    currentEmulator     = null;
                    currentFolder       = null;
                    currentSqlTail      = null;
                    currentGameProperty = gameProperty.none;
                    fillEmulators();
                    facade.SelectedListItemIndex = 0;
                    onFacadeAction();
                }
                //Go back to parent directory
                else
                {
                    currentFolder = currentFolder.Remove(currentFolder.LastIndexOf("\\"));
                    fillGames();
                    facade.SelectedListItemIndex = 1;
                }
            }
        }