Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 7 years ago

Closed 7 years ago

#3293 closed patch (fixed)

Autodiscovery Patch for MythFrontend

Reported by: dblain Owned by: dblain
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

Attached is a patch against Revision 13184 that adds Auto-Discovery to the Frontend.

NOTE: The Screens to pick a backend and enter a password are downright UGLY!

The code in the patch is completely functional, and only needs cosmetic changes.

A few things to note:

  • Themes don't work without a database available for settings. This includes the existing dialog that should be presented to the user if mysql.txt is missing and the defaults don't work. I was able to trick it into working by calling OverrideSettingForSession? with 31 settings, however as soon as the MythMainWindow? is created, it tries to insert all of the global key bindings into the database which fails. Although I could have continued down this route, it seemed like too much of a hack so I scrapped it for the current implementation.
  • I tried to make as few changes to mythcontext as possible. If the user chooses "No master Backend" it will default to the existing program flow.
  • A new Command Line option -p or --prompt will force the selection screen to be displayed even if the config.xml file has a valid USN in it.
  • The autodiscovery code stores the users default selection in the .mythtv/config.xml file. It's also the file that can be used to override default UPnP settings. (See prior commit for more details on file format).
  • Only the USN (Unique Service Name) of the backend is stored, not it's IP address. This allows the backend to change IPs at will, and the frontend will always be able to connect to it with no user intervention.
  • All of the poorly designed dialog boxes are in the masterselection.cpp/.h files in case anyone wants to improve upon them.
  • With this patch, the frontend starts to participate in the UPnP protocol as a AVMediaRenderer. A full implementation at this time would make the patch too complex. If this, or a modified version of this patch gets committed, I will add the remaining classes to stub out all services needed for a fully compliant UPnP Renderer. (However, this patch does make the frontend a discoverable device).

Attachments (2)

FrontendAutoDiscovery.diff (37.9 KB) - added by dblain 7 years ago.
FrontendAutoDiscovery2.diff (43.3 KB) - added by stuartm 7 years ago.
Added lirc support and improved dialogs (Updated)

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by dblain

comment:1 Changed 7 years ago by jochen

Problem with the patch:

i have configured my client so that lirc sends key events to the programms, i don't use the direct licr integration.

and i can't close the select the mythtvserver window with pressing enter or any key the i have mapped to a button.

maybe enter in the list should do the same as pressing ok, and pressing left on the list should set focus to the button, the same way it works in myth archive.

greets.

comment:2 Changed 7 years ago by stuartm

  • Milestone changed from unknown to 0.21

Attaching an updated patch which adds the pin setting to mythtv-setup.

By default there is no pin is specified. Without a pin, no frontends are unable to connect. Setting the pin to "0000" disables pin checking, allowing anyone to connect.

I've also sorted out some debugging statements which were left in the original patch. Although there is still work to be done, imho this should go into SVN sooner rather than later or it risks going stale. At least with it in SVN people will be more motivated to fix any problems.

comment:3 Changed 7 years ago by stuartm

Uploaded a third patch with lirc support, improved navigation and dialogues.

The patch is a little messy, I'll clean it up later.

Two known issues:

  • Even though qpushbuttons are submitted when a user hits return while they are focused there is no accompanying animation. This really only matters for the search button because it's not obvious when a search occurs. Is the search even needed, I haven't once had to use it for my backends to appear.
  • When the pin dialog is shown the server selection dialog vanishes. The pin dialog only uses a fraction of the center of the screen, so I've no idea why the background dialog disappears. I'd be interested to hear the solution.

Changed 7 years ago by stuartm

Added lirc support and improved dialogs (Updated)

comment:4 Changed 7 years ago by stuartm

There is a problem with the lirc threads which I'm not going to be able to fix before next week at the earliest, but I'd invite someone else to look at.

The thread started by MasterSelectionWindow? persists after we have finished with MasterSelectionWindow? and blocks the connection of the second thread to lircd in MythMainWindow?. Either the two need to share a single thread or we need a way to tell the lirc thread to exit.

comment:5 Changed 7 years ago by Matthew Wire <devel@…>

I don't like the way the pin settings changed with the second patch. IMO the methodology should be:
blank = all access
anything else = pin restricted

I modified the checking line like this so that pin codes consisting of 0's will still be validated:

if ((( sSecurityPin.length() != 0 )
( sSecurityPin.left(1) == "0" )) && ( sPin != sSecurityPin ))

This also means that people upgrading don't suddenly get locked out of their setup because they haven't specified a pin (like I did :( )

I also think the search button could be removed since servers pop up and disappear from the list anyway.

comment:6 Changed 7 years ago by stuartm

We won't be changing the pin access because it's too insecure. People installing from packages may never set a password giving everyone on that network full access to their database and backend.

comment:7 Changed 7 years ago by dblain

  • Resolution set to fixed
  • Status changed from new to closed

(In [14492])
Adds auto discovery of master backend servers to mythfrontend.

Be careful when running more than one server with different versions.
If you choose a server with an older version of Myth on it, it will
upgraded the database without warning.

I ran out of time so I just commented out the lirc logic.
Support for remotes in the master selection and pin screens, will be
added at a later date.

See ticket # 3293 for more details http://svn.mythtv.org/trac/ticket/3293

Closes #3293

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.