Example #1
0
 private void OnPriority()
 {
     if (_upcomingProgram != null)
     {
         Schedule schedule = Proxies.SchedulerService.GetScheduleById(_upcomingProgram.ScheduleId).Result;
         if (schedule == null)
         {
             return;
         }
         GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
         if (dlg != null)
         {
             dlg.Reset();
             dlg.SetHeading(Utility.GetLocalizedText(TextId.RecordingsListItemsSuffix));
             dlg.Add(Utility.GetLocalizedText(TextId.VeryLow));
             dlg.Add(Utility.GetLocalizedText(TextId.Low));
             dlg.Add(Utility.GetLocalizedText(TextId.Normal));
             dlg.Add(Utility.GetLocalizedText(TextId.High));
             dlg.Add(Utility.GetLocalizedText(TextId.VeryHigh));
             dlg.SelectedLabel = (int)schedule.SchedulePriority + 2;
             dlg.DoModal(GetID);
             if (dlg.SelectedLabel >= 0)
             {
                 schedule.SchedulePriority = (SchedulePriority)(dlg.SelectedLabel - 2);
                 Proxies.SchedulerService.SaveSchedule(schedule).Wait();
             }
         }
     }
 }
Example #2
0
        protected override void OnPageLoad()
        {
            PluginMain.EnsureConnection();

            base.OnPageLoad();
            if (PluginMain.IsConnected())
            {
                LoadSettings();
                if (GUIWindowManager.GetPreviousActiveWindow() != WindowId.ProgramInfo &&
                    GUIWindowManager.GetPreviousActiveWindow() != WindowId.ManualShedule)
                {
                    _selectedSchedule = null;
                }
                LoadUpcomingPrograms(_selectedSchedule);
                _sortByButton.SortChanged += new SortEventHandler(SortChanged);

                if (this._channelType == ChannelType.Television)
                {
                    GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.TVScheduler));
                }
                else
                {
                    GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.RadioScheduler));
                }
            }
        }
Example #3
0
        private void OnRestoreDefaults()
        {
            GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO);

            if (dlgYesNo != null)
            {
                dlgYesNo.Reset();
                dlgYesNo.SetHeading(927);
                dlgYesNo.SetLine(1, Utility.GetLocalizedText(TextId.RestoreDefaults));
                dlgYesNo.SetLine(2, Utility.GetLocalizedText(TextId.AreYouSure));
                dlgYesNo.SetLine(3, string.Empty);
                dlgYesNo.SetDefaultToYes(false);
                dlgYesNo.DoModal(GetID);

                if (dlgYesNo.IsConfirmed)
                {
                    Proxies.ConfigurationService.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.CreateVideoThumbnails, null).Wait();
                    Proxies.ConfigurationService.SetBooleanValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.AlwaysCreateMetadataFiles, null).Wait();
                    Proxies.ConfigurationService.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreferredGuideSource, null).Wait();
                    Proxies.ConfigurationService.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PreRecordsSeconds, null).Wait();
                    Proxies.ConfigurationService.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.PostRecordsSeconds, null).Wait();
                    Proxies.ConfigurationService.SetStringValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilMode, null).Wait();
                    Proxies.ConfigurationService.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.DefaultKeepUntilValue, null).Wait();
                    Proxies.ConfigurationService.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.FreeDiskSpaceInMB, null).Wait();
                    Proxies.ConfigurationService.SetIntValue(ConfigurationModule.Scheduler, ConfigurationKey.Scheduler.MinimumFreeDiskSpaceInMB, null).Wait();
                }
            }
        }
Example #4
0
 protected override void OnWindowLoaded()
 {
     base.OnWindowLoaded();
     _tvGuideButton.Label      = Utility.GetLocalizedText(TextId.TvGuide);
     _recordingsButton.Label   = Utility.GetLocalizedText(TextId.RecordedTv);
     _teletextButton.IsEnabled = false;
 }
Example #5
0
 private void OnClearRules(bool withDialog)
 {
     if (_categorieArguments.Count > 0 || _channelArguments.Count > 0)
     {
         if (withDialog)
         {
             GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO);
             if (dlgYesNo != null)
             {
                 dlgYesNo.SetHeading(Utility.GetLocalizedText(TextId.Attention));
                 dlgYesNo.SetLine(1, Utility.GetLocalizedText(TextId.AlsoDeleteChannelAndCategorie));
                 dlgYesNo.SetLine(2, string.Empty);
                 dlgYesNo.SetLine(3, string.Empty);
                 dlgYesNo.SetDefaultToYes(true);
                 dlgYesNo.DoModal(GetID);
                 if (dlgYesNo.IsConfirmed)
                 {
                     _categorieArguments.Clear();
                     _channelArguments.Clear();
                 }
             }
         }
         else
         {
             _categorieArguments.Clear();
             _channelArguments.Clear();
         }
     }
     _rules.Clear();
 }
Example #6
0
        protected override void OnShowContextMenu()
        {
            int         itemIndex = GetSelectedItemNo();
            GUIListItem item      = GetItem(itemIndex);

            if (item == null ||
                item.IsFolder)
            {
                return;
            }
            UpcomingProgram program = item.TVTag as UpcomingProgram;

            if (program != null)
            {
                GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
                if (dlg == null)
                {
                    return;
                }
                dlg.Reset();
                dlg.SetHeading(program.Title);
                dlg.Add(Utility.GetLocalizedText(TextId.Information));
                dlg.DoModal(GetID);
                switch (dlg.SelectedLabel)
                {
                case 0:     // information
                    OnEditSchedule(program);
                    break;
                }
            }
        }
Example #7
0
 private void OnChangePriority(UpcomingProgram upcoming)
 {
     if (upcoming != null)
     {
         GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
         if (dlg != null)
         {
             dlg.Reset();
             dlg.SetHeading(Utility.GetLocalizedText(TextId.Priority));
             dlg.Add(Utility.GetLocalizedText(TextId.VeryLow));
             dlg.Add(Utility.GetLocalizedText(TextId.Low));
             dlg.Add(Utility.GetLocalizedText(TextId.Normal));
             dlg.Add(Utility.GetLocalizedText(TextId.High));
             dlg.Add(Utility.GetLocalizedText(TextId.VeryHigh));
             dlg.Add(Utility.GetLocalizedText(TextId.Highest));
             dlg.Add(Utility.GetLocalizedText(TextId.ResetToSchedulePriority));
             dlg.SelectedLabel = (int)upcoming.Priority + 2;
             dlg.DoModal(GetID);
             if (dlg.SelectedLabel >= 0)
             {
                 int selectedInt = dlg.SelectedLabel - 2;
                 UpcomingProgramPriority?priority = null;
                 if (selectedInt >= (int)UpcomingProgramPriority.VeryLow &&
                     selectedInt <= (int)UpcomingProgramPriority.Highest)
                 {
                     priority = (UpcomingProgramPriority)selectedInt;
                 }
                 Proxies.SchedulerService.SetUpcomingProgramPriority(upcoming.UpcomingProgramId, upcoming.StartTime, priority).Wait();
                 m_iSelectedItem = GetSelectedItemNo();
                 LoadUpcomingPrograms(null);
             }
         }
     }
 }
Example #8
0
        protected override void OnPageLoad()
        {
            PluginMain.EnsureConnection();

            base.OnPageLoad();
            if (PluginMain.IsConnected())
            {
                LoadSettings();
                if (GUIWindowManager.GetPreviousActiveWindow() != WindowId.ProgramInfo)
                {
                    OnClearRules(false);
                    _selectedTitle      = string.Empty;
                    _selectedTitleIndex = 0;
                }
                ShowSearchResults(_selectedTitle);
                UpdateButtonStates();
                _sortByButton.SortChanged += new SortEventHandler(SortChanged);

                if (this._channelType == ChannelType.Television)
                {
                    GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.TVGuideSearch));
                }
                else
                {
                    GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.RadioGuideSearch));
                }
            }
        }
Example #9
0
        private void LoadGroupAndChannelSettings(Settings xmlreader, ChannelType channelType, string section)
        {
            string channelName = xmlreader.GetValueAsString(section, "channel", String.Empty);

            string groupname = xmlreader.GetValueAsString(section, "group", Utility.GetLocalizedText(TextId.AllChannels));

            foreach (ChannelGroup group in _navigatorChannels[channelType].Groups)
            {
                if (group.GroupName == groupname)
                {
                    _navigatorChannels[channelType].PreviousChannelGroup = group;
                    _currentChannelGroup = group;
                    RefreshChannelsInGroup(channelType);
                    break;
                }
            }
            _navigatorChannels[channelType].LastChannelGroup = _navigatorChannels[channelType].PreviousChannelGroup;

            _navigatorChannels[channelType].PreviousChannel = null;
            foreach (Channel channel in _navigatorChannels[channelType].Channels)
            {
                if (channel.DisplayName == channelName)
                {
                    _navigatorChannels[channelType].PreviousChannel = channel;
                    break;
                }
            }
            _navigatorChannels[channelType].LastChannel = _navigatorChannels[channelType].PreviousChannel;
        }
Example #10
0
        private void OnNewSchedule()
        {
            GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);

            if (dlg != null)
            {
                dlg.Reset();
                dlg.SetHeading(GUILocalizeStrings.Get(424));
                dlg.Add(Utility.GetLocalizedText(this._channelType == ChannelType.Television ? TextId.TvGuide : TextId.RadioGuide));
                dlg.Add(Utility.GetLocalizedText(TextId.SearchGuide));
                dlg.Add(Utility.GetLocalizedText(TextId.Manual));
                dlg.DoModal(GetID);

                switch (dlg.SelectedLabel)
                {
                case 0:
                    GUIWindowManager.ActivateWindow(
                        this._channelType == ChannelType.Television ? WindowId.TvGuide : WindowId.RadioGuide);
                    break;

                case 1:
                    GUIWindowManager.ActivateWindow(
                        this._channelType == ChannelType.Television ? WindowId.TvGuideSearch : WindowId.RadioGuideSearch);
                    break;

                case 2:
                    ManualSchedule.upcomingProgram = null;
                    ManualSchedule.channelType     = this._channelType;
                    GUIWindowManager.ActivateWindow(WindowId.ManualShedule);
                    break;
                }
            }
        }
Example #11
0
        private string GetCategorieArgumentString(bool isforDialog)
        {
            string text = String.Empty;

            text = Utility.GetLocalizedText(TextId.Categories) + " ";
            if (_categorieArguments.Count > 0)
            {
                foreach (object argument in _categorieArguments)
                {
                    text += argument.ToString() + ",";
                }
                text = text.Remove(text.Length - 1);
            }
            else
            {
                if (isforDialog)
                {
                    text = Utility.GetLocalizedText(TextId.SelectCategorie);
                }
                else
                {
                    text += Utility.GetLocalizedText(TextId.All);
                }
            }
            return(text);
        }
Example #12
0
        protected override void OnWindowLoaded()
        {
            base.OnWindowLoaded();
            _testConnectionButton.Label        = Utility.GetLocalizedText(TextId.TestConnection);
            _autoFullScreenButton.Label        = Utility.GetLocalizedText(TextId.AutoFullscreen);
            _dvbSubtitlesButton.Label          = Utility.GetLocalizedText(TextId.DVBSubtitles);
            _teletextSubtitleButton.Label      = Utility.GetLocalizedText(TextId.TXTSubtitles);
            _preferAC3Button.Label             = Utility.GetLocalizedText(TextId.PreferAC3);
            _hideAllChannelsGroupButton.Label  = Utility.GetLocalizedText(TextId.HideAllChannelsGroup);
            _showChannelNumbersButton.Label    = Utility.GetLocalizedText(TextId.ShowChannelNrInGuide);
            _recordingNotificationButton.Label = Utility.GetLocalizedText(TextId.RecordingNotifications);
            _standbyOnHomeButton.Label         = Utility.GetLocalizedText(TextId.OnlySleepOnHome);
            _rtspStreamingRecButton.Label      = Utility.GetLocalizedText(TextId.RTSPForRec);
            _rtspStreamingTVButton.Label       = Utility.GetLocalizedText(TextId.RTSPForTv);
            _autoStreamingButton.Label         = Utility.GetLocalizedText(TextId.AutoSelectRTSP);
            _WolTimeoutButton.Label            = Utility.GetLocalizedText(TextId.WolTimeout);
            _enableWolButton.Label             = Utility.GetLocalizedText(TextId.EnableWol);

            if (_infoLabel != null)
            {
                _infoLabel.Label = Utility.GetLocalizedText(TextId.ClientSettingsInfo);
            }
            if (_serverLabel != null)
            {
                _serverLabel.Label = Utility.GetLocalizedText(TextId.Server);
            }
            if (_portLabel != null)
            {
                _portLabel.Label = Utility.GetLocalizedText(TextId.Port);
            }
        }
Example #13
0
        private string GetChannelArgumentsString(bool isforDialog)
        {
            string text = string.Empty;

            text = Utility.GetLocalizedText(TextId.Channels) + " ";
            if (_channelArguments.Count > 0)
            {
                foreach (object argument in _channelArguments)
                {
                    Channel chan = SchedulerAgent.GetChannelById(new Guid(argument.ToString()));
                    text += chan.DisplayName + ",";
                }
                text = text.Remove(text.Length - 1);
            }
            else
            {
                if (isforDialog)
                {
                    text = Utility.GetLocalizedText(TextId.SelectChannel);
                }
                else
                {
                    text += Utility.GetLocalizedText(TextId.All);
                }
            }
            return(text);
        }
Example #14
0
 protected override void OnWindowLoaded()
 {
     base.OnWindowLoaded();
     _tvGuideButton.Label    = Utility.GetLocalizedText(TextId.RadioGuide);
     _recordingsButton.Label = Utility.GetLocalizedText(TextId.RecordedRadio);
     _tvOnOffButton.Label    = Utility.GetLocalizedText(TextId.RadioOn);
     _teletextButton         = null;
 }
Example #15
0
 public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)
 {
     strButtonText       = Utility.GetLocalizedText(TextId.MyTv);
     strButtonImage      = String.Empty;
     strButtonImageFocus = String.Empty;
     strPictureImage     = "hover_my tv.png";
     return(true);
 }
Example #16
0
        private void RefreshGroups(ChannelType channelType)
        {
            try
            {
                using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
                {
                    List <ChannelGroup> groups = new List <ChannelGroup>(tvSchedulerAgent.GetAllChannelGroups(channelType, true));
                    if (_currentChannelGroup != null &&
                        _currentChannelGroup.ChannelGroupId != ChannelGroup.AllTvChannelsGroupId &&
                        _currentChannelGroup.ChannelGroupId != ChannelGroup.AllRadioChannelsGroupId)
                    {
                        bool currentFound = false;
                        foreach (ChannelGroup group in groups)
                        {
                            if (group.ChannelGroupId == _currentChannelGroup.ChannelGroupId)
                            {
                                currentFound = true;
                                break;
                            }
                        }
                        if (!currentFound)
                        {
                            _currentChannelGroup = null;
                        }
                    }

                    bool hideAllChannelsGroup = false;
                    using (Settings xmlreader = new MPSettings())
                    {
                        hideAllChannelsGroup = xmlreader.GetValueAsBool("mytv", "hideAllChannelsGroup", false);
                    }

                    if (!hideAllChannelsGroup || groups.Count == 0)
                    {
                        groups.Add(new ChannelGroup()
                        {
                            ChannelGroupId = channelType == ChannelType.Television ? ChannelGroup.AllTvChannelsGroupId : ChannelGroup.AllRadioChannelsGroupId,
                            ChannelType    = channelType,
                            GroupName      = Utility.GetLocalizedText(TextId.AllChannels),
                            Sequence       = int.MaxValue,
                            VisibleInGuide = true
                        });
                    }

                    _navigatorChannels[channelType].Groups = groups;

                    if (_currentChannelGroup == null && _navigatorChannels[channelType].Groups.Count > 0)
                    {
                        _currentChannelGroup = _navigatorChannels[channelType].Groups[0];
                        RefreshChannelsInGroup(tvSchedulerAgent, channelType);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error("ChannelNavigator: Error in RefreshChannelGroups - {0}", ex.Message);
            }
        }
Example #17
0
        protected override void OnPageLoad()
        {
            base.OnPageLoad();
            _mpRestartNeeded     = false;
            _restartPlayerNeeded = false;

            LoadSettings(false);
            _isSingleSeat = Utility.IsThisASingleSeatSetup(_serverSettings.ServerName);
            UpdateButtons();
            GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.ArgusClientSettings));
        }
Example #18
0
        protected override void OnPageLoad()
        {
            PluginMain.EnsureConnection();
            base.OnPageLoad();

            if (PluginMain.IsConnected())
            {
                _currentChannelType = ChannelType.Television;
                LoadAll(null);
                GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.ChannelManager));
            }
        }
