private void SetProperties(UpcomingProgram upcoming, ScheduleSummary schedule) { string guiPropertyPrefix = this._channelType == ChannelType.Television ? "#TV" : "#Radio"; if (schedule != null) { GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Channel", String.Empty); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Title", schedule.Name); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Genre", String.Empty); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Time", String.Empty); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Description", " "); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.thumb", "defaultFolderBig.png"); } else if (upcoming != null) { GuideProgram guideProgram = upcoming.GuideProgramId.HasValue ? Proxies.GuideService.GetProgramById(upcoming.GuideProgramId.Value).Result : null; string strTime = string.Format("{0} {1} - {2}", Utility.GetShortDayDateString(upcoming.StartTime), upcoming.StartTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat), upcoming.StopTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat)); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Channel", upcoming.Channel.DisplayName); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Title", upcoming.Title); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Genre", upcoming.Category); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Time", strTime); string description = String.Empty; if (guideProgram != null) { description = guideProgram.CreateCombinedDescription(true); } GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Description", description); string logo = Utility.GetLogoImage(upcoming.Channel.ChannelId, upcoming.Channel.DisplayName); if (!string.IsNullOrEmpty(logo)) { GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.thumb", logo); } else { GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.thumb", "defaultVideoBig.png"); } } else { GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Channel", String.Empty); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Title", String.Empty); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Genre", String.Empty); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Time", String.Empty); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.Description", " "); GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Upcoming.thumb", String.Empty); } }
private void DisplayTorrents(List <Torrent> TorrentsAll) { long downloadSpeed = 0; int downs = 0; long uploadSpeed = 0; long seeding = 0; double avgProgress = 0.0; int unfinished = 0; int ActiveTorrents = 0; foreach (Torrent torrent in TorrentsAll) { if (torrent.Started()) { if (torrent.DownloadSpeed > 0 || torrent.UploadSpeed > 0) { ActiveTorrents++; } downloadSpeed += torrent.DownloadSpeed; uploadSpeed += torrent.UploadSpeed; if (torrent.Progress >= 100) { //only seeding seeding = seeding + 1; } else { downs++; } } if (torrent.Progress < 100.0) { avgProgress += torrent.Progress; unfinished += 1; } } UpdateScreen(); GUIPropertyManager.SetProperty("#MyTorrents.IsConnected", TorrentEngine.Instance().IsConnected.ToString()); GUIPropertyManager.SetProperty("#MyTorrents.CombinedDownloadSpeed", UnitConvert.TransferSpeedToString(downloadSpeed)); GUIPropertyManager.SetProperty("#MyTorrents.CombinedUploadSpeed", UnitConvert.TransferSpeedToString(uploadSpeed)); GUIPropertyManager.SetProperty("#MyTorrents.Downloads.Count", string.Format("{0}", downs)); GUIPropertyManager.SetProperty("#MyTorrents.Uploads.Count", string.Format("{0}", seeding)); GUIPropertyManager.SetProperty("#MyTorrents.Active.Count", string.Format("{0}", ActiveTorrents)); //GUIPropertyManager.SetProperty("#MyTorrents.Ready.Count", string.Format("{0}", TorrentsAll.Count - TorrentsActive.Count)); //GUIPropertyManager.SetProperty("#MyTorrents.Unfinished.Count", string.Format("{0}", unfinished)); //GUIPropertyManager.SetProperty("#MyTorrents.AverageProgressOfUnfinished", string.Format("{0:F2}", avgProgress / unfinished)); if (Notifier.Instance() != null && Notifier.Instance().IsNotificationBarAvailable() && (_config.Notify)) { Notifier.Instance().ChangeText(); } }
private void Update() { if (m_pTexture != null) { m_pTexture.Dispose(); } int iRotate = PictureDatabase.GetRotation(FileName); m_pTexture = Util.Picture.Load(FileName, iRotate, 1024, 1024, true, false, out m_iTextureWidth, out m_iTextureHeight); lblCameraModel.Label = string.Empty; lblDateTakenLabel.Label = string.Empty; lblEquipmentMake.Label = string.Empty; lblExposureCompensation.Label = string.Empty; lblExposureTime.Label = string.Empty; lblFlash.Label = string.Empty; lblFstop.Label = string.Empty; lblImgDimensions.Label = string.Empty; lblImgTitle.Label = string.Empty; lblMeteringMode.Label = string.Empty; lblResolutions.Label = string.Empty; lblShutterSpeed.Label = string.Empty; lblViewComments.Label = string.Empty; using (ExifMetadata extractor = new ExifMetadata()) { ExifMetadata.Metadata metaData = extractor.GetExifMetadata(FileName); lblCameraModel.Label = metaData.CameraModel.DisplayValue; lblDateTakenLabel.Label = metaData.DatePictureTaken.DisplayValue; lblEquipmentMake.Label = metaData.EquipmentMake.DisplayValue; lblExposureCompensation.Label = metaData.ExposureCompensation.DisplayValue; lblExposureTime.Label = metaData.ExposureTime.DisplayValue; lblFlash.Label = metaData.Flash.DisplayValue; lblFstop.Label = metaData.Fstop.DisplayValue; lblImgDimensions.Label = metaData.ImageDimensions.DisplayValue; lblImgTitle.Label = Path.GetFileNameWithoutExtension(FileName); lblMeteringMode.Label = metaData.MeteringMode.DisplayValue; lblResolutions.Label = metaData.Resolution.DisplayValue; lblShutterSpeed.Label = metaData.ShutterSpeed.DisplayValue; lblViewComments.Label = metaData.ViewerComments.DisplayValue; imgPicture.IsVisible = false; } if (File.Exists(FileName)) { GUIPropertyManager.SetProperty("#selectedthumb", FileName); } else { GUIPropertyManager.SetProperty("#selectedthumb", string.Empty); } }
public static void Play() { // We have the Station Name in there to retrieve the correct Coverart for the station in the Vis Window GUIPropertyManager.RemovePlayerProperties(); GUIPropertyManager.SetProperty("#Play.Current.ArtistThumb", _currentChannel.DisplayName); GUIPropertyManager.SetProperty("#Play.Current.Album", _currentChannel.DisplayName); if ((_currentChannel.IsWebstream()) || (_currentChannel.CurrentProgram == null || _currentChannel.NextProgram == null || string.IsNullOrEmpty(_currentChannel.CurrentProgram.Title) || string.IsNullOrEmpty(_currentChannel.NextProgram.Title))) { GUIPropertyManager.SetProperty("#Play.Current.Title", _currentChannel.DisplayName); // No EPG GUIPropertyManager.SetProperty("#Play.Next.Title", string.Empty); } else { GUIPropertyManager.SetProperty("#Play.Current.Title", _currentChannel.CurrentProgram.Title); GUIPropertyManager.SetProperty("#Play.Next.Title", _currentChannel.NextProgram.Title); } string strLogo = Utils.GetCoverArt(Thumbs.Radio, _currentChannel.DisplayName); if (string.IsNullOrEmpty(strLogo)) { strLogo = "defaultMyRadioBig.png"; } GUIPropertyManager.SetProperty("#Play.Current.Thumb", strLogo); if (g_Player.Playing && !_currentChannel.IsWebstream()) { if (!g_Player.IsTimeShifting || (g_Player.IsTimeShifting && _currentChannel.IsWebstream())) { g_Player.Stop(); } } if (_currentChannel.IsWebstream()) { g_Player.PlayAudioStream(GetPlayPath(_currentChannel)); GUIPropertyManager.SetProperty("#Play.Current.Title", _currentChannel.DisplayName); } else { if (g_Player.IsRadio && g_Player.Playing) { Channel currentlyPlaying = TVHome.Navigator.Channel; if (currentlyPlaying != null && currentlyPlaying.IdChannel == _currentChannel.IdChannel) { return; } } TVHome.ViewChannelAndCheck(_currentChannel); } }
public void ShowTorrentDetails() { lock (UpdateLocker) { FileList.ListItems = ViewDetails.GetTorrentDetails(torrentList.SelectedListItem.AlbumInfoTag as Torrent); } torrentList.Visible = false; GUIPropertyManager.SetProperty("#MyTorrents.TorrentDetails.Visible", "yes"); GiveFocus(FileList); }
public void ResetProperties() { GUIPropertyManager.SetProperty("#Actor.Name", string.Empty); GUIPropertyManager.SetProperty("#Actor.DateOfBirth", string.Empty); GUIPropertyManager.SetProperty("#Actor.PlaceOfBirth", string.Empty); GUIPropertyManager.SetProperty("#Actor.LastUpdate", string.Empty); GUIPropertyManager.SetProperty("#Actor.DateOfDeath", string.Empty); GUIPropertyManager.SetProperty("#Actor.PlaceOfDeath", string.Empty); GUIPropertyManager.SetProperty("#Actor.Biography", string.Empty); GUIPropertyManager.SetProperty("#hideActorinfo", "true"); }
public override void PostRender(float timePassed, int iLayer) { if (iLayer != 2) { return; } if (!base.IsAnimating(AnimationType.WindowClose)) { if (GUIPropertyManager.GetProperty("#Play.Current.Thumb") != _thumbLogo) { _thumbLogo = GUIPropertyManager.GetProperty("#Play.Current.Thumb"); if (g_Player.CurrentFile != _fileName) { _fileName = g_Player.CurrentFile; SetCurrentFile(_fileName); } } // int speed = g_Player.Speed; // double pos = g_Player.CurrentPosition; // Should not called from this thread. ! if (_imagePlayLogo != null) { _imagePlayLogo.Visible = (g_Player.Paused == false); } if (_imagePauseLogo != null) { _imagePauseLogo.Visible = false; // (g_Player.Paused == true); } if (_imageFastForward != null) { _imageFastForward.Visible = false; // (g_Player.Speed>1); } if (_imageRewind != null) { _imageRewind.Visible = false; // (g_Player.Speed<0); } if (_videoRectangle != null) { if (g_Player.Playing) { _videoRectangle.Visible = GUIGraphicsContext.ShowBackground; } else { _videoRectangle.Visible = false; } } } base.Render(timePassed); }
/// <summary> /// Calculates the percentage of the control /// </summary> /// <returns></returns> private int GetPercentage() { float percent; float.TryParse(GUIPropertyManager.Parse(_progressControl.Property), out percent); if (percent > 100) { percent = 100; } return((int)percent); }
protected override void OnPageLoad() { base.OnPageLoad(); GUIPropertyManager.SetProperty("#ptg_header", "Edit"); ///BAV: Load Data if (_keywordID > 0) { } InitToggleButtons(); UpdateWindow(); }
private void LoadDirectory() { GUIControl.ClearControl(GetID, listPriorities.GetID); SqlBuilder sb = new SqlBuilder(StatementType.Select, typeof(Schedule)); sb.AddOrderByField(false, "priority"); SqlStatement stmt = sb.GetStatement(true); IList itemlist = ObjectFactory.GetCollection(typeof(Schedule), stmt.Execute()); int total = 0; foreach (Schedule rec in itemlist) { if (rec.IsSerieIsCanceled(rec.StartTime, rec.IdChannel)) { continue; } GUIListItem item = new GUIListItem(); item.Label = String.Format("{0}.{1}", total, rec.ProgramName); item.TVTag = rec; string strLogo = Utils.GetCoverArt(Thumbs.TVChannel, rec.ReferencedChannel().DisplayName); if (string.IsNullOrEmpty(strLogo)) { strLogo = "defaultVideoBig.png"; } TvServer server = new TvServer(); VirtualCard card; if (server.IsRecordingSchedule(rec.IdSchedule, out card)) { if (rec.ScheduleType != (int)ScheduleRecordingType.Once) { item.PinImage = Thumbs.TvRecordingSeriesIcon; } else { item.PinImage = Thumbs.TvRecordingIcon; } } else if (rec.ReferringConflicts().Count > 0) { item.PinImage = Thumbs.TvConflictRecordingIcon; } item.ThumbnailImage = strLogo; item.IconImageBig = strLogo; item.IconImage = strLogo; listPriorities.Add(item); total++; } //set object count label GUIPropertyManager.SetProperty("#itemcount", Utils.GetObjectCountLabel(total)); GUIControl.SelectItemControl(GetID, listPriorities.GetID, m_iSelectedItem); }
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)); }
protected override void OnPageLoad() { base.OnPageLoad(); GUIPropertyManager.SetProperty("#ptg_header", "Upcoming Broadcasts"); GUIPropertyManager.SetProperty("#description", " "); if (imStars != null) { imStars.SetFileName(String.Empty); } LoadSettings(); }
protected int Time2Int(string _property) { int totalSeconds = -1; string property = GUIPropertyManager.GetProperty(_property); if (property.Length > 0) { totalSeconds = (int)DateTime.Parse(property).TimeOfDay.TotalSeconds; } return(totalSeconds); }
protected void ClearPlayProps() { GUIPropertyManager.SetProperty("#Play.Current.Thumb", string.Empty); GUIPropertyManager.SetProperty("#Play.Current.Artist", string.Empty); GUIPropertyManager.SetProperty("#Play.Current.Title", string.Empty); GUIPropertyManager.SetProperty("#Play.Current.Track", string.Empty); GUIPropertyManager.SetProperty("#Play.Current.Album", string.Empty); GUIPropertyManager.SetProperty("#Play.Current.Year", string.Empty); GUIPropertyManager.SetProperty("#Play.Current.BitRate", string.Empty); GUIPropertyManager.SetProperty("#Play.Current.FileType", string.Empty); GUIPropertyManager.SetProperty("#Play.Current.Rating", "0"); }
private void OnGroupChanged() { if (_spinGroup.Visible) { GUIWaitCursor.Show(); _currentGroup = _channelGroupList[_spinGroup.Value]; string guiPropertyPrefix = this.ChannelType == ChannelType.Television ? "#TV" : "#Radio"; GUIPropertyManager.SetProperty(guiPropertyPrefix + ".Guide.Group", _spinGroup.GetLabel()); FillChannelList(); GUIWaitCursor.Hide(); } }
protected override void OnPageLoad() { PluginMain.EnsureConnection(); base.OnPageLoad(); if (PluginMain.IsConnected()) { LoadSettings(); UpdateButtons(); GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.ArgusServerSettings)); } }
private void SetBackdrop(BaseScore score) { string bd = FindBackdrop(score); if (bd.Length == 0) { bd = GetDefaultBackdrop(); } //Tools.LogMessage("==> BD={0}", bd); GUIPropertyManager.SetProperty("#ScoreCenter.bd", Path.Combine(m_center.Setup.BackdropDir, bd)); }
protected override void OnPageLoad() { PluginMain.EnsureConnection(); base.OnPageLoad(); if (PluginMain.IsConnected()) { _currentChannelType = ChannelType.Television; LoadAll(null); GUIPropertyManager.SetProperty("#currentmodule", Utility.GetLocalizedText(TextId.ChannelManager)); } }
private bool OnInit() { _Settings.Load(); if (_Settings.Music) { GUIControl.SelectControl(GetID, (int)Controls.ToggleMusic); } else { GUIControl.DeSelectControl(GetID, (int)Controls.ToggleMusic); } if (_Settings.Sound) { GUIControl.SelectControl(GetID, (int)Controls.ToggleSound); } else { GUIControl.DeSelectControl(GetID, (int)Controls.ToggleSound); } m_wndTetris = GetControl((int)Controls.Tetris) as MyTetrisControl; int nScore = 0; int nLines = 0; int nLevel = 0; if (m_wndTetris != null) { nScore = m_wndTetris.Score; nLines = m_wndTetris.Lines; nLevel = m_wndTetris.Level; m_wndTetris.Sound = _Settings.Sound; m_wndTetris.Music = _Settings.Music; // we don't get told when the green (return to home window) button is hit so // we make it look like we correctly paused the game when it was hit here if (m_wndTetris.State == State.Running) { m_wndTetris.State = State.Paused; } } GUIPropertyManager.SetProperty("#tetris_score", nScore.ToString()); GUIPropertyManager.SetProperty("#tetris_lines", nLines.ToString()); GUIPropertyManager.SetProperty("#tetris_level", nLevel.ToString()); GUIPropertyManager.SetProperty("#tetris_highscore", _Settings.Highscore.ToString()); GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get((int)Strings.MyTetris)); return(true); }
private void writeProperty() { if (_active && _property != null && _identifier != null) { GUIPropertyManager.SetProperty(_property, _identifier); } else if (_property != null) { GUIPropertyManager.SetProperty(_property, "-"); } }
void playBeginWorker_DoWork(object sender, DoWorkEventArgs e) { try { GUIPropertyManager.SetProperty("#Play.Current.Artist", GUIPropertyManager.GetProperty("#Youtube.fm.NowPlaying.Artist.Name")); GUIPropertyManager.SetProperty("#Play.Current.Title", GUIPropertyManager.GetProperty("#Youtube.fm.NowPlaying.Video.Title")); if (Youtube2MP.NowPlayingEntry.Media != null) { GUIPropertyManager.SetProperty("#Play.Current.Thumb", Youtube2MP.GetLocalImageFileName( GetBestUrl(Youtube2MP.NowPlayingEntry.Media.Thumbnails))); } if (Youtube2MP.NowPlayingEntry.Rating != null) { GUIPropertyManager.SetProperty("#Play.Current.Rating", (Youtube2MP.NowPlayingEntry.Rating.Average * 2).ToString()); } SetLabels(Youtube2MP.NowPlayingEntry, "NowPlaying"); SetLabels(Youtube2MP.NextPlayingEntry, "Next"); DatabaseProvider.InstanInstance.SavePlayData(Youtube2MP.NowPlayingEntry, DateTime.Now); ArtistManager.Instance.SetSkinProperties(Youtube2MP.NowPlayingEntry, "NowPlaying", true, true); ArtistManager.Instance.SetSkinProperties(Youtube2MP.NextPlayingEntry, "Next", true, true); relatated.Clear(); similar.Clear(); if (GUIWindowManager.ActiveWindow == (int)GetID) { if (listControl != null) { GUIControl.ClearControl(GetID, listControl.GetID); } if (listsimilar != null) { GUIControl.ClearControl(GetID, listsimilar.GetID); } } if (Youtube2MP._settings.LastFmNowPlay) { Youtube2MP.LastFmProfile.NowPlaying(Youtube2MP.NowPlayingEntry); } infoTimer.Enabled = true; _lastFmTimer.Stop(); _lastFmTimer.Start(); Track.TrackPlay(); } catch (Exception exception) { Log.Error(exception); } }
private void LoadDirectory() { int total = 0; GUIWaitCursor.Show(); GUIControl.ClearControl(GetID, listConflicts.GetID); if (selectedItem == null) { IList <Conflict> conflictsList = Conflict.ListAll(); foreach (Conflict conflict in conflictsList) { Schedule schedule = Schedule.Retrieve(conflict.IdSchedule); Schedule conflictingSchedule = Schedule.Retrieve(conflict.IdConflictingSchedule); GUIListItem item = Schedule2ListItem(schedule); item.MusicTag = conflictingSchedule; item.Label3 = conflictingSchedule.ProgramName; item.IsFolder = true; listConflicts.Add(item); total++; } } else { Schedule schedule = selectedItem.TVTag as Schedule; Schedule conflictingSchedule = selectedItem.MusicTag as Schedule; GUIListItem item = new GUIListItem(); item.Label = ".."; item.IsFolder = true; listConflicts.Add(item); total++; item = Schedule2ListItem(schedule); listConflicts.Add(item); total++; item = Schedule2ListItem(conflictingSchedule); listConflicts.Add(item); SetLabels(); total++; } //set object count label GUIPropertyManager.SetProperty("#itemcount", Utils.GetObjectCountLabel(total)); GUIWaitCursor.Hide(); if (listConflicts.Count == 0) { GUIWindowManager.ShowPreviousWindow(); } }
public void UpdatePlayProps() { // Log.Debug("*** UpdatePlayProps"); try { if (!g_Player.Playing) { return; } PlayGuidId = (string.IsNullOrEmpty(PlayGuidId)) ? GUIPropertyManager.GetProperty("#RadioTime.Play.GuidId") : PlayGuidId; if (string.IsNullOrEmpty(PlayGuidId)) { return; } _station = new RadioTimeStation(); _station.Grabber = grabber; _station.Get(PlayGuidId); if (!string.IsNullOrEmpty(PlayGuidId) && _station.IsAvailable) { //var nowPlaying = Settings.NowPlaying; _nowPlaying = new RadioTimeNowPlaying(); _nowPlaying.Grabber = grabber; _nowPlaying.Get(PlayGuidId, _station.HasSong); // if (_nowPlaying.IsShow && !string.IsNullOrEmpty(_nowPlaying.ShowGuidId)) { _show = new RadioTimeShow(); _show.Grabber = grabber; _show.Get(_nowPlaying.ShowGuidId); } // Settings.NowPlaying = _nowPlaying.Clone(); Settings.NowPlayingStation = _station.Clone(); if (_show != null) { Settings.NowPlayingShow = _show.Clone(); } else { Settings.NowPlayingShow = null; } // UpdateProps(); } } catch (Exception ex) { Log.Debug("UpdatePlayProps: " + ex.Message); } }
/// <summary> /// Checks, if an update for the element is needed /// </summary> /// <returns>true, if an update is needed</returns> protected override bool CheckElementSpecificForUpdate() { bool result = false; String newLabel = GUIPropertyManager.Parse(_label.Label); if (!newLabel.Equals(_labelString)) { _labelString = newLabel; result = true; } return(result); }
private void UpdateButtons() { GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNREFRESH, GUILocalizeStrings.Get(184)); //Refresh GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELCHANNEL, m_strDescription); //Channel name label GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(9) + @"/" + m_strSiteName); int posX = m_pSiteImage.XPosition; int posY = m_pSiteImage.YPosition; m_pSiteImage.SetPosition(posX, posY); m_pSiteImage.ColourDiffuse = 0xffffffff; m_pSiteImage.SetFileName(m_strSiteIcon); // m_pSiteImage.Width = m_pSiteImage.TextureWidth; // m_pSiteImage.Height = m_pSiteImage.TextureHeight; GUIControl.ClearControl(GetID, (int)Controls.CONTROL_LIST); int iTotalItems = 0; foreach (feed_details feed in m_feed_details) { if (feed.m_title == "" && feed.m_description == "") { // Skip this empty item continue; } GUIListItem item = new GUIListItem(); item.Label = feed.m_title; item.IsFolder = false; item.MusicTag = feed; item.ThumbnailImage = ""; item.IconImage = "defaultMyNews.png"; GUIControl.AddListItemControl(GetID, (int)Controls.CONTROL_LIST, item); iTotalItems++; } //set object count label GUIPropertyManager.SetProperty("#itemcount", Util.Utils.GetObjectCountLabel(iTotalItems)); GUIControl.FocusControl(GetID, (int)Controls.CONTROL_LIST); GUIListItem selecteditem = GUIControl.GetSelectedListItem(GetID, (int)Controls.CONTROL_LIST); if (selecteditem != null) { GUIPropertyManager.SetProperty("#selecteditem", selecteditem.Label); } GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STORYTEXT, m_feed_details[0].m_description); }
public override bool OnMessage(GUIMessage message) { switch (message.Message) { case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: { _prevLayer = GUILayerManager.GetLayer(GUILayerManager.LayerType.Dialog); _prevOverlay = GUIGraphicsContext.Overlay; if (GUIGraphicsContext.VideoRenderer != GUIGraphicsContext.VideoRendererType.madVR) { GUIGraphicsContext.Overlay = base.IsOverlayAllowed; } GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Dialog); GUIPropertyManager.SetProperty("#currentmoduleid", Convert.ToString(GUIWindowManager.ActiveWindow)); GUIPropertyManager.SetProperty("#currentmodule", GetModuleName()); Log.Debug("DialogWindow: {0} init", this.ToString()); GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SETFOCUS, GetID, 0, _defaultControlId, 0, 0, null); OnMessage(msg); OnPageLoad(); return(true); } case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT: { //base.OnMessage(message); // TODO: Establishes a circular loop // OnPageDestroy(_parentWindowID); OnPageDestroy(GetID); // mantis 2996: Dialog windows do not animate when closed _running = false; _parentWindowID = 0; _parentWindow = null; GUIGraphicsContext.Overlay = _prevOverlay; Dispose(); DeInitControls(); GUILayerManager.UnRegisterLayer(this); GUILayerManager.RegisterLayer(_prevLayer, GUILayerManager.LayerType.Dialog); _prevLayer = null; return(true); } } return(base.OnMessage(message)); }
protected override void OnPageLoad() { base.OnPageLoad(); GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(100031)); if (!MediaPortal.Util.Utils.IsGUISettingsWindow(GUIWindowManager.GetPreviousActiveWindow())) { if (MediaPortal.GUI.Settings.GUISettings.IsPinLocked() && !MediaPortal.GUI.Settings.GUISettings.RequestPin()) { GUIWindowManager.CloseCurrentWindow(); } } }
private void SaveListState(bool clear) { if (listControl.ListView.ListItems.Count > 0) { NavigationStack.Push(new NavigationObject(listControl.ListView, GUIPropertyManager.GetProperty("#header.title"), listControl.SelectedListItemIndex, (View)mapSettings.ViewAs)); } if (clear) { GUIControl.ClearControl(GetID, listControl.GetID); Youtube2MP.temp_player.Reset(); Youtube2MP.temp_player.GetPlaylist(PlayListType.PLAYLIST_MUSIC_VIDEO).Clear(); } }
private void DoBack() { if (NavigationStack.Count > 0) { GUIControl.ClearControl(GetID, listControl.GetID); NavigationObject obj = NavigationStack.Pop() as NavigationObject; obj.SetItems(listControl); listControl.SelectedListItemIndex = obj.Position; GUIPropertyManager.SetProperty("#header.title", obj.Title); mapSettings.ViewAs = (int)obj.CurrentView; ShowPanel(); } }
private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error != null) { return; } string thumbNailFileName = Util.Utils.GetAlbumThumbName(albumInfo.Artist, albumInfo.Title); if (Util.Utils.FileExistsInCache(thumbNailFileName)) { GUIPropertyManager.SetProperty("#AlbumInfo.Thumb", thumbNailFileName); } }