Commit 8740918f authored by LNJ's avatar LNJ Committed by Jonah Brüchert

Fix RichText labels in Plasma (Mobile) (#175)

This adds explicit textFormat settings in most labels, so labels are always
parsed, if wanted and never if not. So now, the messages aren't parsed anymore,
so the "send image hack" won't work anymore. This is also for security reasons,
because you probably don't want your system to always check any incoming links
in img tags.
parent 695cd61f
......@@ -60,24 +60,28 @@ Kirigami.OverlaySheet {
Kirigami.Heading {
text: "Kaidan " + kaidan.getVersionString()
textFormat: Text.PlainText
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: "<i>" + qsTr("A simple, user-friendly Jabber/XMPP client") + "</i>"
textFormat: Text.RichText
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: "<b>" + qsTr("License:") + "</b> GPLv3+ / CC BY-SA 4.0"
textFormat: Text.RichText
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
}
Controls.Label {
text: "Copyright © 2016-2018\nKaidan developers and contributors"
textFormat: Text.PlainText
wrapMode: Text.WordWrap
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
......
......@@ -101,20 +101,27 @@ Kirigami.Page {
// Connect button
Controls.Button {
id: connectButton
text: isRetry ? qsTr("Retry") : qsTr("Connect")
Layout.columnSpan: 2
Layout.alignment: Qt.AlignRight
Layout.minimumWidth: connectLabel.width
onClicked: {
// disable the button
connectButton.enabled = false;
// indicate that we're connecting now
connectButton.text = "<i>" + qsTr("Connecting…") + "</i>";
connectLabel.text = "<i>" + qsTr("Connecting…") + "</i>";
// connect to given account data
kaidan.jid = jidField.text;
kaidan.password = passField.text;
kaidan.mainConnect();
}
Controls.Label {
id: connectLabel
anchors.centerIn: connectButton
text: isRetry ? qsTr("Retry") : qsTr("Connect")
textFormat: Text.RichText
}
}
}
......
......@@ -37,7 +37,7 @@ Kirigami.OverlaySheet {
property string jid;
onSheetOpenChanged: {
infoLabel.text = qsTr("Do you really want to delete the contact \"%1\" from your roster?").arg(jid);
infoLabel.text = qsTr("Do you really want to delete the contact <%1> from your roster?").arg(jid);
}
ColumnLayout {
......@@ -50,6 +50,7 @@ Kirigami.OverlaySheet {
Controls.Label {
id: infoLabel
text: ""
textFormat: Text.PlainText
wrapMode: Text.WordWrap
Layout.fillWidth: true
......@@ -68,7 +69,6 @@ Kirigami.OverlaySheet {
Controls.Button {
text: qsTr("Delete")
onClicked: {
print(jid);
kaidan.removeContact(jid);
close();
}
......
......@@ -80,6 +80,7 @@ Row {
topPadding: Kirigami.Units.gridUnit * 0.5
bottomPadding: Kirigami.Units.gridUnit * 0.2
text: messageBody
textFormat: Text.PlainText
wrapMode: Text.Wrap
color: sentByMe ? "black" : "white"
}
......
......@@ -62,6 +62,7 @@ Kirigami.SwipeListItem {
// contact name
Kirigami.Heading {
text: name
textFormat: Text.PlainText
elide: Text.ElideRight
maximumLineCount: 1
level: 3
......@@ -74,6 +75,7 @@ Kirigami.SwipeListItem {
elide: Text.ElideRight
maximumLineCount: 1
text: kaidan.removeNewLinesFromString(lastMessage);
textFormat: Text.PlainText
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment