mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
IPv6 support (#1369)
* hyperion-remote - Support IPv6 * LEDDevices - Remove IPv6 limitations * Separate JsonEditorHostValidation * Standalone grabbers & JSON/Flatbuffer forwarder: IPv6 support * remote: Fix setting multiple colors via Hex, add standard logging * IPv6 Updates -Add db migration activities * Addressing non-Windows compile issues * Code cleanup, address clang feedback * Update address (hostname, IPv4/IPv6) help text * Apply migration steps to "old" configurations imported * Show user the UI-Url, if hyperion is already running, address clang findings * Windows Cmake OpenSLL output * Minor Text update
This commit is contained in:
@@ -17,15 +17,18 @@ bool ColorsOption::validate(Parser & parser, QString & value)
|
||||
return true;
|
||||
}
|
||||
|
||||
// check if we can create the color by hex RRGGBB getColors
|
||||
QRegularExpression hexRe("^([0-9A-F]{6})+$", QRegularExpression::CaseInsensitiveOption);
|
||||
QRegularExpressionMatch match = hexRe.match(value);
|
||||
if(match.hasMatch())
|
||||
// check if we can create the colors by hex RRGGBB getColors
|
||||
QRegularExpression re("(([A-F0-9]){6})(?=(?:..)*)");
|
||||
QRegularExpressionMatchIterator i = re.globalMatch(value);
|
||||
|
||||
while (i.hasNext()) {
|
||||
QRegularExpressionMatch match = i.next();
|
||||
QString captured = match.captured(1);
|
||||
_colors.push_back(QColor(QString("#%1").arg(captured)));
|
||||
}
|
||||
|
||||
if (!_colors.isEmpty() && (_colors.size() * 6) == value.length())
|
||||
{
|
||||
for(const QString & m : match.capturedTexts())
|
||||
{
|
||||
_colors.push_back(QColor(QString("#%1").arg(m)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user