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
  #21  
Old 06-25-2006, 03:05 AM
koelec koelec is offline
Sage Aficionado
 
Join Date: Aug 2003
Location: Netherlands
Posts: 309
Quote:
Originally Posted by flachbar
Chris,

support for this has been added in v1.3

Dirk
Hi Dirk,
Using v1.3. Works great !
thanks,
Chris
Reply With Quote
  #22  
Old 06-25-2006, 01:44 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
I'm making an assumption that I hope is true with these utility functions. For Listener widgets it uses either the Widget Name or the ListenerEvent property when using findWidget, findExistingWidget or findImportedWidget. The reason I ask is that while some Listeners have both not all do. I have found some with just the property and some with just a name so you can't even count on the ListenerEvent property always being present. For example the Left command in the ARAdjustZoom menu in the default STV has the name Left but the ListenerEvent is blank. So is my assumption valid?

Thanks.
BobP.
Reply With Quote
  #23  
Old 06-25-2006, 03:12 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by BobPhoenix
I'm making an assumption that I hope is true with these utility functions. For Listener widgets it uses either the Widget Name or the ListenerEvent property when using findWidget, findExistingWidget or findImportedWidget. The reason I ask is that while some Listeners have both not all do. I have found some with just the property and some with just a name so you can't even count on the ListenerEvent property always being present. For example the Left command in the ARAdjustZoom menu in the default STV has the name Left but the ListenerEvent is blank. So is my assumption valid?

Thanks.
BobP.
Hi Bob,

yes your assumption is correct

GetWidgetName() (which is used by the implementation of all find...() methods) first looks at the name, and if this is empty, returns the ListenerEvent property.

Dirk
Reply With Quote
  #24  
Old 06-28-2006, 07:14 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Possible bug but maybe it's just me.

Code first:
Code:
 existing code from previous import:
Main Menu
+-BeforeMenuLoad
   +-"REM FCL Main Menu code"

 Code in the import to remove the prior code (that works):
