示例#1
0
        private void LoadRelatedShows()
        {
            GUIUtils.SetProperty("#Trakt.Items", string.Empty);

            GUIBackgroundTask.Instance.ExecuteInBackgroundAndCallback(() =>
            {
                if (hideWatchedButton != null)
                {
                    GUIControl.DisableControl((int)TraktGUIWindows.RelatedShows, hideWatchedButton.GetID);
                }
                return(RelatedShows);
            },
                                                                      delegate(bool success, object result)
            {
                if (hideWatchedButton != null)
                {
                    GUIControl.EnableControl((int)TraktGUIWindows.RelatedShows, hideWatchedButton.GetID);
                }

                if (success)
                {
                    IEnumerable <TraktShow> shows = result as IEnumerable <TraktShow>;
                    SendRelatedShowsToFacade(shows);
                }
            }, Translation.GettingRelatedShows, true);
        }
示例#2
0
        private void EnableGUIButtons()
        {
            if (nextEpisodeButton == null || prevEpisodeButton == null)
            {
                return;
            }

            // only enable episode buttons for episode shouts
            if (ShoutType != ShoutTypeEnum.episode)
            {
                GUIControl.DisableControl(GetID, nextEpisodeButton.GetID);
                GUIControl.DisableControl(GetID, prevEpisodeButton.GetID);
                return;
            }

            // we could get the max episode number and disable next button
            // on last episode, for now, lets not do the extra request and
            // rely on notify to popup indicating no more shouts.
            GUIControl.EnableControl(GetID, nextEpisodeButton.GetID);
            GUIControl.EnableControl(GetID, prevEpisodeButton.GetID);

            // if episode one, then disable prev button
            if (EpisodeInfo.EpisodeIdx <= 1)
            {
                GUIControl.DisableControl(GetID, prevEpisodeButton.GetID);
            }
        }
示例#3
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            if (control == btnLog)
            {
                OnLog();
            }
            if (control == btnProcess)
            {
                OnProcess();
            }
            if (control == cmWatchdog)
            {
                SettingsChanged(true);
            }
            if (control == cmAutoRestart)
            {
                if (!cmAutoRestart.Selected)
                {
                    GUIControl.DisableControl(GetID, (int)Controls.CONTROL_DELAYINSEC);
                }
                else
                {
                    GUIControl.EnableControl(GetID, (int)Controls.CONTROL_DELAYINSEC);
                }
                SettingsChanged(true);
            }

            base.OnClicked(controlId, control, actionType);
        }
示例#4
0
        protected override void OnPageLoad()
        {
            updateStationLogoTimer.Enabled = true;

            _setting = Settings.Instance;
            grabber.Settings.User      = _setting.User;
            grabber.Settings.Password  = _setting.Password;
            grabber.Settings.PartnerId = _setting.PartnerId;
            LoadLocalPresetStations();

            if (String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#RadioTime.Presets.Folder.Name").Trim()))
            {
                GUIControl.DisableControl(GetID, folderButton.GetID);
            }
            else
            {
                GUIControl.EnableControl(GetID, folderButton.GetID);
            }

            foreach (var name in Translation.Strings.Keys)
            {
                SetProperty("#RadioTime.Translation." + name + ".Label", Translation.Strings[name]);
            }

            GUIControl.FocusControl(GetID, GetFocusControlId());

            base.OnPageLoad();
        }
        private void LoadRelatedMovies()
        {
            GUIUtils.SetProperty("#Trakt.Items", string.Empty);

            GUIBackgroundTask.Instance.ExecuteInBackgroundAndCallback(() =>
            {
                if (hideWatchedButton != null)
                {
                    GUIControl.DisableControl((int)TraktGUIWindows.RelatedMovies, hideWatchedButton.GetID);
                }

                if (HideWatched)
                {
                    // wait until watched item has been sent to trakt or timesout (10secs)
                    while (SendingWatchedToTrakt)
                    {
                        Thread.Sleep(500);
                    }
                }
                return(RelatedMovies);
            },
                                                                      delegate(bool success, object result)
            {
                if (hideWatchedButton != null)
                {
                    GUIControl.EnableControl((int)TraktGUIWindows.RelatedMovies, hideWatchedButton.GetID);
                }

                if (success)
                {
                    var movies = result as IEnumerable <TraktMovieSummary>;
                    SendRelatedMoviesToFacade(movies);
                }
            }, Translation.GettingRelatedMovies, true);
        }
 private void EnableButtons(bool enable)
 {
     if (enable)
     {
         cmBlankScreen.IsEnabled     = true;
         cmReduceFrameRate.IsEnabled = true;
         GUIControl.EnableControl(GetID, (int)Controls.CONTROL_SCREENSAVER_DELAY);
     }
     else
     {
         cmBlankScreen.IsEnabled     = false;
         cmReduceFrameRate.IsEnabled = false;
         GUIControl.DisableControl(GetID, (int)Controls.CONTROL_SCREENSAVER_DELAY);
     }
 }
示例#7
0
        private void LoadSettings()
        {
            using (MPSettings xmlreader = new MPSettings())
            {
                _loglevel              = xmlreader.GetValueAsString("general", "loglevel", "2"); // set loglevel to 2:info 3:debug
                _priority              = xmlreader.GetValueAsString("general", "ThreadPriority", "Normal");
                cmWatchdog.Selected    = xmlreader.GetValueAsBool("general", "watchdogEnabled", false);
                cmAutoRestart.Selected = xmlreader.GetValueAsBool("general", "restartOnError", true);

                if (!cmAutoRestart.Selected)
                {
                    GUIControl.DisableControl(GetID, (int)Controls.CONTROL_DELAYINSEC);
                }
                else
                {
                    GUIControl.EnableControl(GetID, (int)Controls.CONTROL_DELAYINSEC);
                }

                _iDelay = xmlreader.GetValueAsInt("general", "restart delay", 10);
            }
        }
示例#8
0
        protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            if (control.GetType() == typeof(GUIButtonControl))
            {
                if (controlId > 100 && controlId <= Settings.LocalPresetsNumber + 100 &&
                    _setting.PresetStations[controlId - 100 - 1] != null &&
                    _setting.PresetStations[controlId - 100 - 1].GuidId != null)
                {
                    DoPlay(_setting.PresetStations[controlId - 100 - 1]);
                    if (_setting.JumpNowPlaying)
                    {
                        GUIWindowManager.ActivateWindow(25652);
                    }
                }
            }
            if (control == homeButton)
            {
                GUIWindowManager.ActivateWindow(25650);
            }
            else if (control == folderButton)
            {
                var s = GetPresetFolder();
                if (s == noPresetFolders)
                {
                    ErrMessage(Translation.NoPresetFoldersFound);
                    GUIControl.DisableControl(GetID, folderButton.GetID);
                }
                else if (s != null)
                {
                    _setting.FolderId = s;
                    _setting.Save();
                    LoadLocalPresetStations();
                }
            }

            base.OnClicked(controlId, control, actionType);
        }
示例#9
0
 private void DisableAllControls()
 {
     GUIControl.DisableControl(GetID, (int)Controls.CONTROL_BTNCLOSE);
     return;
 }