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 10-02-2010, 02:08 PM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
Change a menu reference

I want to change all of the references in an STV to point to a different menu using the WidgetAPI. Is there any easy way to do that using the WidgetAPI class? I see how to get the menu widgets, but don't see a way to get the references to it.

Thanks,
Jeff
Reply With Quote
  #2  
Old 10-02-2010, 07:35 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Select the menu and hit highlight references. I don't think there is a way to do it universally.

If you are wanting to override that menu completely I would just add a beforemenuload on that menu and reference it o another menu I believe sagemc use to do that in some menus.
Reply With Quote
  #3  
Old 10-02-2010, 08:43 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
just a thought off the top of my head... no i have never done this... open up the stv in an xml text editor and find the reference... then i bet you could a search and replace on that reference with the correct line for the new reference... again just a thought off the top of my head and i have no idea if it will actually work
__________________
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
  #4  
Old 10-03-2010, 08:10 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by razrsharpe View Post
just a thought off the top of my head... no i have never done this... open up the stv in an xml text editor and find the reference... then i bet you could a search and replace on that reference with the correct line for the new reference... again just a thought off the top of my head and i have no idea if it will actually work
Gregs studio tools would do the same thin in studio with the search and replace.
Reply With Quote
  #5  
Old 10-03-2010, 12:19 PM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
Sorry, should have clarified, Actually I am trying to do it from java or programmatically from studio code.

Thanks,
Jeff
Reply With Quote
  #6  
Old 10-03-2010, 01:26 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by jphipps View Post
Sorry, should have clarified, Actually I am trying to do it from java or programmatically from studio code.
Yikes, that will probably be a lot of work. I have not used the "WidgetAPI" very much but there is nothing obvious in there. Can you explain what you are trying to do?
__________________

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
  #7  
Old 10-03-2010, 01:29 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by jphipps View Post
I want to change all of the references in an STV to point to a different menu using the WidgetAPI. Is there any easy way to do that using the WidgetAPI class? I see how to get the menu widgets, but don't see a way to get the references to it.

Thanks,
Jeff
Quote:
Originally Posted by jphipps View Post
Sorry, should have clarified, Actually I am trying to do it from java or programmatically from studio code.

Thanks,
Jeff
I believe that if the menu is referenced with a link in a widget chain that you can use GetWidgetParents to return an array of all the references.
Reply With Quote
  #8  
Old 10-03-2010, 04:53 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by tmiranda View Post
Yikes, that will probably be a lot of work. I have not used the "WidgetAPI" very much but there is nothing obvious in there. Can you explain what you are trying to do?
You are missing out the widget api is very powerful from java and saves allot of stvi coding

Jeff,

Are you wanting to remove all references or just replace them? It could be done but would take a bit of work. The probably would probably come in wanting to re add them later...
Reply With Quote
  #9  
Old 10-03-2010, 06:11 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
As Bob said, you can easily get a list of all existing references to widget X using GetWidgetParents. Replacing widget X with widget Y in all those places is then just a matter of iterating over the list and calling RemoveWidgetChild and AddWidgetChild.

Is this something you're looking to do just once, for some particular pair of menus in some particular STV? If so, you'll probably find that writing and debugging the code to automate it is going to be more work than just manually hitting Delete and Paste however many times (unless the numbers are in the hundreds of references).

If the idea is to create an STVI that does this at import time, a simpler solution might be to leave the references as they are, and just redirect to the new menu in the old menu's BeforeMenuLoad hook.

Quote:
Originally Posted by PLUCKYHD View Post
Gregs studio tools would do the same thin in studio with the search and replace.
Not true; my Replace command operates within the textual property fields of existing widgets. It does not alter parent/child relationships between widgets.

I do also have a List Widget References command that can display a list of references to a given widget. It would be up to you, though, to manually edit each reference site.
__________________
-- Greg
Reply With Quote
  #10  
Old 10-03-2010, 06:18 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by GKusnick View Post



Not true; my Replace command operates within the textual property fields of existing widgets. It does not alter parent/child relationships between widgets.

I do also have a List Widget References command that can display a list of references to a given widget. It would be up to you, though, to manually edit each reference site.
Yup I was wrong on that one sorry jeff for the misdirection there. I also agree that beforemenuload is the easiest as stated by Greg and myself.
Reply With Quote
  #11  
Old 10-03-2010, 07:39 PM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
My main idea was for replacing the Main Menu with a custom one to be able to modify all the references for all the other menus that link back to it. But the more I look at it, the more I agree that debugging and getting it to work may be more of a hassle...

I had tried using the BeforeMenu hook on the main menu to redirect to a custom menu, but it seemed to have a delay. I will have to looking more into the delay and see what is causing it. That is probably the best and simplest route.

Thanks,
Jeff
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
Background change and static menu benjamintm SageMC Custom Interface 2 01-05-2009 12:48 AM
Change default menu item in Music Khristopher SageTV Studio 7 07-21-2008 09:14 PM
Can I change Menu titles? rdefino SageTV Software 1 08-24-2006 11:47 AM
Menu Tint Change? Polypro SageTV Customizations 2 12-07-2005 06:01 PM
How to change the STV without the setup menu? InTheFlow SageTV Customizations 7 02-05-2005 06:17 PM


All times are GMT -6. The time now is 02:27 AM.


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