+-"REM unlink Main Menu menu code"
    +-LinkLocation=df_sageutils_Import_findExistingWidget("Main Menu/BeforeMenuLoad")
       +-widget=df_sageutils_Import_findExistingWidget("Main Menu/BeforeMenuLoad/\"REM FCL Main Menu code*")
           +-If widget != null



 Code in the import to remove the same as above (that doesn't work - this is include in ZIP):
+-"REM unlink Main Menu menu code"
    +-LinkLocation=df_sageutils_Import_findExistingWidget("Main Menu/BeforeMenuLoad")
       +-widget=df_sageutils_Import_findWidget(LinkLocation, "\"REM FCL Main Menu code*")
           +-If widget != null
Obviously I can make this work by just using findExistingWidget and I'm converting my code now but if you can reproduce this and it really is a bug I thought you would like to know about it.

Now for the problem:
The problem is that I get a Java error - sorry it's as a graphic (in zip) - too much to write. Also included is my log file from SageTV and the import itself. All in the same Zip file. The code has no problem on the first import. NO Java error. But when I re-import I get the included error.

Edit: Opps forgot SageMC 6.6 and 1.3 of this import utility.

Thanks.
BobP.
Attached Files
File Type: zip ErrorInfoForFB.zip (56.0 KB, 255 views)

Last edited by BobPhoenix; 06-28-2006 at 07:16 PM.
Reply With Quote
  #25  
Old 06-28-2006, 08:20 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by BobPhoenix
Possible bug but maybe it's just me.
Hi Bob,

my Internet connection was down all evening, but I'll have a look at it tomorrow. Thanks for the detailed description.

Dirk
Reply With Quote
  #26  
Old 06-28-2006, 08:24 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by flachbar
Hi Bob,

my Internet connection was down all evening, but I'll have a look at it tomorrow. Thanks for the detailed description.

Dirk
No rush. I'm just coding around what may just be my problem anyway.

BobP.
Reply With Quote
  #27  
Old 06-28-2006, 09:53 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
I think I have a clue now as to why it didn't work for me. I have multiple links to widgets that existed in the STV before the first import. I unlinked them and reestablished the original links in an attempt to return it to what the STV was like before the first import. However I still have some left over links from the code in "Imported Nodes" to those objects. I then proceed to try to import new code and link it up and in the process it executes the code you had in the template for removing the old hook. I'm thinking my problem is that I need to unlink all widgets from those that I linked back into the STV and this problem might go away. I'm going to test this theory out tomorrow night when I get home from work - too late to start now.

If you do look at this maybe you will see what I did wrong if you get to it tomorrow. Also if you need anything else let me know but I really think it is just me and I'm just not using your routines correctly.

Thanks.
BobP.

PS I'm taking a CBT on Java but other than what I've seen so far and in Studio it's still a foreign language. If it was COBOL I would be better off since that is what I do all day.
Reply With Quote
  #28  
Old 06-29-2006, 09:19 AM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
One last note on this. I did get all of my findWidget's converted to findExistingWidget's and that got rid of the Java errors but it still won't import correctly it actually destroy's the main menu - as in it is broken apart into multiple root level entries. As far as I can tell it should re-import correctly so anything you can suggest would be great.

Thanks.
BobP.
Reply With Quote
  #29  
Old 06-29-2006, 09:22 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by BobPhoenix
One last note on this. I did get all of my findWidget's converted to findExistingWidget's and that got rid of the Java errors but it still won't import correctly it actually destroy's the main menu - as in it is broken apart into multiple root level entries. As far as I can tell it should re-import correctly so anything you can suggest would be great.

Thanks.
BobP.
Bob, got my emails I sent this morning ?
Reply With Quote
  #30  
Old 06-29-2006, 10:17 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by BobPhoenix
One last note on this. I did get all of my findWidget's converted to findExistingWidget's and that got rid of the Java errors but it still won't import correctly it actually destroy's the main menu - as in it is broken apart into multiple root level entries. As far as I can tell it should re-import correctly so anything you can suggest would be great.

Thanks.
BobP.
Hi Bob,

I think I found the problem in your code: you are deleting your old existing menu before calling the defineLink() methods, this way deleteWidgetTree() does not know about your linked widgets and will not stop deletion on widgets of the original STV you linked to ...

After changing the order of defineLink() in your import I noticed the next issue: the defineLink() does not work for some widgets when re-importing, because the original target widget has been replaced with a different one:

e.g. the defineLink("LinkToSetFocusForVariable", "Guide/MenuNeeds*/*/Ensure*/Has*/SetFocusForVariable*") works fine on the first import, but the import code replaces the SetFocusForVariable widget with "REM FCL Guide MenuNeedsDefaultFocus hook code", so that when the plugin is reimported again the defineLink() can't find the widget any more, and the automatic linking fails ... If you modify the link targets in such a way, you will either have to restore the original state before defining the links, or use manual linking for those widgets

Dirk
Reply With Quote
  #31  
Old 06-29-2006, 11:29 AM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by flachbar
Bob, got my emails I sent this morning ?
Nope. I assume you repeated them in the other post. Figured I was misunderstanding how to use it. Thanks for looking at this. Now I know how to proceed.

BobP.
Reply With Quote
  #32  
Old 07-09-2006, 12:29 AM
aperry's Avatar
aperry aperry is offline
Sage Expert
 
Join Date: Jan 2005
Posts: 680
So, using this import/Java routines, I could link to the CenteredDirectoryBrower OptionsMenu widget in the main SageTV STV? Assuming that the answer is yes, then how do I know which one to link to?

Currently, the "main" copy of it is in:
Configuration Wizard - Set Video Recording Dirs/MenuContainer/MenuItems/Add New Directory/... a few more levels .../CenteredDirectoryBrower

There are references to it in four other places, like:
StorageDeviceAdded/if false/... more levels .../CenteredDirectoryBrower

So, if I understand the JavaDoc correctly, could I just do something like this to link in CenteredDirectoryBrower from the main SageTV STV?
df_sageutils_Import_defineLink("MTDirectoryBrowser", "//CenteredDirectoryBrower")

The reason I ask is that the one that Sage considers to be the "main" one does not remain static, at any given time, it could be any of the five occurrences.

----------

Once I get that done, what do I put into my import to call the main CenteredDirectoryBrower OptionsMenu?

Last edited by aperry; 07-09-2006 at 01:51 AM.
Reply With Quote
  #33  
Old 07-09-2006, 08:01 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by aperry
Currently, the "main" copy of it is in:
Configuration Wizard - Set Video Recording Dirs/MenuContainer/MenuItems/Add New Directory/... a few more levels .../CenteredDirectoryBrower

There are references to it in four other places, like:
StorageDeviceAdded/if false/... more levels .../CenteredDirectoryBrower

The reason I ask is that the one that Sage considers to be the "main" one does not remain static, at any given time, it could be any of the five occurrences.
Hi aperry,

the answer is: it doesn't matter to which occurence you link to, they are actually all the same widget... The concept of "primary reference'" (bold) and "secondary reference" (italic) is just a display thing inside of Studio.

Quote:
Originally Posted by aperry
So, if I understand the JavaDoc correctly, could I just do something like this to link in CenteredDirectoryBrower from the main SageTV STV?
df_sageutils_Import_defineLink("MTDirectoryBrowser", "//CenteredDirectoryBrower")
"//" can't be used at the beginning of a path expression. But more importantly: my advice is to not use the "//" shortcut for any paths into the STV, since it has to follow all possible paths between the widgets, and since everything is interlinked in the STV this will visit a huge amount of nodes and take very long ...

Instead, to save typing, use the "*" wildcard in path expressions: for widgets with only one child, you can just use the "*" :

Code:
w1 +-w2 +-w3 +w4 w1/*/*/w4


For widgets with multiple children use as much of the widget name as is necessary to distinguish it from the other children:

Code:
w1
+-w2Listener
    +-w3Action
        +w4
    +-w3Item
+-w2Hook

w1/w2L*/w3A*/w4
So just pick the shortest path to the CenteredDirectoryBrowser and use this path in the defineLink() call ...


Quote:
Originally Posted by aperry

Once I get that done, what do I put into my import to call the main CenteredDirectoryBrower OptionsMenu?
Not quite sure, what do you mean by "call the OptionsMenu" ?


Dirk
Reply With Quote
  #34  
Old 07-09-2006, 12:32 PM
aperry's Avatar
aperry aperry is offline
Sage Expert
 
Join Date: Jan 2005
Posts: 680
Quote:
Originally Posted by flachbar
Not quite sure, what do you mean by "call the OptionsMenu" ?
What I mean is that assuming I put in something like:

df_sageutils_Import_defineLink("MTDirectoryBrowser", "/path/CenteredDirectoryBrower")

Inside my import, do I then just create an options menu item called "MTDirectoryBrowser"? If not, what do I put in my import so that once it gets imported, the CenteredDirectoryBrower gets called the way I would expect?

Thanks!
Reply With Quote
  #35  
Old 07-09-2006, 01:38 PM
alon24 alon24 is offline
Sage Aficionado
 
Join Date: Jun 2004
Posts: 351
Hi,
I wrote this in a seperate post, but no one answered, maybe you can help, since you already did thiss with DeleteWidgetTree.

I am trying to do some cleanup after I broke some child parent relationship, and clean house.
I am trying to do RemoveWidget but it fails with the following error:

Code:
private static void removeLeftOvers()
        throws InvocationTargetException
    {
        ArrayList lst = new ArrayList();
//        Object[] widgets =(Object[]) SageApi.Api("GetAllWidgets");
//        int size = SageApi.IntApi("Size", new Object[]{widgets});
//        log("all widgets = " +widgets+", " + size);
//        log("children size = " + size);
        List imported = Arrays.asList((Object[])_importedWidgets);
        for (Iterator iter = imported.iterator(); iter.hasNext();)
        {
            Object widget = (Object) iter.next();
            Object[] parents =(Object[]) SageApi.Api("GetWidgetParents", new Object[]{widget});
//            log("checking " + widget);
            if (parents.length>0)
                continue;
 
            ImportAction act = isImportActionsWidgets(widget);
            if (act != null)
            {
                lst.add(widget);
                log("found to delete " + widget);
            }
        }
 
        for (Iterator iter = lst.iterator(); iter.hasNext();)
        {
            Object widget = (Object) iter.next();
            log("the widget to del = " + widget);
            SageApi.Api("RemoveWidget", new Object[]{widget});//line 109
        }
    }
Code:
 
found to delete TimerExport:null|Action:linkme to Menu, Main Menu
Sun 7/9 13:18:02.580 the widget to del = TimerExport:null|Action:linkme to Menu, Main Menu
java.lang.NullPointerException
Sun 7/9 13:18:02.581  at sage.c.l$6.new(Unknown Source)
Sun 7/9 13:18:02.582  at sage.at.a(Unknown Source)
Sun 7/9 13:18:02.582  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.583  at sage.SageTV.api(Unknown Source)
Sun 7/9 13:18:02.584  at net.sf.sageplugins.sageutils.SageApi.Api(SageApi.java:17)
Sun 7/9 13:18:02.585  at alon24.Utils.removeLeftOvers(Utils.java:109)
Sun 7/9 13:18:02.585  at alon24.Utils.finish(Utils.java:74)
Sun 7/9 13:18:02.586  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Sun 7/9 13:18:02.586  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Sun 7/9 13:18:02.586  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Sun 7/9 13:18:02.587  at java.lang.reflect.Method.invoke(Unknown Source)
Sun 7/9 13:18:02.587  at sage.d$d.a(Unknown Source)
Sun 7/9 13:18:02.588  at sage.d.d.a(Unknown Source)
Sun 7/9 13:18:02.588  at sage.d.c.a(Unknown Source)
Sun 7/9 13:18:02.588  at sage.d.d.a(Unknown Source)
Sun 7/9 13:18:02.589  at sage.d.m.a(Unknown Source)
Sun 7/9 13:18:02.589  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.589  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.590  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.590  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.591  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.591  at tv.sage.b.k.a(Unknown Source)
Sun 7/9 13:18:02.591  at tv.sage.c.a(Unknown Source)
Sun 7/9 13:18:02.592  at sage.StudioFrame.actionPerformed(Unknown Source)
Sun 7/9 13:18:02.592  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
Sun 7/9 13:18:02.593  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
Sun 7/9 13:18:02.593  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
Sun 7/9 13:18:02.594  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
Sun 7/9 13:18:02.594  at javax.swing.AbstractButton.doClick(Unknown Source)
Sun 7/9 13:18:02.595  at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
Sun 7/9 13:18:02.595  at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
Sun 7/9 13:18:02.596  at java.awt.Component.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.596  at javax.swing.JComponent.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.597  at java.awt.Component.processEvent(Unknown Source)
Sun 7/9 13:18:02.598  at java.awt.Container.processEvent(Unknown Source)
Sun 7/9 13:18:02.599  at java.awt.Component.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.599  at java.awt.Container.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.600  at java.awt.Component.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.602  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
Sun 7/9 13:18:02.603  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.604  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.605  at java.awt.Container.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.606  at java.awt.Window.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.607  at java.awt.Component.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.608  at java.awt.EventQueue.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.609  at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
Sun 7/9 13:18:02.610  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
Sun 7/9 13:18:02.611  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Sun 7/9 13:18:02.612  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Sun 7/9 13:18:02.612  at java.awt.EventDispatchThread.run(Unknown Source)
java.lang.reflect.InvocationTargetException
Sun 7/9 13:18:02.616  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Sun 7/9 13:18:02.616  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Sun 7/9 13:18:02.617  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Sun 7/9 13:18:02.617  at java.lang.reflect.Method.invoke(Unknown Source)
Sun 7/9 13:18:02.618  at sage.d$d.a(Unknown Source)
Sun 7/9 13:18:02.618  at sage.d.d.a(Unknown Source)
Sun 7/9 13:18:02.618  at sage.d.c.a(Unknown Source)
Sun 7/9 13:18:02.619  at sage.d.d.a(Unknown Source)
Sun 7/9 13:18:02.619  at sage.d.m.a(Unknown Source)
Sun 7/9 13:18:02.620  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.620  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.621  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.621  at sage.a6.a(Unknown Source)
Sun 7/9 13:18:02.621  at sage.d.a(Unknown Source)
Sun 7/9 13:18:02.622  at tv.sage.b.k.a(Unknown Source)
Sun 7/9 13:18:02.622  at tv.sage.c.a(Unknown Source)
Sun 7/9 13:18:02.622  at sage.StudioFrame.actionPerformed(Unknown Source)
Sun 7/9 13:18:02.623  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
Sun 7/9 13:18:02.623  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
Sun 7/9 13:18:02.624  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
Sun 7/9 13:18:02.624  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
Sun 7/9 13:18:02.625  at javax.swing.AbstractButton.doClick(Unknown Source)
Sun 7/9 13:18:02.625  at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
Sun 7/9 13:18:02.625  at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
Sun 7/9 13:18:02.626  at java.awt.Component.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.626  at javax.swing.JComponent.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.627  at java.awt.Component.processEvent(Unknown Source)
Sun 7/9 13:18:02.627  at java.awt.Container.processEvent(Unknown Source)
Sun 7/9 13:18:02.627  at java.awt.Component.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.628  at java.awt.Container.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.628  at java.awt.Component.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.628  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
Sun 7/9 13:18:02.629  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
Sun 7/9 13:18:02.629  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.630  at java.awt.Container.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.630  at java.awt.Window.dispatchEventImpl(Unknown Source)
Sun 7/9 13:18:02.630  at java.awt.Component.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.631  at java.awt.EventQueue.dispatchEvent(Unknown Source)
Sun 7/9 13:18:02.631  at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
Sun 7/9 13:18:02.631  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
Sun 7/9 13:18:02.632  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Sun 7/9 13:18:02.632  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
Sun 7/9 13:18:02.633  at java.awt.EventDispatchThread.run(Unknown Source)
Sun 7/9 13:18:02.634 Caused by: java.lang.reflect.InvocationTargetException: Exception while executing SageApi: "RemoveWidget" numargs=1
Sun 7/9 13:18:02.634  at net.sf.sageplugins.sageutils.SageApi.Api(SageApi.java:20)
Sun 7/9 13:18:02.635  at alon24.Utils.removeLeftOvers(Utils.java:109)
Sun 7/9 13:18:02.635  at alon24.Utils.finish(Utils.java:74)
Sun 7/9 13:18:02.636  ... 43 more
Sun 7/9 13:18:02.636

Do you have any ideas?
I need to do cleanup, I could also not break the parent but it wont delete it there either.
__________________
Server
SageTv 6.3.5, Core2Duo 6300 ,2Gigs ,Saphire x1650, PVR250, 2*320GB + 160GB, java 1.6.1
Client
SageTV Client 6.3.5 , AMD 3000, 1024Mb, Saphire x1600Pro256HDMI, java 1.6.1

Using Nielm's Web server 2.22
Reply With Quote
  #36  
Old 07-09-2006, 01:47 PM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally Posted by aperry
If not, what do I put in my import so that once it gets imported, the CenteredDirectoryBrower gets called the way I would expect?
In your import, make the item and the action tree as normal, including setting up the variables required for the browser but add a text action as a placeholder:
"REM CenteredDirectoryBrowser to me", then in the actions after this one you can use the result of the browser...

In the import code, link the CenteredDirectoryBrowser to the imported text action
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #37  
Old 07-09-2006, 01:49 PM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally Posted by alon24
Hi,
I wrote this in a seperate post, but no one answered, maybe you can help, since you already did thiss with DeleteWidgetTree.

I am trying to do some cleanup after I broke some child parent relationship, and clean house.
I am trying to do RemoveWidget but it fails with the following error:
...
Do you have any ideas?
I am not sure but I think you need to call the Api with a UI context when you perform widget AP calls...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #38  
Old 07-09-2006, 02:33 PM
alon24 alon24 is offline
Sage Aficionado
 
Join Date: Jun 2004
Posts: 351
Thanks Nielm, that did the trick.

Where can I find out the rules about the different context, and when to use them?
__________________
Server
SageTv 6.3.5, Core2Duo 6300 ,2Gigs ,Saphire x1650, PVR250, 2*320GB + 160GB, java 1.6.1
Client
SageTV Client 6.3.5 , AMD 3000, 1024Mb, Saphire x1600Pro256HDMI, java 1.6.1

Using Nielm's Web server 2.22
Reply With Quote
  #39  
Old 07-09-2006, 05:14 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by aperry
What I mean is that assuming I put in something like:

df_sageutils_Import_defineLink("MTDirectoryBrowser", "/path/CenteredDirectoryBrower")

Inside my import, do I then just create an options menu item called "MTDirectoryBrowser"? If not, what do I put in my import so that once it gets imported, the CenteredDirectoryBrower gets called the way I would expect?

Thanks!
Hi aperry,

you just have to create a dummy widget (type doesn't matter) with the name "MTDirectoryBrowser" at exactly the place where you want the "CenteredDirectoryBrower' widget to appear. As Niel said, you first have to set up the variables used by the browser. It would look like:

Code:
+- AddVideoDir = ...
   +- DirBrowseTitle = ...
      +- CurrentDirPath = ...
         +- UseLocalDirPaths = ...
            +- SelectedDirPath = null
               +- MTDirectoryBrowser   <- dummy widget (any type, with name used in defineLink())
               +- if SelectedDirPath != null
                   +-  do something
Don't forget to call df_sageutils_Import_linkWidgets() at some point in your import code.

Important: I discovered that linkWidgets() did not maintain the position of the link within the parent. Since the above code will not work if the position is not maintained, please download the current version 1.5 of the import library where this issue has been fixed.

Dirk
Reply With Quote
  #40  
Old 07-09-2006, 09:20 PM
aperry's Avatar
aperry aperry is offline
Sage Expert
 
Join Date: Jan 2005
Posts: 680
You had previously mentioned to avoid using the // notation. However, can't it get used with little to no impact once you get into a structure like this:

Code:
-Menu
 +Thing1
 -Thing2
  -Thing21
   -Thing211
    -Thing2111
     -ThingIWant
In other words, if I put in "Menu/Thing2//ThingIWant", that in theory shouldn't be any slower than if I spelled it out, correct? As I understand it, there is only one path to get to "ThingIWant" once I get to "Thing2" in the path, right?

This would be especially useful in a situation like what I have where there are 4 or 5 variables set before calling the CenteredDirectoryBrower, so if I could skip most of those variable setups for specifying my destination widget path, that would make it easier for me.

Last edited by aperry; 07-09-2006 at 09:24 PM.
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 06:12 PM.


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