SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-13-2011, 04:04 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
How to Re-load a menu

Is there a way to re-load a screen in Studio such that it executes the before menu loaded and after menu loaded hooks?

I want to be able to execute a conditional such that when a user makes a particular selection, it sets some variables and then re-enters the screen. I want to do it this way since there is a lot of complex code in the before and after menu loaded hooks that I don't want to duplicate.

A simple refresh() doe not execute these hooks.

I could have the conditional link back to the menu widget (this works - sort of, but it clutters up the history, so if the user then clicks the back button it takes him back to the same screen).
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM
Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2)
,USBUIRT (multi-zone)
Source:
Comcast/Xfinity X1 Cable
Primary Client: Server Other Clients: (1) HD200, (1) HD300
Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE,
HDHR, HVR-2250, HD-PVR
Reply With Quote
  #2  
Old 02-13-2011, 04:30 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Anything that reloads the menu and activates those hooks will affect the menu history.

But reloading the menu or duplicating the code are not your only choices. Put the common code under a comment that says "Shared code for setting up menu state" or whatever, and then add a secondary reference to it at the point where you need it. (Widget references are covers in Chapter 2 of the Studio manual.)
__________________
-- Greg
Reply With Quote
  #3  
Old 02-13-2011, 04:31 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
If you do not want to link back to the menu execute the BeforeMenuLoad and AfterMenuLoad widget chain manually (by reference) and then Refresh().
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #4  
Old 02-13-2011, 05:42 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
Quote:
Originally Posted by tmiranda View Post
If you do not want to link back to the menu execute the BeforeMenuLoad and AfterMenuLoad widget chain manually (by reference) and then Refresh().
That is probably what I will have to do. I was hoping there was a more elegant way. Since there are multiple branches under each of the hooks, I will need to make references to each of them (you can't reference directly to the hook widget - instead must reference to each child widget).

I try to make my changes and code references to an existing menu as minimal and non-disruptive to the existing code as possible. This reduces the chance that I will have conflicts with someone else's plugin or that my code will break when Sage updates their STV.
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM
Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2)
,USBUIRT (multi-zone)
Source:
Comcast/Xfinity X1 Cable
Primary Client: Server Other Clients: (1) HD200, (1) HD300
Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE,
HDHR, HVR-2250, HD-PVR
Reply With Quote
  #5  
Old 02-13-2011, 07:00 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by Tiki View Post
That is probably what I will have to do. I was hoping there was a more elegant way. Since there are multiple branches under each of the hooks, I will need to make references to each of them (you can't reference directly to the hook widget - instead must reference to each child widget).
I tend to do what Greg outlined, make a "REM Some descriptive text of what this does" widget the parent of all the widgets that do something related so I can easily reference it in other places of the STV. It's a "poor man's" subroutine, Studio style
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #6  
Old 02-14-2011, 08:47 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
if you don't mind mucking with back history like greg pointed out you can reference the menu itself. This will reload the menu and evaluate the attributes, and beforemenuload, etc hooks.
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #7  
Old 02-14-2011, 10:00 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by razrsharpe View Post
if you don't mind mucking with back history like greg pointed out you can reference the menu itself. This will reload the menu and evaluate the attributes, and beforemenuload, etc hooks.
You can also do a "back" command and get it removed from history down it before but don't remember how at the moment.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
missing selection icon in DVD menu, and how to select root menu brantmacga SageTV Software 6 01-18-2011 09:53 PM
Pressing info and menu button in 6.3.9 no longer shows the applicable menu LehighBri SageMC Custom Interface 3 04-02-2009 12:05 PM
Cannot load menu layout files littlerm SageMC Custom Interface 1 07-09-2008 09:11 AM
Where can I find the menu title theme (Main Menu, Program Guide, Setup Menu, etc) mkanet SageTV Studio 5 11-11-2005 04:55 AM


All times are GMT -6. The time now is 06:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.