Merge branch 'emojiAppAdd' of github.com:MiladNazeri/hifi into emojiAppAdd

This commit is contained in:
RebeccaStankus 2019-08-16 12:09:17 -07:00
commit 18a9f3fbfb
1446 changed files with 120 additions and 63 deletions

View file

@ -18,7 +18,6 @@ import PerformanceEnums 1.0
Flickable {
property string avatarNametagMode: Settings.getValue("simplifiedNametag/avatarNametagMode", "on")
property bool emoteIndicatorVisible: true;
id: root
contentWidth: parent.width
contentHeight: generalColumnLayout.height
@ -137,11 +136,20 @@ Flickable {
Layout.preferredHeight: 18
Layout.preferredWidth: parent.width
labelTextOn: "Show Emote UI"
checked: root.emoteIndicatorVisible
checked: Settings.getValue("simplifiedUI/emoteIndicatorVisible", true)
onClicked: {
root.emoteIndicatorVisible = !root.emoteIndicatorVisible;
sendEmoteVisible({method: 'handleEmoteIndicatorVisible', emoteIndicatorVisible: root.emoteIndicatorVisible, source: "SettingsApp.qml"});
console.log("emoteSwitch clicked. Emote UI is ", root.emoteIndicatorVisible);
var currentSetting = Settings.getValue("simplifiedUI/emoteIndicatorVisible", true);
Settings.setValue("simplifiedUI/emoteIndicatorVisible", !currentSetting);
}
Connections {
target: Settings
onValueChanged: {
if (setting === "simplifiedUI/emoteIndicatorVisible") {
emoteSwitch.checked = value;
}
}
}
}
}

View file

@ -35,8 +35,12 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting, const QVar
}
void SettingsScriptingInterface::setValue(const QString& setting, const QVariant& value) {
if (getValue(setting) == value) {
return;
}
// Make a deep-copy of the string.
// Dangling pointers can occur with QStrings that are implicitly shared from a QScriptEngine.
QString deepCopy = QString::fromUtf16(setting.utf16());
Setting::Handle<QVariant>(deepCopy).set(value);
emit valueChanged(setting, value);
}

View file

@ -64,6 +64,9 @@ public slots:
* print("Value: " + (typeof value) + " " + JSON.stringify(value)); // object {"x":0,"y":10,"z":0}
*/
void setValue(const QString& setting, const QVariant& value);
signals:
void valueChanged(const QString& setting, const QVariant& value);
};
#endif // hifi_SettingsScriptingInterface_h

Some files were not shown because too many files have changed in this diff Show more