![]() |
|
|||||||
| 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. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
Quote:
with the search and replace.
|
|
#5
|
|||
|
|||
|
Sorry, should have clarified, Actually I am trying to do it from java or programmatically from studio code.
Thanks, Jeff |
|
#6
|
||||
|
||||
|
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. |
|
#7
|
|||
|
|||
|
Quote:
|
|
#8
|
|||
|
|||
|
Quote:
the widget api is very powerful from java and saves allot of stvi codingJeff, 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... |
|
#9
|
||||
|
||||
|
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:
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 |
|
#10
|
|||
|
|||
|
Quote:
|
|
#11
|
|||
|
|||
|
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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
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 |