SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-01-2010, 11:52 AM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Plugin installation and restart

I'm in a bit of a fix.

I need to do some one time only setting of Sage.properties during my plugin installation.

As there is no enabled/disable call back I have had to piggy back this setup on the start() method testing a property to see if the one time setup is required.

This works ok but once the settings are there the only way I can see SageTV will pick them up is via another restart.

Is there any cool way to reshow that "restart now/later" dialog that pops up after the plugin install?

Michael
__________________
Web Feed Encoder developer
SageTV Catchup developer
Reply With Quote
  #2  
Old 07-01-2010, 12:15 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
What properties are you setting that require a restart to pick them up? If you set them via SetProperty, they should be accessible immediately via GetProperty.
__________________
-- Greg
Reply With Quote
  #3  
Old 07-01-2010, 02:19 PM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Quote:
Originally Posted by GKusnick View Post
What properties are you setting that require a restart to pick them up? If you set them via SetProperty, they should be accessible immediately via GetProperty.
I am adding a new network encoder and a new EPG import plugin

Michael
__________________
Web Feed Encoder developer
SageTV Catchup developer
Reply With Quote
  #4  
Old 07-21-2010, 01:19 AM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Can anyone help here please.

Its a bit of a sticking point.

I can add server properties for a new tuner - but a restart is needed before it appears in the list of available tuners.

I can just do a server restart without asking - but that seems a bit unfriendly.

I can raise a java swing dialog first- but I'm not sure that would work in all client contexts or work with the remote control.

What would be great would be if there was an easy way to raise a Sage style dialog with a message and OK cancel buttons.

Perfect would be to be able to set the plugin status so it still looks like a restart is required and the existing "restart now/later" dialog is raised.

Can anyone help?

Michael
__________________
Web Feed Encoder developer
SageTV Catchup developer
Reply With Quote
  #5  
Old 07-21-2010, 05:17 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Michael,

There is probably a better way, but you can create a button (CONFIG_BUTTON) in the plugin framework that does the restart. The button description could say something along the lines of "Restart" and the button itself could say "Not Needed" until the user added the property. After adding the property you could make the button say "Restart Now". You could use the HelpText to give more info to the user. You don't get a pop-up confirmation, but the user does have to proactively select restart.

When the user presses the button the setConfigValue (I may have the method name wrong) plugin method is called and you can put the restart code in there. The button text that is displayed is controlled by the getConfigValue method. (You probably knew that already.)

I'm interested in what others have to say about this because I've been fooling around with a plugin that does various actions based on button presses within the plugin manager framework as well.

Tom
__________________

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
  #6  
Old 07-21-2010, 11:36 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
One klugey solution might be to create a dummy Library plugin that you can install and uninstall via the PluginAPI during your one-time initialization in order to fake the server into thinking it needs to be restarted and trigger the built-in Restart prompt.
__________________
-- Greg
Reply With Quote
  #7  
Old 07-22-2010, 03:14 PM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Quote:
Originally Posted by GKusnick View Post
One klugey solution might be to create a dummy Library plugin that you can install and uninstall via the PluginAPI during your one-time initialization in order to fake the server into thinking it needs to be restarted and trigger the built-in Restart prompt.
Even better - I can request installation of the plugin I'm installing after the first normal "restart for plugin installation".

Seems to work.

Michael
__________________
Web Feed Encoder developer
SageTV Catchup developer
Reply With Quote
  #8  
Old 07-23-2010, 07:09 AM
michaeldjcox michaeldjcox is offline
Sage Fanatic
 
Join Date: Nov 2006
Location: Ipswich, Suffolk, United Kingdom
Posts: 829
Quote:
Originally Posted by michaeldjcox View Post
Even better - I can request installation of the plugin I'm installing after the first normal "restart for plugin installation".

Seems to work.

Michael
..and has now stopped working - after the second restart the plugin JAR is no longer in place in the JARs directory

Michael
__________________
Web Feed Encoder developer
SageTV Catchup developer
Reply With Quote
  #9  
Old 07-23-2010, 10:54 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
I'm not clear on exactly what you did to cause that. Maybe seeing some code would help.

But if you're saying that you're calling InstallPlugin() on a plugin that's already installed (and is not a version upgrade), then my guess is that you're doing something that the PluginAPI wasn't designed to handle and it's getting confused about whether JAR files need to be removed or added. (In a normal plugin upgrade, old JARs are removed and new ones are added unless their checksums haven't changed.)

This could perhaps be construed as a bug in the PluginAPI, but if you're going to submit a bug report, then you might as well explain what you're really trying to do (i.e. set the Restart Needed flag) and ask for a way to do it directly without klugery.
__________________
-- 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restart PC Button? Nick_W SageMC Custom Interface 7 02-28-2009 10:04 PM
Anyone have a script tp restart client ? brewston SageTV Software 3 09-16-2008 08:02 AM
Scheduled Windows Restart / Reboot (Shutdown -r) and Sage doesn't restart dealsdyker SageTV Software 8 03-09-2007 04:24 PM


All times are GMT -6. The time now is 07:28 PM.


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