Skip to content

Commit

Permalink
Solved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
hfedcba committed May 29, 2018
2 parents 3b5cb2a + a65b2f6 commit 3cea9a2
Show file tree
Hide file tree
Showing 54 changed files with 4,053 additions and 3,089 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ set(SOURCE_FILES
src/RPC/RpcClient.h
src/RPC/RPCMethods.cpp
src/RPC/RPCMethods.h
src/RPC/RPCServer.cpp
src/RPC/RPCServer.h
src/RPC/Server.cpp
src/RPC/Server.h
src/RPC/RpcServer.cpp
src/RPC/RpcServer.h
src/ScriptEngine/php_config_fixes.h
src/ScriptEngine/php_homegear_globals.cpp
src/ScriptEngine/php_homegear_globals.h
Expand Down
7 changes: 4 additions & 3 deletions homegear-miscellaneous/src/MiscPeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ MiscPeer::~MiscPeer()
std::lock_guard<std::mutex> scriptInfoGuard(_scriptInfoMutex);
if(_scriptInfo)
{
_scriptInfo->scriptFinishedCallback = nullptr;
int32_t i = 0;
while(!_scriptInfo->finished && i < 30)
{
Expand All @@ -96,6 +95,7 @@ MiscPeer::~MiscPeer()
i++;
}
if(i == 30) GD::out.printError("Error: Script of peer " + std::to_string(_peerID) + " did not finish.");
_scriptInfo->scriptFinishedCallback = nullptr;
}
if(_programPID != -1)
{
Expand Down Expand Up @@ -126,7 +126,7 @@ void MiscPeer::homegearShuttingDown()
_shuttingDown = true;
Peer::homegearShuttingDown();

stopScript(false);
stopScript(!GD::bl->shuttingDown);
}
catch(const std::exception& ex)
{
Expand All @@ -153,7 +153,7 @@ void MiscPeer::stopScript(bool callStop)

int32_t i = 0;
_stopRunProgramThread = true;
if(!(!_rpcDevice->runProgram->script2.empty() && _shuttingDown))
if(!(!_rpcDevice->runProgram->script2.empty() && _shuttingDown && !GD::bl->shuttingDown))
{
while(_scriptRunning && i < 30)
{
Expand Down Expand Up @@ -407,6 +407,7 @@ void MiscPeer::runScript(int32_t delay)

std::lock_guard<std::mutex> scriptInfoGuard(_scriptInfoMutex);
if(_shuttingDown) return;
if(_scriptInfo) _scriptInfo->scriptFinishedCallback = nullptr;
_scriptInfo = std::make_shared<BaseLib::ScriptEngine::ScriptInfo>(!_rpcDevice->runProgram->script2.empty() ? BaseLib::ScriptEngine::ScriptInfo::ScriptType::device2 : BaseLib::ScriptEngine::ScriptInfo::ScriptType::device, path, path, script, args, _peerID);
if(_rpcDevice->runProgram->startType != RunProgram::StartType::once)
{
Expand Down
5 changes: 5 additions & 0 deletions misc/Config Directory/main.conf
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ replaceClientServerAddress = http://127.0.0.1:9292/bidcos http://$REMOTEIP:9292/
#### !!!Don't change settings below unless you know exactly what you're doing!!! ####
#### !!!Don't change settings below unless you know exactly what you're doing!!! ####

# When set to "true" Homegear waits for NTP to set the correct time. The check tests, if the unix time stamp is less
# than 1000000000.
# Default: waitForCorrectTime = true
waitForCorrectTime = true

# Default: prioritizeThreads = true
prioritizeThreads = true

Expand Down
2 changes: 1 addition & 1 deletion misc/State Directory/node-blue/www/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function clientInPrivateNet() : bool
</head>
<body spellcheck="false">
<div id="header">
<span class="logo"><img src="red/images/node-blue.png" title="0.18.0-git"> <span>Node-BLUE</span></span>
<span class="logo"><img src="red/images/node-blue.png" title="0.18.6"> <span>Node-BLUE</span></span>
<ul class="header-toolbar hide">
<li><a id="btn-sidemenu" class="button" data-toggle="dropdown" href="#"><i class="fa fa-bars"></i></a></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion misc/State Directory/node-blue/www/red/keymap.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ctrl-i": "core:show-import-dialog",
"ctrl-space": "core:toggle-sidebar",
"ctrl-,": "core:show-user-settings",

"ctrl-alt-r": "core:show-remote-diff",
"ctrl-alt-n": "core:new-project",
"ctrl-alt-o": "core:open-project",
"ctrl-g v": "core:show-version-control-tab"
Expand Down
84 changes: 74 additions & 10 deletions misc/State Directory/node-blue/www/red/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@
(function() {
var firstHomegearReady = true;

function appendNodeConfig(nodeConfig) {
var m = /<!-- --- \[red-module:(\S+)\] --- -->/.exec(nodeConfig.trim());
var moduleId;
if (m) {
moduleId = m[1];
} else {
moduleId = "unknown";
}
try {
$("body").append(nodeConfig);
} catch(err) {
RED.notify(RED._("notification.errors.failedToAppendNode",{module:moduleId, error:err.toString()}),{
type: "error",
timeout: 10000
});
console.log("["+moduleId+"] "+err.toString());
}
}

function loadNodeList() {
$.ajax({
headers: {
Expand Down Expand Up @@ -58,7 +77,11 @@
cache: false,
url: 'nodes',
success: function(data) {
$("body").append(data);
var configs = data.trim().split(/(?=<!-- --- \[red-module:\S+\] --- -->)/);
configs.forEach(function(data) {
appendNodeConfig(data);
});

$("body").i18n();
$("#palette > .palette-spinner").hide();
$(".palette-scroll").removeClass("hide");
Expand All @@ -70,6 +93,7 @@
if (!activeProject) {
// Projects enabled but no active project
RED.menu.setDisabled('menu-item-projects-open',true);
RED.menu.setDisabled('menu-item-projects-settings',true);
if (activeProject === false) {
// User previously decline the migration to projects.
} else { // null/undefined
Expand Down Expand Up @@ -133,11 +157,12 @@
var project = RED.projects.getActiveProject();
var message = {
"change-branch":"Change to local branch '"+project.git.branches.local+"'",
"abort-merge":"Git merge aborted",
"merge-abort":"Git merge aborted",
"loaded":"Project '"+msg.project+"' loaded",
"updated":"Project '"+msg.project+"' updated",
"pull":"Project '"+msg.project+"' reloaded",
"revert": "Project '"+msg.project+"' reloaded"
"revert": "Project '"+msg.project+"' reloaded",
"merge-complete":"Git merge completed"
}[msg.action];
RED.notify("<p>"+message+"</p>");
RED.sidebar.info.refresh()
Expand Down Expand Up @@ -180,13 +205,25 @@
]
}
} else if (msg.error === "credentials_load_failed") {
if (RED.user.hasPermission("projects.write")) {
if (RED.settings.theme("projects.enabled",false)) {
// projects enabled
if (RED.user.hasPermission("projects.write")) {
options.buttons = [
{
text: "Setup credentials",
click: function() {
persistentNotifications[notificationId].hideNotification();
RED.projects.showCredentialsPrompt();
}
}
]
}
} else {
options.buttons = [
{
text: "Setup credentials",
text: "Close",
click: function() {
persistentNotifications[notificationId].hideNotification();
RED.projects.showCredentialsPrompt();
}
}
]
Expand All @@ -203,6 +240,18 @@
}
]
}
} else if (msg.error === "missing_package_file") {
if (RED.user.hasPermission("projects.write")) {
options.buttons = [
{
text: "Create default package file",
click: function() {
persistentNotifications[notificationId].hideNotification();
RED.projects.createDefaultPackageFile();
}
}
]
}
} else if (msg.error === "project_empty") {
if (RED.user.hasPermission("projects.write")) {
options.buttons = [
Expand All @@ -221,6 +270,20 @@
}
]
}
} else if (msg.error === "git_merge_conflict") {
RED.nodes.clear();
RED.sidebar.versionControl.refresh(true);
if (RED.user.hasPermission("projects.write")) {
options.buttons = [
{
text: "Show merge conflicts",
click: function() {
persistentNotifications[notificationId].hideNotification();
RED.sidebar.versionControl.showLocalChanges();
}
}
]
}
}
}
if (!persistentNotifications.hasOwnProperty(notificationId)) {
Expand Down Expand Up @@ -323,7 +386,7 @@
addedTypes = addedTypes.concat(m.types);
RED.i18n.loadCatalog(id, function() {
$.get('nodes/'+id, function(data) {
$("body").append(data);
appendNodeConfig(data);
});
});
});
Expand Down Expand Up @@ -352,7 +415,7 @@
RED.notify(RED._("palette.event.nodeEnabled", {count:msg.types.length})+typeList,"success");
} else {
$.get('nodes/'+msg.id, function(data) {
$("body").append(data);
appendNodeConfig(data);
typeList = "<ul><li>"+msg.types.join("</li><li>")+"</li></ul>";
RED.notify(RED._("palette.event.nodeAdded", {count:msg.types.length})+typeList,"success");
});
Expand Down Expand Up @@ -398,8 +461,9 @@
var menuOptions = [];
if (RED.settings.theme("projects.enabled",false)) {
menuOptions.push({id:"menu-item-projects-menu",label:"Projects",options:[
{id:"menu-item-projects-new",label:"New...",disabled:false,onselect:"core:new-project"},
{id:"menu-item-projects-open",label:"Open...",disabled:false,onselect:"core:open-project"}
{id:"menu-item-projects-new",label:"New",disabled:false,onselect:"core:new-project"},
{id:"menu-item-projects-open",label:"Open",disabled:false,onselect:"core:open-project"},
{id:"menu-item-projects-settings",label:"Project Settings",disabled:false,onselect:"core:show-project-settings"}
]});
}

Expand Down

0 comments on commit 3cea9a2

Please sign in to comment.