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
  #101  
Old 12-04-2007, 06:22 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by GKusnick;250061[LIST
[*]You can now assign hotkeys (menu accelerators) to Studio plugin commands. There's no UI for setting up the hotkeys, but you can configure them by creating a Studio.hotkeys file in your SageTV directory. See the gkusnick.sagetv.studio package documentation in the included Javadocs for details of this file format.[/list]
Awesome, Greg! This is the icing on the cake. Thanks!!


Dirk
Reply With Quote
  #102  
Old 12-04-2007, 09:37 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by flachbar View Post
Quote:
Originally Posted by GKusnick View Post
You can now assign hotkeys (menu accelerators) to Studio plugin commands. There's no UI for setting up the hotkeys, but you can configure them by creating a Studio.hotkeys file in your SageTV directory. See the gkusnick.sagetv.studio package documentation in the included Javadocs for details of this file format.
Awesome, Greg! This is the icing on the cake. Thanks!!
I'll second that. I haven't had a chance to try it yet, but I am looking forward to it.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #103  
Old 01-04-2008, 01:24 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
Help with the new Export as STVi Tools

OK, I'm trying to use the GKusnick's tools for the first time to create an STVi. I had previously used the Flachbar tools to do this, but it appears that these tools should supersede those by automating things more and doing a bunch of other useful things.

So, I got everything installed and working and began working on a really simple STVi to try things out. It worked really well to handle automatically link up my new widgets to the existing code, but it doesn't automatically delete the existing widgets that I want to replace. It appears that I need to create an STVImported hook and add some code to delete existing widgets that I don't want anymore. Here is where I get a little confused.

The GK Tools have a function called RemoveWidgetEx(). Does this remove all the widgets below it on the tree (like Flachbar's deleteWidgetTree() function) or does it just delete the referenced widget and orphan all the subwidgets (like the default studio removeWidget() command)? Also, the javadoc show only one argument (string sxPath), but the description indicates you need to pass an instance to the STVi as the first argument if called from widget code. Is this because of the Java wrapper? Is there an example on how to get the instance?

For example, let's say the existing STV has the following Menu structure and I want to replace Widget C with my own new code containing Widget X and Widget Y. How do I do it?

Existing Menu
|->Widget A
....|->Widget B
.........|->Widget C
............|->Widget D

New Code
|->Widget X
....|->Widget Y



Existing Menu - After Import
|->Widget A
....|->Widget B
.........|->Widget X
............|->Widget Y
................|->Widget D


Step 1: Create a dummy menu to hold the new code.
Step 2: ???
Step 3: ???
Step X: Select the dummy menu and choose "Export as STVi from the Plugins|STVi Tools Menu.

Thanks in advance for the help...
__________________
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
  #104  
Old 01-04-2008, 01:54 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
RemoveWidgetEx() checks to see if there are any other refs to the removed widget, and if not, does widget.DeleteTree(true) on it. This is equivalent to Select Safe Subtree followed by Delete. So only the orphaned widgets get deleted; shared widgets are retained. I'll update the docs to make this clearer. (But when in doubt, you can always look at the included source code to see exactly what it does.)

The docs show just one argument because the "this" argument is implicit for non-static methods in Java. However when calling Java methods from Studio, you must pass in the "this" argument explicitly. You don't need to create an instance to pass in; the automatically generated STVImported hook will create one (called stvi) to pass in to ProcessImportEx(), and that's the one you should use.

You should be able to do what you want in your example as follows:

Step 2: Paste a ref to Widget X under Widget B.
Step 3: Paste a ref to Widget D under Widget Y.
Step 4: Create an STVImported hook under New Code.
Step 5: Put a call to RemoveWidgetEx(stvi, "") under the hook.
Step 6: Right-click Widget C and choose Copy Widget Path.
Step 7: Paste the path between the empty quotes in Step 5.
Step 8: Export.
__________________
-- Greg
Reply With Quote
  #105  
Old 01-04-2008, 03:57 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
Thanks Greg! Very helpful.

I assume that when copying and pasting the widget path, I will need to manually escape any quote marks that appear in the widget path (i.e. for comment widgets)?
__________________
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
  #106  
Old 01-04-2008, 04:38 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
I answered my own question through experimentation:
1. Must manually insert "\" backslash character before any " marks that appear in the middle of the widget path.
2. Must remember to include the class path when calling any functions from the library, so RemoveWidgetEx(stvi,"") won't work. Instead use: gkunsick_sagetv_studio_RemoveWidgetEx(stvi,"") when calling from widget code.

These are some really powerful tools, once you get the hang of them. Thanks again for all your hard work Greg!
__________________
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
  #107  
Old 01-09-2008, 12:22 PM
Tiki's Avatar
Tiki Tiki is offline
Sage Icon
 
Join Date: Feb 2005
Location: Southwest Florida, USA
Posts: 2,009
How to make STVi safe for re-import

Well, I got my basic import working, but I am still struggling with one detail - how to make my STVi safe for re-import.

I tried adding code to the STVImported hook to delete any of the widgets that my STVi adds, but for some reason, it won't delete the menu. I also tried renaming the menu in case it was getting confused and trying to delete the wrong copy, but it didn't help.

The first time I run the import, all is well and I see no errors in the error log. But the second time I run the import, I see the following errors:

Code:
Wed 1/9 13:13:02.355 Module processing STVImported Hook
Wed 1/9 13:13:02.403 java.lang.reflect.InvocationTargetException
Wed 1/9 13:13:02.403 	at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
Wed 1/9 13:13:02.403 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Wed 1/9 13:13:02.403 	at java.lang.reflect.Method.invoke(Unknown Source)
Wed 1/9 13:13:02.403 	at sage.e$d.a(Unknown Source)
Wed 1/9 13:13:02.403 	at sage.a.m$b.a(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.a.m.a(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.e.a(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.e.a(Unknown Source)
Wed 1/9 13:13:02.404 	at tv.sage.b.k.a(Unknown Source)
Wed 1/9 13:13:02.404 	at tv.sage.c.a(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.d.e$2.new(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.av.a(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.a.m$b.a(Unknown Source)
Wed 1/9 13:13:02.404 	at sage.a.m.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.e.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.a8.new(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.a8.mouseReleased(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.bg.if(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.ad.if(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.405 	at sage.bn.do(Unknown Source)
Wed 1/9 13:13:02.406 	at sage.bn.mouseReleased(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.Component.processMouseEvent(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.Component.processEvent(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.Component.dispatchEventImpl(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.Component.dispatchEvent(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.EventQueue.dispatchEvent(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Wed 1/9 13:13:02.406 	at java.awt.EventDispatchThread.run(Unknown Source)
Wed 1/9 13:13:02.407 Caused by: java.lang.NullPointerException
Wed 1/9 13:13:02.407 	at gkusnick.sagetv.studio.STVI.RemoveWidgetEx(STVI.java:473)
Wed 1/9 13:13:02.407 	... 44 more
Wed 1/9 13:13:02.407 java.lang.NullPointerException
Wed 1/9 13:13:02.407 	at gkusnick.sagetv.studio.STVI.RemoveWidgetEx(STVI.java:473)
Wed 1/9 13:13:02.407 	at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
Wed 1/9 13:13:02.407 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Wed 1/9 13:13:02.407 	at java.lang.reflect.Method.invoke(Unknown Source)
Wed 1/9 13:13:02.407 	at sage.e$d.a(Unknown Source)
Wed 1/9 13:13:02.407 	at sage.a.m$b.a(Unknown Source)
Wed 1/9 13:13:02.407 	at sage.a.m.a(Unknown Source)
Wed 1/9 13:13:02.407 	at sage.e.a(Unknown Source)
Wed 1/9 13:13:02.407 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.407 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.e.a(Unknown Source)
Wed 1/9 13:13:02.408 	at tv.sage.b.k.a(Unknown Source)
Wed 1/9 13:13:02.408 	at tv.sage.c.a(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.d.e$2.new(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.av.a(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.a.m$b.a(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.a.m.a(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.e.a(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.a8.new(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.a8.mouseReleased(Unknown Source)
Wed 1/9 13:13:02.408 	at sage.bg.if(Unknown Source)
Wed 1/9 13:13:02.409 	at sage.ad.if(Unknown Source)
Wed 1/9 13:13:02.409 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.409 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.409 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.409 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.409 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.409 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.409 	at sage.bn.do(Unknown Source)
Wed 1/9 13:13:02.409 	at sage.bn.mouseReleased(Unknown Source)
Wed 1/9 13:13:02.409 	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
Wed 1/9 13:13:02.409 	at java.awt.Component.processMouseEvent(Unknown Source)
Wed 1/9 13:13:02.409 	at java.awt.Component.processEvent(Unknown Source)
Wed 1/9 13:13:02.409 	at java.awt.Component.dispatchEventImpl(Unknown Source)
Wed 1/9 13:13:02.409 	at java.awt.Component.dispatchEvent(Unknown Source)
Wed 1/9 13:13:02.410 	at java.awt.EventQueue.dispatchEvent(Unknown Source)
Wed 1/9 13:13:02.410 	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
Wed 1/9 13:13:02.410 	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
Wed 1/9 13:13:02.410 	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
Wed 1/9 13:13:02.410 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Wed 1/9 13:13:02.410 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Wed 1/9 13:13:02.410 	at java.awt.EventDispatchThread.run(Unknown Source)
Wed 1/9 13:13:02.410 EXCEPTION in getValueAsObject:sage.a.e: Error in method reflection of gkusnick_sagetv_studio_STVI_RemoveWidgetEx of java.lang.reflect.InvocationTargetException for:gkusnick_sagetv_studio_STVI_RemoveWidgetEx(stvi,"Menu:xtra Tiki Enhancements")
Wed 1/9 13:13:02.410 sage.a.e: Error in method reflection of gkusnick_sagetv_studio_STVI_RemoveWidgetEx of java.lang.reflect.InvocationTargetException
Wed 1/9 13:13:02.410 	at sage.e$d.a(Unknown Source)
Wed 1/9 13:13:02.410 	at sage.a.m$b.a(Unknown Source)
Wed 1/9 13:13:02.411 	at sage.a.m.a(Unknown Source)
Wed 1/9 13:13:02.411 	at sage.e.a(Unknown Source)
Wed 1/9 13:13:02.411 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.411 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.411 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.411 	at sage.e.a(Unknown Source)
Wed 1/9 13:13:02.411 	at tv.sage.b.k.a(Unknown Source)
Wed 1/9 13:13:02.411 	at tv.sage.c.a(Unknown Source)
Wed 1/9 13:13:02.411 	at sage.d.e$2.new(Unknown Source)
Wed 1/9 13:13:02.411 	at sage.av.a(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.a.m$b.a(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.a.m.a(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.e.a(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.a8.a(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.a8.new(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.a8.mouseReleased(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.bg.if(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.ad.if(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.412 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.413 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.413 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.413 	at sage.bn.a(Unknown Source)
Wed 1/9 13:13:02.413 	at sage.bn.do(Unknown Source)
Wed 1/9 13:13:02.413 	at sage.bn.mouseReleased(Unknown Source)
Wed 1/9 13:13:02.413 	at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
Wed 1/9 13:13:02.413 	at java.awt.Component.processMouseEvent(Unknown Source)
Wed 1/9 13:13:02.413 	at java.awt.Component.processEvent(Unknown Source)
Wed 1/9 13:13:02.413 	at java.awt.Component.dispatchEventImpl(Unknown Source)
Wed 1/9 13:13:02.413 	at java.awt.Component.dispatchEvent(Unknown Source)
Wed 1/9 13:13:02.413 	at java.awt.EventQueue.dispatchEvent(Unknown Source)
Wed 1/9 13:13:02.413 	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
Wed 1/9 13:13:02.413 	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
Wed 1/9 13:13:02.414 	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
Wed 1/9 13:13:02.414 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Wed 1/9 13:13:02.414 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Wed 1/9 13:13:02.414 	at java.awt.EventDispatchThread.run(Unknown Source)
Wed 1/9 13:13:02.987 UIMgr loading UI from: C:\Program Files\SageTV\SageTV\STVs\SageTV3\!!!SageTV3 (6.3.5)-origtest-4.xml
Wed 1/9 13:13:03.435 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 750
Wed 1/9 13:13:03.579 setUI(sage.b1@165d53c[Main Menu]) histIdx=0 uiHistory=[sage.b1@165d53c[Main Menu]]
I will post my STVi code in case anyone is willing to take a look. The import is pretty simple and doesn't do a whole lot - I wanted to get the mechanics of creating the import down before I invested a lot of time in the feature set.
Attached Files
File Type: stvi TiKi_Enhancements_6_3a.stvi (8.4 KB, 208 views)
__________________
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
  #108  
Old 01-09-2008, 09:54 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
It looks like RemoveWidgetEx isn't prepared to handle top-level widgets with no primary parent. I can fix that in the next release (whenever that may be).

That said, in your shoes I wouldn't worry too much about re-importation. For one thing it's not necessary, because users can always start fresh from the stock STV and import new versions of your STVI into that. Flachbar has release a batch importer that automates the importation of multiple STVIs, and that's the solution that most people use when upgrading individual STVIs.

Also, supporting re-importation in the general case isn't really practical. What if additional STVIs have been imported after yours that alter the STV in ways you can't predict? Maybe your STVI will become so popular that people will release STVI mods for it, in which case you might not be able to recognize your own widgets when you see them.

Bottom line is that it's a non-problem for which there isn't a good general solution, so most STVI authors don't bother.
__________________
-- Greg
Reply With Quote
  #109  
Old 01-15-2008, 10:11 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Thanks for the STV import creation tool. It really makes things a lot easier.

I noticed that all my references to themes become primary references when I import my STVI after export (into the default STV). Is this to be expected? All other secondary references seem to be fine - it is just themes that seem to behave this way.
__________________
-Craig
Reply With Quote
  #110  
Old 01-15-2008, 12:31 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
You're saying the refs are bound to the correct themes, but that they become primary refs after import? That's most likely a consequence of the way themes are stored in the STV file. Studio writes them out last, after all the menus have been written, regardless of where they actually live in the widget tree. So all refs to themes become secondary refs on save, and the last menu to refer to it becomes the new primary ref on load.

The devs already know how I feel about the fact that save and load don't preserve primary refs, so I won't repeat that rant here. Use the Normalize Refs command on the Plugins > GK Tools menu to put the primary refs back under the Theme Organizer where they belong.
__________________
-- Greg
Reply With Quote
  #111  
Old 01-15-2008, 01:08 PM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by GKusnick View Post
You're saying the refs are bound to the correct themes, but that they become primary refs after import?
Yes, that's exactly it. One would have to do the "Normalize Refs" manually in Studio after importing my STVI, right? I don't really care since the themes are still intact - just curious. Thanks.
__________________
-Craig
Reply With Quote
  #112  
Old 01-24-2008, 01:28 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Hi Greg,

I have yet another (hopefully) quick question. I haven't really looked at this yet, but is there anything specific that has to be done to make sure that a plugin generated using the latest version of your tools can be imported from an extender or placeshifter? Does it handle this transparently now? Thanks.

Aloha,
Mike
Reply With Quote
  #113  
Old 01-24-2008, 01:36 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
From post #99:

Quote:
STVIs created by Export as STVI are now importable on Placeshifter and Extender clients. If you have custom STVImported code that calls InsertWidget, RemoveWidget, RenameWidget, or SetWidgetProperty, those functions are now deprecated and you should replace them with calls to the new *WidgetEx functions that supersede them. (The old functions still work for existing STVIs, just not on Placeshifters and Extenders.)
So yes, it's largely transparent. If you have custom STVImported code, make sure to call the *Ex versions of the STVI methods, and pass in the stvi argument as per post #104.
__________________
-- Greg
Reply With Quote
  #114  
Old 01-24-2008, 01:51 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Quote:
Originally Posted by GKusnick View Post
From post #99:


So yes, it's largely transparent. If you have custom STVImported code, make sure to call the *Ex versions of the STVI methods, and pass in the stvi argument as per post #104.
Thanks Greg,

I just wanted to make sure that I wasn't missing something.

Aloha,
Mike
Reply With Quote
  #115  
Old 01-24-2008, 03:24 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
Sustaining an STVi import

So now that I've got an STVi that I'll be letting into the wild, I'm wondering how to best handle the ongoing development and fixes etc that go along with that.

For instance, if I'm going to do some new development on it I'll import it into the STV parent, and make changes. Then I have to go through and check all the references to code in the base STV, and make sure they are secondary. IT seems like a few of my references always become primary after import. That's a pain.

Are there tools to make this easier? Or am I stuck manually looking over every primary / secondary reference in my code every time I create an STVi?

btl.
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #116  
Old 01-24-2008, 03:46 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
What I generally do is save a copy of the modified STV just before exporting, and do any further development on that saved copy. That way I don't have to re-import it unless there's a new release of Sage and a new base STV.

However that doesn't really help with the reference issue. It's just a fact of life that references migrate around on every save/load cycle. The Normalize References and Select Shared Descendents commands may be of some use here, or, if it really bugs you, you can create your own Studio plugin with your own implementation of Normalize References that does exactly what you need it to do.

Short of that, there isn't really an alternative to manually eyeballing each ref (I'm picturing the Life of Brian aliens here) every time you export.
__________________
-- Greg
Reply With Quote
  #117  
Old 02-06-2008, 11:38 PM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by GKusnick View Post
From post #99:


So yes, it's largely transparent. If you have custom STVImported code, make sure to call the *Ex versions of the STVI methods, and pass in the stvi argument as per post #104.
My import doesn't have any custom STVImported code but when I try to import it from an extender it doesn't connect any of the secondary references (when I look on my server at the resulting STV file it still shows "ref>>" in all the locations). The same import works fine from within SageTV or Client. It does not show an "Imported" date in the comments section which might give a clue. Any ideas? Thanks.
__________________
-Craig
Reply With Quote
  #118  
Old 02-08-2008, 08:12 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by cncb View Post
My import doesn't have any custom STVImported code but when I try to import it from an extender it doesn't connect any of the secondary references (when I look on my server at the resulting STV file it still shows "ref>>" in all the locations). The same import works fine from within SageTV or Client. It does not show an "Imported" date in the comments section which might give a clue. Any ideas? Thanks.
It worked for me when I tried it here using a test STVI. Are you sure you're using Studio Tools version 0.5? When you open the STVI in Studio (open, not import), do you see a call to ProcessImport, or ProcessImportEx?

The JAR bundled with your PSE Photos & Videos download is version 0.4 (although oddly it seems to have a later revision date than the 0.5 JAR), so if that's what you're still using, you'll need to upgrade.
__________________
-- Greg
Reply With Quote
  #119  
Old 02-09-2008, 07:44 AM
cncb cncb is offline
Sage Icon
 
Join Date: Jul 2006
Posts: 1,271
Quote:
Originally Posted by GKusnick View Post
It worked for me when I tried it here using a test STVI. Are you sure you're using Studio Tools version 0.5? When you open the STVI in Studio (open, not import), do you see a call to ProcessImport, or ProcessImportEx?

The JAR bundled with your PSE Photos & Videos download is version 0.4 (although oddly it seems to have a later revision date than the 0.5 JAR), so if that's what you're still using, you'll need to upgrade.
It is my PSE import that doesn't seem to be working. I have downloaded 0.5 of your tools and made sure I have the correct JAR but it still seems to not hook up for some reason on import. When I open the import in Studio it has a call to ProcessImport in the STVImported hook but it doesn't seem to be actually ever called when importing from an extender? Thanks for your help.
__________________
-Craig
Reply With Quote
  #120  
Old 02-09-2008, 12:36 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
The function is getting called; it just won't do anything on an extender because it has the wrong UI context. To get the right context, it needs to call ProcessImportEx instead, which you can accomplish by re-exporting the STVI using 0.5. It's not enough to use 0.5 just for the import; you must use it for the export too.
__________________
-- Greg
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


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


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