Example #19
0
        protected override void OnPageLoad()
        {
            PluginMain.EnsureConnection();
            base.OnPageLoad();

            if (PluginMain.IsConnected())
            {
                LoadSettings();
                UpdateButtons();
                GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.ArgusServerSettings));
            }
        }
Example #20
0
        public override bool Init()
        {
            bool result = Load(GUIGraphicsContext.Skin + @"\ARGUS_ClientSettings.xml");

            if (result)
            {
                GUIPropertyManager.SetProperty("#TV.Settings.ArgusClientSettingsName", Utility.GetLocalizedText(TextId.ArgusClientSettings));
                GUIPropertyManager.SetProperty("#TV.Settings.ArgusServerSettingsName", Utility.GetLocalizedText(TextId.ArgusServerSettings));
                GUIPropertyManager.SetProperty("#TV.Settings.ChannelManagerName", Utility.GetLocalizedText(TextId.ChannelManager));
                GUIPropertyManager.SetProperty("#TV.Settings.ArgusSettingsEnabled", "true"); //info for skins
            }
            return(result);
        }
Example #21
0
        protected override void OnWindowLoaded()
        {
            base.OnWindowLoaded();
            _allChannelsLabel.Label      = Utility.GetLocalizedText(TextId.ChannelsNotInGroup);
            _channelGroupsLabel.Label    = Utility.GetLocalizedText(TextId.ChannelGroups);
            _channelInGroupLabel.Label   = Utility.GetLocalizedText(TextId.ChannelsInGroup);
            _newChannelGroupButton.Label = Utility.GetLocalizedText(TextId.NewGroup);

            if (_infoLabel != null)
            {
                _infoLabel.Label = Utility.GetLocalizedText(TextId.ChannelManagmentInfo);
            }
        }
Example #22
0
        private void UpdateButtons()
        {
            if (_currentKeepUntilMode == KeepUntilMode.Forever || _currentKeepUntilMode == KeepUntilMode.UntilSpaceIsNeeded)
            {
                _currentKeepUntilValue          = 0;
                _keepUntilValueButton.IsEnabled = false;
            }
            else
            {
                _keepUntilValueButton.IsEnabled = true;
            }
            _keepUntilValueButton.Label = _currentKeepUntilValue.ToString();

            switch (_currentKeepUntilMode)
            {
            case KeepUntilMode.UntilSpaceIsNeeded:
                _keepUntilModeButton.Label = Utility.GetLocalizedText(TextId.UntilSpaceNeeded);
                break;

            case KeepUntilMode.NumberOfDays:
                _keepUntilModeButton.Label = Utility.GetLocalizedText(TextId.NumberOfDays);
                break;

            case KeepUntilMode.NumberOfEpisodes:
                _keepUntilModeButton.Label = Utility.GetLocalizedText(TextId.NumberOfEpisodes);
                break;

            case KeepUntilMode.NumberOfWatchedEpisodes:
                _keepUntilModeButton.Label = Utility.GetLocalizedText(TextId.NumberOfWatchedEpisodes);
                break;

            case KeepUntilMode.Forever:
                _keepUntilModeButton.Label = Utility.GetLocalizedText(TextId.Forever);
                break;
            }

            switch (_currentGuideSource)
            {
            case GuideSource.DvbEpg:
                _guideSourceButton.Label = GuideSource.DvbEpg.ToString();
                break;

            case GuideSource.XmlTv:
                _guideSourceButton.Label = GuideSource.XmlTv.ToString();
                break;

            case GuideSource.Other:
                _guideSourceButton.Label = "Other";
                break;
            }
        }
Example #23
0
        protected override void OnPageDestroy(int new_windowId)
        {
            SaveSettings(false);
            GUIWaitCursor.Hide();

            if (_mpRestartNeeded)
            {
                GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_YES_NO);
                if (dlgYesNo != null)
                {
                    dlgYesNo.Reset();
                    dlgYesNo.SetHeading(927);
                    dlgYesNo.SetLine(1, Utility.GetLocalizedText(TextId.RecommendedToRestartMP));
                    dlgYesNo.SetLine(2, Utility.GetLocalizedText(TextId.RestartMPNow));
                    dlgYesNo.SetDefaultToYes(true);
                    dlgYesNo.DoModal(GetID);

                    if (dlgYesNo.IsConfirmed)
                    {
                        Utility.RestartMP();
                    }
                }
            }
            else if (_restartPlayerNeeded)
            {
                if (g_Player.Playing && (g_Player.IsTV || g_Player.IsRadio || g_Player.IsTVRecording))
                {
                    GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_YES_NO);
                    if (dlgYesNo != null)
                    {
                        dlgYesNo.Reset();
                        dlgYesNo.SetHeading(927);
                        dlgYesNo.SetLine(1, Utility.GetLocalizedText(TextId.RecommendedToStopPlayback));
                        dlgYesNo.SetLine(2, Utility.GetLocalizedText(TextId.StopPlayBackNow));
                        dlgYesNo.SetDefaultToYes(true);
                        dlgYesNo.DoModal(GetID);

                        if (dlgYesNo.IsConfirmed)
                        {
                            g_Player.Stop();
                        }
                    }
                }
            }
            base.OnPageDestroy(new_windowId);
        }
Example #24
0
        private void OnChangeGuideChannel(Channel channel)
        {
            var guideChannels = Proxies.GuideService.GetAllChannels(_currentChannelType).Result;

            if (guideChannels != null && guideChannels.Count > 0)
            {
                GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);
                if (dlg != null)
                {
                    dlg.Reset();
                    dlg.SetHeading(Utility.GetLocalizedText(TextId.SelectGuideChannel));
                    dlg.Add(Utility.GetLocalizedText(TextId.None));

                    int y = 0;
                    for (int i = 0; i < guideChannels.Count; i++)
                    {
                        GUIListItem item = new GUIListItem();
                        item.Label = guideChannels[i].Name;
                        if (channel.GuideChannelId.HasValue && (guideChannels[i].GuideChannelId == channel.GuideChannelId.Value))
                        {
                            item.IsPlayed = true;
                            y             = i + 1;
                        }
                        dlg.Add(item);
                    }
                    dlg.SelectedLabel = y;

                    dlg.DoModal(GetID);
                    if (dlg.SelectedId > 0)
                    {
                        if (dlg.SelectedLabel <= 0)
                        {
                            channel.GuideChannelId = null;
                            Proxies.SchedulerService.SaveChannel(channel).Wait();
                        }
                        else
                        {
                            GuideChannel guideChannel = guideChannels[dlg.SelectedLabel - 1];
                            Proxies.SchedulerService.AttachChannelToGuide(channel.ChannelId, guideChannel.GuideChannelId).Wait();
                        }
                    }
                }
            }
        }
Example #25
0
        private void UpdateButtonStates()
        {
            string strLine = string.Empty;

            if (_isInSubDirectory || !_groupBySchedButton.Selected)
            {
                switch (_currentSortMethod)
                {
                case SortMethod.Channel:
                    strLine = Utility.GetLocalizedText(TextId.SortByChannel);
                    break;

                case SortMethod.Date:
                    strLine = Utility.GetLocalizedText(TextId.SortByDate);
                    break;

                case SortMethod.Name:
                    strLine = Utility.GetLocalizedText(TextId.SortByTitle);
                    break;
                }
            }
            else
            {
                strLine = Utility.GetLocalizedText(TextId.SortByTitle);
            }
            GUIControl.SetControlLabel(GetID, _sortByButton.GetID, strLine);

            switch (_currentProgramType)
            {
            case ScheduleType.Recording:
                strLine = Utility.GetLocalizedText(TextId.UpcomingTypeRecordings);
                break;

            case ScheduleType.Alert:
                strLine = Utility.GetLocalizedText(TextId.UpcomingTypeAlerts);
                break;

            case ScheduleType.Suggestion:
                strLine = Utility.GetLocalizedText(TextId.UpcomingTypeSuggestions);
                break;
            }
            GUIControl.SetControlLabel(GetID, _programTypeButton.GetID, strLine);
            _sortByButton.IsAscending = m_bSortAscending;
        }
Example #26
0
        protected override void OnWindowLoaded()
        {
            base.OnWindowLoaded();
            _keepValueLabel.Label             = Utility.GetLocalizedText(TextId.Value);
            _preferedGuideSourceLabel.Label   = Utility.GetLocalizedText(TextId.PreferedEPGSource);
            _deleteAllGuideDataButton.Label   = Utility.GetLocalizedText(TextId.DeleteAllGuideData);
            _restoreDefaultsButton.Label      = Utility.GetLocalizedText(TextId.RestoreDefaults);
            _freeDiskSpaceSpinButton.Label    = Utility.GetLocalizedText(TextId.FreeDiskSpace);
            _minFreeDiskSpaceSpinButton.Label = Utility.GetLocalizedText(TextId.MinFreeDiskSpace);
            _preRecordButton.Label            = Utility.GetLocalizedText(TextId.DefaultPreRec);
            _postRecordButton.Label           = Utility.GetLocalizedText(TextId.DefaultPostRec);
            _autoCreateThumbsButton.Label     = Utility.GetLocalizedText(TextId.RecThumbs);
            _metaDataForRecsButton.Label      = Utility.GetLocalizedText(TextId.MetaDataForRec);
            _showLogsButton.Label             = Utility.GetLocalizedText(TextId.ShowLogs);

            if (_infoLabel != null)
            {
                _infoLabel.Label = Utility.GetLocalizedText(TextId.ServerSettingsInfo);
            }
        }
Example #27
0
        private void OnDeleteAllGuideData()
        {
            GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO);

            if (dlgYesNo != null)
            {
                dlgYesNo.Reset();
                dlgYesNo.SetHeading(927);
                dlgYesNo.SetLine(1, Utility.GetLocalizedText(TextId.DeleteAllGuideData));
                dlgYesNo.SetLine(2, Utility.GetLocalizedText(TextId.AreYouSure));
                dlgYesNo.SetLine(3, string.Empty);
                dlgYesNo.SetDefaultToYes(false);
                dlgYesNo.DoModal(GetID);

                if (dlgYesNo.IsConfirmed)
                {
                    Proxies.GuideService.DeleteAllPrograms().Wait();
                }
            }
        }
Example #28
0
        private bool OnDeleteChannel(Channel channel)
        {
            GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO);

            if (dlgYesNo != null)
            {
                dlgYesNo.Reset();
                dlgYesNo.SetHeading(channel.DisplayName);
                dlgYesNo.SetLine(1, Utility.GetLocalizedText(TextId.DeleteChannel));
                dlgYesNo.SetLine(2, Utility.GetLocalizedText(TextId.AreYouSure));
                dlgYesNo.SetLine(3, string.Empty);
                dlgYesNo.SetDefaultToYes(false);
                dlgYesNo.DoModal(GetID);

                if (dlgYesNo.IsConfirmed)
                {
                    Proxies.SchedulerService.DeleteChannel(channel.ChannelId, true).Wait();
                    return(true);
                }
            }
            return(false);
        }
Example #29
0
        private void OnchangeEpgSource()
        {
            GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);

            if (dlg != null)
            {
                dlg.Reset();
                dlg.SetHeading(Utility.GetLocalizedText(TextId.PreferedEPGSource));

                dlg.Add(GuideSource.XmlTv.ToString());
                dlg.Add(GuideSource.DvbEpg.ToString());

                int selectedId = 0;
                if (_currentGuideSource == GuideSource.XmlTv)
                {
                    selectedId = 0;
                }
                else if (_currentGuideSource == GuideSource.DvbEpg)
                {
                    selectedId = 1;
                }
                dlg.SelectedLabel = selectedId;

                dlg.DoModal(GetID);
                if (dlg.SelectedId > 0)
                {
                    switch (dlg.SelectedLabel)
                    {
                    case 0:
                        _currentGuideSource = GuideSource.XmlTv;
                        break;

                    case 1:
                        _currentGuideSource = GuideSource.DvbEpg;
                        break;
                    }
                }
            }
        }
Example #30
0
        private void ChangeChannelType()
        {
            GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU);

            if (dlg != null)
            {
                dlg.Reset();
                dlg.SetHeading(Utility.GetLocalizedText(TextId.Type));

                dlg.Add(Utility.GetLocalizedText(TextId.Television));
                dlg.Add(Utility.GetLocalizedText(TextId.Radio));
                switch (_currentChannelType)
                {
                case ChannelType.Television:
                    dlg.SelectedLabel = 0;
                    break;

                case ChannelType.Radio:
                    dlg.SelectedLabel = 1;
                    break;
                }

                dlg.DoModal(GetID);
                if (dlg.SelectedId > 0)
                {
                    switch (dlg.SelectedLabel)
                    {
                    case 0:
                        _currentChannelType = ChannelType.Television;
                        break;

                    case 1:
                        _currentChannelType = ChannelType.Radio;
                        break;
                    }
                }
            }
        }