[mythtv] [mythtv-commits] mythtv commit: r19845 - in trunk/mythtv/libs by nigel

Isaac Richards ijr at case.edu
Wed Jan 28 05:57:34 UTC 2009


On Wednesday 28 January 2009 12:41:57 am Nigel Pearson wrote:
> > Instead of the WaitForPopups, just change the code to listen for
> > the dialog
> > completion event and then return an error.
>
> I didn't find a way to do that.
>
> 1) The Qt main event loop isn't running yet,
> so no UI is drawn except for the window,
> and no DCE is sent.

Then run the main event loop, temporarily.  It needs to be there for the rest 
of the UI code to work properly.

Is there any reason this code has to be using mythui in the first place?  If it 
can't talk to the database, it can't do basic things like figure out which 
painter to use, even, and I *know* that mythmainwindow doesn't clean up after 
itself properly, so creating a temporary one for this won't work terribly 
well.

> 2) If I work around that with a few processEvents,
> OK, but what is the code doing until the DCE is sent?

Waiting in the main event loop for user input.

> We can't return from the schema upgrade until the
> user decides upgrade/exit. It may not be safe to
> use the existing schema with possibly newer code
> in a plugin's Init(). Even a frontend sending a
> protocol version check to a backend could be bad?

So, don't continue on until the user's given input.  What used to be one 
functions with a blocking UI call in the middle just needs to be split up a 
bit, it really shouldn't be all that difficult to do.

> Unless I misunderstand your suggestion.
>
> > UI code _cannot_ block.
>
> Agreed, but here there isn't really a UI yet.

I'm really not liking a lot of the stuff that's been added to mythdialog.h - 
the signals/slots are *completely* unnecessary, for example, and moreover, 
dangerous unless you're very careful about how you're writing code using this 
stuff.  I can't count how many crashes were eventually attributed to bad use of 
signals/slots in the old UI code.

processEvents() should essentially be considered to not exist at all.  
Anything using it is badly broken, and needs fixed.  One of the basic goals of 
the mythui rewrite was to do away with all the modal UI junk that caused so 
much instability in the old UI.  Yes, this intentionally makes porting take a 
little more time, but it will lead to a more responsive and (much more 
importantly) a less buggy UI.

Isaac



More information about the mythtv-dev mailing list