HelpMenu.py question...

Moderators: Gully, peteru

Post Reply
IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

HelpMenu.py question...

Post by IanSav » Fri Aug 24, 2018 11:00

Hi Prl,

Is there a specific reason why the HelpMenu code in the showHelp() method specifically looks for the SecondInfoBarScreen and closes it if it is open? (This is also in OpenViX but not in OpenPLi.)

Regards,
Ian.

prl
Wizard God
Posts: 32703
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: HelpMenu.py question...

Post by prl » Fri Aug 24, 2018 11:57

IanSav wrote:
Fri Aug 24, 2018 11:00
Is there a specific reason why the HelpMenu code in the showHelp() method specifically looks for the SecondInfoBarScreen and closes it if it is open? (This is also in OpenViX but not in OpenPLi.)

I'm not sure. It was put there a long time ago and logged to Paul In & In in 2012 (I think that In & In did the original port of enigma2 to Beyonwiz). The code was originally:

Code: Select all

		if self.secondInfoBarScreen and self.secondInfoBarScreen.shown:
			self.secondInfoBarScreen.hide()
			self.secondInfoBarWasShown = False
The only comment on the checkin was the fairly obvious "HelpScreen: close 2nd infobar if open." One of my pet peeves is checkin comments that just say in words what the diff shows.

This was changed 12 days later by Paul In & In to:

Code: Select all

                try:
                        if self.secondInfoBarScreen and self.secondInfoBarScreen.shown:
                                self.secondInfoBarScreen.hide()
                except:
                        pass
With the commit log message: "HelpMenu: fix possible BSOD." The reason for catching the exception is simple - the code would crash if the HelpableScreen was used in any class other than InfoBar. It's not explained why the self.secondInfoBarWasShown = False statement was removed.

I think that's longhand for "I don't know," but commenting the code out doesn't seem to do anything obviously bad.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: HelpMenu.py question...

Post by IanSav » Fri Aug 24, 2018 12:45

Hi Prl,

That was my finding as well. I thought it better to ask. ;)

I am preparing a port of your help improvements for use in OpenPLi and OpenViX. With all the extra help screens I am adding to their code they are starting to notice how poor was their original help system. ;)

Regards,
Ian.

prl
Wizard God
Posts: 32703
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: HelpMenu.py question...

Post by prl » Fri Aug 24, 2018 12:56

IanSav wrote:
Fri Aug 24, 2018 12:45
With all the extra help screens I am adding to their code they are starting to notice how poor was their original help system. ;)

Yes, it was in pretty poor shape when I started work on it. It was probably little used because it wasn't all that good.

BTW, I think the code I wrote to do the button indicator movement animation in MovingPixmap is overcomplicated and should just use floating point arithmetic to calculate the intermediate points, and toss all the integer-only code that uses a modified Bresenham's line algorithm.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: HelpMenu.py question...

Post by IanSav » Fri Aug 24, 2018 13:10

Hi Prl,

I would like this to go in with minimal change to minimise future merge issues. (VirtualKeyBoard.py and NumericalTextInput.py have been coded to be identical for all images.) If you want to tidy up the Beyonwiz version then I will simply track your improvements across the other images.

Regards,
Ian.

prl
Wizard God
Posts: 32703
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: HelpMenu.py question...

Post by prl » Fri Aug 24, 2018 13:34

OK, I'll have a look at it over the weekend.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: HelpMenu.py question...

Post by IanSav » Fri Aug 24, 2018 15:23

Hi Prl,

If you want to really simplify the code you could leave out the animation. If I remember that was how it was previously. Either way, I will follow your lead.

Regards,
Ian.

prl
Wizard God
Posts: 32703
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: HelpMenu.py question...

Post by prl » Fri Aug 24, 2018 17:32

IanSav wrote:
Fri Aug 24, 2018 15:23
If you want to really simplify the code you could leave out the animation. If I remember that was how it was previously. Either way, I will follow your lead.

It's what's implementing the animation that's changing, not the use of animation in the Help screen. It's putting Components.PixMap.MovingPixmap back to closer to what it used to be.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32703
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: HelpMenu.py question...

Post by prl » Sat Aug 25, 2018 14:48

prl wrote:
Fri Aug 24, 2018 12:56
BTW, I think the code I wrote to do the button indicator movement animation in MovingPixmap is overcomplicated and should just use floating point arithmetic to calculate the intermediate points, and toss all the integer-only code that uses a modified Bresenham's line algorithm.
Submitted.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

prl
Wizard God
Posts: 32703
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: HelpMenu.py question...

Post by prl » Sun Aug 26, 2018 13:13

prl wrote:
Sat Aug 25, 2018 14:48
prl wrote:
Fri Aug 24, 2018 12:56
BTW, I think the code I wrote to do the button indicator movement animation in MovingPixmap is overcomplicated and should just use floating point arithmetic to calculate the intermediate points, and toss all the integer-only code that uses a modified Bresenham's line algorithm.
Submitted.

Merged and in firmware 20180825.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

Post Reply

Return to “Developers Community”