mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
More CR & simplifications
This commit is contained in:
parent
14def61eb8
commit
dde5f69ac9
4 changed files with 5 additions and 17 deletions
|
@ -218,10 +218,9 @@ Item {
|
||||||
id: actionCheckBox
|
id: actionCheckBox
|
||||||
visible: isCheckBox
|
visible: isCheckBox
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
checked: model && model[styleData.role]
|
checked: model[styleData.role]
|
||||||
// If this is a "personal mute" checkbox, and the model is valid, Check the checkbox if the Ignore
|
// If this is a "Personal Mute" checkbox, disable the checkbox if the "Ignore" checkbox is checked.
|
||||||
// checkbox is checked.
|
enabled: !(styleData.role === "personalMute" && model["ignore"])
|
||||||
enabled: styleData.role === "personalMute" ? ((model && model["ignore"]) === true ? false : true) : true
|
|
||||||
boxSize: 24
|
boxSize: 24
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var newValue = !model[styleData.role]
|
var newValue = !model[styleData.role]
|
||||||
|
@ -239,8 +238,8 @@ Item {
|
||||||
}
|
}
|
||||||
// http://doc.qt.io/qt-5/qtqml-syntax-propertybinding.html#creating-property-bindings-from-javascript
|
// http://doc.qt.io/qt-5/qtqml-syntax-propertybinding.html#creating-property-bindings-from-javascript
|
||||||
// I'm using an explicit binding here because clicking a checkbox breaks the implicit binding as set by
|
// I'm using an explicit binding here because clicking a checkbox breaks the implicit binding as set by
|
||||||
// "checked: model[styleData.role]" above.
|
// "checked:" statement above.
|
||||||
checked = Qt.binding(function() { return (model && model[styleData.role]) ? model[styleData.role] : false})
|
checked = Qt.binding(function() { return (model[styleData.role])})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ UsersScriptingInterface::UsersScriptingInterface() {
|
||||||
connect(nodeList.data(), &LimitedNodeList::canKickChanged, this, &UsersScriptingInterface::canKickChanged);
|
connect(nodeList.data(), &LimitedNodeList::canKickChanged, this, &UsersScriptingInterface::canKickChanged);
|
||||||
connect(nodeList.data(), &NodeList::ignoreRadiusEnabledChanged, this, &UsersScriptingInterface::ignoreRadiusEnabledChanged);
|
connect(nodeList.data(), &NodeList::ignoreRadiusEnabledChanged, this, &UsersScriptingInterface::ignoreRadiusEnabledChanged);
|
||||||
connect(nodeList.data(), &NodeList::usernameFromIDReply, this, &UsersScriptingInterface::usernameFromIDReply);
|
connect(nodeList.data(), &NodeList::usernameFromIDReply, this, &UsersScriptingInterface::usernameFromIDReply);
|
||||||
connect(nodeList.data(), &NodeList::ignoredNode, this, &UsersScriptingInterface::ignoredNode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UsersScriptingInterface::ignore(const QUuid& nodeID, bool ignoreEnabled) {
|
void UsersScriptingInterface::ignore(const QUuid& nodeID, bool ignoreEnabled) {
|
||||||
|
|
|
@ -117,7 +117,6 @@ public slots:
|
||||||
signals:
|
signals:
|
||||||
void canKickChanged(bool canKick);
|
void canKickChanged(bool canKick);
|
||||||
void ignoreRadiusEnabledChanged(bool isEnabled);
|
void ignoreRadiusEnabledChanged(bool isEnabled);
|
||||||
void ignoredNode(const QUuid& nodeID, bool enabled);
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Notifies scripts that another user has entered the ignore radius
|
* Notifies scripts that another user has entered the ignore radius
|
||||||
|
|
|
@ -333,14 +333,6 @@ pal.visibleChanged.connect(onVisibleChanged);
|
||||||
pal.closed.connect(off);
|
pal.closed.connect(off);
|
||||||
Users.usernameFromIDReply.connect(usernameFromIDReply);
|
Users.usernameFromIDReply.connect(usernameFromIDReply);
|
||||||
|
|
||||||
function onIgnore(sessionId, enabled) { // make it go away in the usual way, since we'll still get data keeping it live
|
|
||||||
if (enabled) {
|
|
||||||
// Why doesn't this work from .qml? (crashes)
|
|
||||||
AvatarList.getAvatar(sessionId).setShouldDie();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Users.ignoredNode.connect(onIgnore);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Cleanup.
|
// Cleanup.
|
||||||
//
|
//
|
||||||
|
@ -350,7 +342,6 @@ Script.scriptEnding.connect(function () {
|
||||||
pal.visibleChanged.disconnect(onVisibleChanged);
|
pal.visibleChanged.disconnect(onVisibleChanged);
|
||||||
pal.closed.disconnect(off);
|
pal.closed.disconnect(off);
|
||||||
Users.usernameFromIDReply.disconnect(usernameFromIDReply);
|
Users.usernameFromIDReply.disconnect(usernameFromIDReply);
|
||||||
Users.ignoredNode.disconnect(onIgnore);
|
|
||||||
off();
|
off();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue