mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 13:12:39 +02: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
|
||||
visible: isCheckBox
|
||||
anchors.centerIn: parent
|
||||
checked: model && model[styleData.role]
|
||||
// If this is a "personal mute" checkbox, and the model is valid, Check the checkbox if the Ignore
|
||||
// checkbox is checked.
|
||||
enabled: styleData.role === "personalMute" ? ((model && model["ignore"]) === true ? false : true) : true
|
||||
checked: model[styleData.role]
|
||||
// If this is a "Personal Mute" checkbox, disable the checkbox if the "Ignore" checkbox is checked.
|
||||
enabled: !(styleData.role === "personalMute" && model["ignore"])
|
||||
boxSize: 24
|
||||
onClicked: {
|
||||
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
|
||||
// I'm using an explicit binding here because clicking a checkbox breaks the implicit binding as set by
|
||||
// "checked: model[styleData.role]" above.
|
||||
checked = Qt.binding(function() { return (model && model[styleData.role]) ? model[styleData.role] : false})
|
||||
// "checked:" statement above.
|
||||
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(), &NodeList::ignoreRadiusEnabledChanged, this, &UsersScriptingInterface::ignoreRadiusEnabledChanged);
|
||||
connect(nodeList.data(), &NodeList::usernameFromIDReply, this, &UsersScriptingInterface::usernameFromIDReply);
|
||||
connect(nodeList.data(), &NodeList::ignoredNode, this, &UsersScriptingInterface::ignoredNode);
|
||||
}
|
||||
|
||||
void UsersScriptingInterface::ignore(const QUuid& nodeID, bool ignoreEnabled) {
|
||||
|
|
|
@ -117,7 +117,6 @@ public slots:
|
|||
signals:
|
||||
void canKickChanged(bool canKick);
|
||||
void ignoreRadiusEnabledChanged(bool isEnabled);
|
||||
void ignoredNode(const QUuid& nodeID, bool enabled);
|
||||
|
||||
/**jsdoc
|
||||
* Notifies scripts that another user has entered the ignore radius
|
||||
|
|
|
@ -333,14 +333,6 @@ pal.visibleChanged.connect(onVisibleChanged);
|
|||
pal.closed.connect(off);
|
||||
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.
|
||||
//
|
||||
|
@ -350,7 +342,6 @@ Script.scriptEnding.connect(function () {
|
|||
pal.visibleChanged.disconnect(onVisibleChanged);
|
||||
pal.closed.disconnect(off);
|
||||
Users.usernameFromIDReply.disconnect(usernameFromIDReply);
|
||||
Users.ignoredNode.disconnect(onIgnore);
|
||||
off();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue