The groupbox had a name that misleadingly suggested that it only contained
"instance" related controls when actually it contains both instance and
playlist controls. If dbus is not available it is only the instance ones
that should be hidden not the entire groupbox.
The `CONFIG_GENERIC_NO_BOOL` macro dates from a time when some config
control types took an extra boolean flag in addition to input and label
widget pointers, and some did not, and thus two different macros were
needed.
This has been obsolete since 259f2753af
which removed the relevant bool param.
Note that this macro never gained logic for disabling options that were
unavailable, unlike `CONFIG_GENERIC`, so one side benefit of switching
these items over to `CONFIG_GENERIC` is that they will correctly be
disabled when unavailable now.
Note that a tweak to `CONFIG_GENERIC` was necessary to fix a compilation
error due to there now being use cases where the label param is null.
I included adaptation here of a few existing cases using a different
solution to the helper defines suggested in review.
Example warning:
```
../../modules/gui/qt/dialogs/preferences/simple_preferences.cpp: In constructor 'SPrefsCatList::SPrefsCatList(qt_intf_t*, QWidget*)':
WARNING : ../../modules/gui/qt/dialogs/preferences/simple_preferences.cpp:254: 40: 'void QSignalMapper::mapped(int)' is deprecated: Use QSignalMapper::mappedInt(int) instead [-Wdeprecated-declarations]
254 | connect( mapper, QOverload<int>::of(&QSignalMapper::mapped), this, &SPrefsCatList::switchPanel );
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/QSignalMapper:1,
from ../../modules/gui/qt/dialogs/preferences/simple_preferences.cpp:45:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qsignalmapper.h:71:10: note: declared here
71 | void mapped(int);
| ^~~~~~
```
This replaces almost all use of `SIGNAL()` and `SLOT()` with Qt5-style
strongly-typed connections. The `CONNECT()`, and `DCONNECT()` helpers
built around them have been removed.
Cases involving the `BUTTON_*` macros will be tackled in a separate
commit to improve clarity.
A few cases remain using `SIGNAL()` and `SLOT()` for now due to
complications that should be dealt with separately.
Only two such defines were already in use, the rest were pointlessly
duplicating the text, which should be identical in both interfaces and so
it makes sense to have shared defines.
This happens to fix a few unwanted inconsistencies:
- MacOS was using lowercase "settings" in two places.
- Qt was using completely different language for the hotkey and ML tag
tooltips to everything else.
- A trivial difference between input tab tooltips.
qt/open_panels: use 'save-recentplay'
qt/preferences: use 'save-recentplay'
qt/MainInterface: use 'save-recentplay'
qt/recent_menu: use 'save-recentplay'
the string type was unusual in having a special extra boolean parameter to
select between an ordinary string type control and a password type one,
rather than having a password specific type which derived from it, as
everything else does.
splitting out password controls into their own derived type simplifies
things a little.
it also achieves two other things:
- it puts us into a position from which we can further customise password
controls, as i have done in some later work to be submitted after this.
- it makes it easier/cleaner to add further string derivative controls,
as i also have done in at least one instance in other work.
note that we are also removing a boolean param from the constructors of
`IntegerListConfigControl`. this type only had this param because the
string type did, in connection to the use of generic macros in the simple
preferences code.
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
this widget is that through which all hotkeys are edited.
as just explained in the previous commit, the item pointer provided to
the constructor is always that of a single hotkey config item.
the point in passing along an item pointer was that the base control class
requires one. note that all other controls target a single config item and
so it makes sense for them, but does not make any sense for this. for
whatever reason, someone thought it made more sense to pass along an
arbitrary hotkey item pointer rather than null (possibly in relation to
the fact of displaying the incorrect tooltip removed in the previous
commit).
since the param is entirely useless for this widget, this removes it and
passes along null to the base control constructor instead. this control
simply does not need to be linked to an individual item.
note that the line removed involving "key-play" is deliberate, that was
the arbirarily chosen item to use for the widget in the simple view. (the
`p_config` var is still needed for other things though).
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
>From Qt 5.14.0, Qt::SplitBehavior enum is available and QString::split function causes warning when QString::SplitBehavior enum is used.
Signed-off-by: Pierre Lamot <pierre@videolabs.io>