Fix settings display on macs

Qt widgets uses a default style that varies between platforms. On Linux, the default text is white, on mac its black.
The color of the text in the old settings aren’t configurable as it is (wouldn’t be difficult to do so)

Most themes are using a dark background, so on mac, using the old type settings is proving difficult as mostly unreadable.

So we redefine the style of most QWidget objects so it looks more similar to Linux.
This is done using Qt stylesheets. Where Qt stylesheets do not provided the intended behavior, we use QPalettes instead

(cherry picked from commit 96ecd539de8e76a880f0013b4b8854da216e17b1)

Conflicts:
	mythtv/libs/libmyth/mythwidgets.cpp
Bump API version

Following dca8f922a25e2ddd881ed0666f9cd9b3925c28e2, a full recompile is required
Fix AppleRemote thread not being killed when exiting the application

I’ve been seeing the error about the AppleRemote thread still running when quitting for years… had enough

(cherry picked from commit 42dd0a3470b401a59c36d22e9b0982a17db26a77)
Make python bindings work on mac

We play with the environment variable PYTHONPATH at run time so it points to the current location where the application bundle is located.
It assumes —with-python=python2.6 has been provided to configure (which the mac perl packager will do from now on)

(cherry picked from commit 66e6b5b7906eca45ae481df3c5911a6283eb225b)
Fix MythVideo general settings page not working

How long that one has been broken ???

The new MythUI screen is always on top, so it must be hidden when starting on old Qt screen…
Hopefully there are no more like this

(cherry picked from commit d7de3ff15162c6ce08ede065b5902bda31d1435f)
Revert "Bump API version"

This reverts commit c54c89865d430e2d106696695064ccd50bb88489.
Revert "Fix settings display on macs"

This reverts commit dca8f922a25e2ddd881ed0666f9cd9b3925c28e2.
Fix settings display on macs

My analysis for the problem in 96ecd539de8e76a880f0013b4b8854da216e17b1 was wrong.
The actual issue is that QPalette inheritance appears broken on a mac; if you set the palette to the top widget container, it doesn’t do anything on its children. However, setting the palette to the main application itself does.

Now things look exactly the same between mac and linux for better or worse. Including font sizes and colors.
A downside, is that the selection color appears to be misused in most themes including the default. So you can't tell if a text is selected or simply having focus

(cherry picked from commit 15425cb53e643a8c00975c1ef0ea7674464fdca2)
Fix old Qt setting screens preventing them from accepting keyboard inputs

Hopefully this is the final fix…
The issue seems to only have occurred on macs. When opening two MythDialogs (that includes MythPopup) in a row, often the 2nd one would not accept any used input anymore, only causing a “beep”; making it impossible to even exit that window.

The existing logic (and there was nothing wrong with it) was to simply disable the current MythDialog and put the new one on top of it. However, when doing so, somehow key events are now ignored.
So instead, we now disable all widgets within that MythDialog, without disabling the dialog itself.

When doing so, the newly created MythDialog is always working as expected.
This code should not be necessary, it is a workaround to what appears to be a Qt bug.

Fixes #11990.

(cherry picked from commit 9edb6d6c4aa0ed930be222ddd32cfc008d709d9f)
Revert "Fix settings display on macs"

This reverts commit 829a0986edc2ab695273ec5c8038842c243f36f3.
My analysis for the problem in 96ecd539de8e76a880f0013b4b8854da216e17b1 was wrong.
The actual issue is that QPalette inheritance appears broken on a mac; if you set the palette to the top widget container, it doesn’t do anything on its children. However, setting the palette to the main application itself does.

Now things look exactly the same between mac and linux for better or worse. Including font sizes and colors.
A downside, is that the selection color appears to be misused in most themes including the default. So you can't tell if a text is selected or simply having focus
Qt bug: QTBUG-32067, QTBUG-26144 (over 224 bugs related to palette use in Qt as of 2014-04-05)

(cherry picked from commit 103d4651e68215e661c843ca5862d7d64c052f93)
Fix linking issues.

Spotted by Craig Treleaven, freetype linking parameters were added twice and too early, causing general linking with installed system libraries first, and then local tree ones.
Configure also automatically adds all libraries checked for to EXTRALIBS define

(cherry picked from commit 4f15d4449a31d551d61d0a00362089d8d7d8a763)

Conflicts:
	mythtv/libs/libmythtv/libmythtv.pro
	mythtv/settings.pro
Fixes Video Playback Profile Editor.

Two corrected issues:
1- Adding or Editing an existing profile, did nothing visually, but would actually update the database. Regression was introduced in 9686f034ac54
2- When deleting a profile, the newly selected one wasn’t actually saved as default

(cherry picked from commit c2b22cb99313cbcd496cdbd7593edc853bac41df)

Conflicts:
	mythtv/libs/libmyth/mythconfiggroups.h
Should first Apple Remote listening fail, don’t attempt to use apple remote.

This would only happen on a mac with no remote receiver

(cherry picked from commit 42c2278813687d1d0bded1e0164b0a64e4407365)
Fix crashes when pressing menu key during channel change

There’s a short amount of time when changing channel during which there are no video output defined.

(cherry picked from commit 400f35aa8de2a6e29ec8e98bf173deb95e724adc)
Sync closed caption code with master.
Fix CEA-608 preamble access codes that indent.

See https://code.mythtv.org/trac/ticket/12051
Make sure cc608 FormattedTextChunk::textRect has non-zero width

See https://code.mythtv.org/trac/ticket/12056
Improve legibility and display of CEA-608 captions.

Make sure 608 captions are centered on screen, while still confined
to 90% safe area, as long as zoom factor is not too extreme.

Use correct maximum columns (32) and rows (15) for geometry.

Compute a better font.pixelSize by making first guess, then adjusting
using QFontMetrics' height and lineSpacing to choose a font.pixelSize
that works for all but the most extreme fonts.

Eliminate use of fudge factors that caused a number of problems, such as:
- smaller than necessary font.pixelSize.
- Gaps between caption lines.
- Captions meant for row 14 appearing on row 15.

Make sure top rows are anchored to top of safe area and bottom rows are
anchored to bottom of safe area while eliminating unhelpful
floating point arithmetic.

More logging at verbosity vbi and log level debug have been added to
gain visibility into geometry calculations.

See https://code.mythtv.org/trac/ticket/12057
Pad for italics

If a chunk is in italics, add a few pixels to the width.
This is to compensate for some font/char combos that would otherwise
have the top right corner of the last char clipped.
The effect can be seen with Droid Sans Mono and certain upper case chars
like E or W.