introduce a third grouping mode (GROUPED_OPTIONAL) for models that have at most
one active state but the state can be disabled (video/audio tracks for instance)
Note that in some cases they have been changed to forward declarations, and
in some they have been moved, for instance inclusion of `<QUrl>` was moved
from `qt.hpp` to where it was needed.
qt/open_panels: use 'save-recentplay'
qt/preferences: use 'save-recentplay'
qt/MainInterface: use 'save-recentplay'
qt/recent_menu: use 'save-recentplay'
These functions populate the menu given in parameter and were always returning
it, this made confusing code where the return value was used like a different
menu from the incoming.
"View" menu parent was unset that led the menu and the associated resources
being leaked, notably an observer on the "intf-add" variable which asserted on
quit.
Since the actual interface object is now contained in the main Qt
Interface. This fixes regressions introduced by
537d41a468 which were breaking the vlc var
fetching.
this will allow to unload the interface module without unloading Qt in a
further patch.
the new structure is still a vlc object as we use it notably for logging
capacity and to interact with vlc variables
The signal slot binding here is redundant, because every time
the menu is created, the value is obtained from MainInterface,
and there is no need to set it again through the signal.
As discussed in MR #11 ([1]), `qtr()` is only meant to be used with static
strings, not constants or variables. Translation occurs through pointing
xgettext at the `qtr` keyword to find strings (as an alternative to `_()`,
taking into account the common need to convert to a Qt `String` type).
Thus use with anything other than a static string relies upon xgettext
having to recognise and ignore instances that do not actually wrap static
strings, which is considered to be wrong, even if it happens to work.
Accordingly here `qfut()` has been introduced. This is to be used in cases
where `qtr()` was incorrectly used around constant identifiers and
variables (i.e. where a combination of `qfu()` plus translation is needed,
with the string being defined elsewhere (with `N_()`)). The `qtr()` macro
itself now acts as a wrapper to `qfut()` for cases where the parameter is
in fact a static string, thus additionally marking it to be picked up by
xgettext, unlike other use of `qfut()`.
Notes for future readers, the set of macro names reflect:
- `qfu()`: Creates a Qt `String` type from UTF-8 ('f'=from, 'u'=utf8).
- `qfue()`: `qfu()` with ampersand escaping ('e'=escape).
- `qfut()`: `qfu()` with translation ('t'=translation).
- `qtu()`: Qt `String` to UTF-8 ('t'='to', 'u'=utf8).
- `qtr()`: this is a wrapper for `qfut()`, acting as an xgettext marker,
similar to `_()` except returning a Qt `String`. ('tr'=translate).
[1]: https://code.videolan.org/videolan/vlc/-/merge_requests/11