Esempio n. 1
0
        protected override void OnPageLoad()
        {
            if (!TVHome.Connected)
            {
                RemoteControl.Clear();
                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_TVENGINE);
                return;
            }

            TVHome.WaitForGentleConnection();

            if (TVHome.Navigator == null)
            {
                TVHome.OnLoaded();
            }
            else if (TVHome.Navigator.Channel == null)
            {
                TVHome.m_navigator.ReLoad();
                TVHome.LoadSettings(false);
            }

            if (TVHome.m_navigator == null)
            {
                TVHome.m_navigator = new ChannelNavigator(); // Create the channel navigator (it will load groups and channels)
            }

            base.OnPageLoad();
            if (btnPriorities != null)
            {
                btnPriorities.Visible = false;
            }
            //@      ConflictManager.OnConflictsUpdated += new MediaPortal.TV.Recording.ConflictManager.OnConflictsUpdatedHandler(ConflictManager_OnConflictsUpdated);

            LoadSettings();
            needUpdate   = false;
            selectedItem = null;
            LoadDirectory();

            while (m_iSelectedItem >= GetItemCount() && m_iSelectedItem > 0)
            {
                m_iSelectedItem--;
            }
            GUIControl.SelectItemControl(GetID, listSchedules.GetID, m_iSelectedItem);

            btnSortBy.SortChanged += new SortEventHandler(SortChanged);
        }
Esempio n. 2
0
        protected override void OnPageLoad()
        {
            Log.Info("RadioHome:OnPageLoad");

            if (!TVHome.Connected)
            {
                RemoteControl.Clear();
                GUIWindowManager.ActivateWindow((int)Window.WINDOW_SETTINGS_TVENGINE);
                return;
            }

            if (TVHome.Navigator == null)
            {
                TVHome.OnLoaded();
            }
            else if (TVHome.Navigator.Channel == null)
            {
                TVHome.m_navigator.ReLoad();
                TVHome.LoadSettings(false);
            }

            // Create the channel navigator (it will load groups and channels)
            if (TVHome.m_navigator == null)
            {
                TVHome.m_navigator = new ChannelNavigator();
            }

            // Reload ChannelGroups
            Radio radioLoad = (Radio)GUIWindowManager.GetWindow((int)Window.WINDOW_RADIO);

            radioLoad.OnAdded();

            base.OnPageLoad();
            GUIMessage msgStopRecorder = new GUIMessage(GUIMessage.MessageType.GUI_MSG_RECORDER_STOP, 0, 0, 0, 0, 0, null);

            GUIWindowManager.SendMessage(msgStopRecorder);
            switch (currentSortMethod)
            {
            case SortMethod.Name:
                btnSortBy.SelectedItem = 0;
                break;

            case SortMethod.Type:
                btnSortBy.SelectedItem = 1;
                break;

            case SortMethod.Genre:
                btnSortBy.SelectedItem = 2;
                break;

            case SortMethod.Bitrate:
                btnSortBy.SelectedItem = 3;
                break;

            case SortMethod.Number:
                btnSortBy.SelectedItem = 4;
                break;
            }

            SelectCurrentItem();
            LoadDirectory(currentFolder);

            SetLastChannel();

            if ((_autoTurnOnRadio) && !(g_Player.Playing && g_Player.IsRadio))
            {
                GUIListItem item = facadeLayout.SelectedListItem;
                if (item != null && item.Label != ".." && !item.IsFolder)
                {
                    Play(facadeLayout.SelectedListItem);
                }
            }

            btnSortBy.SortChanged += SortChanged;
        }