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 11-15-2010, 11:07 PM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
How to Delete?

I am having trouble issuing a delete from my STVI plugin.

I perform a AddStaticContext("Airing",AiringObject) - in which the airing object is my object and then I reference OPUS4-91972.

This part seems to work as expected. However, if I say no to the delete and then later perform another AddStaticContext with a different airing object, I am still prompted to delete the first airing.

Anyone run into this before?
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #2  
Old 11-16-2010, 02:38 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
AddStaticContext is meant for passing parameters from one menu to another, and seems like overkill for setting up a variable for a shared piece of code that doesn't involve a menu transition. For your purpose, an attribute variable should be adequate.

That said, I don't see any obvious reason why AddStaticContext shouldn't work. So perhaps there's a bug in your code somewhere such that Airing doesn't contain what you think it does.

In general, it's much easier for us to diagnose problems of this sort if you show us screenshots of the actual code you're trying to debug, rather than just describing in general terms what you're intending to do. The bugs usually turn out to be in the places where the code doesn't accurately reflect your intention.

If you don't want to tip your hand about what you're working on, construct a generic dummy example that exhibits the bug and show us that instead.
__________________
-- Greg
Reply With Quote
  #3  
Old 11-16-2010, 05:46 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
I actually think you are right Greg I don't think a static context can be changed again assigned unless a MENU transition occurs.

But back to the question agree with Greg what you are referencing is just a popup so definately just set an attribute value before linking to the popup. If this is on the a table just set the attribute vale under the item widget for all cells then you don't have to do it over and over again for multiple links.

Something like

Code:
Airing[=tablecell]

Last edited by PLUCKYHD; 11-16-2010 at 07:02 AM.
Reply With Quote
  #4  
Old 11-16-2010, 06:28 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
AddStaticContext is meant for passing parameters from one menu to another, and seems like overkill for setting up a variable for a shared piece of code that doesn't involve a menu transition. For your purpose, an attribute variable should be adequate.
Correct! I thought I needed AddStaticContext, but just a variable is fine.

Quote:
That said, I don't see any obvious reason why AddStaticContext shouldn't work. So perhaps there's a bug in your code somewhere such that Airing doesn't contain what you think it does.
Hmm - not sure why AddStaticContext doesn't work - but it does not seem to - the code seems to be right because I can assign the same method call to a variable and that seems to work


Quote:
In general, it's much easier for us to diagnose problems of this sort if you show us screenshots of the actual code you're trying to debug, rather than just describing in general terms what you're intending to do. The bugs usually turn out to be in the places where the code doesn't accurately reflect your intention.
Makes sense.

Quote:
If you don't want to tip your hand about what you're working on, construct a generic dummy example that exhibits the bug and show us that instead.
Not afraid of tipping my hand. This is for TVB.
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #5  
Old 11-16-2010, 06:29 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
Originally Posted by PLUCKYHD View Post
I actually think you are right Greg I don't think a static context can be changed again assigned unless army transition occurs.

But back to the question agree with Greg what you are referencing is just a popup so definately just set an attribute value before linking to the popup. If this is on the a table just set the attribute vale under the item widget for all cells then you don't have to do it over and over again for multiple links.

Something like

Code:
Airing[=tablecell]
Thanks Plucky - works great when its a var.
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #6  
Old 11-16-2010, 07:22 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by PLUCKYHD View Post
I actually think you are right Greg I don't think a static context can be changed again assigned unless a MENU transition occurs.
I don't think that's what Greg was suggesting. I just tried it and had no problem setting a static context variable & then changing it.

However, it is true that a static context is not needed (nor desirable) for this since the value isn't being sent to a new menu.

- 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
  #7  
Old 11-16-2010, 07:30 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
I'd stay away from using a global static variable called "Airing" because that variable name is used all over the default STV and it's assumed to have the correct Airing Object.
__________________

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
  #8  
Old 11-16-2010, 10:21 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by Opus4 View Post
I don't think that's what Greg was suggesting. I just tried it and had no problem setting a static context variable & then changing it.

However, it is true that a static context is not needed (nor desirable) for this since the value isn't being sent to a new menu.

- Andy
I trust your answer I know I have had issue with static context and not changing menu's in the past. It works fine when I changed menu items, but again it could have also been my coding
Reply With Quote
  #9  
Old 11-16-2010, 11:32 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by tmiranda View Post
I'd stay away from using a global static variable called "Airing" because that variable name is used all over the default STV and it's assumed to have the correct Airing Object.
This is a good point. There may be a lot of undeclared local variables called Airing. But once you've made a static context called Airing, then suddenly all those undeclared refs will bind to that instead, perhaps with unexpected results.

(Pardon the rant, but this is why proper programming languages require declarations for all variables, so that the scope is explicit and can't be hijacked.)
__________________
-- Greg
Reply With Quote
  #10  
Old 11-16-2010, 12:29 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by GKusnick View Post
This is a good point. There may be a lot of undeclared local variables called Airing. But once you've made a static context called Airing, then suddenly all those undeclared refs will bind to that instead, perhaps with unexpected results.

(Pardon the rant, but this is why proper programming languages require declarations for all variables, so that the scope is explicit and can't be hijacked.)
Agreed

I stay away from global context for this very reason if an when I use them I make sure that the variable is unique to me and my work. To me it is better and easier to set a property for something global.
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
Delete doesn't delete! SageFL SageTV Software 11 04-24-2007 01:44 PM
How to delete multiple recordings or set it to auto delete? batigol9 SageTV Software 24 11-10-2006 07:57 PM
ask to delete... snoopy SageTV Customizations 2 08-05-2005 06:50 AM
Can't delete? ikarus79m SageTV Beta Test Software 9 03-23-2004 10:27 PM
Is there a better way to delete?! White94Cobra SageTV Beta Test Software 1 01-24-2004 03:45 PM


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


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