[mythtv] Display popup from network control. Was: Re: Displaying messages from mythshutdown in mythfrontend - ideas?

Matthew Wire devel at mrwire.co.uk
Fri Aug 24 11:26:57 UTC 2007


> Is "defaultbutton" a button name or number?  If it's a name, is that name
> required to be one of the button1...buttonN, or is it in addition to them?
It's a number, starting at 0 for the first button.

> > POPUP status (optional)[popupIdentifier]
> > 	returns [popupIdentifier] {ACTIVE|CLOSED}
> > POPUP close
> > 	returns [popupIdentifier] CLOSED
> 
> It'd be safer to require a [popupIdentifier] with the close, in case it's
> already been closed, or, worse, another popup has been opened by another
> process (which you wouldn't want to close by accident).
I'll make the popupIdentifier on close an option.  If it's already been
closed it's no problem since it will just return 0 as the identifier.

> How about:
> 
> POPUP status (optional)[popupIdentifier]
> 	returns [popupIdentifier] {ACTIVE|CANCELLED|CLOSED buttonN}
> 
> where buttonN is one of the button identifiers
I was thinking of something like that myself.  Just have to work out how
to find out which button was pressed programmatically.
The other issue is that the status needs to be stored somewhere after
the popup has been closed, how many results should be stored?  If two
popups run in quick succession you'd need to store the result of the
first and second one.

> It's not really necessary, since you can poll with POPUP status.  But on the
> theory that polling is evil, you could add another command to wait until a
> button is pressed or the dialog is cancelled.  Equivalent to repeatedly calling
> POPUP status until it returns something other than ACTIVE, but without actually
> polling.  Something like:
> 
> POPUP wait (optional)[popupIdentifier]
> 	returns [popupIdentifier] {CANCELLED|CLOSED buttonN}
> 
> But I don't know enough about working with sockets to know whether or not this
> is a stupid idea.
The first patch I wrote waited until the popup was closed, but this did
nasty blocking and stuff to the UI, and also blocks the network control
interface.  So, polling is the way to go I think.
> 
> Last question:  are you going to open a ticket and attach this patch?  I'd love
> to see this incorporated into 0.21.
I will, but I want to iron out some of the kinks first - such as getting
the pressed button.  Also, I will probably write some code for
mythshutdown to demonstrate the dialog.



More information about the mythtv-dev mailing list