diff --git a/assets/webconfig/js/content_dashboard.js b/assets/webconfig/js/content_dashboard.js index 47eae059..daf355a3 100644 --- a/assets/webconfig/js/content_dashboard.js +++ b/assets/webconfig/js/content_dashboard.js @@ -75,10 +75,10 @@ $(document).ready( function() { // add more info $('#dash_leddevice').html(window.serverInfo.ledDevices.active); - $('#dash_currv').html(window.currentVersion); + $('#dash_currv').html(window.currentChannel+' '+window.currentVersion); $('#dash_instance').html(window.serverConfig.general.name); $('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port); - $('#dash_versionbranch').html(window.currentChannel); + $('#dash_versionbranch').html(window.serverConfig.general.versionBranch); getReleases(function(callback){ if(callback) diff --git a/config/hyperion.config.json.commented b/config/hyperion.config.json.commented index 959c06be..3213951d 100644 --- a/config/hyperion.config.json.commented +++ b/config/hyperion.config.json.commented @@ -6,10 +6,12 @@ { /// general Settings /// * 'name' : The user friendly name of the hyperion instance (used for network things) + /// * 'versionBranch' : Which branch should be used for hyperion version /// * 'showOptHelp' : Show option expanations at the webui. Highly recommended for beginners. "general" : { "name" : "MyHyperionConfig", + "versionBranch" : "Stable", "showOptHelp" : true }, /// set log level: silent warn verbose debug diff --git a/config/hyperion.config.json.default b/config/hyperion.config.json.default index d863fb0d..30224989 100644 --- a/config/hyperion.config.json.default +++ b/config/hyperion.config.json.default @@ -2,6 +2,7 @@ "general" : { "name" : "My Hyperion Config", + "versionBranch" : "Stable", "showOptHelp" : true }, "logger" : diff --git a/include/commandline/Option.h b/include/commandline/Option.h index 0981bc3d..b6525393 100644 --- a/include/commandline/Option.h +++ b/include/commandline/Option.h @@ -15,13 +15,13 @@ class Option: public QCommandLineOption public: Option(const QString &name, const QString &description = QString(), - const QString &valueName = QString::null, + const QString &valueName = QString(), const QString &defaultValue = QString() ); Option(const QStringList &names, const QString &description = QString(), - const QString &valueName = QString::null, + const QString &valueName = QString(), const QString &defaultValue = QString() ); diff --git a/libsrc/effectengine/EffectFileHandler.cpp b/libsrc/effectengine/EffectFileHandler.cpp index 906b726f..6e355a1d 100644 --- a/libsrc/effectengine/EffectFileHandler.cpp +++ b/libsrc/effectengine/EffectFileHandler.cpp @@ -246,7 +246,7 @@ void EffectFileHandler::updateEffects() // collect effect schemas efxCount = 0; - directory = path.endsWith("/") ? (path + "schema/") : (path + "/schema/"); + directory.setPath(path.endsWith("/") ? (path + "schema/") : (path + "/schema/")); QStringList pynames = directory.entryList(QStringList() << "*.json", QDir::Files, QDir::Name | QDir::IgnoreCase); for (const QString & pyname : pynames) { diff --git a/libsrc/hyperion/schema/schema-general.json b/libsrc/hyperion/schema/schema-general.json index bbb07d0a..fff7a320 100644 --- a/libsrc/hyperion/schema/schema-general.json +++ b/libsrc/hyperion/schema/schema-general.json @@ -14,6 +14,19 @@ "required" : true, "propertyOrder" : 1 }, + "versionBranch" : + { + "type" : "string", + "title" : "edt_conf_gen_versionBranch_title", + "enum" : ["Stable", "Beta"], + "required" : true, + "access" : "expert", + "default" : "Stable", + "options" : { + "enum_titles" : ["Stable", "Beta"] + }, + "propertyOrder" : 2 + }, "showOptHelp" : { "type" : "boolean", diff --git a/libsrc/leddevice/dev_net/LedDevicePhilipsHue.cpp b/libsrc/leddevice/dev_net/LedDevicePhilipsHue.cpp index d3fcc215..fe453894 100644 --- a/libsrc/leddevice/dev_net/LedDevicePhilipsHue.cpp +++ b/libsrc/leddevice/dev_net/LedDevicePhilipsHue.cpp @@ -125,7 +125,7 @@ float CiColor::getDistanceBetweenTwoPoints(CiColor p1, CiColor p2) PhilipsHueBridge::PhilipsHueBridge(Logger* log, QString host, QString username) : QObject() - , log(log) + , _log(log) , host(host) , username(username) { @@ -141,12 +141,12 @@ void PhilipsHueBridge::bConnect(void) { if(username.isEmpty() || host.isEmpty()) { - Error(log,"Username or IP Address is empty!"); + Error(_log,"Username or IP Address is empty!"); } else { QString url = QString("http://%1/api/%2").arg(host).arg(username); - Debug(log, "Connect to bridge %s", QSTRING_CSTR(url)); + Debug(_log, "Connect to bridge %s", QSTRING_CSTR(url)); QNetworkRequest request(url); manager.get(request); @@ -164,13 +164,13 @@ void PhilipsHueBridge::resolveReply(QNetworkReply* reply) QJsonDocument doc = QJsonDocument::fromJson(response, &error); if (error.error != QJsonParseError::NoError) { - Error(log, "Got invalid response from bridge"); + Error(_log, "Got invalid response from bridge"); return; } // check for authorization if(doc.isArray()) { - Error(log, "Authorization failed, username invalid"); + Error(_log, "Authorization failed, username invalid"); return; } @@ -178,7 +178,7 @@ void PhilipsHueBridge::resolveReply(QNetworkReply* reply) if(obj.isEmpty()) { - Error(log, "Bridge has no registered bulbs/stripes"); + Error(_log, "Bridge has no registered bulbs/stripes"); return; } @@ -193,7 +193,7 @@ void PhilipsHueBridge::resolveReply(QNetworkReply* reply) } else { - Error(log,"Network Error: %s", QSTRING_CSTR(reply->errorString())); + Error(_log,"Network Error: %s", QSTRING_CSTR(reply->errorString())); bTimer.start(); } } @@ -202,7 +202,7 @@ void PhilipsHueBridge::resolveReply(QNetworkReply* reply) void PhilipsHueBridge::post(QString route, QString content) { - //Debug(log, "Post %s: %s", QSTRING_CSTR(QString("http://IP/api/USR/%1").arg(route)), QSTRING_CSTR(content)); + //Debug(_log, "Post %s: %s", QSTRING_CSTR(QString("http://IP/api/USR/%1").arg(route)), QSTRING_CSTR(content)); QNetworkRequest request(QString("http://%1/api/%2/%3").arg(host).arg(username).arg(route)); manager.put(request, content.toLatin1()); @@ -216,14 +216,14 @@ const std::set PhilipsHueLight::GAMUT_C_MODEL_IDS = { "LLC020", "LST002", "LCT011", "LCT012", "LCT010", "LCT014", "LCT015", "LCT016", "LCT024" }; PhilipsHueLight::PhilipsHueLight(Logger* log, PhilipsHueBridge* bridge, unsigned int id, QJsonObject values) - : log(log) + : _log(log) , bridge(bridge) , id(id) { // Get state object values which are subject to change. if (!values["state"].toObject().contains("on")) { - Error(log, "Got invalid state object from light ID %d", id); + Error(_log, "Got invalid state object from light ID %d", id); } QJsonObject state; state["on"] = values["state"].toObject()["on"]; @@ -248,7 +248,7 @@ PhilipsHueLight::PhilipsHueLight(Logger* log, PhilipsHueBridge* bridge, unsigned // Find id in the sets and set the appropriate color space. if (GAMUT_A_MODEL_IDS.find(modelId) != GAMUT_A_MODEL_IDS.end()) { - Debug(log, "Recognized model id %s of light ID %d as gamut A", modelId.toStdString().c_str(), id); + Debug(_log, "Recognized model id %s of light ID %d as gamut A", modelId.toStdString().c_str(), id); colorSpace.red = { 0.704f, 0.296f}; colorSpace.green = @@ -258,7 +258,7 @@ PhilipsHueLight::PhilipsHueLight(Logger* log, PhilipsHueBridge* bridge, unsigned } else if (GAMUT_B_MODEL_IDS.find(modelId) != GAMUT_B_MODEL_IDS.end()) { - Debug(log, "Recognized model id %s of light ID %d as gamut B", modelId.toStdString().c_str(), id); + Debug(_log, "Recognized model id %s of light ID %d as gamut B", modelId.toStdString().c_str(), id); colorSpace.red = { 0.675f, 0.322f}; colorSpace.green = @@ -268,7 +268,7 @@ PhilipsHueLight::PhilipsHueLight(Logger* log, PhilipsHueBridge* bridge, unsigned } else if (GAMUT_C_MODEL_IDS.find(modelId) != GAMUT_C_MODEL_IDS.end()) { - Debug(log, "Recognized model id %s of light ID %d as gamut C", modelId.toStdString().c_str(), id); + Debug(_log, "Recognized model id %s of light ID %d as gamut C", modelId.toStdString().c_str(), id); colorSpace.red = { 0.6915f, 0.3083f}; colorSpace.green = @@ -278,7 +278,7 @@ PhilipsHueLight::PhilipsHueLight(Logger* log, PhilipsHueBridge* bridge, unsigned } else { - Warning(log, "Did not recognize model id %s of light ID %d", modelId.toStdString().c_str(), id); + Warning(_log, "Did not recognize model id %s of light ID %d", modelId.toStdString().c_str(), id); colorSpace.red = { 1.0f, 0.0f}; colorSpace.green = @@ -287,7 +287,7 @@ PhilipsHueLight::PhilipsHueLight(Logger* log, PhilipsHueBridge* bridge, unsigned { 0.0f, 0.0f}; } - Info(log,"Light ID %d created", id); + Info(_log,"Light ID %d created", id); } PhilipsHueLight::~PhilipsHueLight() diff --git a/libsrc/leddevice/dev_net/LedDevicePhilipsHue.h b/libsrc/leddevice/dev_net/LedDevicePhilipsHue.h index 0403b388..d42407bc 100644 --- a/libsrc/leddevice/dev_net/LedDevicePhilipsHue.h +++ b/libsrc/leddevice/dev_net/LedDevicePhilipsHue.h @@ -92,7 +92,7 @@ class PhilipsHueBridge : public QObject Q_OBJECT private: - Logger* log; + Logger* _log; /// QNetworkAccessManager for sending requests. QNetworkAccessManager manager; /// Ip address of the bridge @@ -138,7 +138,7 @@ public: class PhilipsHueLight { private: - Logger* log; + Logger* _log; PhilipsHueBridge* bridge; /// light id unsigned int id; diff --git a/test/TestQtScreenshot.cpp b/test/TestQtScreenshot.cpp index 20128cfe..7fe5cf8f 100644 --- a/test/TestQtScreenshot.cpp +++ b/test/TestQtScreenshot.cpp @@ -19,10 +19,10 @@ void createScreenshot(const int cropHorizontal, const int cropVertical, const int decimation, Image & image) { // Create the full size screenshot - const QRect screenSize = QApplication::desktop()->screenGeometry(); + QScreen *screen = QApplication::primaryScreen(); + const QRect screenSize = screen->availableGeometry(); const int croppedWidth = screenSize.width() - 2*cropVertical; const int croppedHeight = screenSize.height() - 2*cropHorizontal; - QScreen *screen = QApplication::primaryScreen(); const QPixmap fullSizeScreenshot = screen->grabWindow(QApplication::desktop()->winId(), cropVertical, cropHorizontal, croppedWidth, croppedHeight); // Scale the screenshot to the required size