Run qmlformat over everything
This commit is contained in:
@@ -40,9 +40,8 @@ FormCard.FormCardPage {
|
||||
if (fileDialog) {
|
||||
return;
|
||||
}
|
||||
|
||||
fileDialog = openFileDialog.createObject(this);
|
||||
fileDialog.chosen.connect((receivedSource) => {
|
||||
fileDialog.chosen.connect(receivedSource => {
|
||||
if (!receivedSource) {
|
||||
return;
|
||||
}
|
||||
@@ -137,7 +136,9 @@ FormCard.FormCardPage {
|
||||
visible: root.connection !== undefined && root.connection.canChangePassword === false
|
||||
text: i18n("Your server doesn't support changing your password")
|
||||
}
|
||||
FormCard.FormDelegateSeparator { visible: root.connection !== undefined && root.connection.canChangePassword === false }
|
||||
FormCard.FormDelegateSeparator {
|
||||
visible: root.connection !== undefined && root.connection.canChangePassword === false
|
||||
}
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: currentPassword
|
||||
label: i18n("Current Password:")
|
||||
@@ -212,7 +213,11 @@ FormCard.FormCardPage {
|
||||
FormCard.FormButtonDelegate {
|
||||
id: deactivateAccountButton
|
||||
text: i18n("Deactivate Account")
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ConfirmDeactivateAccountDialog.qml", {connection: root.connection}, {title: i18nc("@title", "Confirm Deactivating Account")})
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ConfirmDeactivateAccountDialog.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Confirm Deactivating Account")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,24 +24,24 @@ QQC2.Menu {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Account editor")
|
||||
});
|
||||
})
|
||||
}
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Notification settings")
|
||||
icon.name: "notifications"
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/SettingsPage.qml", {
|
||||
defaultPage: "notifications",
|
||||
connection: root.connection,
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure")
|
||||
});
|
||||
})
|
||||
}
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Devices")
|
||||
icon.name: "computer-symbolic"
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/SettingsPage.qml", {
|
||||
defaultPage: "devices",
|
||||
connection: root.connection,
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Configure")
|
||||
})
|
||||
|
||||
@@ -80,7 +80,7 @@ FormCard.FormCardPage {
|
||||
connection: accountDelegate.connection
|
||||
onAccepted: {
|
||||
if (AccountRegistry.accountCount === 1) {
|
||||
root.Window.window.close()
|
||||
root.Window.window.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,9 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator { below: addAccountDelegate }
|
||||
FormCard.FormDelegateSeparator {
|
||||
below: addAccountDelegate
|
||||
}
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
id: addAccountDelegate
|
||||
@@ -107,7 +109,7 @@ FormCard.FormCardPage {
|
||||
target: Controller
|
||||
function onConnectionAdded() {
|
||||
if (pageStack.layers.depth > 2) {
|
||||
pageStack.layers.pop()
|
||||
pageStack.layers.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,9 @@ FormCard.FormCardPage {
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
QQC2.ButtonGroup { id: themeGroup }
|
||||
QQC2.ButtonGroup {
|
||||
id: themeGroup
|
||||
}
|
||||
ThemeRadioButton {
|
||||
thin: timelineModeSetting.width < Kirigami.Units.gridUnit * 22
|
||||
innerObject: [
|
||||
@@ -196,7 +198,9 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { below: compactRoomListDelegate }
|
||||
FormCard.FormDelegateSeparator {
|
||||
below: compactRoomListDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: compactRoomListDelegate
|
||||
@@ -208,7 +212,11 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { above: compactRoomListDelegate ; below: colorSchemeDelegate.item ; visible: colorSchemeDelegate.visible }
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: compactRoomListDelegate
|
||||
below: colorSchemeDelegate.item
|
||||
visible: colorSchemeDelegate.visible
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: colorSchemeDelegate
|
||||
@@ -231,7 +239,10 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { above: showFancyEffectsDelegate ; below: hasWindowSystemDelegate }
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: showFancyEffectsDelegate
|
||||
below: hasWindowSystemDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: hasWindowSystemDelegate
|
||||
@@ -245,7 +256,10 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { above: hasWindowSystemDelegate; below: transparencyDelegate }
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: hasWindowSystemDelegate
|
||||
below: transparencyDelegate
|
||||
}
|
||||
|
||||
FormCard.AbstractFormDelegate {
|
||||
id: transparencyDelegate
|
||||
@@ -269,7 +283,9 @@ FormCard.FormCardPage {
|
||||
}
|
||||
Layout.fillWidth: true
|
||||
|
||||
HoverHandler { id: sliderHover }
|
||||
HoverHandler {
|
||||
id: sliderHover
|
||||
}
|
||||
QQC2.ToolTip.visible: sliderHover.hovered && !enabled
|
||||
QQC2.ToolTip.text: i18n("Only enabled if the transparent chat page is enabled.")
|
||||
}
|
||||
@@ -280,7 +296,11 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { above: transparencyDelegate; below: showLocalMessagesOnRightDelegate; visible: transparencyDelegate.visible }
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: transparencyDelegate
|
||||
below: showLocalMessagesOnRightDelegate
|
||||
visible: transparencyDelegate.visible
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showLocalMessagesOnRightDelegate
|
||||
@@ -288,25 +308,27 @@ FormCard.FormCardPage {
|
||||
checked: Config.showLocalMessagesOnRight
|
||||
enabled: !Config.isShowLocalMessagesOnRightImmutable && !Config.compactLayout
|
||||
onToggled: {
|
||||
Config.showLocalMessagesOnRight = checked
|
||||
Config.save()
|
||||
Config.showLocalMessagesOnRight = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { above: showLocalMessagesOnRightDelegate; below: showLinkPreviewDelegate }
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: showLocalMessagesOnRightDelegate
|
||||
below: showLinkPreviewDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showLinkPreviewDelegate
|
||||
text: i18n("Show links preview in the chat messages")
|
||||
checked: Config.showLinkPreview
|
||||
onToggled: {
|
||||
Config.showLinkPreview = checked
|
||||
Config.save()
|
||||
Config.showLinkPreview = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FormCard.FormHeader {
|
||||
title: i18n("Show Avatar")
|
||||
}
|
||||
@@ -315,8 +337,8 @@ FormCard.FormCardPage {
|
||||
text: i18n("In chat")
|
||||
checked: Config.showAvatarInTimeline
|
||||
onToggled: {
|
||||
Config.showAvatarInTimeline = checked
|
||||
Config.save()
|
||||
Config.showAvatarInTimeline = checked;
|
||||
Config.save();
|
||||
}
|
||||
enabled: !Config.isShowAvatarInTimelineImmutable
|
||||
}
|
||||
@@ -326,8 +348,8 @@ FormCard.FormCardPage {
|
||||
checked: Config.showAvatarInRoomDrawer
|
||||
enabled: !Config.isShowAvatarInRoomDrawerImmutable
|
||||
onToggled: {
|
||||
Config.showAvatarInRoomDrawer = checked
|
||||
Config.save()
|
||||
Config.showAvatarInRoomDrawer = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,10 @@ QQC2.Popup {
|
||||
text: i18n("Choose local file")
|
||||
|
||||
onClicked: {
|
||||
root.close()
|
||||
|
||||
var fileDialog = openFileDialog.createObject(QQC2.ApplicationWindow.overlay)
|
||||
fileDialog.chosen.connect(path => root.chosen(path))
|
||||
fileDialog.open()
|
||||
root.close();
|
||||
var fileDialog = openFileDialog.createObject(QQC2.ApplicationWindow.overlay);
|
||||
fileDialog.chosen.connect(path => root.chosen(path));
|
||||
fileDialog.open();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,11 +45,11 @@ QQC2.Popup {
|
||||
icon.name: 'insert-image'
|
||||
text: i18n("Clipboard image")
|
||||
onClicked: {
|
||||
const path = StandardPaths.standardLocations(StandardPaths.CacheLocation)[0] + "/screenshots/" + (new Date()).getTime() + ".png"
|
||||
const path = StandardPaths.standardLocations(StandardPaths.CacheLocation)[0] + "/screenshots/" + (new Date()).getTime() + ".png";
|
||||
if (!Clipboard.saveImage(path)) {
|
||||
return;
|
||||
}
|
||||
root.chosen(path)
|
||||
root.chosen(path);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.kde.neochat
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
signal attachmentCancelled()
|
||||
signal attachmentCancelled
|
||||
|
||||
property string attachmentPath
|
||||
|
||||
@@ -47,7 +47,7 @@ ColumnLayout {
|
||||
|
||||
onClicked: {
|
||||
let imageEditor = applicationWindow().pageStack.layers.push(imageEditorPage);
|
||||
imageEditor.newPathChanged.connect(function(newPath) {
|
||||
imageEditor.newPathChanged.connect(function (newPath) {
|
||||
applicationWindow().pageStack.layers.pop();
|
||||
root.attachmentPath = newPath;
|
||||
});
|
||||
@@ -61,7 +61,7 @@ ColumnLayout {
|
||||
action: Kirigami.Action {
|
||||
text: i18n("Cancel sending attachment")
|
||||
icon.name: "dialog-close"
|
||||
onTriggered: attachmentCancelled();
|
||||
onTriggered: attachmentCancelled()
|
||||
shortcut: "Escape"
|
||||
}
|
||||
QQC2.ToolTip.text: text
|
||||
@@ -81,14 +81,14 @@ ColumnLayout {
|
||||
|
||||
onSourceChanged: {
|
||||
// Reset source size height, which affect implicitHeight
|
||||
sourceSize.height = -1
|
||||
sourceSize.height = -1;
|
||||
}
|
||||
|
||||
onSourceSizeChanged: {
|
||||
if (implicitHeight > Kirigami.Units.gridUnit * 8) {
|
||||
// This can save a lot of RAM when loading large images.
|
||||
// It also improves visual quality for large images.
|
||||
sourceSize.height = Kirigami.Units.gridUnit * 8
|
||||
sourceSize.height = Kirigami.Units.gridUnit * 8;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ MessageDelegate {
|
||||
target: playButton
|
||||
icon.name: "media-playback-stop"
|
||||
onClicked: {
|
||||
root.room.cancelFileTransfer(root.eventId)
|
||||
root.room.cancelFileTransfer(root.eventId);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -78,7 +78,7 @@ MessageDelegate {
|
||||
target: playButton
|
||||
icon.name: "media-playback-start"
|
||||
onClicked: {
|
||||
audio.play()
|
||||
audio.play();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -15,8 +15,8 @@ Delegates.RoundedItemDelegate {
|
||||
|
||||
property url source
|
||||
|
||||
signal contextMenuRequested()
|
||||
signal selected()
|
||||
signal contextMenuRequested
|
||||
signal selected
|
||||
|
||||
padding: Kirigami.Units.largeSpacing
|
||||
|
||||
@@ -24,9 +24,9 @@ Delegates.RoundedItemDelegate {
|
||||
QQC2.ToolTip.text: text
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
|
||||
Accessible.onPressAction: selected();
|
||||
Keys.onSpacePressed: selected();
|
||||
Keys.onEnterPressed: selected();
|
||||
Accessible.onPressAction: selected()
|
||||
Keys.onSpacePressed: selected()
|
||||
Keys.onEnterPressed: selected()
|
||||
|
||||
onPressAndHold: root.contextMenuRequested()
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ Kirigami.Page {
|
||||
icon.name: "im-ban-user"
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
||||
onClicked: {
|
||||
root.room.ban(root.userId, reason.text)
|
||||
root.closeDialog()
|
||||
root.room.ban(root.userId, reason.text);
|
||||
root.closeDialog();
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
|
||||
@@ -183,7 +183,7 @@ QQC2.Control {
|
||||
Connections {
|
||||
target: replyLoader.item
|
||||
function onReplyClicked() {
|
||||
replyClicked(root.replyId)
|
||||
replyClicked(root.replyId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,20 +202,22 @@ QQC2.Control {
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
||||
Kirigami.Theme.inherit: false
|
||||
color: if (root.author.isLocalUser) {
|
||||
return Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.highlightColor, 0.15)
|
||||
return Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.highlightColor, 0.15);
|
||||
} else if (root.showHighlight) {
|
||||
return Kirigami.Theme.positiveBackgroundColor
|
||||
return Kirigami.Theme.positiveBackgroundColor;
|
||||
} else {
|
||||
return Kirigami.Theme.backgroundColor
|
||||
return Kirigami.Theme.backgroundColor;
|
||||
}
|
||||
radius: Kirigami.Units.smallSpacing
|
||||
shadow {
|
||||
size: Kirigami.Units.smallSpacing
|
||||
size: Kirigami.Units.smallSpacing
|
||||
color: root.showHighlight ? Qt.rgba(0.0, 0.0, 0.0, 0.10) : Qt.rgba(Kirigami.Theme.textColor.r, Kirigami.Theme.textColor.g, Kirigami.Theme.textColor.b, 0.10)
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation { duration: Kirigami.Units.shortDuration }
|
||||
ColorAnimation {
|
||||
duration: Kirigami.Units.shortDuration
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ LoginStep {
|
||||
url: "http://localhost:20847"
|
||||
implicitHeight: 500
|
||||
onLoadingChanged: {
|
||||
webview.runJavaScript("document.body.style.background = '" + Kirigami.Theme.backgroundColor + "'")
|
||||
webview.runJavaScript("document.body.style.background = '" + Kirigami.Theme.backgroundColor + "'");
|
||||
}
|
||||
|
||||
Timer {
|
||||
@@ -29,15 +29,15 @@ LoginStep {
|
||||
running: true
|
||||
interval: 300
|
||||
onTriggered: {
|
||||
if(!webview.visible) {
|
||||
return
|
||||
if (!webview.visible) {
|
||||
return;
|
||||
}
|
||||
webview.runJavaScript("!!grecaptcha ? grecaptcha.getResponse() : \"\"", function(response){
|
||||
if(!webview.visible || !response)
|
||||
return
|
||||
webview.runJavaScript("!!grecaptcha ? grecaptcha.getResponse() : \"\"", function (response) {
|
||||
if (!webview.visible || !response)
|
||||
return;
|
||||
timer.running = false;
|
||||
Registration.recaptchaResponse = response;
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ KirigamiSettings.CategorizedSettings {
|
||||
return {
|
||||
room: root.room,
|
||||
connection: root.connection
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
@@ -36,7 +36,7 @@ KirigamiSettings.CategorizedSettings {
|
||||
initialProperties: {
|
||||
return {
|
||||
room: root.room
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
@@ -47,7 +47,7 @@ KirigamiSettings.CategorizedSettings {
|
||||
initialProperties: {
|
||||
return {
|
||||
room: root.room
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
KirigamiSettings.SettingAction {
|
||||
@@ -58,7 +58,7 @@ KirigamiSettings.CategorizedSettings {
|
||||
initialProperties: {
|
||||
return {
|
||||
room: root.room
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -57,15 +57,15 @@ QQC2.Control {
|
||||
property bool isBusy: root.currentRoom && root.currentRoom.hasFileUploading
|
||||
|
||||
// Matrix does not allow sending attachments in replies
|
||||
visible: _private.chatBarCache.replyId.length === 0 && _private.chatBarCache.attachmentPath.length === 0
|
||||
visible: _private.chatBarCache.replyId.length === 0 && _private.chatBarCache.attachmentPath.length === 0
|
||||
icon.name: "mail-attachment"
|
||||
text: i18n("Attach an image or file")
|
||||
displayHint: Kirigami.DisplayHint.IconOnly
|
||||
|
||||
onTriggered: {
|
||||
let dialog = (Clipboard.hasImage ? attachDialog : openFileDialog).createObject(applicationWindow().overlay)
|
||||
dialog.chosen.connect(path => _private.chatBarCache.attachmentPath = path)
|
||||
dialog.open()
|
||||
let dialog = (Clipboard.hasImage ? attachDialog : openFileDialog).createObject(applicationWindow().overlay);
|
||||
dialog.chosen.connect(path => _private.chatBarCache.attachmentPath = path);
|
||||
dialog.open();
|
||||
}
|
||||
|
||||
tooltip: text
|
||||
@@ -83,9 +83,9 @@ QQC2.Control {
|
||||
|
||||
onTriggered: {
|
||||
if (emojiDialog.visible) {
|
||||
emojiDialog.close()
|
||||
emojiDialog.close();
|
||||
} else {
|
||||
emojiDialog.open()
|
||||
emojiDialog.open();
|
||||
}
|
||||
}
|
||||
tooltip: text
|
||||
@@ -98,7 +98,9 @@ QQC2.Control {
|
||||
displayHint: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onTriggered: {
|
||||
locationChooser.createObject(QQC2.ApplicationWindow.overlay, {room: root.currentRoom}).open()
|
||||
locationChooser.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
room: root.currentRoom
|
||||
}).open();
|
||||
}
|
||||
tooltip: text
|
||||
},
|
||||
@@ -113,7 +115,7 @@ QQC2.Control {
|
||||
checkable: true
|
||||
|
||||
onTriggered: {
|
||||
_private.postMessage()
|
||||
_private.postMessage();
|
||||
}
|
||||
|
||||
tooltip: text
|
||||
@@ -123,7 +125,7 @@ QQC2.Control {
|
||||
/**
|
||||
* @brief A message has been sent from the chat bar.
|
||||
*/
|
||||
signal messageSent()
|
||||
signal messageSent
|
||||
|
||||
spacing: 0
|
||||
|
||||
@@ -134,7 +136,7 @@ QQC2.Control {
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
Kirigami.Separator {
|
||||
anchors.left: parent.left
|
||||
anchors.right:parent.right
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
}
|
||||
}
|
||||
@@ -146,7 +148,8 @@ QQC2.Control {
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
Item { // Required to adjust for the top separator
|
||||
Item {
|
||||
// Required to adjust for the top separator
|
||||
Layout.preferredHeight: 1
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
@@ -200,17 +203,17 @@ QQC2.Control {
|
||||
|
||||
onTextChanged: {
|
||||
if (!repeatTimer.running && Config.typingNotifications) {
|
||||
var textExists = text.length > 0
|
||||
root.currentRoom.sendTypingNotification(textExists)
|
||||
textExists ? repeatTimer.start() : repeatTimer.stop()
|
||||
var textExists = text.length > 0;
|
||||
root.currentRoom.sendTypingNotification(textExists);
|
||||
textExists ? repeatTimer.start() : repeatTimer.stop();
|
||||
}
|
||||
_private.chatBarCache.text = text
|
||||
_private.chatBarCache.text = text;
|
||||
}
|
||||
onSelectedTextChanged: {
|
||||
if (selectedText.length > 0) {
|
||||
quickFormatBar.selectionStart = selectionStart
|
||||
quickFormatBar.selectionEnd = selectionEnd
|
||||
quickFormatBar.open()
|
||||
quickFormatBar.selectionStart = selectionStart;
|
||||
quickFormatBar.selectionEnd = selectionEnd;
|
||||
quickFormatBar.open();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,42 +228,42 @@ QQC2.Control {
|
||||
|
||||
Keys.onDeletePressed: {
|
||||
if (selectedText.length > 0) {
|
||||
remove(selectionStart, selectionEnd)
|
||||
remove(selectionStart, selectionEnd);
|
||||
} else {
|
||||
remove(cursorPosition, cursorPosition + 1)
|
||||
remove(cursorPosition, cursorPosition + 1);
|
||||
}
|
||||
if (textField.text == selectedText || textField.text.length <= 1) {
|
||||
root.currentRoom.sendTypingNotification(false)
|
||||
repeatTimer.stop()
|
||||
root.currentRoom.sendTypingNotification(false);
|
||||
repeatTimer.stop();
|
||||
}
|
||||
if (quickFormatBar.visible) {
|
||||
quickFormatBar.close()
|
||||
quickFormatBar.close();
|
||||
}
|
||||
}
|
||||
Keys.onEnterPressed: event => {
|
||||
if (completionMenu.visible) {
|
||||
completionMenu.complete()
|
||||
completionMenu.complete();
|
||||
} else if (event.modifiers & Qt.ShiftModifier || Kirigami.Settings.isMobile) {
|
||||
textField.insert(cursorPosition, "\n")
|
||||
textField.insert(cursorPosition, "\n");
|
||||
} else {
|
||||
_private.postMessage();
|
||||
}
|
||||
}
|
||||
Keys.onReturnPressed: event => {
|
||||
if (completionMenu.visible) {
|
||||
completionMenu.complete()
|
||||
completionMenu.complete();
|
||||
} else if (event.modifiers & Qt.ShiftModifier || Kirigami.Settings.isMobile) {
|
||||
textField.insert(cursorPosition, "\n")
|
||||
textField.insert(cursorPosition, "\n");
|
||||
} else {
|
||||
_private.postMessage();
|
||||
}
|
||||
}
|
||||
Keys.onTabPressed: {
|
||||
if (completionMenu.visible) {
|
||||
completionMenu.complete()
|
||||
completionMenu.complete();
|
||||
}
|
||||
}
|
||||
Keys.onPressed: (event) => {
|
||||
Keys.onPressed: event => {
|
||||
if (event.key === Qt.Key_V && event.modifiers & Qt.ControlModifier) {
|
||||
event.accepted = _private.pasteImage();
|
||||
} else if (event.key === Qt.Key_Up && event.modifiers & Qt.ControlModifier) {
|
||||
@@ -268,26 +271,26 @@ QQC2.Control {
|
||||
} else if (event.key === Qt.Key_Up && textField.text.length === 0) {
|
||||
root.currentRoom.editLastMessage();
|
||||
} else if (event.key === Qt.Key_Up && completionMenu.visible) {
|
||||
completionMenu.decrementIndex()
|
||||
completionMenu.decrementIndex();
|
||||
} else if (event.key === Qt.Key_Down && completionMenu.visible) {
|
||||
completionMenu.incrementIndex()
|
||||
completionMenu.incrementIndex();
|
||||
} else if (event.key === Qt.Key_Backspace) {
|
||||
if (textField.text == selectedText || textField.text.length <= 1) {
|
||||
root.currentRoom.sendTypingNotification(false)
|
||||
repeatTimer.stop()
|
||||
root.currentRoom.sendTypingNotification(false);
|
||||
repeatTimer.stop();
|
||||
}
|
||||
if (quickFormatBar.visible && selectedText.length > 0) {
|
||||
quickFormatBar.close()
|
||||
quickFormatBar.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Keys.onShortcutOverride: event => {
|
||||
if (completionMenu.visible) {
|
||||
completionMenu.close()
|
||||
completionMenu.close();
|
||||
} else if ((_private.chatBarCache.isReplying || _private.chatBarCache.attachmentPath.length > 0) && event.key === Qt.Key_Escape) {
|
||||
_private.chatBarCache.attachmentPath = ""
|
||||
_private.chatBarCache.replyId = ""
|
||||
_private.chatBarCache.threadId = ""
|
||||
_private.chatBarCache.attachmentPath = "";
|
||||
_private.chatBarCache.replyId = "";
|
||||
_private.chatBarCache.threadId = "";
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
@@ -358,7 +361,7 @@ QQC2.Control {
|
||||
|
||||
onAttachmentCancelled: {
|
||||
_private.chatBarCache.attachmentPath = "";
|
||||
root.forceActiveFocus()
|
||||
root.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -370,11 +373,11 @@ QQC2.Control {
|
||||
|
||||
function postMessage() {
|
||||
root.actionsHandler.handleMessageEvent(_private.chatBarCache);
|
||||
repeatTimer.stop()
|
||||
repeatTimer.stop();
|
||||
root.currentRoom.markAllMessagesAsRead();
|
||||
textField.clear();
|
||||
_private.chatBarCache.replyId = "";
|
||||
messageSent()
|
||||
messageSent();
|
||||
}
|
||||
|
||||
function formatText(format, selectionStart, selectionEnd) {
|
||||
@@ -386,21 +389,19 @@ QQC2.Control {
|
||||
*/
|
||||
let innerText = textField.text.substr(selectionStart, selectionEnd - selectionStart);
|
||||
if (innerText.charAt(innerText.length - 1) === " ") {
|
||||
let trimmedRightString = innerText.replace(/\s*$/,"");
|
||||
let trimmedRightString = innerText.replace(/\s*$/, "");
|
||||
let trimDifference = innerText.length - trimmedRightString.length;
|
||||
selectionEnd -= trimDifference;
|
||||
}
|
||||
if (innerText.charAt(0) === " ") {
|
||||
let trimmedLeftString = innerText.replace(/^\s*/,"");
|
||||
let trimmedLeftString = innerText.replace(/^\s*/, "");
|
||||
let trimDifference = innerText.length - trimmedLeftString.length;
|
||||
selectionStart = selectionStart + trimDifference;
|
||||
}
|
||||
|
||||
let startText = textField.text.substr(0, selectionStart);
|
||||
// Needs updating with the new selectionStart and selectionEnd with white space trimmed.
|
||||
innerText = textField.text.substr(selectionStart, selectionEnd - selectionStart);
|
||||
let endText = textField.text.substr(selectionEnd);
|
||||
|
||||
textField.text = "";
|
||||
textField.text = startText + format.start + innerText + format.end + format.extra + endText;
|
||||
|
||||
@@ -495,13 +496,14 @@ QQC2.Control {
|
||||
currentRoom: root.currentRoom
|
||||
|
||||
onChosen: emoji => insertText(emoji)
|
||||
onClosed: if (emojiAction.checked) emojiAction.checked = false
|
||||
onClosed: if (emojiAction.checked) {
|
||||
emojiAction.checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
function insertText(text) {
|
||||
let initialCursorPosition = textField.cursorPosition;
|
||||
|
||||
textField.text = textField.text.substr(0, initialCursorPosition) + text + textField.text.substr(initialCursorPosition)
|
||||
textField.cursorPosition = initialCursorPosition + text.length
|
||||
textField.text = textField.text.substr(0, initialCursorPosition) + text + textField.text.substr(initialCursorPosition);
|
||||
textField.cursorPosition = initialCursorPosition + text.length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ Kirigami.ScrollablePage {
|
||||
id: roomDelegate
|
||||
filterText: ""
|
||||
onSelected: {
|
||||
root.chosen(roomDelegate.currentRoom.id)
|
||||
root.chosen(roomDelegate.currentRoom.id);
|
||||
}
|
||||
connection: root.connection
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ FormCard.FormComboBoxDelegate {
|
||||
textRole: "display"
|
||||
valueRole: "display"
|
||||
model: ColorSchemer.model
|
||||
Component.onCompleted: currentIndex = ColorSchemer.indexForScheme(Config.colorScheme);
|
||||
Component.onCompleted: currentIndex = ColorSchemer.indexForScheme(Config.colorScheme)
|
||||
onCurrentValueChanged: {
|
||||
ColorSchemer.apply(currentIndex);
|
||||
Config.colorScheme = ColorSchemer.nameForIndex(currentIndex);
|
||||
|
||||
@@ -21,7 +21,9 @@ QQC2.Popup {
|
||||
|
||||
visible: completions.count > 0
|
||||
|
||||
onVisibleChanged: if (visible) root.open()
|
||||
onVisibleChanged: if (visible) {
|
||||
root.open();
|
||||
}
|
||||
|
||||
RoomListModel {
|
||||
id: roomListModel
|
||||
@@ -33,15 +35,15 @@ QQC2.Popup {
|
||||
}
|
||||
|
||||
function incrementIndex() {
|
||||
completions.incrementCurrentIndex()
|
||||
completions.incrementCurrentIndex();
|
||||
}
|
||||
|
||||
function decrementIndex() {
|
||||
completions.decrementCurrentIndex()
|
||||
completions.decrementCurrentIndex();
|
||||
}
|
||||
|
||||
function complete() {
|
||||
root.chatDocumentHandler.complete(completions.currentIndex)
|
||||
root.chatDocumentHandler.complete(completions.currentIndex);
|
||||
}
|
||||
|
||||
leftPadding: 0
|
||||
|
||||
@@ -35,8 +35,8 @@ FormCard.FormCardPage {
|
||||
icon.name: "emblem-warning"
|
||||
enabled: passwordField.text.length > 0
|
||||
onClicked: {
|
||||
root.connection.deactivateAccount(passwordField.text)
|
||||
root.closeDialog()
|
||||
root.connection.deactivateAccount(passwordField.text);
|
||||
root.closeDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ QQC2.Dialog {
|
||||
text: i18n("Activate Encryption")
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
||||
onClicked: {
|
||||
root.room.activateEncryption()
|
||||
root.room.activateEncryption();
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ Loader {
|
||||
property NeoChatRoom room
|
||||
required property NeoChatConnection connection
|
||||
|
||||
signal closed()
|
||||
signal closed
|
||||
|
||||
Component {
|
||||
id: regularMenu
|
||||
@@ -30,7 +30,7 @@ Loader {
|
||||
id: newWindow
|
||||
text: i18n("Open in New Window")
|
||||
icon.name: "window-new"
|
||||
onTriggered: RoomManager.openWindow(room);
|
||||
onTriggered: RoomManager.openWindow(room)
|
||||
visible: !Kirigami.Settings.isMobile
|
||||
}
|
||||
|
||||
@@ -60,11 +60,11 @@ Loader {
|
||||
text: room.isDirectChat() ? i18nc("@action:inmenu", "Copy user's Matrix ID to Clipboard") : i18nc("@action:inmenu", "Copy Address to Clipboard")
|
||||
icon.name: "edit-copy"
|
||||
onTriggered: if (room.isDirectChat()) {
|
||||
Clipboard.saveText(room.directChatRemoteUser.id)
|
||||
Clipboard.saveText(room.directChatRemoteUser.id);
|
||||
} else if (room.canonicalAlias.length === 0) {
|
||||
Clipboard.saveText(room.id)
|
||||
Clipboard.saveText(room.id);
|
||||
} else {
|
||||
Clipboard.saveText(room.canonicalAlias)
|
||||
Clipboard.saveText(room.canonicalAlias);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,40 +80,40 @@ Loader {
|
||||
checked: room.pushNotificationState === PushNotificationState.Default
|
||||
enabled: room.pushNotificationState != PushNotificationState.Unknown
|
||||
onTriggered: {
|
||||
room.pushNotificationState = PushNotificationState.Default
|
||||
room.pushNotificationState = PushNotificationState.Default;
|
||||
}
|
||||
}
|
||||
QQC2.MenuItem {
|
||||
text: i18nc("As in 'notify for all messages'","All")
|
||||
text: i18nc("As in 'notify for all messages'", "All")
|
||||
icon.name: "notifications"
|
||||
checkable: true
|
||||
autoExclusive: true
|
||||
checked: room.pushNotificationState === PushNotificationState.All
|
||||
enabled: room.pushNotificationState != PushNotificationState.Unknown
|
||||
onTriggered: {
|
||||
room.pushNotificationState = PushNotificationState.All
|
||||
room.pushNotificationState = PushNotificationState.All;
|
||||
}
|
||||
}
|
||||
QQC2.MenuItem {
|
||||
text: i18nc("As in 'notify when the user is mentioned or the message contains a set keyword'","@Mentions and Keywords")
|
||||
text: i18nc("As in 'notify when the user is mentioned or the message contains a set keyword'", "@Mentions and Keywords")
|
||||
icon.name: "im-user"
|
||||
checkable: true
|
||||
autoExclusive: true
|
||||
checked: room.pushNotificationState === PushNotificationState.MentionKeyword
|
||||
enabled: room.pushNotificationState != PushNotificationState.Unknown
|
||||
onTriggered: {
|
||||
room.pushNotificationState = PushNotificationState.MentionKeyword
|
||||
room.pushNotificationState = PushNotificationState.MentionKeyword;
|
||||
}
|
||||
}
|
||||
QQC2.MenuItem {
|
||||
text: i18nc("As in 'do not notify for any messages'","Off")
|
||||
text: i18nc("As in 'do not notify for any messages'", "Off")
|
||||
icon.name: "notifications-disabled"
|
||||
checkable: true
|
||||
autoExclusive: true
|
||||
checked: room.pushNotificationState === PushNotificationState.Mute
|
||||
enabled: room.pushNotificationState != PushNotificationState.Unknown
|
||||
onTriggered: {
|
||||
room.pushNotificationState = PushNotificationState.Mute
|
||||
room.pushNotificationState = PushNotificationState.Mute;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,12 @@ Loader {
|
||||
QQC2.MenuItem {
|
||||
text: i18n("Room Settings")
|
||||
icon.name: "configure"
|
||||
onTriggered: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {room: room, connection: connection}, { title: i18n("Room Settings") })
|
||||
onTriggered: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
room: room,
|
||||
connection: connection
|
||||
}, {
|
||||
title: i18n("Room Settings")
|
||||
})
|
||||
}
|
||||
|
||||
QQC2.MenuSeparator {}
|
||||
@@ -133,7 +138,7 @@ Loader {
|
||||
}
|
||||
|
||||
onClosed: {
|
||||
root.closed()
|
||||
root.closed();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,8 +195,13 @@ Loader {
|
||||
QQC2.ToolButton {
|
||||
icon.name: 'settings-configure'
|
||||
onClicked: {
|
||||
QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {room: room, connection: root.connection}, { title: i18n("Room Settings") })
|
||||
drawer.close()
|
||||
QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
room: room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Room Settings")
|
||||
});
|
||||
drawer.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -214,8 +224,8 @@ Loader {
|
||||
text: i18n("Leave Room")
|
||||
icon.name: "go-previous"
|
||||
onClicked: {
|
||||
RoomManager.leaveRoom(room)
|
||||
drawer.close()
|
||||
RoomManager.leaveRoom(room);
|
||||
drawer.close();
|
||||
}
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
@@ -49,22 +49,30 @@ FormCard.FormCardPage {
|
||||
valueRole: "isSpace"
|
||||
|
||||
Component.onCompleted: {
|
||||
currentIndex = indexOfValue(root.isSpace)
|
||||
roomTypeModel.append({"text": i18n("Room"), "isSpace": false});
|
||||
roomTypeModel.append({"text": i18n("Space"), "isSpace": true});
|
||||
roomTypeCombo.currentIndex = 0
|
||||
roomTypeCombo.isInitialising = false
|
||||
currentIndex = indexOfValue(root.isSpace);
|
||||
roomTypeModel.append({
|
||||
"text": i18n("Room"),
|
||||
"isSpace": false
|
||||
});
|
||||
roomTypeModel.append({
|
||||
"text": i18n("Space"),
|
||||
"isSpace": true
|
||||
});
|
||||
roomTypeCombo.currentIndex = 0;
|
||||
roomTypeCombo.isInitialising = false;
|
||||
}
|
||||
onCurrentValueChanged: {
|
||||
if (!isInitialising) {
|
||||
root.isSpace = currentValue
|
||||
root.isSpace = currentValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: roomNameField
|
||||
label: i18n("Name:")
|
||||
onAccepted: if (roomNameField.text.length > 0) roomTopicField.forceActiveFocus();
|
||||
onAccepted: if (roomNameField.text.length > 0) {
|
||||
roomTopicField.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormTextFieldDelegate {
|
||||
@@ -88,8 +96,8 @@ FormCard.FormCardPage {
|
||||
} else {
|
||||
root.connection.createRoom(roomNameField.text, roomTopicField.text, root.parentId, newOfficialCheck.checked);
|
||||
}
|
||||
root.newChild(roomNameField.text)
|
||||
root.closeDialog()
|
||||
root.newChild(roomNameField.text);
|
||||
root.closeDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +111,11 @@ FormCard.FormCardPage {
|
||||
visible: !chosenRoomDelegate.visible
|
||||
text: i18nc("@action:button", "Pick room")
|
||||
onClicked: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.connection}, {title: i18nc("@title", "Explore Rooms")})
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
});
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
chosenRoomDelegate.roomId = roomId;
|
||||
chosenRoomDelegate.displayName = displayName;
|
||||
@@ -113,7 +125,7 @@ FormCard.FormCardPage {
|
||||
chosenRoomDelegate.memberCount = memberCount;
|
||||
chosenRoomDelegate.isJoined = isJoined;
|
||||
chosenRoomDelegate.visible = true;
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
FormCard.AbstractFormDelegate {
|
||||
@@ -158,7 +170,7 @@ FormCard.FormCardPage {
|
||||
QQC2.Label {
|
||||
Layout.fillWidth: true
|
||||
visible: text
|
||||
text: chosenRoomDelegate.topic ? chosenRoomDelegate.topic.replace(/(\r\n\t|\n|\r\t)/gm," ") : ""
|
||||
text: chosenRoomDelegate.topic ? chosenRoomDelegate.topic.replace(/(\r\n\t|\n|\r\t)/gm, " ") : ""
|
||||
textFormat: Text.PlainText
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
@@ -182,7 +194,11 @@ FormCard.FormCardPage {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.connection}, {title: i18nc("@title", "Explore Rooms")})
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
});
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
chosenRoomDelegate.roomId = roomId;
|
||||
chosenRoomDelegate.displayName = displayName;
|
||||
@@ -192,7 +208,7 @@ FormCard.FormCardPage {
|
||||
chosenRoomDelegate.memberCount = memberCount;
|
||||
chosenRoomDelegate.isJoined = isJoined;
|
||||
chosenRoomDelegate.visible = true;
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
|
||||
@@ -68,7 +68,7 @@ FormCard.AbstractFormDelegate {
|
||||
text: i18n("Cancel editing display name")
|
||||
icon.name: "edit-delete-remove"
|
||||
onTriggered: {
|
||||
root.editDeviceName = false
|
||||
root.editDeviceName = false;
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
@@ -76,7 +76,7 @@ FormCard.AbstractFormDelegate {
|
||||
icon.name: "checkmark"
|
||||
visible: nameField.text !== root.displayName
|
||||
onTriggered: {
|
||||
devicesModel.setName(root.id, nameField.text)
|
||||
devicesModel.setName(root.id, nameField.text);
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -104,7 +104,7 @@ FormCard.AbstractFormDelegate {
|
||||
text: i18n("Verify device")
|
||||
icon.name: "security-low-symbolic"
|
||||
onTriggered: {
|
||||
devicesModel.connection.startKeyVerificationSession(devicesModel.connection.localUserId, root.id)
|
||||
devicesModel.connection.startKeyVerificationSession(devicesModel.connection.localUserId, root.id);
|
||||
}
|
||||
}
|
||||
QQC2.ToolTip {
|
||||
@@ -119,8 +119,8 @@ FormCard.AbstractFormDelegate {
|
||||
text: i18n("Logout device")
|
||||
icon.name: "edit-delete-remove"
|
||||
onTriggered: {
|
||||
passwordSheet.deviceId = root.id
|
||||
passwordSheet.open()
|
||||
passwordSheet.deviceId = root.id;
|
||||
passwordSheet.open();
|
||||
}
|
||||
}
|
||||
QQC2.ToolTip {
|
||||
|
||||
@@ -44,6 +44,3 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ FormCard.FormCardPage {
|
||||
FormCard.AbstractFormDelegate {
|
||||
Layout.fillWidth: true
|
||||
visible: root.connection && devicesModel.count === 0 // We can assume 0 means loading since there is at least one device
|
||||
contentItem: Kirigami.LoadingPlaceholder { }
|
||||
contentItem: Kirigami.LoadingPlaceholder {}
|
||||
}
|
||||
|
||||
Kirigami.InlineMessage {
|
||||
@@ -87,9 +87,9 @@ FormCard.FormCardPage {
|
||||
text: i18nc("As in 'Remove this device'", "Remove")
|
||||
icon.name: "delete"
|
||||
onTriggered: {
|
||||
devicesModel.logout(passwordSheet.deviceId, passwordField.text)
|
||||
passwordField.text = ""
|
||||
passwordSheet.close()
|
||||
devicesModel.logout(passwordSheet.deviceId, passwordField.text);
|
||||
passwordField.text = "";
|
||||
passwordSheet.close();
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -33,12 +33,12 @@ ColumnLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
onClicked: {
|
||||
RoomManager.resolveResource(root.room.directChatRemoteUser.id, "mention")
|
||||
RoomManager.resolveResource(root.room.directChatRemoteUser.id, "mention");
|
||||
}
|
||||
|
||||
contentItem: KirigamiComponents.Avatar {
|
||||
name: root.room ? root.room.displayName : ""
|
||||
source: root.room ? ("image://mxc/" + root.room.avatarMediaId) : ""
|
||||
source: root.room ? ("image://mxc/" + root.room.avatarMediaId) : ""
|
||||
|
||||
Rectangle {
|
||||
visible: root.room.usesEncryption
|
||||
|
||||
@@ -15,8 +15,8 @@ Labs.Menu {
|
||||
text: i18nc("text editing menu action", "Undo")
|
||||
shortcut: StandardKey.Undo
|
||||
onTriggered: {
|
||||
root.field.undo()
|
||||
root.close()
|
||||
root.field.undo();
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,21 +25,20 @@ Labs.Menu {
|
||||
text: i18nc("text editing menu action", "Redo")
|
||||
shortcut: StandardKey.Redo
|
||||
onTriggered: {
|
||||
root.field.undo()
|
||||
root.close()
|
||||
root.field.undo();
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
Labs.MenuSeparator {
|
||||
}
|
||||
Labs.MenuSeparator {}
|
||||
|
||||
Labs.MenuItem {
|
||||
enabled: root.field !== null && root.field.selectedText
|
||||
text: i18nc("text editing menu action", "Cut")
|
||||
shortcut: StandardKey.Cut
|
||||
onTriggered: {
|
||||
root.field.cut()
|
||||
root.close()
|
||||
root.field.cut();
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +47,8 @@ Labs.Menu {
|
||||
text: i18nc("text editing menu action", "Copy")
|
||||
shortcut: StandardKey.Copy
|
||||
onTriggered: {
|
||||
root.field.copy()
|
||||
root.close()
|
||||
root.field.copy();
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +57,8 @@ Labs.Menu {
|
||||
text: i18nc("text editing menu action", "Paste")
|
||||
shortcut: StandardKey.Paste
|
||||
onTriggered: {
|
||||
root.field.paste()
|
||||
root.close()
|
||||
root.field.paste();
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,21 +67,20 @@ Labs.Menu {
|
||||
text: i18nc("text editing menu action", "Delete")
|
||||
shortcut: ""
|
||||
onTriggered: {
|
||||
root.field.remove(root.field.selectionStart, root.field.selectionEnd)
|
||||
root.close()
|
||||
root.field.remove(root.field.selectionStart, root.field.selectionEnd);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
Labs.MenuSeparator {
|
||||
}
|
||||
Labs.MenuSeparator {}
|
||||
|
||||
Labs.MenuItem {
|
||||
enabled: root.field !== null
|
||||
text: i18nc("text editing menu action", "Select All")
|
||||
shortcut: StandardKey.SelectAll
|
||||
onTriggered: {
|
||||
root.field.selectAll()
|
||||
root.close()
|
||||
root.field.selectAll();
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@ import org.kde.neochat
|
||||
LoginStep {
|
||||
id: root
|
||||
|
||||
onActiveFocusChanged: if (activeFocus) emailField.forceActiveFocus()
|
||||
onActiveFocusChanged: if (activeFocus) {
|
||||
emailField.forceActiveFocus();
|
||||
}
|
||||
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: emailField
|
||||
@@ -21,7 +23,7 @@ LoginStep {
|
||||
onTextChanged: Registration.email = text
|
||||
Keys.onReturnPressed: {
|
||||
if (root.nextAction.enabled) {
|
||||
root.nextAction.trigger()
|
||||
root.nextAction.trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,11 +46,11 @@ LoginStep {
|
||||
enabled: emailField.text.length > 0
|
||||
onTriggered: {
|
||||
if (confirmMessage.visible) {
|
||||
Registration.registerAccount()
|
||||
Registration.registerAccount();
|
||||
} else {
|
||||
Registration.registerEmail()
|
||||
confirmMessage.visible = true
|
||||
resendButton.visible = true
|
||||
Registration.registerEmail();
|
||||
confirmMessage.visible = true;
|
||||
resendButton.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,16 +25,16 @@ QQC2.Popup {
|
||||
Connections {
|
||||
target: RoomManager
|
||||
function onCurrentRoomChanged() {
|
||||
root.close()
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!visible) {
|
||||
emojiPicker.clearSearchField()
|
||||
return
|
||||
emojiPicker.clearSearchField();
|
||||
return;
|
||||
}
|
||||
emojiPicker.forceActiveFocus()
|
||||
emojiPicker.forceActiveFocus();
|
||||
}
|
||||
|
||||
background: Kirigami.ShadowedRectangle {
|
||||
@@ -68,8 +68,10 @@ QQC2.Popup {
|
||||
includeCustom: root.includeCustom
|
||||
showQuickReaction: root.showQuickReaction
|
||||
onChosen: emoji => {
|
||||
root.chosen(emoji)
|
||||
if (root.closeOnChosen) root.close()
|
||||
root.chosen(emoji);
|
||||
if (root.closeOnChosen) {
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ QQC2.ScrollView {
|
||||
signal stickerChosen(int index)
|
||||
|
||||
onActiveFocusChanged: if (activeFocus) {
|
||||
emojis.forceActiveFocus()
|
||||
emojis.forceActiveFocus();
|
||||
}
|
||||
|
||||
GridView {
|
||||
@@ -34,9 +34,9 @@ QQC2.ScrollView {
|
||||
currentIndex: -1
|
||||
keyNavigationEnabled: true
|
||||
onActiveFocusChanged: if (activeFocus && currentIndex === -1) {
|
||||
currentIndex = 0
|
||||
currentIndex = 0;
|
||||
} else {
|
||||
currentIndex = -1
|
||||
currentIndex = -1;
|
||||
}
|
||||
onModelChanged: currentIndex = -1
|
||||
|
||||
@@ -61,19 +61,23 @@ QQC2.ScrollView {
|
||||
Keys.onReturnPressed: clicked()
|
||||
onClicked: {
|
||||
if (root.stickers) {
|
||||
root.stickerChosen(model.index)
|
||||
root.stickerChosen(model.index);
|
||||
}
|
||||
root.chosen(modelData.isCustom ? modelData.shortName : modelData.unicode)
|
||||
EmojiModel.emojiUsed(modelData)
|
||||
root.chosen(modelData.isCustom ? modelData.shortName : modelData.unicode);
|
||||
EmojiModel.emojiUsed(modelData);
|
||||
}
|
||||
Keys.onSpacePressed: pressAndHold()
|
||||
onPressAndHold: {
|
||||
if (EmojiModel.tones(modelData.shortName).length === 0) {
|
||||
return;
|
||||
}
|
||||
let tones = tonesPopupComponent.createObject(emojiDelegate, {shortName: modelData.shortName, unicode: modelData.unicode, categoryIconSize: root.targetIconSize})
|
||||
tones.open()
|
||||
tones.forceActiveFocus()
|
||||
let tones = tonesPopupComponent.createObject(emojiDelegate, {
|
||||
shortName: modelData.shortName,
|
||||
unicode: modelData.unicode,
|
||||
categoryIconSize: root.targetIconSize
|
||||
});
|
||||
tones.open();
|
||||
tones.forceActiveFocus();
|
||||
}
|
||||
showTones: !!modelData && EmojiModel.tones(modelData.shortName).length > 0
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ ColumnLayout {
|
||||
|
||||
readonly property var currentEmojiModel: {
|
||||
if (includeCustom) {
|
||||
EmojiModel.categoriesWithCustom
|
||||
EmojiModel.categoriesWithCustom;
|
||||
} else {
|
||||
EmojiModel.categories
|
||||
EmojiModel.categories;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +73,12 @@ ColumnLayout {
|
||||
focus: true
|
||||
orientation: ListView.Horizontal
|
||||
|
||||
Keys.onReturnPressed: if (emojiGrid.count > 0) emojiGrid.focus = true
|
||||
Keys.onEnterPressed: if (emojiGrid.count > 0) emojiGrid.focus = true
|
||||
Keys.onReturnPressed: if (emojiGrid.count > 0) {
|
||||
emojiGrid.focus = true;
|
||||
}
|
||||
Keys.onEnterPressed: if (emojiGrid.count > 0) {
|
||||
emojiGrid.focus = true;
|
||||
}
|
||||
|
||||
KeyNavigation.down: emojiGrid.count > 0 ? emojiGrid : categories
|
||||
KeyNavigation.tab: emojiGrid.count > 0 ? emojiGrid : categories
|
||||
@@ -208,6 +212,6 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
function clearSearchField() {
|
||||
searchField.text = ""
|
||||
searchField.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ Column {
|
||||
|
||||
required property var model
|
||||
|
||||
signal accept()
|
||||
signal reject()
|
||||
signal accept
|
||||
signal reject
|
||||
|
||||
visible: dialog.session.state === KeyVerificationSession.WAITINGFORVERIFICATION
|
||||
anchors.centerIn: parent
|
||||
@@ -46,7 +46,7 @@ Column {
|
||||
anchors.bottom: parent.bottom
|
||||
text: i18n("They don't match")
|
||||
icon.name: "dialog-cancel"
|
||||
onClicked: root.reject()
|
||||
onClicked: root.reject()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,9 +63,9 @@ QQC2.Popup {
|
||||
Keys.onEnterPressed: clicked()
|
||||
Keys.onReturnPressed: clicked()
|
||||
onClicked: {
|
||||
root.chosen(modelData.unicode)
|
||||
EmojiModel.emojiUsed(modelData)
|
||||
root.close()
|
||||
root.chosen(modelData.unicode);
|
||||
EmojiModel.emojiUsed(modelData);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ FormCard.FormCardPage {
|
||||
property bool newEmoticon: false
|
||||
required property var emoticonType
|
||||
|
||||
title: emoticonType === EmoticonFormCard.Stickers ? (newEmoticon ? i18nc("@title", "Add Sticker") : i18nc("@title", "Edit Sticker"))
|
||||
: (newEmoticon ? i18nc("@title", "Add Emoji") : i18nc("@title", "Edit Emoji"))
|
||||
title: emoticonType === EmoticonFormCard.Stickers ? (newEmoticon ? i18nc("@title", "Add Sticker") : i18nc("@title", "Edit Sticker")) : (newEmoticon ? i18nc("@title", "Add Emoji") : i18nc("@title", "Edit Emoji"))
|
||||
|
||||
FormCard.FormHeader {
|
||||
title: emoticonType === EmoticonFormCard.Stickers ? i18n("Sticker") : i18n("Emoji")
|
||||
@@ -67,23 +66,22 @@ FormCard.FormCardPage {
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
property var fileDialog: null;
|
||||
property var fileDialog: null
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
|
||||
onClicked: {
|
||||
if (fileDialog != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
fileDialog = openFileDialog.createObject(QQC2.ApplicationWindow.Overlay)
|
||||
fileDialog.chosen.connect(function(receivedSource) {
|
||||
fileDialog = openFileDialog.createObject(QQC2.ApplicationWindow.Overlay);
|
||||
fileDialog.chosen.connect(function (receivedSource) {
|
||||
mouseArea.fileDialog = null;
|
||||
if (!receivedSource) {
|
||||
return;
|
||||
}
|
||||
parent.source = receivedSource;
|
||||
});
|
||||
fileDialog.onRejected.connect(function() {
|
||||
fileDialog.onRejected.connect(function () {
|
||||
mouseArea.fileDialog = null;
|
||||
});
|
||||
fileDialog.open();
|
||||
@@ -112,19 +110,19 @@ FormCard.FormCardPage {
|
||||
enabled: !root.newEmoticon || (image.source.toString().length > 0 && shortcode.text && description.text)
|
||||
onClicked: {
|
||||
if (root.newEmoticon) {
|
||||
model.addEmoticon(image.source, shortcode.text, description.text, emoticonType === EmoticonFormCard.Stickers ? "sticker" : "emoticon")
|
||||
model.addEmoticon(image.source, shortcode.text, description.text, emoticonType === EmoticonFormCard.Stickers ? "sticker" : "emoticon");
|
||||
} else {
|
||||
if (description.text !== root.description) {
|
||||
root.model.setEmoticonBody(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, description.text)
|
||||
root.model.setEmoticonBody(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, description.text);
|
||||
}
|
||||
if (shortcode.text !== root.shortcode) {
|
||||
root.model.setEmoticonShortcode(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, shortcode.text)
|
||||
root.model.setEmoticonShortcode(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, shortcode.text);
|
||||
}
|
||||
if (image.source + "" !== root.url) {
|
||||
root.model.setEmoticonImage(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, image.source)
|
||||
root.model.setEmoticonImage(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, image.source);
|
||||
}
|
||||
}
|
||||
root.closeDialog()
|
||||
root.closeDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ FormCard.FormCard {
|
||||
emoticonType: root.emoticonType
|
||||
}, {
|
||||
title: root.emoticonType === EmoticonFormCard.Emojis ? i18nc("@title", "Edit Emoji") : i18nc("@title", "Edit Sticker")
|
||||
});
|
||||
})
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
Image {
|
||||
@@ -101,7 +101,7 @@ FormCard.FormCard {
|
||||
emoticonType: root.emoticonType
|
||||
}, {
|
||||
title: root.emoticonType === EmoticonFormCard.Emojis ? i18nc("@title", "Add Emoji") : i18nc("@title", "Add Sticker")
|
||||
});
|
||||
})
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
Kirigami.Icon {
|
||||
|
||||
@@ -31,7 +31,6 @@ FormCard.FormCardPage {
|
||||
connection: root.connection
|
||||
}
|
||||
|
||||
|
||||
property Component emoticonEditorPage: Component {
|
||||
id: emoticonEditorPage
|
||||
EmoticonEditorPage {}
|
||||
|
||||
@@ -21,22 +21,34 @@ RowLayout {
|
||||
text: i18n("Explore rooms")
|
||||
icon.name: "compass"
|
||||
onTriggered: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.connection}, {title: i18nc("@title", "Explore Rooms")})
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
});
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join")
|
||||
})
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join");
|
||||
});
|
||||
}
|
||||
}
|
||||
property Kirigami.Action chatAction: Kirigami.Action {
|
||||
text: i18n("Find your friends")
|
||||
icon.name: "list-add-user"
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {connection: root.connection}, {title: i18nc("@title", "Find your friends")})
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
})
|
||||
}
|
||||
property Kirigami.Action roomAction: Kirigami.Action {
|
||||
text: i18n("Create a Room")
|
||||
icon.name: "system-users-symbolic"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {connection: root.connection}, {title: i18nc("@title", "Create a Room")})
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Create a Room")
|
||||
});
|
||||
}
|
||||
shortcut: StandardKey.New
|
||||
}
|
||||
@@ -44,7 +56,13 @@ RowLayout {
|
||||
text: i18n("Create a Space")
|
||||
icon.name: "list-add"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {connection: root.connection, isSpace: true, title: i18nc("@title", "Create a Space")}, {title: i18nc("@title", "Create a Space")})
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
connection: root.connection,
|
||||
isSpace: true,
|
||||
title: i18nc("@title", "Create a Space")
|
||||
}, {
|
||||
title: i18nc("@title", "Create a Space")
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +90,7 @@ RowLayout {
|
||||
menu.open();
|
||||
} else {
|
||||
const menu = desktopMenu.createObject(menuButton);
|
||||
menu.closed.connect(menuButton.toggle)
|
||||
menu.closed.connect(menuButton.toggle);
|
||||
menu.open();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,10 +52,14 @@ ColumnLayout {
|
||||
text: i18n("Explore rooms")
|
||||
icon.name: "compass"
|
||||
onTriggered: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.connection}, {title: i18nc("@title", "Explore Rooms")})
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
});
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join")
|
||||
})
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join");
|
||||
});
|
||||
exploreTabBar.currentIndex = -1;
|
||||
}
|
||||
},
|
||||
@@ -63,7 +67,11 @@ ColumnLayout {
|
||||
text: i18n("Find your friends")
|
||||
icon.name: "list-add-user"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {connection: root.connection}, {title: i18nc("@title", "Find your friends")})
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
});
|
||||
exploreTabBar.currentIndex = -1;
|
||||
}
|
||||
},
|
||||
@@ -132,8 +140,12 @@ ColumnLayout {
|
||||
text: i18n("Create a Room")
|
||||
icon.name: "system-users-symbolic"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {connection: root.connection}, {title: i18nc("@title", "Create a Room")})
|
||||
explorePopup.close()
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Create a Room")
|
||||
});
|
||||
explorePopup.close();
|
||||
}
|
||||
shortcut: StandardKey.New
|
||||
}
|
||||
@@ -144,8 +156,14 @@ ColumnLayout {
|
||||
text: i18n("Create a Space")
|
||||
icon.name: "list-add"
|
||||
onTriggered: {
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {connection: root.connection, isSpace: true, title: i18nc("@title", "Create a Space")}, {title: i18nc("@title", "Create a Space")})
|
||||
explorePopup.close()
|
||||
pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/CreateRoomDialog.qml", {
|
||||
connection: root.connection,
|
||||
isSpace: true,
|
||||
title: i18nc("@title", "Create a Space")
|
||||
}, {
|
||||
title: i18nc("@title", "Create a Space")
|
||||
});
|
||||
explorePopup.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,13 +41,7 @@ SearchPage {
|
||||
* upon as required, e.g. joining or entering the room or adding the room as
|
||||
* the child of a space.
|
||||
*/
|
||||
signal roomSelected(string roomId,
|
||||
string displayName,
|
||||
url avatarUrl,
|
||||
string alias,
|
||||
string topic,
|
||||
int memberCount,
|
||||
bool isJoined)
|
||||
signal roomSelected(string roomId, string displayName, url avatarUrl, string alias, string topic, int memberCount, bool isJoined)
|
||||
|
||||
title: i18nc("@action:title", "Explore Rooms")
|
||||
|
||||
@@ -101,7 +95,9 @@ SearchPage {
|
||||
QtObject {
|
||||
id: _private
|
||||
function openManualRoomDialog() {
|
||||
let dialog = manualRoomDialog.createObject(applicationWindow().overlay, {connection: root.connection});
|
||||
let dialog = manualRoomDialog.createObject(applicationWindow().overlay, {
|
||||
connection: root.connection
|
||||
});
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
root.roomSelected(roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined);
|
||||
root.closeDialog();
|
||||
|
||||
@@ -30,25 +30,13 @@ Delegates.RoundedItemDelegate {
|
||||
* upon as required, e.g. joining or entering the room or adding the room as
|
||||
* the child of a space.
|
||||
*/
|
||||
signal roomSelected(string roomId,
|
||||
string displayName,
|
||||
url avatarUrl,
|
||||
string alias,
|
||||
string topic,
|
||||
int memberCount,
|
||||
bool isJoined)
|
||||
signal roomSelected(string roomId, string displayName, url avatarUrl, string alias, string topic, int memberCount, bool isJoined)
|
||||
|
||||
onClicked: {
|
||||
if (!isJoined) {
|
||||
justJoined = true;
|
||||
}
|
||||
root.roomSelected(root.roomId,
|
||||
root.displayName,
|
||||
root.avatarUrl,
|
||||
root.alias,
|
||||
root.topic,
|
||||
root.memberCount,
|
||||
root.isJoined)
|
||||
root.roomSelected(root.roomId, root.displayName, root.avatarUrl, root.alias, root.topic, root.memberCount, root.isJoined);
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
@@ -85,7 +73,7 @@ Delegates.RoundedItemDelegate {
|
||||
QQC2.Label {
|
||||
Layout.fillWidth: true
|
||||
visible: text
|
||||
text: root.topic ? root.topic.replace(/(\r\n\t|\n|\r\t)/gm," ") : ""
|
||||
text: root.topic ? root.topic.replace(/(\r\n\t|\n|\r\t)/gm, " ") : ""
|
||||
textFormat: Text.PlainText
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
|
||||
@@ -10,33 +10,33 @@ import org.kde.kirigami as Kirigami
|
||||
Item {
|
||||
id: root
|
||||
property bool enabled: false
|
||||
property int effectInterval: Kirigami.Units.veryLongDuration*10;
|
||||
property int effectInterval: Kirigami.Units.veryLongDuration * 10
|
||||
property color darkSnowColor: "grey"
|
||||
property bool isThemeDark: Kirigami.Theme.backgroundColor.hslLightness <= darkSnowColor.hslLightness
|
||||
|
||||
function showConfettiEffect() {
|
||||
confettiTimer.start()
|
||||
confettiTimer.start();
|
||||
}
|
||||
|
||||
function showSnowEffect() {
|
||||
snowTimer.start()
|
||||
snowTimer.start();
|
||||
}
|
||||
|
||||
function showFireworksEffect() {
|
||||
fireworksTimer.start()
|
||||
fireworksTimer.start();
|
||||
}
|
||||
|
||||
// Confetti
|
||||
|
||||
Timer {
|
||||
id: confettiTimer
|
||||
interval: root.effectInterval;
|
||||
running: false;
|
||||
repeat: false;
|
||||
triggeredOnStart: true;
|
||||
interval: root.effectInterval
|
||||
running: false
|
||||
repeat: false
|
||||
triggeredOnStart: true
|
||||
onTriggered: {
|
||||
if (root.enabled) {
|
||||
confettiSystem.running = !confettiSystem.running
|
||||
confettiSystem.running = !confettiSystem.running;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,15 +48,17 @@ Item {
|
||||
running: false
|
||||
onRunningChanged: {
|
||||
if (running) {
|
||||
opacity = 1
|
||||
opacity = 1;
|
||||
} else {
|
||||
opacity = 0
|
||||
opacity = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on opacity {
|
||||
SequentialAnimation {
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration }
|
||||
NumberAnimation {
|
||||
duration: Kirigami.Units.longDuration
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,8 +78,8 @@ Item {
|
||||
top: parent.top
|
||||
}
|
||||
|
||||
sizeVariation: Kirigami.Units.iconSizes.small/2
|
||||
lifeSpan: Kirigami.Units.veryLongDuration*10
|
||||
sizeVariation: Kirigami.Units.iconSizes.small / 2
|
||||
lifeSpan: Kirigami.Units.veryLongDuration * 10
|
||||
size: Kirigami.Units.iconSizes.small
|
||||
|
||||
velocity: AngleDirection {
|
||||
@@ -92,13 +94,13 @@ Item {
|
||||
|
||||
Timer {
|
||||
id: snowTimer
|
||||
interval: root.effectInterval;
|
||||
running: false;
|
||||
repeat: false;
|
||||
triggeredOnStart: true;
|
||||
interval: root.effectInterval
|
||||
running: false
|
||||
repeat: false
|
||||
triggeredOnStart: true
|
||||
onTriggered: {
|
||||
if (root.enabled) {
|
||||
snowSystem.running = !snowSystem.running
|
||||
snowSystem.running = !snowSystem.running;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,15 +112,17 @@ Item {
|
||||
running: false
|
||||
onRunningChanged: {
|
||||
if (running) {
|
||||
opacity = 1
|
||||
opacity = 1;
|
||||
} else {
|
||||
opacity = 0
|
||||
opacity = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on opacity {
|
||||
SequentialAnimation {
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration }
|
||||
NumberAnimation {
|
||||
duration: Kirigami.Units.longDuration
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +145,7 @@ Item {
|
||||
}
|
||||
|
||||
sizeVariation: Kirigami.Units.iconSizes.medium
|
||||
lifeSpan: Kirigami.Units.veryLongDuration*10
|
||||
lifeSpan: Kirigami.Units.veryLongDuration * 10
|
||||
size: Kirigami.Units.iconSizes.large
|
||||
emitRate: 42
|
||||
|
||||
@@ -157,13 +161,13 @@ Item {
|
||||
|
||||
Timer {
|
||||
id: fireworksTimer
|
||||
interval: root.effectInterval;
|
||||
running: false;
|
||||
repeat: false;
|
||||
triggeredOnStart: true;
|
||||
interval: root.effectInterval
|
||||
running: false
|
||||
repeat: false
|
||||
triggeredOnStart: true
|
||||
onTriggered: {
|
||||
if (root.enabled) {
|
||||
fireworksInternalTimer.running = !fireworksInternalTimer.running
|
||||
fireworksInternalTimer.running = !fireworksInternalTimer.running;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,11 +179,11 @@ Item {
|
||||
running: false
|
||||
repeat: true
|
||||
onTriggered: {
|
||||
var x = Math.random() * parent.width
|
||||
var y = Math.random() * parent.height
|
||||
customEmit(x, y)
|
||||
customEmit(x, y)
|
||||
customEmit(x, y)
|
||||
var x = Math.random() * parent.width;
|
||||
var y = Math.random() * parent.height;
|
||||
customEmit(x, y);
|
||||
customEmit(x, y);
|
||||
customEmit(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,15 +193,17 @@ Item {
|
||||
running: fireworksInternalTimer.running
|
||||
onRunningChanged: {
|
||||
if (running) {
|
||||
opacity = 1
|
||||
opacity = 1;
|
||||
} else {
|
||||
opacity = 0
|
||||
opacity = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on opacity {
|
||||
SequentialAnimation {
|
||||
NumberAnimation { duration: Kirigami.Units.longDuration }
|
||||
NumberAnimation {
|
||||
duration: Kirigami.Units.longDuration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -256,39 +262,42 @@ Item {
|
||||
running: true
|
||||
onTriggered: {
|
||||
container.destroy();
|
||||
var randomHue = Math.random()
|
||||
var lightness = root.isThemeDark ? 0.8 : 0.7
|
||||
fireworksParticleA.color = Qt.hsla(randomHue, 0.8, lightness, 1)
|
||||
fireworksParticleB.color = Qt.hsla(1-randomHue, 0.8, lightness, 1)
|
||||
var randomHue = Math.random();
|
||||
var lightness = root.isThemeDark ? 0.8 : 0.7;
|
||||
fireworksParticleA.color = Qt.hsla(randomHue, 0.8, lightness, 1);
|
||||
fireworksParticleB.color = Qt.hsla(1 - randomHue, 0.8, lightness, 1);
|
||||
}
|
||||
}
|
||||
velocity: AngleDirection {angleVariation:360; magnitude: 200}
|
||||
velocity: AngleDirection {
|
||||
angleVariation: 360
|
||||
magnitude: 200
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function customEmit(x,y) {
|
||||
var currentSize = Math.round(Math.random() * 200) + 40
|
||||
var currentLifeSpan = Math.round(Math.random() * 1000) + 100
|
||||
for (var i=0; i<8; i++) {
|
||||
function customEmit(x, y) {
|
||||
var currentSize = Math.round(Math.random() * 200) + 40;
|
||||
var currentLifeSpan = Math.round(Math.random() * 1000) + 100;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
var obj = emitterComp.createObject(parent);
|
||||
obj.x = x
|
||||
obj.y = y
|
||||
obj.targetX = Math.random() * currentSize - currentSize/2 + obj.x
|
||||
obj.targetY = Math.random() * currentSize - currentSize/2 + obj.y
|
||||
obj.life = Math.round(Math.random() * 23) + 150
|
||||
obj.emitRate = Math.round(Math.random() * 32) + 5
|
||||
obj.lifeSpan = currentLifeSpan
|
||||
obj.x = x;
|
||||
obj.y = y;
|
||||
obj.targetX = Math.random() * currentSize - currentSize / 2 + obj.x;
|
||||
obj.targetY = Math.random() * currentSize - currentSize / 2 + obj.y;
|
||||
obj.life = Math.round(Math.random() * 23) + 150;
|
||||
obj.emitRate = Math.round(Math.random() * 32) + 5;
|
||||
obj.lifeSpan = currentLifeSpan;
|
||||
const group = Math.round(Math.random() * 3);
|
||||
switch (group) {
|
||||
case 0:
|
||||
obj.group = "light";
|
||||
break;
|
||||
case 1:
|
||||
obj.group = "a";
|
||||
break;
|
||||
case 2:
|
||||
obj.group = "b";
|
||||
break;
|
||||
case 0:
|
||||
obj.group = "light";
|
||||
break;
|
||||
case 1:
|
||||
obj.group = "a";
|
||||
break;
|
||||
case 2:
|
||||
obj.group = "b";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ MessageDelegate {
|
||||
property bool autoOpenFile: false
|
||||
|
||||
onDownloadedChanged: {
|
||||
itineraryModel.path = root.progressInfo.localPath
|
||||
itineraryModel.path = root.progressInfo.localPath;
|
||||
if (autoOpenFile) {
|
||||
openSavedFile();
|
||||
}
|
||||
@@ -52,9 +52,9 @@ MessageDelegate {
|
||||
onOpenContextMenu: RoomManager.viewEventMenu(eventId, author, delegateType, plainText, "", "", mediaInfo.mimeType, progressInfo)
|
||||
|
||||
function saveFileAs() {
|
||||
const dialog = fileDialog.createObject(QQC2.ApplicationWindow.overlay)
|
||||
dialog.open()
|
||||
dialog.currentFile = dialog.folder + "/" + root.room.fileNameToDownload(root.eventId)
|
||||
const dialog = fileDialog.createObject(QQC2.ApplicationWindow.overlay);
|
||||
dialog.open();
|
||||
dialog.currentFile = dialog.folder + "/" + root.room.fileNameToDownload(root.eventId);
|
||||
}
|
||||
|
||||
function openSavedFile() {
|
||||
@@ -183,10 +183,10 @@ MessageDelegate {
|
||||
fileMode: FileDialog.SaveFile
|
||||
folder: Config.lastSaveDirectory.length > 0 ? Config.lastSaveDirectory : StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
||||
onAccepted: {
|
||||
Config.lastSaveDirectory = folder
|
||||
Config.save()
|
||||
Config.lastSaveDirectory = folder;
|
||||
Config.save();
|
||||
if (autoOpenFile) {
|
||||
UrlHelper.copyTo(root.progressInfo.localPath, file)
|
||||
UrlHelper.copyTo(root.progressInfo.localPath, file);
|
||||
} else {
|
||||
root.room.download(root.eventId, file);
|
||||
}
|
||||
@@ -213,9 +213,9 @@ MessageDelegate {
|
||||
text: model.name
|
||||
}
|
||||
QQC2.Label {
|
||||
text: model.coach ? i18n("Coach: %1, Seat: %2", model.coach, model.seat) : ""
|
||||
visible: model.coach
|
||||
opacity: 0.7
|
||||
text: model.coach ? i18n("Coach: %1, Seat: %2", model.coach, model.seat) : ""
|
||||
visible: model.coach
|
||||
opacity: 0.7
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
@@ -234,7 +234,7 @@ MessageDelegate {
|
||||
}
|
||||
ColumnLayout {
|
||||
QQC2.Label {
|
||||
text: model.arrivalStation + (model.arrivalPlatform ? (" [" + model.arrivalPlatform + "]") : "")
|
||||
text: model.arrivalStation + (model.arrivalPlatform ? (" [" + model.arrivalPlatform + "]") : "")
|
||||
}
|
||||
QQC2.Label {
|
||||
text: model.arrivalTime
|
||||
|
||||
@@ -43,16 +43,16 @@ MessageDelegateContextMenu {
|
||||
text: i18n("Open Externally")
|
||||
icon.name: "document-open"
|
||||
onTriggered: {
|
||||
currentRoom.openEventMediaExternally(root.eventId)
|
||||
currentRoom.openEventMediaExternally(root.eventId);
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: i18n("Save As")
|
||||
icon.name: "document-save"
|
||||
onTriggered: {
|
||||
var dialog = saveAsDialog.createObject(QQC2.ApplicationWindow.overlay)
|
||||
dialog.open()
|
||||
dialog.currentFile = dialog.folder + "/" + currentRoom.fileNameToDownload(eventId)
|
||||
var dialog = saveAsDialog.createObject(QQC2.ApplicationWindow.overlay);
|
||||
dialog.open();
|
||||
dialog.currentFile = dialog.folder + "/" + currentRoom.fileNameToDownload(eventId);
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
@@ -61,14 +61,14 @@ MessageDelegateContextMenu {
|
||||
onTriggered: {
|
||||
currentRoom.mainCache.replyId = eventId;
|
||||
currentRoom.editCache.editId = "";
|
||||
RoomManager.requestFullScreenClose()
|
||||
RoomManager.requestFullScreenClose();
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: i18n("Copy")
|
||||
icon.name: "edit-copy"
|
||||
onTriggered: {
|
||||
currentRoom.copyEventMedia(root.eventId)
|
||||
currentRoom.copyEventMedia(root.eventId);
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
@@ -76,7 +76,10 @@ MessageDelegateContextMenu {
|
||||
text: i18n("Remove")
|
||||
icon.name: "edit-delete-remove"
|
||||
icon.color: "red"
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/RemoveSheet.qml", {room: currentRoom, eventId: eventId}, {
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/RemoveSheet.qml", {
|
||||
room: currentRoom,
|
||||
eventId: eventId
|
||||
}, {
|
||||
title: i18nc("@title", "Remove Message"),
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
})
|
||||
@@ -85,7 +88,10 @@ MessageDelegateContextMenu {
|
||||
text: i18nc("@action:button 'Report' as in 'Report this event to the administrators'", "Report")
|
||||
icon.name: "dialog-warning-symbolic"
|
||||
visible: author.id !== currentRoom.localUser.id
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ReportSheet.qml", {room: currentRoom, eventId: eventId}, {
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ReportSheet.qml", {
|
||||
room: currentRoom,
|
||||
eventId: eventId
|
||||
}, {
|
||||
title: i18nc("@title", "Report Message"),
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
})
|
||||
@@ -109,10 +115,10 @@ MessageDelegateContextMenu {
|
||||
'urls': [],
|
||||
'mimeType': [root.mimeType]
|
||||
}
|
||||
property string filename: StandardPaths.writableLocation(StandardPaths.CacheLocation) + "/" + eventId.replace(":", "_").replace("/", "_").replace("+", "_") + currentRoom.fileNameToDownload(eventId);
|
||||
property string filename: StandardPaths.writableLocation(StandardPaths.CacheLocation) + "/" + eventId.replace(":", "_").replace("/", "_").replace("+", "_") + currentRoom.fileNameToDownload(eventId)
|
||||
|
||||
doBeforeSharing: () => {
|
||||
currentRoom.downloadFile(eventId, filename)
|
||||
currentRoom.downloadFile(eventId, filename);
|
||||
}
|
||||
Component.onCompleted: {
|
||||
shareAction.inputData = {
|
||||
@@ -132,9 +138,9 @@ MessageDelegateContextMenu {
|
||||
if (!currentFile) {
|
||||
return;
|
||||
}
|
||||
Config.lastSaveDirectory = folder
|
||||
Config.save()
|
||||
currentRoom.downloadFile(eventId, currentFile)
|
||||
Config.lastSaveDirectory = folder;
|
||||
Config.save();
|
||||
currentRoom.downloadFile(eventId, currentFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,7 @@ ApplicationWindow {
|
||||
MapView {
|
||||
id: mapView
|
||||
anchors.fill: parent
|
||||
map.center: root.liveLocationModel ? QtPositioning.coordinate(root.liveLocationModel.boundingBox.y, root.liveLocationModel.boundingBox.x)
|
||||
: QtPositioning.coordinate(root.latitude, root.longitude)
|
||||
map.center: root.liveLocationModel ? QtPositioning.coordinate(root.liveLocationModel.boundingBox.y, root.liveLocationModel.boundingBox.x) : QtPositioning.coordinate(root.latitude, root.longitude)
|
||||
map.zoomLevel: 15
|
||||
map.plugin: OsmLocationPlugin.plugin
|
||||
LocationMapItem {
|
||||
@@ -57,7 +56,7 @@ ApplicationWindow {
|
||||
Connections {
|
||||
target: mapView.map
|
||||
function onCopyrightLinkActivated() {
|
||||
Qt.openUrlExternally(link)
|
||||
Qt.openUrlExternally(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,15 +48,13 @@ FormCard.FormCardPage {
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: {
|
||||
const fileDialog = openFileDialog.createObject(QQC2.ApplicationWindow.overlay)
|
||||
|
||||
fileDialog.chosen.connect(function(path) {
|
||||
if (!path) return
|
||||
|
||||
room.changeAvatar(path)
|
||||
})
|
||||
|
||||
fileDialog.open()
|
||||
const fileDialog = openFileDialog.createObject(QQC2.ApplicationWindow.overlay);
|
||||
fileDialog.chosen.connect(function (path) {
|
||||
if (!path)
|
||||
return;
|
||||
room.changeAvatar(path);
|
||||
});
|
||||
fileDialog.open();
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
@@ -107,11 +105,10 @@ FormCard.FormCardPage {
|
||||
text: i18n("Save")
|
||||
onClicked: {
|
||||
if (room.name != roomNameField.text) {
|
||||
room.setName(roomNameField.text)
|
||||
room.setName(roomNameField.text);
|
||||
}
|
||||
|
||||
if (room.topic != roomTopicField.text) {
|
||||
room.setTopic(roomTopicField.text)
|
||||
room.setTopic(roomTopicField.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +126,7 @@ FormCard.FormCardPage {
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: {
|
||||
Clipboard.saveText(room.id)
|
||||
Clipboard.saveText(room.id);
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
@@ -149,8 +146,8 @@ FormCard.FormCardPage {
|
||||
|
||||
onClicked: {
|
||||
if (room.canSwitchVersions()) {
|
||||
roomUpgradeSheet.currentRoomVersion = room.version
|
||||
roomUpgradeSheet.open()
|
||||
roomUpgradeSheet.currentRoomVersion = room.version;
|
||||
roomUpgradeSheet.open();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +183,7 @@ FormCard.FormCardPage {
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: {
|
||||
room.setCanonicalAlias(modelData)
|
||||
room.setCanonicalAlias(modelData);
|
||||
}
|
||||
QQC2.ToolTip {
|
||||
text: setCanonicalAliasButton.text
|
||||
@@ -201,7 +198,7 @@ FormCard.FormCardPage {
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: {
|
||||
room.unmapAlias(modelData)
|
||||
room.unmapAlias(modelData);
|
||||
}
|
||||
QQC2.ToolTip {
|
||||
text: deleteButton.text
|
||||
@@ -209,13 +206,12 @@ FormCard.FormCardPage {
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
FormCard.AbstractFormDelegate {
|
||||
visible: room.canSendState("m.room.canonical_alias")
|
||||
|
||||
contentItem : RowLayout {
|
||||
contentItem: RowLayout {
|
||||
Kirigami.ActionTextField {
|
||||
id: aliasAddField
|
||||
|
||||
@@ -227,12 +223,12 @@ FormCard.FormCardPage {
|
||||
icon.name: "edit-clear"
|
||||
visible: aliasAddField.text.length > 0
|
||||
onTriggered: {
|
||||
aliasAddField.text = ""
|
||||
aliasAddField.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
room.mapAlias(aliasAddField.text)
|
||||
room.mapAlias(aliasAddField.text);
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
@@ -245,7 +241,7 @@ FormCard.FormCardPage {
|
||||
enabled: aliasAddField.text.length > 0
|
||||
|
||||
onClicked: {
|
||||
room.mapAlias(aliasAddField.text)
|
||||
room.mapAlias(aliasAddField.text);
|
||||
}
|
||||
|
||||
QQC2.ToolTip {
|
||||
@@ -266,7 +262,7 @@ FormCard.FormCardPage {
|
||||
checked: room.defaultUrlPreviewState
|
||||
visible: room.canSendState("org.matrix.room.preview_urls")
|
||||
onToggled: {
|
||||
room.defaultUrlPreviewState = checked
|
||||
room.defaultUrlPreviewState = checked;
|
||||
}
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
@@ -275,7 +271,7 @@ FormCard.FormCardPage {
|
||||
description: room.defaultUrlPreviewState ? i18n("URL previews are enabled by default in this room") : i18n("URL previews are disabled by default in this room")
|
||||
checked: room.urlPreviewEnabled
|
||||
onToggled: {
|
||||
room.urlPreviewEnabled = checked
|
||||
room.urlPreviewEnabled = checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -353,7 +349,7 @@ FormCard.FormCardPage {
|
||||
FormCard.FormButtonDelegate {
|
||||
visible: root.room.canSendState("m.space.parent")
|
||||
text: i18nc("@action:button", "Add new official parent")
|
||||
onClicked: selectParentDialog.createObject(applicationWindow().overlay).open();
|
||||
onClicked: selectParentDialog.createObject(applicationWindow().overlay).open()
|
||||
|
||||
Component {
|
||||
id: selectParentDialog
|
||||
@@ -418,11 +414,10 @@ FormCard.FormCardPage {
|
||||
QQC2.Button {
|
||||
text: i18n("Confirm")
|
||||
onClicked: {
|
||||
room.switchVersion(spinBox.value)
|
||||
roomUpgradeSheet.close()
|
||||
room.switchVersion(spinBox.value);
|
||||
roomUpgradeSheet.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,12 +26,15 @@ FormCard.FormCardPage {
|
||||
visible: Controller.supportSystemTray
|
||||
enabled: !Config.isSystemTrayImmutable
|
||||
onToggled: {
|
||||
Config.systemTray = checked
|
||||
Config.save()
|
||||
Config.systemTray = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { above: closeDelegate; below: minimizeDelegate }
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: closeDelegate
|
||||
below: minimizeDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: minimizeDelegate
|
||||
@@ -40,12 +43,15 @@ FormCard.FormCardPage {
|
||||
visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile
|
||||
enabled: Config.systemTray && !Config.isMinimizeToSystemTrayOnStartupImmutable
|
||||
onToggled: {
|
||||
Config.minimizeToSystemTrayOnStartup = checked
|
||||
Config.save()
|
||||
Config.minimizeToSystemTrayOnStartup = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { above: minimizeDelegate; below: automaticallyDelegate }
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: minimizeDelegate
|
||||
below: automaticallyDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: automaticallyDelegate
|
||||
@@ -54,8 +60,8 @@ FormCard.FormCardPage {
|
||||
enabled: !Config.isAutoRoomInfoDrawerImmutable
|
||||
visible: Qt.platform.os !== "android"
|
||||
onToggled: {
|
||||
Config.autoRoomInfoDrawer = checked
|
||||
Config.save()
|
||||
Config.autoRoomInfoDrawer = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,12 +75,15 @@ FormCard.FormCardPage {
|
||||
checked: Config.showDeletedMessages
|
||||
enabled: !Config.isShowDeletedMessagesImmutable
|
||||
onToggled: {
|
||||
Config.showDeletedMessages = checked
|
||||
Config.save()
|
||||
Config.showDeletedMessages = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator { above: showDeletedMessages; below: showStateEvents }
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: showDeletedMessages
|
||||
below: showStateEvents
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showStateEvents
|
||||
@@ -82,15 +91,16 @@ FormCard.FormCardPage {
|
||||
checked: Config.showStateEvent
|
||||
enabled: !Config.isShowStateEventImmutable
|
||||
onToggled: {
|
||||
Config.showStateEvent = checked
|
||||
Config.save()
|
||||
Config.showStateEvent = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
visible: Config.showStateEvent
|
||||
above: showStateEvents
|
||||
below: showLeaveJoinEventDelegate }
|
||||
below: showLeaveJoinEventDelegate
|
||||
}
|
||||
|
||||
FormCard.FormCheckDelegate {
|
||||
id: showLeaveJoinEventDelegate
|
||||
@@ -99,8 +109,8 @@ FormCard.FormCardPage {
|
||||
checked: Config.showLeaveJoinEvent
|
||||
enabled: !Config.isShowLeaveJoinEventImmutable
|
||||
onToggled: {
|
||||
Config.showLeaveJoinEvent = checked
|
||||
Config.save()
|
||||
Config.showLeaveJoinEvent = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,8 +127,8 @@ FormCard.FormCardPage {
|
||||
checked: Config.showRename
|
||||
enabled: !Config.isShowRenameImmutable
|
||||
onToggled: {
|
||||
Config.showRename = checked
|
||||
Config.save()
|
||||
Config.showRename = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,8 +145,8 @@ FormCard.FormCardPage {
|
||||
checked: Config.showAvatarUpdate
|
||||
enabled: !Config.isShowAvatarUpdateImmutable
|
||||
onToggled: {
|
||||
Config.showAvatarUpdate = checked
|
||||
Config.save()
|
||||
Config.showAvatarUpdate = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,19 +160,22 @@ FormCard.FormCardPage {
|
||||
checked: Config.allowQuickEdit
|
||||
enabled: !Config.isAllowQuickEditImmutable
|
||||
onToggled: {
|
||||
Config.allowQuickEdit = checked
|
||||
Config.save()
|
||||
Config.allowQuickEdit = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator { above: quickEditCheckbox; below: typingNotificationsDelegate }
|
||||
FormCard.FormDelegateSeparator {
|
||||
above: quickEditCheckbox
|
||||
below: typingNotificationsDelegate
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
id: typingNotificationsDelegate
|
||||
text: i18n("Send typing notifications")
|
||||
checked: Config.typingNotifications
|
||||
enabled: !Config.isTypingNotificationsImmutable
|
||||
onToggled: {
|
||||
Config.typingNotifications = checked
|
||||
Config.save()
|
||||
Config.typingNotifications = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,8 +188,8 @@ FormCard.FormCardPage {
|
||||
checked: Config.developerTools
|
||||
enabled: !Config.isDeveloperToolsImmutable
|
||||
onToggled: {
|
||||
Config.developerTools = checked
|
||||
Config.save()
|
||||
Config.developerTools = checked;
|
||||
Config.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,24 +47,32 @@ Labs.MenuBar {
|
||||
Labs.MenuItem {
|
||||
text: i18nc("menu", "Find your friends")
|
||||
enabled: pageStack.layers.currentItem.title !== i18n("Find your friends") && AccountRegistry.accountCount > 0
|
||||
onTriggered: pushReplaceLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {connection: root.connection}, {title: i18nc("@title", "Find your friends")})
|
||||
onTriggered: pushReplaceLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
})
|
||||
}
|
||||
Labs.MenuItem {
|
||||
text: i18nc("menu", "New Group…")
|
||||
enabled: pageStack.layers.currentItem.title !== i18n("Find your friends") && AccountRegistry.accountCount > 0
|
||||
shortcut: StandardKey.New
|
||||
onTriggered: {
|
||||
const dialog = createRoomDialog.createObject(root.overlay)
|
||||
dialog.open()
|
||||
const dialog = createRoomDialog.createObject(root.overlay);
|
||||
dialog.open();
|
||||
}
|
||||
}
|
||||
Labs.MenuItem {
|
||||
text: i18nc("menu", "Browse Chats…")
|
||||
onTriggered: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.connection}, {title: i18nc("@title", "Explore Rooms")})
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
});
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join")
|
||||
})
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ FormCard.FormCardPage {
|
||||
checked: root.pushRuleModel.globalNotificationsEnabled
|
||||
enabled: root.pushRuleModel.globalNotificationsSet
|
||||
onToggled: {
|
||||
root.pushRuleModel.globalNotificationsEnabled = checked
|
||||
root.pushRuleModel.globalNotificationsEnabled = checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -42,8 +42,8 @@ FormCard.FormCardPage {
|
||||
Repeater {
|
||||
model: KSortFilterProxyModel {
|
||||
sourceModel: root.pushRuleModel
|
||||
filterRowCallback: function(source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole)
|
||||
filterRowCallback: function (source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole);
|
||||
return sectionRole == PushRuleSection.Room;
|
||||
}
|
||||
}
|
||||
@@ -59,8 +59,8 @@ FormCard.FormCardPage {
|
||||
Repeater {
|
||||
model: KSortFilterProxyModel {
|
||||
sourceModel: root.pushRuleModel
|
||||
filterRowCallback: function(source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole)
|
||||
filterRowCallback: function (source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole);
|
||||
return sectionRole == PushRuleSection.Mentions;
|
||||
}
|
||||
}
|
||||
@@ -77,8 +77,8 @@ FormCard.FormCardPage {
|
||||
model: KSortFilterProxyModel {
|
||||
sourceModel: root.pushRuleModel
|
||||
|
||||
filterRowCallback: function(source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole)
|
||||
filterRowCallback: function (source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole);
|
||||
return sectionRole == PushRuleSection.Keywords;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ FormCard.FormCardPage {
|
||||
FormCard.AbstractFormDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem : RowLayout {
|
||||
contentItem: RowLayout {
|
||||
Kirigami.ActionTextField {
|
||||
id: keywordAddField
|
||||
|
||||
@@ -101,13 +101,13 @@ FormCard.FormCardPage {
|
||||
icon.name: "edit-clear"
|
||||
visible: keywordAddField.text.length > 0
|
||||
onTriggered: {
|
||||
keywordAddField.text = ""
|
||||
keywordAddField.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
root.pushRuleModel.addKeyword(keywordAddField.text)
|
||||
keywordAddField.text = ""
|
||||
root.pushRuleModel.addKeyword(keywordAddField.text);
|
||||
keywordAddField.text = "";
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
@@ -120,8 +120,8 @@ FormCard.FormCardPage {
|
||||
enabled: NotificationsManager.keywordNotificationAction !== PushRuleAction.Unknown
|
||||
|
||||
onClicked: {
|
||||
root.pushRuleModel.addKeyword(keywordAddField.text)
|
||||
keywordAddField.text = ""
|
||||
root.pushRuleModel.addKeyword(keywordAddField.text);
|
||||
keywordAddField.text = "";
|
||||
}
|
||||
|
||||
QQC2.ToolTip {
|
||||
@@ -140,8 +140,8 @@ FormCard.FormCardPage {
|
||||
Repeater {
|
||||
model: KSortFilterProxyModel {
|
||||
sourceModel: root.pushRuleModel
|
||||
filterRowCallback: function(source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole)
|
||||
filterRowCallback: function (source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole);
|
||||
return sectionRole == PushRuleSection.Invites;
|
||||
}
|
||||
}
|
||||
@@ -161,8 +161,8 @@ FormCard.FormCardPage {
|
||||
model: KSortFilterProxyModel {
|
||||
id: unknownModel
|
||||
sourceModel: root.pushRuleModel
|
||||
filterRowCallback: function(source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole)
|
||||
filterRowCallback: function (source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole);
|
||||
return sectionRole == PushRuleSection.Unknown;
|
||||
}
|
||||
}
|
||||
@@ -175,9 +175,9 @@ FormCard.FormCardPage {
|
||||
id: ruleDelegate
|
||||
NotificationRuleItem {
|
||||
onDeleteRule: {
|
||||
root.pushRuleModel.removeKeyword(id)
|
||||
root.pushRuleModel.removeKeyword(id);
|
||||
}
|
||||
onActionChanged: (action) => root.pushRuleModel.setPushRuleAction(id, action)
|
||||
onActionChanged: action => root.pushRuleModel.setPushRuleAction(id, action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ ColumnLayout {
|
||||
Layout.preferredHeight: Kirigami.Units.iconSizes.large
|
||||
|
||||
name: root.room ? root.room.displayName : ""
|
||||
source: root.room && root.room.avatarMediaId ? ("image://mxc/" + root.room.avatarMediaId) : ""
|
||||
source: root.room && root.room.avatarMediaId ? ("image://mxc/" + root.room.avatarMediaId) : ""
|
||||
|
||||
Rectangle {
|
||||
visible: room.usesEncryption
|
||||
@@ -54,7 +54,6 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
@@ -12,7 +12,9 @@ import org.kde.neochat
|
||||
LoginStep {
|
||||
id: root
|
||||
|
||||
onActiveFocusChanged: if (activeFocus) urlField.forceActiveFocus()
|
||||
onActiveFocusChanged: if (activeFocus) {
|
||||
urlField.forceActiveFocus();
|
||||
}
|
||||
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: urlField
|
||||
@@ -24,7 +26,7 @@ LoginStep {
|
||||
statusMessage: Registration.status === Registration.ServerNoRegistration ? i18n("Registration is disabled on this server.") : ""
|
||||
Keys.onReturnPressed: {
|
||||
if (root.nextAction.enabled) {
|
||||
root.nextAction.trigger()
|
||||
root.nextAction.trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,7 +40,7 @@ LoginStep {
|
||||
nextAction: Kirigami.Action {
|
||||
text: Registration.testing ? i18n("Loading") : null
|
||||
enabled: Registration.status > Registration.ServerNoRegistration
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml");
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml")
|
||||
}
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: root.processed("qrc:/org/kde/neochat/qml/LoginRegister.qml")
|
||||
|
||||
@@ -35,7 +35,7 @@ QQC2.Control {
|
||||
/**
|
||||
* @brief Request that the chat bar be focussed.
|
||||
*/
|
||||
signal focusChatBar()
|
||||
signal focusChatBar
|
||||
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
@@ -51,7 +51,7 @@ QQC2.Control {
|
||||
if (visible) {
|
||||
// HACK: delay disapearing by 200ms, otherwise this can create some glitches
|
||||
// See https://invent.kde.org/network/neochat/-/issues/333
|
||||
showActionsTimer.restart()
|
||||
showActionsTimer.restart();
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
@@ -124,7 +124,7 @@ QQC2.Control {
|
||||
id: emojiDialog
|
||||
currentRoom: root.currentRoom
|
||||
showQuickReaction: true
|
||||
onChosen: (emoji) => {
|
||||
onChosen: emoji => {
|
||||
root.currentRoom.toggleReaction(root.delegate.eventId, emoji);
|
||||
if (!Kirigami.Settings.isMobile) {
|
||||
root.focusChatBar();
|
||||
|
||||
@@ -129,32 +129,34 @@ MessageDelegate {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
gesturePolicy: TapHandler.ReleaseWithinBounds | TapHandler.WithinBounds
|
||||
onTapped: {
|
||||
imageContainer.QQC2.ToolTip.hide()
|
||||
imageContainer.QQC2.ToolTip.hide();
|
||||
if (root.mediaInfo.animated) {
|
||||
imageContainer.imageItem.paused = true
|
||||
imageContainer.imageItem.paused = true;
|
||||
}
|
||||
root.ListView.view.interactive = false
|
||||
root.ListView.view.interactive = false;
|
||||
// We need to make sure the index is that of the MediaMessageFilterModel.
|
||||
if (root.ListView.view.model instanceof MessageFilterModel) {
|
||||
RoomManager.maximizeMedia(RoomManager.mediaMessageFilterModel.getRowForSourceItem(root.index))
|
||||
RoomManager.maximizeMedia(RoomManager.mediaMessageFilterModel.getRowForSourceItem(root.index));
|
||||
} else {
|
||||
RoomManager.maximizeMedia(root.index)
|
||||
RoomManager.maximizeMedia(root.index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function downloadAndOpen() {
|
||||
if (downloaded) {
|
||||
openSavedFile()
|
||||
openSavedFile();
|
||||
} else {
|
||||
openOnFinished = true
|
||||
root.room.downloadFile(root.eventId, StandardPaths.writableLocation(StandardPaths.CacheLocation) + "/" + root.eventId.replace(":", "_").replace("/", "_").replace("+", "_") + root.room.fileNameToDownload(root.eventId))
|
||||
openOnFinished = true;
|
||||
root.room.downloadFile(root.eventId, StandardPaths.writableLocation(StandardPaths.CacheLocation) + "/" + root.eventId.replace(":", "_").replace("/", "_").replace("+", "_") + root.room.fileNameToDownload(root.eventId));
|
||||
}
|
||||
}
|
||||
|
||||
function openSavedFile() {
|
||||
if (UrlHelper.openUrl(root.progressInfo.localPath)) return;
|
||||
if (UrlHelper.openUrl(root.progressInfo.localDir)) return;
|
||||
if (UrlHelper.openUrl(root.progressInfo.localPath))
|
||||
return;
|
||||
if (UrlHelper.openUrl(root.progressInfo.localDir))
|
||||
return;
|
||||
}
|
||||
|
||||
MediaSizeHelper {
|
||||
|
||||
@@ -13,10 +13,10 @@ import org.kde.kquickimageeditor as KQuickImageEditor
|
||||
Kirigami.Page {
|
||||
id: rootEditorView
|
||||
|
||||
property bool resizing: false;
|
||||
property bool resizing: false
|
||||
required property string imagePath
|
||||
|
||||
signal newPathChanged(string newPath);
|
||||
signal newPathChanged(string newPath)
|
||||
|
||||
title: i18n("Edit")
|
||||
leftPadding: 0
|
||||
@@ -27,7 +27,7 @@ Kirigami.Page {
|
||||
function crop() {
|
||||
const ratioX = editImage.paintedWidth / editImage.nativeWidth;
|
||||
const ratioY = editImage.paintedHeight / editImage.nativeHeight;
|
||||
rootEditorView.resizing = false
|
||||
rootEditorView.resizing = false;
|
||||
imageDoc.crop(selectionTool.selectionX / ratioX, selectionTool.selectionY / ratioY, selectionTool.selectionWidth / ratioX, selectionTool.selectionHeight / ratioY);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ Kirigami.Page {
|
||||
id: undoAction
|
||||
text: i18nc("@action:button Undo modification", "Undo")
|
||||
icon.name: "edit-undo"
|
||||
onTriggered: imageDoc.undo();
|
||||
onTriggered: imageDoc.undo()
|
||||
visible: imageDoc.edited
|
||||
},
|
||||
Kirigami.Action {
|
||||
@@ -45,19 +45,17 @@ Kirigami.Page {
|
||||
icon.name: "dialog-ok"
|
||||
onTriggered: {
|
||||
let newPath = Platform.StandardPaths.writableLocation(Platform.StandardPaths.CacheLocation) + "/" + (new Date()).getTime() + "." + imagePath.split('.').pop();
|
||||
if (imageDoc.saveAs(newPath)) {;
|
||||
if (imageDoc.saveAs(newPath)) {
|
||||
newPathChanged(newPath);
|
||||
} else {
|
||||
msg.type = Kirigami.MessageType.Error
|
||||
msg.text = i18n("Unable to save file. Check if you have the correct permission to edit the cache directory.")
|
||||
msg.type = Kirigami.MessageType.Error;
|
||||
msg.text = i18n("Unable to save file. Check if you have the correct permission to edit the cache directory.");
|
||||
msg.visible = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
|
||||
KQuickImageEditor.ImageItem {
|
||||
id: editImage
|
||||
// Assigning this to the contentItem and setting the padding causes weird positioning issues
|
||||
@@ -68,17 +66,17 @@ Kirigami.Page {
|
||||
|
||||
Shortcut {
|
||||
sequence: StandardKey.Undo
|
||||
onActivated: undoAction.trigger();
|
||||
onActivated: undoAction.trigger()
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequences: [StandardKey.Save, "Enter"]
|
||||
onActivated: saveAction.trigger();
|
||||
onActivated: saveAction.trigger()
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequence: StandardKey.SaveAs
|
||||
onActivated: saveAsAction.trigger();
|
||||
onActivated: saveAsAction.trigger()
|
||||
}
|
||||
|
||||
KQuickImageEditor.ImageDocument {
|
||||
@@ -104,15 +102,15 @@ Kirigami.Page {
|
||||
Connections {
|
||||
target: selectionTool.selectionArea
|
||||
function onDoubleClicked() {
|
||||
rootEditorView.crop()
|
||||
rootEditorView.crop();
|
||||
}
|
||||
}
|
||||
}
|
||||
onImageChanged: {
|
||||
selectionTool.selectionX = 0
|
||||
selectionTool.selectionY = 0
|
||||
selectionTool.selectionWidth = Qt.binding(() => selectionTool.width)
|
||||
selectionTool.selectionHeight = Qt.binding(() => selectionTool.height)
|
||||
selectionTool.selectionX = 0;
|
||||
selectionTool.selectionY = 0;
|
||||
selectionTool.selectionWidth = Qt.binding(() => selectionTool.width);
|
||||
selectionTool.selectionHeight = Qt.binding(() => selectionTool.height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,48 +121,47 @@ Kirigami.Page {
|
||||
actions: [
|
||||
Kirigami.Action {
|
||||
icon.name: rootEditorView.resizing ? "dialog-cancel" : "transform-crop"
|
||||
text: rootEditorView.resizing ? i18n("Cancel") : i18nc("@action:button Crop an image", "Crop");
|
||||
text: rootEditorView.resizing ? i18n("Cancel") : i18nc("@action:button Crop an image", "Crop")
|
||||
onTriggered: {
|
||||
resizeRectangle.width = editImage.paintedWidth
|
||||
resizeRectangle.height = editImage.paintedHeight
|
||||
resizeRectangle.x = editImage.horizontalPadding
|
||||
resizeRectangle.y = editImage.verticalPadding
|
||||
resizeRectangle.insideX = 100
|
||||
resizeRectangle.insideY = 100
|
||||
resizeRectangle.insideWidth = 100
|
||||
resizeRectangle.insideHeight = 100
|
||||
|
||||
resizeRectangle.width = editImage.paintedWidth;
|
||||
resizeRectangle.height = editImage.paintedHeight;
|
||||
resizeRectangle.x = editImage.horizontalPadding;
|
||||
resizeRectangle.y = editImage.verticalPadding;
|
||||
resizeRectangle.insideX = 100;
|
||||
resizeRectangle.insideY = 100;
|
||||
resizeRectangle.insideWidth = 100;
|
||||
resizeRectangle.insideHeight = 100;
|
||||
rootEditorView.resizing = !rootEditorView.resizing;
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
icon.name: "dialog-ok"
|
||||
visible: rootEditorView.resizing
|
||||
text: i18nc("@action:button Crop an image", "Crop");
|
||||
onTriggered: rootEditorView.crop();
|
||||
text: i18nc("@action:button Crop an image", "Crop")
|
||||
onTriggered: rootEditorView.crop()
|
||||
},
|
||||
Kirigami.Action {
|
||||
icon.name: "object-rotate-left"
|
||||
text: i18nc("@action:button Rotate an image to the left", "Rotate left");
|
||||
onTriggered: imageDoc.rotate(-90);
|
||||
text: i18nc("@action:button Rotate an image to the left", "Rotate left")
|
||||
onTriggered: imageDoc.rotate(-90)
|
||||
visible: !rootEditorView.resizing
|
||||
},
|
||||
Kirigami.Action {
|
||||
icon.name: "object-rotate-right"
|
||||
text: i18nc("@action:button Rotate an image to the right", "Rotate right");
|
||||
onTriggered: imageDoc.rotate(90);
|
||||
text: i18nc("@action:button Rotate an image to the right", "Rotate right")
|
||||
onTriggered: imageDoc.rotate(90)
|
||||
visible: !rootEditorView.resizing
|
||||
},
|
||||
Kirigami.Action {
|
||||
icon.name: "object-flip-vertical"
|
||||
text: i18nc("@action:button Mirror an image vertically", "Flip");
|
||||
onTriggered: imageDoc.mirror(false, true);
|
||||
text: i18nc("@action:button Mirror an image vertically", "Flip")
|
||||
onTriggered: imageDoc.mirror(false, true)
|
||||
visible: !rootEditorView.resizing
|
||||
},
|
||||
Kirigami.Action {
|
||||
icon.name: "object-flip-horizontal"
|
||||
text: i18nc("@action:button Mirror an image horizontally", "Mirror");
|
||||
onTriggered: imageDoc.mirror(true, false);
|
||||
text: i18nc("@action:button Mirror an image horizontally", "Mirror")
|
||||
onTriggered: imageDoc.mirror(true, false)
|
||||
visible: !rootEditorView.resizing
|
||||
}
|
||||
]
|
||||
|
||||
@@ -26,14 +26,14 @@ Kirigami.PlaceholderMessage {
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
Layout.alignment : Qt.AlignHCenter
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: i18n("Reject")
|
||||
|
||||
onClicked: RoomManager.leaveRoom(root.currentRoom);
|
||||
onClicked: RoomManager.leaveRoom(root.currentRoom)
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
Layout.alignment : Qt.AlignHCenter
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: i18n("Accept")
|
||||
|
||||
onClicked: {
|
||||
|
||||
@@ -45,7 +45,7 @@ Kirigami.ScrollablePage {
|
||||
highlighted: true
|
||||
|
||||
onClicked: {
|
||||
room.inviteToRoom(identifierField.text)
|
||||
room.inviteToRoom(identifierField.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ Kirigami.ScrollablePage {
|
||||
|
||||
onToggled: {
|
||||
if (inRoom) {
|
||||
checked = true
|
||||
checked = true;
|
||||
} else {
|
||||
room.inviteToRoom(delegate.userId);
|
||||
applicationWindow().pageStack.layers.pop();
|
||||
|
||||
@@ -74,7 +74,9 @@ Kirigami.Page {
|
||||
visible: root.session.state === KeyVerificationSession.INCOMING
|
||||
QQC2.DialogButtonBox {
|
||||
anchors.fill: parent
|
||||
Item { Layout.fillWidth: true }
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
QQC2.Button {
|
||||
text: i18n("Accept")
|
||||
icon.name: "dialog-ok"
|
||||
|
||||
@@ -31,7 +31,7 @@ Loader {
|
||||
* When the content of the link preview is larger than this it will be
|
||||
* elided/hidden until maximized.
|
||||
*/
|
||||
property var defaultHeight : Kirigami.Units.gridUnit * 3 + Kirigami.Units.smallSpacing * 2
|
||||
property var defaultHeight: Kirigami.Units.gridUnit * 3 + Kirigami.Units.smallSpacing * 2
|
||||
|
||||
/**
|
||||
* @brief Whether the loading indicator should animate if visible.
|
||||
@@ -146,4 +146,3 @@ Loader {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,10 @@ MessageDelegate {
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onTapped: {
|
||||
let map = fullScreenMap.createObject(parent, {liveLocationModel: liveLocationModel});
|
||||
map.open()
|
||||
let map = fullScreenMap.createObject(parent, {
|
||||
liveLocationModel: liveLocationModel
|
||||
});
|
||||
map.open();
|
||||
}
|
||||
onLongPressed: openMessageContext("")
|
||||
}
|
||||
@@ -54,7 +56,7 @@ MessageDelegate {
|
||||
Connections {
|
||||
target: mapView.map
|
||||
function onCopyrightLinkActivated() {
|
||||
Qt.openUrlExternally(link)
|
||||
Qt.openUrlExternally(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ LoginStep {
|
||||
Connections {
|
||||
target: Controller
|
||||
function onConnectionAdded(connection) {
|
||||
connection.syncDone.connect(() => root.closeDialog())
|
||||
connection.syncDone.connect(() => root.closeDialog());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ Components.AbstractMaximizeComponent {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
root.location = mapView.map.toCoordinate(Qt.point(mouseX, mouseY), false)
|
||||
root.location = mapView.map.toCoordinate(Qt.point(mouseX, mouseY), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ Components.AbstractMaximizeComponent {
|
||||
Connections {
|
||||
target: mapView.map
|
||||
function onCopyrightLinkActivated() {
|
||||
Qt.openUrlExternally(link)
|
||||
Qt.openUrlExternally(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,13 @@ MessageDelegate {
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onTapped: {
|
||||
let map = fullScreenMap.createObject(parent, {latitude: root.latitude, longitude: root.longitude, asset: root.asset, author: root.author});
|
||||
map.open()
|
||||
let map = fullScreenMap.createObject(parent, {
|
||||
latitude: root.latitude,
|
||||
longitude: root.longitude,
|
||||
asset: root.asset,
|
||||
author: root.author
|
||||
});
|
||||
map.open();
|
||||
}
|
||||
onLongPressed: openMessageContext("")
|
||||
}
|
||||
@@ -70,13 +75,13 @@ MessageDelegate {
|
||||
Connections {
|
||||
target: mapView.map
|
||||
function onCopyrightLinkActivated() {
|
||||
Qt.openUrlExternally(link)
|
||||
Qt.openUrlExternally(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
Component {
|
||||
id: fullScreenMap
|
||||
FullScreenMap { }
|
||||
FullScreenMap {}
|
||||
}
|
||||
|
||||
RichLabel {
|
||||
|
||||
@@ -67,8 +67,8 @@ MapQuickItem {
|
||||
anchors.bottom: mainIcon.top
|
||||
anchors.horizontalCenter: mainIcon.horizontalCenter
|
||||
transform: Rotation {
|
||||
origin.x: headingIcon.width/2
|
||||
origin.y: headingIcon.height + mainIcon.height/2
|
||||
origin.x: headingIcon.width / 2
|
||||
origin.y: headingIcon.height + mainIcon.height / 2
|
||||
angle: root.heading
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ Kirigami.Page {
|
||||
Connections {
|
||||
target: mapView.map
|
||||
function onCopyrightLinkActivated() {
|
||||
Qt.openUrlExternally(link)
|
||||
Qt.openUrlExternally(link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,11 @@ import org.kde.neochat
|
||||
LoginStep {
|
||||
id: root
|
||||
|
||||
onActiveFocusChanged: if (activeFocus) matrixIdField.forceActiveFocus()
|
||||
onActiveFocusChanged: if (activeFocus)
|
||||
matrixIdField.forceActiveFocus()
|
||||
|
||||
Component.onCompleted: {
|
||||
LoginHelper.matrixId = ""
|
||||
LoginHelper.matrixId = "";
|
||||
}
|
||||
|
||||
FormCard.FormTextFieldDelegate {
|
||||
@@ -25,16 +26,16 @@ LoginStep {
|
||||
placeholderText: "@user:example.org"
|
||||
Accessible.name: i18n("Matrix ID")
|
||||
onTextChanged: {
|
||||
LoginHelper.matrixId = text
|
||||
LoginHelper.matrixId = text;
|
||||
}
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
root.nextAction.trigger()
|
||||
root.nextAction.trigger();
|
||||
}
|
||||
}
|
||||
|
||||
nextAction: Kirigami.Action {
|
||||
text: LoginHelper.isLoggedIn ? i18n("Already logged in") : (LoginHelper.testing && matrixIdField.acceptableInput) ? i18n("Loading…") : i18nc("@action:button", "Continue")
|
||||
text: LoginHelper.isLoggedIn ? i18n("Already logged in") : (LoginHelper.testing && matrixIdField.acceptableInput) ? i18n("Loading…") : i18nc("@action:button", "Continue")
|
||||
onTriggered: {
|
||||
if (LoginHelper.supportsSso && LoginHelper.supportsPassword) {
|
||||
processed("qrc:/org/kde/neochat/qml/LoginMethod.qml");
|
||||
@@ -48,7 +49,7 @@ LoginStep {
|
||||
}
|
||||
previousAction: Kirigami.Action {
|
||||
onTriggered: {
|
||||
root.processed("qrc:/org/kde/neochat/qml/LoginRegister.qml")
|
||||
root.processed("qrc:/org/kde/neochat/qml/LoginRegister.qml");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@ import org.kde.neochat
|
||||
LoginStep {
|
||||
id: root
|
||||
|
||||
onActiveFocusChanged: if (activeFocus) loginPasswordButton.forceActiveFocus()
|
||||
onActiveFocusChanged: if (activeFocus) {
|
||||
loginPasswordButton.forceActiveFocus();
|
||||
}
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
id: loginPasswordButton
|
||||
|
||||
@@ -11,7 +11,9 @@ import org.kde.neochat
|
||||
LoginStep {
|
||||
id: root
|
||||
|
||||
onActiveFocusChanged: if (activeFocus) loginButton.forceActiveFocus(Qt.TabFocusReason)
|
||||
onActiveFocusChanged: if (activeFocus) {
|
||||
loginButton.forceActiveFocus(Qt.TabFocusReason);
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ ColumnLayout {
|
||||
signal showMessage(string message)
|
||||
|
||||
/// Clears any error messages currently being shown
|
||||
signal clearError()
|
||||
signal clearError
|
||||
|
||||
/// Closes the login dialog
|
||||
signal closeDialog()
|
||||
signal closeDialog
|
||||
}
|
||||
|
||||
@@ -20,13 +20,7 @@ Kirigami.Dialog {
|
||||
/**
|
||||
* @brief Signal emitted when a valid room id or alias is entered.
|
||||
*/
|
||||
signal roomSelected(string roomId,
|
||||
string displayName,
|
||||
url avatarUrl,
|
||||
string alias,
|
||||
string topic,
|
||||
int memberCount,
|
||||
bool isJoined)
|
||||
signal roomSelected(string roomId, string displayName, url avatarUrl, string alias, string topic, int memberCount, bool isJoined)
|
||||
|
||||
title: i18nc("@title", "Room ID or Alias")
|
||||
|
||||
@@ -54,7 +48,7 @@ Kirigami.Dialog {
|
||||
if (roomIdAliasText.room) {
|
||||
roomId = roomIdAliasText.room.id;
|
||||
displayName = roomIdAliasText.room.displayName;
|
||||
avatarUrl = roomIdAliasText.room.avatarUrl.toString().length > 0 ? connection.makeMediaUrl(roomIdAliasText.room.avatarUrl) : ""
|
||||
avatarUrl = roomIdAliasText.room.avatarUrl.toString().length > 0 ? connection.makeMediaUrl(roomIdAliasText.room.avatarUrl) : "";
|
||||
alias = roomIdAliasText.room.canonicalAlias;
|
||||
topic = roomIdAliasText.room.topic;
|
||||
memberCount = roomIdAliasText.room.joinedCount;
|
||||
@@ -112,7 +106,7 @@ Kirigami.Dialog {
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
roomIdAliasText.forceActiveFocus()
|
||||
timer.restart()
|
||||
roomIdAliasText.forceActiveFocus();
|
||||
timer.restart();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ Kirigami.Dialog {
|
||||
/**
|
||||
* @brief Thrown when a user is selected.
|
||||
*/
|
||||
signal userSelected()
|
||||
signal userSelected
|
||||
|
||||
title: i18nc("@title", "User ID")
|
||||
|
||||
@@ -37,7 +37,7 @@ Kirigami.Dialog {
|
||||
text: i18n("OK")
|
||||
icon.name: "dialog-ok"
|
||||
onTriggered: {
|
||||
root.connection.openOrCreateDirectChat(userIdText.text)
|
||||
root.connection.openOrCreateDirectChat(userIdText.text);
|
||||
root.accept();
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ Kirigami.Dialog {
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
userIdText.forceActiveFocus()
|
||||
timer.restart()
|
||||
userIdText.forceActiveFocus();
|
||||
timer.restart();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ TimelineDelegate {
|
||||
/**
|
||||
* @brief Open the any message media externally.
|
||||
*/
|
||||
signal openExternally()
|
||||
signal openExternally
|
||||
|
||||
/**
|
||||
* @brief The reply has been clicked.
|
||||
@@ -293,7 +293,9 @@ TimelineDelegate {
|
||||
*/
|
||||
property bool isTemporaryHighlighted: false
|
||||
|
||||
onIsTemporaryHighlightedChanged: if (isTemporaryHighlighted) temporaryHighlightTimer.start()
|
||||
onIsTemporaryHighlightedChanged: if (isTemporaryHighlighted) {
|
||||
temporaryHighlightTimer.start();
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: temporaryHighlightTimer
|
||||
@@ -329,20 +331,20 @@ TimelineDelegate {
|
||||
|
||||
Component.onCompleted: {
|
||||
if (root.isReply && root.replyDelegateType === DelegateType.Other) {
|
||||
root.room.loadReply(root.eventId, root.replyId)
|
||||
root.room.loadReply(root.eventId, root.replyId);
|
||||
}
|
||||
}
|
||||
|
||||
// show hover actions
|
||||
onHoveredChanged: {
|
||||
if (hovered && !Kirigami.Settings.isMobile) {
|
||||
root.setHoverActionsToDelegate()
|
||||
root.setHoverActionsToDelegate();
|
||||
}
|
||||
}
|
||||
|
||||
KirigamiComponents.AvatarButton {
|
||||
id: avatar
|
||||
width: visible || Config.showAvatarInTimeline ? Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2: 0
|
||||
width: visible || Config.showAvatarInTimeline ? Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2 : 0
|
||||
height: width
|
||||
anchors {
|
||||
left: parent.left
|
||||
@@ -351,9 +353,7 @@ TimelineDelegate {
|
||||
topMargin: Kirigami.Units.smallSpacing
|
||||
}
|
||||
|
||||
visible: (root.showAuthor || root.alwaysShowAuthor) &&
|
||||
Config.showAvatarInTimeline &&
|
||||
(Config.compactLayout || !_private.showUserMessageOnRight)
|
||||
visible: (root.showAuthor || root.alwaysShowAuthor) && Config.showAvatarInTimeline && (Config.compactLayout || !_private.showUserMessageOnRight)
|
||||
name: root.author.displayName
|
||||
source: root.author.avatarSource
|
||||
color: root.author.color
|
||||
@@ -409,7 +409,9 @@ TimelineDelegate {
|
||||
replyDisplay: root.replyDisplay
|
||||
replyMediaInfo: root.replyMediaInfo
|
||||
|
||||
onReplyClicked: (eventId) => {root.replyClicked(eventId)}
|
||||
onReplyClicked: eventId => {
|
||||
root.replyClicked(eventId);
|
||||
}
|
||||
|
||||
showBackground: root.cardBackground && !Config.compactLayout
|
||||
}
|
||||
@@ -440,7 +442,7 @@ TimelineDelegate {
|
||||
visible: root.showReactions
|
||||
model: root.reaction
|
||||
|
||||
onReactionClicked: (reaction) => root.room.toggleReaction(root.eventId, reaction)
|
||||
onReactionClicked: reaction => root.room.toggleReaction(root.eventId, reaction)
|
||||
}
|
||||
AvatarFlow {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
@@ -463,13 +465,13 @@ TimelineDelegate {
|
||||
}
|
||||
|
||||
function isVisibleInTimeline() {
|
||||
let yoff = Math.round(y - ListView.view.contentY);
|
||||
return (yoff + height > 0 && yoff < ListView.view.height)
|
||||
let yoff = Math.round(y - ListView.view.contentY);
|
||||
return (yoff + height > 0 && yoff < ListView.view.height);
|
||||
}
|
||||
|
||||
function setHoverActionsToDelegate() {
|
||||
if (ListView.view.setHoverActionsToDelegate) {
|
||||
ListView.view.setHoverActionsToDelegate(root)
|
||||
ListView.view.setHoverActionsToDelegate(root);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,11 +115,11 @@ Loader {
|
||||
}, {
|
||||
title: i18nc("@title", "Forward Message"),
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
})
|
||||
page.chosen.connect(function(targetRoomId) {
|
||||
root.connection.room(targetRoomId).postHtmlMessage(root.plainText, root.htmlText.length > 0 ? root.htmlText : root.plainText)
|
||||
page.closeDialog()
|
||||
})
|
||||
});
|
||||
page.chosen.connect(function (targetRoomId) {
|
||||
root.connection.room(targetRoomId).postHtmlMessage(root.plainText, root.htmlText.length > 0 ? root.htmlText : root.plainText);
|
||||
page.closeDialog();
|
||||
});
|
||||
}
|
||||
},
|
||||
Kirigami.Action {
|
||||
@@ -127,7 +127,10 @@ Loader {
|
||||
text: i18n("Remove")
|
||||
icon.name: "edit-delete-remove"
|
||||
icon.color: "red"
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/RemoveSheet.qml", {room: currentRoom, eventId: eventId}, {
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/RemoveSheet.qml", {
|
||||
room: currentRoom,
|
||||
eventId: eventId
|
||||
}, {
|
||||
title: i18nc("@title", "Remove Message"),
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
})
|
||||
@@ -141,7 +144,10 @@ Loader {
|
||||
text: i18nc("@action:button 'Report' as in 'Report this event to the administrators'", "Report")
|
||||
icon.name: "dialog-warning-symbolic"
|
||||
visible: !author.isLocalUser
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ReportSheet.qml", {room: currentRoom, eventId: eventId}, {
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ReportSheet.qml", {
|
||||
room: currentRoom,
|
||||
eventId: eventId
|
||||
}, {
|
||||
title: i18nc("@title", "Report Message"),
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
})
|
||||
@@ -156,7 +162,7 @@ Loader {
|
||||
text: i18n("Copy Link")
|
||||
icon.name: "edit-copy"
|
||||
onTriggered: {
|
||||
Clipboard.saveText("https://matrix.to/#/" + currentRoom.id + "/" + root.eventId)
|
||||
Clipboard.saveText("https://matrix.to/#/" + currentRoom.id + "/" + root.eventId);
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -180,12 +186,14 @@ Loader {
|
||||
icon.name: modelData.icon.name
|
||||
onTriggered: modelData.trigger()
|
||||
}
|
||||
onObjectAdded: (index, object) => {menuItem.insertItem(0, object)}
|
||||
onObjectAdded: (index, object) => {
|
||||
menuItem.insertItem(0, object);
|
||||
}
|
||||
}
|
||||
}
|
||||
onObjectAdded: (index, object) => {
|
||||
object.visible = false;
|
||||
menu.addMenu(object)
|
||||
menu.addMenu(object);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +202,7 @@ Loader {
|
||||
QQC2.MenuItem {
|
||||
visible: modelData.visible
|
||||
action: modelData
|
||||
onClicked: root.item.close();
|
||||
onClicked: root.item.close()
|
||||
}
|
||||
}
|
||||
QQC2.Menu {
|
||||
@@ -202,7 +210,7 @@ Loader {
|
||||
title: i18n("Search for '%1'", webshortcutmodel.trunkatedSearchText)
|
||||
property bool isVisible: webshortcutmodel.enabled
|
||||
Component.onCompleted: {
|
||||
webshortcutmenu.parent.visible = isVisible
|
||||
webshortcutmenu.parent.visible = isVisible;
|
||||
}
|
||||
onIsVisibleChanged: webshortcutmenu.parent.visible = isVisible
|
||||
Instantiator {
|
||||
@@ -279,7 +287,7 @@ Loader {
|
||||
visible: modelData.visible
|
||||
text: modelData.text
|
||||
onClicked: {
|
||||
modelData.triggered()
|
||||
modelData.triggered();
|
||||
root.item.close();
|
||||
}
|
||||
}
|
||||
@@ -315,7 +323,7 @@ Loader {
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
onLinkActivated: RoomManager.resolveResource(link, "join");
|
||||
onLinkActivated: RoomManager.resolveResource(link, "join")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -361,7 +369,7 @@ Loader {
|
||||
visible: modelData.visible
|
||||
text: modelData.text
|
||||
onClicked: {
|
||||
modelData.triggered()
|
||||
modelData.triggered();
|
||||
root.item.close();
|
||||
}
|
||||
}
|
||||
@@ -401,4 +409,3 @@ Loader {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ QQC2.TextArea {
|
||||
|
||||
required property NeoChatRoom room
|
||||
onRoomChanged: {
|
||||
_private.chatBarCache = room.editCache
|
||||
_private.chatBarCache.relationIdChanged.connect(_private.updateEditText)
|
||||
_private.chatBarCache = room.editCache;
|
||||
_private.chatBarCache.relationIdChanged.connect(_private.updateEditText);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,37 +37,37 @@ QQC2.TextArea {
|
||||
wrapMode: TextEdit.Wrap
|
||||
|
||||
onTextChanged: {
|
||||
_private.chatBarCache.text = text
|
||||
_private.chatBarCache.text = text;
|
||||
}
|
||||
|
||||
Keys.onEnterPressed: {
|
||||
if (completionMenu.visible) {
|
||||
completionMenu.complete()
|
||||
completionMenu.complete();
|
||||
} else if (event.modifiers & Qt.ShiftModifier) {
|
||||
root.insert(cursorPosition, "\n")
|
||||
root.insert(cursorPosition, "\n");
|
||||
} else {
|
||||
root.postEdit();
|
||||
}
|
||||
}
|
||||
Keys.onReturnPressed: {
|
||||
if (completionMenu.visible) {
|
||||
completionMenu.complete()
|
||||
completionMenu.complete();
|
||||
} else if (event.modifiers & Qt.ShiftModifier) {
|
||||
root.insert(cursorPosition, "\n")
|
||||
root.insert(cursorPosition, "\n");
|
||||
} else {
|
||||
root.postEdit();
|
||||
}
|
||||
}
|
||||
Keys.onTabPressed: {
|
||||
if (completionMenu.visible) {
|
||||
completionMenu.complete()
|
||||
completionMenu.complete();
|
||||
}
|
||||
}
|
||||
Keys.onPressed: event => {
|
||||
if (event.key === Qt.Key_Up && completionMenu.visible) {
|
||||
completionMenu.decrementIndex()
|
||||
completionMenu.decrementIndex();
|
||||
} else if (event.key === Qt.Key_Down && completionMenu.visible) {
|
||||
completionMenu.incrementIndex()
|
||||
completionMenu.incrementIndex();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,12 +156,10 @@ QQC2.TextArea {
|
||||
|
||||
function updateEditText() {
|
||||
if (chatBarCache?.isEditing && chatBarCache.relationMessage.length > 0) {
|
||||
root.text = chatBarCache.relationMessage
|
||||
root.text = chatBarCache.relationMessage;
|
||||
root.forceActiveFocus();
|
||||
root.cursorPosition = root.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -100,4 +100,3 @@ Kirigami.Page {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ Components.AlbumMaximizeComponent {
|
||||
downloadAction: Components.DownloadAction {
|
||||
id: downloadAction
|
||||
onTriggered: {
|
||||
currentRoom.downloadFile(root.currentEventId, Platform.StandardPaths.writableLocation(Platform.StandardPaths.CacheLocation) + "/" + root.currentEventId.replace(":", "_").replace("/", "_").replace("+", "_") + currentRoom.fileNameToDownload(root.currentEventId))
|
||||
currentRoom.downloadFile(root.currentEventId, Platform.StandardPaths.writableLocation(Platform.StandardPaths.CacheLocation) + "/" + root.currentEventId.replace(":", "_").replace("/", "_").replace("+", "_") + currentRoom.fileNameToDownload(root.currentEventId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ Components.AlbumMaximizeComponent {
|
||||
|
||||
function onFileTransferProgress(id, progress, total) {
|
||||
if (id == root.currentEventId) {
|
||||
downloadAction.progress = progress / total * 100.0
|
||||
downloadAction.progress = progress / total * 100.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ Components.AlbumMaximizeComponent {
|
||||
target: content
|
||||
|
||||
function onCurrentIndexChanged() {
|
||||
downloadAction.progress = currentProgressInfo.progress / currentProgressInfo.total * 100.0
|
||||
downloadAction.progress = currentProgressInfo.progress / currentProgressInfo.total * 100.0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,25 +87,18 @@ Components.AlbumMaximizeComponent {
|
||||
}
|
||||
}
|
||||
}
|
||||
onItemRightClicked: RoomManager.viewEventMenu(root.currentEventId,
|
||||
root.currentAuthor,
|
||||
root.currentDelegateType,
|
||||
root.currentPlainText,
|
||||
"",
|
||||
"",
|
||||
root.currentMimeType,
|
||||
root.currentProgressInfo)
|
||||
onItemRightClicked: RoomManager.viewEventMenu(root.currentEventId, root.currentAuthor, root.currentDelegateType, root.currentPlainText, "", "", root.currentMimeType, root.currentProgressInfo)
|
||||
|
||||
onSaveItem: {
|
||||
var dialog = saveAsDialog.createObject(QQC2.ApplicationWindow.overlay)
|
||||
dialog.open()
|
||||
dialog.currentFile = dialog.folder + "/" + currentRoom.fileNameToDownload(root.currentEventId)
|
||||
var dialog = saveAsDialog.createObject(QQC2.ApplicationWindow.overlay);
|
||||
dialog.open();
|
||||
dialog.currentFile = dialog.folder + "/" + currentRoom.fileNameToDownload(root.currentEventId);
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: RoomManager
|
||||
function onCloseFullScreen() {
|
||||
root.close()
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,12 +108,12 @@ Components.AlbumMaximizeComponent {
|
||||
fileMode: FileDialog.SaveFile
|
||||
folder: root.saveFolder
|
||||
onAccepted: {
|
||||
Config.lastSaveDirectory = folder
|
||||
Config.save()
|
||||
Config.lastSaveDirectory = folder;
|
||||
Config.save();
|
||||
if (!currentFile) {
|
||||
return;
|
||||
}
|
||||
currentRoom.downloadFile(rooteventId, currentFile)
|
||||
currentRoom.downloadFile(rooteventId, currentFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ FormCard.FormCardPage {
|
||||
checked: currentType === 0
|
||||
enabled: !Config.isProxyTypeImmutable
|
||||
onToggled: {
|
||||
currentType = 0
|
||||
currentType = 0;
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
@@ -35,7 +35,7 @@ FormCard.FormCardPage {
|
||||
checked: currentType === 1
|
||||
enabled: !Config.isProxyTypeImmutable
|
||||
onToggled: {
|
||||
currentType = 1
|
||||
currentType = 1;
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
@@ -43,7 +43,7 @@ FormCard.FormCardPage {
|
||||
checked: currentType === 2
|
||||
enabled: !Config.isProxyTypeImmutable
|
||||
onToggled: {
|
||||
currentType = 2
|
||||
currentType = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ FormCard.FormCardPage {
|
||||
text: Config.proxyHost
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||
onEditingFinished: {
|
||||
proxyConfigChanged = true
|
||||
proxyConfigChanged = true;
|
||||
}
|
||||
}
|
||||
FormCard.FormSpinBoxDelegate {
|
||||
@@ -67,11 +67,11 @@ FormCard.FormCardPage {
|
||||
value: Config.proxyPort
|
||||
from: 0
|
||||
to: 65536
|
||||
textFromValue: function(value, locale) {
|
||||
return value // it will add a thousands separator if we don't do this, not sure why
|
||||
textFromValue: function (value, locale) {
|
||||
return value; // it will add a thousands separator if we don't do this, not sure why
|
||||
}
|
||||
onValueChanged: {
|
||||
proxyConfigChanged = true
|
||||
proxyConfigChanged = true;
|
||||
}
|
||||
}
|
||||
FormCard.FormTextFieldDelegate {
|
||||
@@ -80,7 +80,7 @@ FormCard.FormCardPage {
|
||||
text: Config.proxyUser
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||
onEditingFinished: {
|
||||
proxyConfigChanged = true
|
||||
proxyConfigChanged = true;
|
||||
}
|
||||
}
|
||||
FormCard.FormTextFieldDelegate {
|
||||
@@ -90,7 +90,7 @@ FormCard.FormCardPage {
|
||||
echoMode: TextInput.Password
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||
onEditingFinished: {
|
||||
proxyConfigChanged = true
|
||||
proxyConfigChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,24 +102,24 @@ FormCard.FormCardPage {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
QQC2.Button {
|
||||
QQC2.Button {
|
||||
text: i18n("Apply")
|
||||
enabled: currentType !== Config.proxyType || proxyConfigChanged
|
||||
onClicked: {
|
||||
Config.proxyType = currentType
|
||||
Config.proxyHost = hostField.text
|
||||
Config.proxyPort = portField.value
|
||||
Config.proxyUser = userField.text
|
||||
Config.proxyPassword = passwordField.text
|
||||
Config.save()
|
||||
proxyConfigChanged = false
|
||||
ProxyController.setApplicationProxy()
|
||||
Config.proxyType = currentType;
|
||||
Config.proxyHost = hostField.text;
|
||||
Config.proxyPort = portField.value;
|
||||
Config.proxyUser = userField.text;
|
||||
Config.proxyPassword = passwordField.text;
|
||||
Config.save();
|
||||
proxyConfigChanged = false;
|
||||
ProxyController.setApplicationProxy();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
currentType = Config.proxyType
|
||||
currentType = Config.proxyType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,17 +24,17 @@ FormCard.AbstractFormDelegate {
|
||||
readonly property bool highlightOn: isNotificationRuleHighlight(ruleAction)
|
||||
|
||||
signal actionChanged(int action)
|
||||
signal deleteRule()
|
||||
signal deleteRule
|
||||
|
||||
enabled: ruleAction !== PushRuleAction.Unknown
|
||||
|
||||
text: name
|
||||
|
||||
onClicked: {
|
||||
notificationAction = nextNotificationRuleAction(notificationAction)
|
||||
notificationAction = nextNotificationRuleAction(notificationAction);
|
||||
}
|
||||
|
||||
contentItem : RowLayout {
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
|
||||
QQC2.Label {
|
||||
@@ -78,7 +78,7 @@ FormCard.AbstractFormDelegate {
|
||||
enabled: root.enabled
|
||||
down: checked
|
||||
onToggled: {
|
||||
root.actionChanged(root.notifcationRuleAction())
|
||||
root.actionChanged(root.notifcationRuleAction());
|
||||
}
|
||||
|
||||
QQC2.ToolTip {
|
||||
@@ -99,7 +99,7 @@ FormCard.AbstractFormDelegate {
|
||||
enabled: (onButton.checked || !root.notificationsOnModifiable) && root.enabled
|
||||
down: checked
|
||||
onToggled: {
|
||||
root.actionChanged(root.notifcationRuleAction())
|
||||
root.actionChanged(root.notifcationRuleAction());
|
||||
}
|
||||
|
||||
QQC2.ToolTip {
|
||||
@@ -121,7 +121,7 @@ FormCard.AbstractFormDelegate {
|
||||
enabled: (onButton.checked || !root.notificationsOnModifiable) && root.enabled
|
||||
down: checked
|
||||
onToggled: {
|
||||
root.actionChanged(root.notifcationRuleAction())
|
||||
root.actionChanged(root.notifcationRuleAction());
|
||||
}
|
||||
|
||||
QQC2.ToolTip {
|
||||
@@ -138,7 +138,7 @@ FormCard.AbstractFormDelegate {
|
||||
visible: root.deletable
|
||||
|
||||
onClicked: {
|
||||
root.deleteRule()
|
||||
root.deleteRule();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,57 +147,49 @@ FormCard.AbstractFormDelegate {
|
||||
function notifcationRuleAction() {
|
||||
if (onButton.checked) {
|
||||
if (noisyButton.checked && highlightButton.checked && root.highlightable) {
|
||||
return PushRuleAction.NoisyHighlight
|
||||
return PushRuleAction.NoisyHighlight;
|
||||
} else if (noisyButton.checked) {
|
||||
return PushRuleAction.Noisy
|
||||
return PushRuleAction.Noisy;
|
||||
} else if (highlightButton.checked && root.highlightable) {
|
||||
return PushRuleAction.Highlight
|
||||
return PushRuleAction.Highlight;
|
||||
} else {
|
||||
return PushRuleAction.On
|
||||
return PushRuleAction.On;
|
||||
}
|
||||
} else {
|
||||
return PushRuleAction.Off
|
||||
return PushRuleAction.Off;
|
||||
}
|
||||
}
|
||||
|
||||
function nextNotificationRuleAction(action) {
|
||||
let finished = false
|
||||
|
||||
let finished = false;
|
||||
if (action == PushRuleAction.NoisyHighlight) {
|
||||
action = PushRuleAction.Off
|
||||
action = PushRuleAction.Off;
|
||||
} else {
|
||||
action += 1
|
||||
action += 1;
|
||||
}
|
||||
|
||||
while (!finished) {
|
||||
if (action == PushRuleAction.Off && !root.notificationsOnModifiable) {
|
||||
action = PushRuleAction.On
|
||||
action = PushRuleAction.On;
|
||||
} else if (action == PushRuleAction.Noisy) {
|
||||
action = PushRuleAction.Highlight
|
||||
action = PushRuleAction.Highlight;
|
||||
} else if (action == PushRuleAction.Highlight && !root.highlightable) {
|
||||
action = PushRuleAction.Off
|
||||
action = PushRuleAction.Off;
|
||||
} else {
|
||||
finished = true
|
||||
finished = true;
|
||||
}
|
||||
}
|
||||
|
||||
actionChanged(action)
|
||||
actionChanged(action);
|
||||
}
|
||||
|
||||
function isNotificationRuleOn(action) {
|
||||
return action == PushRuleAction.On ||
|
||||
action == PushRuleAction.Noisy ||
|
||||
action == PushRuleAction.Highlight ||
|
||||
action == PushRuleAction.NoisyHighlight
|
||||
return action == PushRuleAction.On || action == PushRuleAction.Noisy || action == PushRuleAction.Highlight || action == PushRuleAction.NoisyHighlight;
|
||||
}
|
||||
|
||||
function isNotificationRuleNoisy(action) {
|
||||
return action == PushRuleAction.Noisy ||
|
||||
action == PushRuleAction.NoisyHighlight
|
||||
return action == PushRuleAction.Noisy || action == PushRuleAction.NoisyHighlight;
|
||||
}
|
||||
|
||||
function isNotificationRuleHighlight(action) {
|
||||
return action == PushRuleAction.Highlight ||
|
||||
action == PushRuleAction.NoisyHighlight
|
||||
return action == PushRuleAction.Highlight || action == PushRuleAction.NoisyHighlight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,11 +15,12 @@ LoginStep {
|
||||
Connections {
|
||||
target: LoginHelper
|
||||
function onConnected() {
|
||||
processed("qrc:/org/kde/neochat/qml/Loading.qml")
|
||||
processed("qrc:/org/kde/neochat/qml/Loading.qml");
|
||||
}
|
||||
}
|
||||
|
||||
onActiveFocusChanged: if(activeFocus) passwordField.forceActiveFocus()
|
||||
onActiveFocusChanged: if (activeFocus)
|
||||
passwordField.forceActiveFocus()
|
||||
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: passwordField
|
||||
@@ -32,7 +33,7 @@ LoginStep {
|
||||
statusMessage: LoginHelper.isInvalidPassword ? i18n("Invalid username or password") : ""
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
root.nextAction.trigger()
|
||||
root.nextAction.trigger();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ LoginStep {
|
||||
text: i18nc("@action:button", "Login")
|
||||
enabled: passwordField.text.length > 0 && !LoginHelper.isLoggingIn
|
||||
onTriggered: {
|
||||
root.clearError()
|
||||
root.clearError();
|
||||
LoginHelper.login();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ FormCard.FormCardPage {
|
||||
sourceModel: userListModel
|
||||
sortRoleName: "powerLevel"
|
||||
sortOrder: Qt.DescendingOrder
|
||||
filterRowCallback: function(source_row, source_parent) {
|
||||
let powerLevelRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), UserListModel.PowerLevelRole)
|
||||
filterRowCallback: function (source_row, source_parent) {
|
||||
let powerLevelRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), UserListModel.PowerLevelRole);
|
||||
return powerLevelRole > 0;
|
||||
}
|
||||
}
|
||||
@@ -68,20 +68,31 @@ FormCard.FormCardPage {
|
||||
* before the first delegate sets it's current index.
|
||||
*/
|
||||
if (powerLevelModel.count == 0) {
|
||||
powerLevelModel.append({"text": i18n("Member (0)"), "powerLevel": 0});
|
||||
powerLevelModel.append({"text": i18n("Moderator (50)"), "powerLevel": 50});
|
||||
powerLevelModel.append({"text": i18n("Admin (100)"), "powerLevel": 100});
|
||||
powerLevelModel.append({
|
||||
"text": i18n("Member (0)"),
|
||||
"powerLevel": 0
|
||||
});
|
||||
powerLevelModel.append({
|
||||
"text": i18n("Moderator (50)"),
|
||||
"powerLevel": 50
|
||||
});
|
||||
powerLevelModel.append({
|
||||
"text": i18n("Admin (100)"),
|
||||
"powerLevel": 100
|
||||
});
|
||||
}
|
||||
currentIndex = indexOfValue(powerLevel)
|
||||
currentIndex = indexOfValue(powerLevel);
|
||||
}
|
||||
onActivated: {
|
||||
room.setUserPowerLevel(userId, currentValue)
|
||||
room.setUserPowerLevel(userId, currentValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FormCard.FormDelegateSeparator { below: userListSearchCard }
|
||||
FormCard.FormDelegateSeparator {
|
||||
below: userListSearchCard
|
||||
}
|
||||
FormCard.AbstractFormDelegate {
|
||||
id: userListSearchCard
|
||||
visible: room.canSendState("m.room.power_levels")
|
||||
@@ -111,7 +122,6 @@ FormCard.FormCardPage {
|
||||
let maxHeight = userListSearchField.mapToGlobal(userListSearchField.x, userListSearchField.y).y - Kirigami.Units.largeSpacing * 3;
|
||||
let minHeight = Kirigami.Units.gridUnit * 2 + userListSearchPopup.padding * 2;
|
||||
let filterContentHeight = userListView.contentHeight + userListSearchPopup.padding * 2;
|
||||
|
||||
return Math.max(Math.min(filterContentHeight, maxHeight), minHeight);
|
||||
}
|
||||
padding: Kirigami.Units.smallSpacing
|
||||
@@ -157,9 +167,9 @@ FormCard.FormCardPage {
|
||||
|
||||
onFilterTextChanged: {
|
||||
if (filterText.length > 0 && !userListSearchPopup.visible) {
|
||||
userListSearchPopup.open()
|
||||
userListSearchPopup.open();
|
||||
} else if (filterText.length <= 0 && userListSearchPopup.visible) {
|
||||
userListSearchPopup.close()
|
||||
userListSearchPopup.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -204,7 +214,7 @@ FormCard.FormCardPage {
|
||||
action: Kirigami.Action {
|
||||
id: editPowerLevelAction
|
||||
onTriggered: {
|
||||
userListSearchPopup.close()
|
||||
userListSearchPopup.close();
|
||||
let dialog = powerLevelDialog.createObject(applicationWindow().overlay, {
|
||||
room: root.room,
|
||||
userId: userListItem.userId,
|
||||
@@ -240,7 +250,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.defaultUserPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.defaultUserPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.defaultUserPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Default power level to set the room state")
|
||||
@@ -249,7 +261,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.statePowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.statePowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.statePowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Default power level to send messages")
|
||||
@@ -258,7 +272,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.defaultEventPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.defaultEventPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.defaultEventPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +290,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.invitePowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.invitePowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.invitePowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Kick users")
|
||||
@@ -282,7 +300,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.kickPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.kickPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.kickPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Ban users")
|
||||
@@ -290,7 +310,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.banPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.banPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.banPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Remove message sent by other users")
|
||||
@@ -298,7 +320,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.redactPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.redactPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.redactPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,7 +339,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.powerLevelPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.powerLevelPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.powerLevelPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Change the room name")
|
||||
@@ -324,7 +350,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.namePowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.namePowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.namePowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Change the room avatar")
|
||||
@@ -333,7 +361,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.avatarPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.avatarPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.avatarPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Change the room canonical alias")
|
||||
@@ -342,7 +372,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.canonicalAliasPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.canonicalAliasPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.canonicalAliasPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Change the room topic")
|
||||
@@ -351,7 +383,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.topicPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.topicPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.topicPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Enable encryption for the room")
|
||||
@@ -360,7 +394,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.encryptionPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.encryptionPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.encryptionPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Change the room history visibility")
|
||||
@@ -369,7 +405,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.historyVisibilityPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.historyVisibilityPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.historyVisibilityPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Set pinned events")
|
||||
@@ -378,7 +416,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.pinnedEventsPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.pinnedEventsPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.pinnedEventsPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Upgrade the room")
|
||||
@@ -387,7 +427,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.tombstonePowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.tombstonePowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.tombstonePowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Set the room server access control list (ACL)")
|
||||
@@ -396,7 +438,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.serverAclPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.serverAclPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.serverAclPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
visible: room.isSpace
|
||||
@@ -406,7 +450,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.spaceChildPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.spaceChildPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.spaceChildPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
FormCard.FormComboBoxDelegate {
|
||||
text: i18n("Set the parent space of this room")
|
||||
@@ -415,7 +461,9 @@ FormCard.FormCardPage {
|
||||
valueRole: "powerLevel"
|
||||
model: powerLevelModel
|
||||
Component.onCompleted: currentIndex = indexOfValue(room.spaceChildPowerLevel)
|
||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.spaceParentPowerLevel = currentValue
|
||||
onCurrentValueChanged: if (room.canSendState("m.room.power_levels")) {
|
||||
room.spaceParentPowerLevel = currentValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ MessageDelegate {
|
||||
}
|
||||
}
|
||||
Label {
|
||||
visible: root.pollHandler.kind == "org.matrix.msc3381.poll.disclosed" || root.pollHandler.hasEnded
|
||||
visible: root.pollHandler.kind == "org.matrix.msc3381.poll.disclosed" || root.pollHandler.hasEnded
|
||||
text: i18np("Based on votes by %1 user", "Based on votes by %1 users", root.pollHandler.answerCount) + (root.pollHandler.hasEnded ? (" " + i18nc("as in 'this vote has ended'", "(Ended)")) : "")
|
||||
font.pointSize: questionLabel.font.pointSize * 0.8
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ Kirigami.Dialog {
|
||||
|
||||
onOpened: {
|
||||
if (root.opened) {
|
||||
powerLevelComboBox.currentIndex = powerLevelComboBox.indexOfValue(root.powerLevel)
|
||||
powerLevelComboBox.currentIndex = powerLevelComboBox.indexOfValue(root.powerLevel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,18 @@ Kirigami.Dialog {
|
||||
|
||||
// Done this way so we can have translated strings.
|
||||
Component.onCompleted: {
|
||||
powerLevelModel.append({"text": i18n("Member (0)"), "powerLevel": 0});
|
||||
powerLevelModel.append({"text": i18n("Moderator (50)"), "powerLevel": 50});
|
||||
powerLevelModel.append({"text": i18n("Admin (100)"), "powerLevel": 100});
|
||||
powerLevelModel.append({
|
||||
"text": i18n("Member (0)"),
|
||||
"powerLevel": 0
|
||||
});
|
||||
powerLevelModel.append({
|
||||
"text": i18n("Moderator (50)"),
|
||||
"powerLevel": 50
|
||||
});
|
||||
powerLevelModel.append({
|
||||
"text": i18n("Admin (100)"),
|
||||
"powerLevel": 100
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,9 +61,9 @@ Kirigami.Dialog {
|
||||
text: i18n("Confirm")
|
||||
icon.name: "dialog-ok"
|
||||
onTriggered: {
|
||||
root.room.setUserPowerLevel(root.userId, powerLevelComboBox.currentValue)
|
||||
root.close()
|
||||
root.destroy()
|
||||
root.room.setUserPowerLevel(root.userId, powerLevelComboBox.currentValue);
|
||||
root.close();
|
||||
root.destroy();
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -32,31 +32,31 @@ FormCard.FormCardPage {
|
||||
checked: room.pushNotificationState === PushNotificationState.Default
|
||||
enabled: room.pushNotificationState !== PushNotificationState.Unknown
|
||||
onToggled: {
|
||||
room.pushNotificationState = PushNotificationState.Default
|
||||
room.pushNotificationState = PushNotificationState.Default;
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
text: i18nc("As in 'notify for all messages'","All")
|
||||
text: i18nc("As in 'notify for all messages'", "All")
|
||||
checked: room.pushNotificationState === PushNotificationState.All
|
||||
enabled: room.pushNotificationState !== PushNotificationState.Unknown
|
||||
onToggled: {
|
||||
room.pushNotificationState = PushNotificationState.All
|
||||
room.pushNotificationState = PushNotificationState.All;
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
text: i18nc("As in 'notify when the user is mentioned or the message contains a set keyword'","@Mentions and Keywords")
|
||||
text: i18nc("As in 'notify when the user is mentioned or the message contains a set keyword'", "@Mentions and Keywords")
|
||||
checked: room.pushNotificationState === PushNotificationState.MentionKeyword
|
||||
enabled: room.pushNotificationState !== PushNotificationState.Unknown
|
||||
onToggled: {
|
||||
room.pushNotificationState = PushNotificationState.MentionKeyword
|
||||
room.pushNotificationState = PushNotificationState.MentionKeyword;
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
text: i18nc("As in 'do not notify for any messages'","Off")
|
||||
text: i18nc("As in 'do not notify for any messages'", "Off")
|
||||
checked: room.pushNotificationState === PushNotificationState.Mute
|
||||
enabled: room.pushNotificationState !== PushNotificationState.Unknown
|
||||
onToggled: {
|
||||
room.pushNotificationState = PushNotificationState.Mute
|
||||
room.pushNotificationState = PushNotificationState.Mute;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,9 +69,9 @@ FormCard.FormCardPage {
|
||||
model: KSortFilterProxyModel {
|
||||
sourceModel: root.pushRuleModel
|
||||
|
||||
filterRowCallback: function(source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole)
|
||||
let roomIdRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.RoomIdRole)
|
||||
filterRowCallback: function (source_row, source_parent) {
|
||||
let sectionRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.SectionRole);
|
||||
let roomIdRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), PushRuleModel.RoomIdRole);
|
||||
return sectionRole == PushRuleSection.RoomKeywords && roomIdRole == root.room.id;
|
||||
}
|
||||
}
|
||||
@@ -82,16 +82,16 @@ FormCard.FormCardPage {
|
||||
id: ruleDelegate
|
||||
NotificationRuleItem {
|
||||
onDeleteRule: {
|
||||
root.pushRuleModel.removeKeyword(id)
|
||||
root.pushRuleModel.removeKeyword(id);
|
||||
}
|
||||
onActionChanged: (action) => root.pushRuleModel.setPushRuleAction(id, action)
|
||||
onActionChanged: action => root.pushRuleModel.setPushRuleAction(id, action)
|
||||
}
|
||||
}
|
||||
}
|
||||
FormCard.AbstractFormDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem : RowLayout {
|
||||
contentItem: RowLayout {
|
||||
Kirigami.ActionTextField {
|
||||
id: keywordAddField
|
||||
|
||||
@@ -104,13 +104,13 @@ FormCard.FormCardPage {
|
||||
icon.name: "edit-clear"
|
||||
visible: keywordAddField.text.length > 0
|
||||
onTriggered: {
|
||||
keywordAddField.text = ""
|
||||
keywordAddField.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
root.pushRuleModel.addKeyword(keywordAddField.text, root.room.id)
|
||||
keywordAddField.text = ""
|
||||
root.pushRuleModel.addKeyword(keywordAddField.text, root.room.id);
|
||||
keywordAddField.text = "";
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
@@ -123,8 +123,8 @@ FormCard.FormCardPage {
|
||||
enabled: NotificationsManager.keywordNotificationAction !== PushRuleAction.Unknown && keywordAddField.text.length > 0
|
||||
|
||||
onClicked: {
|
||||
root.pushRuleModel.addKeyword(keywordAddField.text, root.room.id)
|
||||
keywordAddField.text = ""
|
||||
root.pushRuleModel.addKeyword(keywordAddField.text, root.room.id);
|
||||
keywordAddField.text = "";
|
||||
}
|
||||
|
||||
QQC2.ToolTip {
|
||||
|
||||
@@ -27,10 +27,10 @@ QQC2.Popup {
|
||||
const format = {
|
||||
start: "**",
|
||||
end: "**",
|
||||
extra: "",
|
||||
}
|
||||
formattingSelected(format, selectionStart, selectionEnd)
|
||||
root.close()
|
||||
extra: ""
|
||||
};
|
||||
formattingSelected(format, selectionStart, selectionEnd);
|
||||
root.close();
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
@@ -46,10 +46,10 @@ QQC2.Popup {
|
||||
const format = {
|
||||
start: "*",
|
||||
end: "*",
|
||||
extra: "",
|
||||
}
|
||||
formattingSelected(format, selectionStart, selectionEnd)
|
||||
root.close()
|
||||
extra: ""
|
||||
};
|
||||
formattingSelected(format, selectionStart, selectionEnd);
|
||||
root.close();
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
@@ -65,10 +65,10 @@ QQC2.Popup {
|
||||
const format = {
|
||||
start: "<del>",
|
||||
end: "</del>",
|
||||
extra: "",
|
||||
}
|
||||
formattingSelected(format, selectionStart, selectionEnd)
|
||||
root.close()
|
||||
extra: ""
|
||||
};
|
||||
formattingSelected(format, selectionStart, selectionEnd);
|
||||
root.close();
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
@@ -84,10 +84,10 @@ QQC2.Popup {
|
||||
const format = {
|
||||
start: "`",
|
||||
end: "`",
|
||||
extra: "",
|
||||
}
|
||||
formattingSelected(format, selectionStart, selectionEnd)
|
||||
root.close()
|
||||
extra: ""
|
||||
};
|
||||
formattingSelected(format, selectionStart, selectionEnd);
|
||||
root.close();
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
@@ -103,10 +103,10 @@ QQC2.Popup {
|
||||
const format = {
|
||||
start: selectionStart == 0 ? ">" : "\n>",
|
||||
end: "\n\n",
|
||||
extra: "",
|
||||
}
|
||||
formattingSelected(format, selectionStart, selectionEnd)
|
||||
root.close()
|
||||
extra: ""
|
||||
};
|
||||
formattingSelected(format, selectionStart, selectionEnd);
|
||||
root.close();
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
@@ -122,10 +122,10 @@ QQC2.Popup {
|
||||
const format = {
|
||||
start: "[",
|
||||
end: "](",
|
||||
extra: ")",
|
||||
}
|
||||
formattingSelected(format, selectionStart, selectionEnd)
|
||||
root.close()
|
||||
extra: ")"
|
||||
};
|
||||
formattingSelected(format, selectionStart, selectionEnd);
|
||||
root.close();
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
|
||||
@@ -26,7 +26,6 @@ QQC2.Dialog {
|
||||
|
||||
anchors.centerIn: applicationWindow().overlay
|
||||
|
||||
|
||||
Shortcut {
|
||||
sequence: "Ctrl+K"
|
||||
onActivated: root.open()
|
||||
@@ -34,28 +33,28 @@ QQC2.Dialog {
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!visible) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
searchField.forceActiveFocus()
|
||||
searchField.text = ""
|
||||
roomList.currentIndex = 0
|
||||
searchField.forceActiveFocus();
|
||||
searchField.text = "";
|
||||
roomList.currentIndex = 0;
|
||||
}
|
||||
|
||||
header: Kirigami.SearchField {
|
||||
id: searchField
|
||||
Keys.onDownPressed: {
|
||||
roomList.forceActiveFocus()
|
||||
roomList.forceActiveFocus();
|
||||
if (roomList.currentIndex < roomList.count - 1) {
|
||||
roomList.currentIndex++
|
||||
roomList.currentIndex++;
|
||||
} else {
|
||||
roomList.currentIndex = 0
|
||||
roomList.currentIndex = 0;
|
||||
}
|
||||
}
|
||||
Keys.onUpPressed: {
|
||||
if (roomList.currentIndex === 0) {
|
||||
roomList.currentIndex = roomList.count - 1
|
||||
roomList.currentIndex = roomList.count - 1;
|
||||
} else {
|
||||
roomList.currentIndex--
|
||||
roomList.currentIndex--;
|
||||
}
|
||||
}
|
||||
Keys.onEnterPressed: {
|
||||
|
||||
@@ -71,4 +71,3 @@ Flow {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,9 @@ TimelineDelegate {
|
||||
|
||||
property bool isTemporaryHighlighted: false
|
||||
|
||||
onIsTemporaryHighlightedChanged: if (isTemporaryHighlighted) temporaryHighlightTimer.start()
|
||||
onIsTemporaryHighlightedChanged: if (isTemporaryHighlighted) {
|
||||
temporaryHighlightTimer.start();
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: temporaryHighlightTimer
|
||||
@@ -36,9 +38,9 @@ TimelineDelegate {
|
||||
id: readMarkerBackground
|
||||
color: {
|
||||
if (root.isTemporaryHighlighted) {
|
||||
return Kirigami.Theme.positiveBackgroundColor
|
||||
return Kirigami.Theme.positiveBackgroundColor;
|
||||
} else {
|
||||
return Kirigami.Theme.backgroundColor
|
||||
return Kirigami.Theme.backgroundColor;
|
||||
}
|
||||
}
|
||||
Kirigami.Theme.inherit: false
|
||||
@@ -51,7 +53,11 @@ TimelineDelegate {
|
||||
border.width: 1
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {target: readMarkerBackground; duration: Kirigami.Units.veryLongDuration; easing.type: Easing.InOutCubic}
|
||||
ColorAnimation {
|
||||
target: readMarkerBackground
|
||||
duration: Kirigami.Units.veryLongDuration
|
||||
easing.type: Easing.InOutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,9 @@ import org.kde.neochat
|
||||
LoginStep {
|
||||
id: root
|
||||
|
||||
onActiveFocusChanged: if (activeFocus) passwordField.forceActiveFocus()
|
||||
onActiveFocusChanged: if (activeFocus) {
|
||||
passwordField.forceActiveFocus();
|
||||
}
|
||||
|
||||
FormCard.FormTextFieldDelegate {
|
||||
id: passwordField
|
||||
@@ -19,7 +21,7 @@ LoginStep {
|
||||
echoMode: TextInput.Password
|
||||
onTextChanged: Registration.password = text
|
||||
Keys.onReturnPressed: {
|
||||
confirmPasswordField.forceActiveFocus()
|
||||
confirmPasswordField.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,15 +33,15 @@ LoginStep {
|
||||
statusMessage: passwordField.text.length === confirmPasswordField.text.length && passwordField.text !== confirmPasswordField.text ? i18n("The passwords do not match.") : ""
|
||||
Keys.onReturnPressed: {
|
||||
if (root.nextAction.enabled) {
|
||||
root.nextAction.trigger()
|
||||
root.nextAction.trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nextAction: Kirigami.Action {
|
||||
onTriggered: {
|
||||
passwordField.enabled = false
|
||||
Registration.registerAccount()
|
||||
passwordField.enabled = false;
|
||||
Registration.registerAccount();
|
||||
}
|
||||
enabled: passwordField.text === confirmPasswordField.text
|
||||
}
|
||||
|
||||
@@ -46,11 +46,11 @@ Kirigami.Page {
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
||||
onClicked: {
|
||||
if (root.userId.length > 0) {
|
||||
root.room.deleteMessagesByUser(root.userId, reason.text)
|
||||
root.room.deleteMessagesByUser(root.userId, reason.text);
|
||||
} else {
|
||||
root.room.redactEvent(root.eventId, reason.text);
|
||||
}
|
||||
root.closeDialog()
|
||||
root.closeDialog();
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
|
||||
@@ -73,7 +73,7 @@ RowLayout {
|
||||
/**
|
||||
* @brief The reply has been clicked.
|
||||
*/
|
||||
signal replyClicked()
|
||||
signal replyClicked
|
||||
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
|
||||
@@ -118,20 +118,20 @@ RowLayout {
|
||||
|
||||
sourceComponent: {
|
||||
switch (root.type) {
|
||||
case DelegateType.Image:
|
||||
case DelegateType.Sticker:
|
||||
return imageComponent;
|
||||
case DelegateType.Message:
|
||||
case DelegateType.Notice:
|
||||
return textComponent;
|
||||
case DelegateType.File:
|
||||
case DelegateType.Video:
|
||||
case DelegateType.Audio:
|
||||
return mimeComponent;
|
||||
case DelegateType.Encrypted:
|
||||
return encryptedComponent;
|
||||
default:
|
||||
return textComponent;
|
||||
case DelegateType.Image:
|
||||
case DelegateType.Sticker:
|
||||
return imageComponent;
|
||||
case DelegateType.Message:
|
||||
case DelegateType.Notice:
|
||||
return textComponent;
|
||||
case DelegateType.File:
|
||||
case DelegateType.Video:
|
||||
case DelegateType.Audio:
|
||||
return mimeComponent;
|
||||
case DelegateType.Encrypted:
|
||||
return encryptedComponent;
|
||||
default:
|
||||
return textComponent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ RowLayout {
|
||||
text: i18nc("@action:button", "Cancel reply")
|
||||
icon.name: "dialog-close"
|
||||
onClicked: {
|
||||
root.cancel()
|
||||
root.cancel();
|
||||
}
|
||||
QQC2.ToolTip.text: text
|
||||
QQC2.ToolTip.visible: hovered
|
||||
|
||||
@@ -44,8 +44,8 @@ Kirigami.Page {
|
||||
icon.name: "dialog-warning-symbolic"
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
||||
onClicked: {
|
||||
root.room.reportEvent(eventId, reason.text)
|
||||
root.closeDialog()
|
||||
root.room.reportEvent(eventId, reason.text);
|
||||
root.closeDialog();
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
|
||||
@@ -106,8 +106,8 @@ a{
|
||||
textFormat: Text.RichText
|
||||
|
||||
onLinkActivated: link => {
|
||||
spoilerRevealed = true
|
||||
RoomManager.resolveResource(link, "join")
|
||||
spoilerRevealed = true;
|
||||
RoomManager.resolveResource(link, "join");
|
||||
}
|
||||
onHoveredLinkChanged: if (hoveredLink.length > 0 && hoveredLink !== "1") {
|
||||
applicationWindow().hoverLinkIndicator.text = hoveredLink;
|
||||
|
||||
@@ -94,7 +94,7 @@ ColumnLayout {
|
||||
}, {
|
||||
title: i18n("Event Source"),
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ Delegates.RoundedItemDelegate {
|
||||
|
||||
readonly property bool hasNotifications: currentRoom.pushNotificationState === PushNotificationState.MentionKeyword || currentRoom.isLowPriority ? highlightCount > 0 : notificationCount > 0
|
||||
|
||||
signal selected()
|
||||
signal selected
|
||||
|
||||
Accessible.name: root.displayName
|
||||
Accessible.onPressAction: select()
|
||||
@@ -48,7 +48,7 @@ Delegates.RoundedItemDelegate {
|
||||
if (button === Qt.RightButton) {
|
||||
root.createRoomListContextMenu();
|
||||
} else {
|
||||
select()
|
||||
select();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ Delegates.RoundedItemDelegate {
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
|
||||
Components.Avatar {
|
||||
source: root.avatar ? "image://mxc/" + root.avatar : ""
|
||||
source: root.avatar ? "image://mxc/" + root.avatar : ""
|
||||
name: root.displayName
|
||||
visible: Config.showAvatarInRoomDrawer
|
||||
implicitHeight: Kirigami.Units.gridUnit + (Config.compactRoomList ? 0 : Kirigami.Units.largeSpacing * 2)
|
||||
@@ -149,11 +149,11 @@ Delegates.RoundedItemDelegate {
|
||||
|
||||
function select() {
|
||||
RoomManager.resolveResource(currentRoom.id);
|
||||
root.selected()
|
||||
root.selected();
|
||||
}
|
||||
|
||||
function createRoomListContextMenu() {
|
||||
const component = Qt.createComponent("qrc:/org/kde/neochat/qml/ContextMenu.qml")
|
||||
const component = Qt.createComponent("qrc:/org/kde/neochat/qml/ContextMenu.qml");
|
||||
if (component.status === Component.Error) {
|
||||
console.error(component.errorString());
|
||||
}
|
||||
@@ -165,13 +165,12 @@ Delegates.RoundedItemDelegate {
|
||||
configButton.visible = true;
|
||||
configButton.down = true;
|
||||
}
|
||||
menu.closed.connect(function() {
|
||||
menu.closed.connect(function () {
|
||||
configButton.down = undefined;
|
||||
configButton.visible = Qt.binding(() => {
|
||||
return root.hovered && !Kirigami.Settings.isMobile
|
||||
&& !Config.compactRoomList;
|
||||
return root.hovered && !Kirigami.Settings.isMobile && !Config.compactRoomList;
|
||||
});
|
||||
})
|
||||
menu.open()
|
||||
});
|
||||
menu.open();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ Kirigami.OverlayDrawer {
|
||||
if (Config.roomDrawerWidth === -1) {
|
||||
return Kirigami.Units.gridUnit * 20;
|
||||
} else {
|
||||
return Config.roomDrawerWidth
|
||||
return Config.roomDrawerWidth;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,9 +53,9 @@ Kirigami.OverlayDrawer {
|
||||
return;
|
||||
}
|
||||
if (Qt.application.layoutDirection === Qt.RightToLeft) {
|
||||
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, Config.roomDrawerWidth - _lastX + mapToGlobal(mouseX, mouseY).x))
|
||||
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, Config.roomDrawerWidth - _lastX + mapToGlobal(mouseX, mouseY).x));
|
||||
} else {
|
||||
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, Config.roomDrawerWidth + _lastX - mapToGlobal(mouseX, mouseY).x))
|
||||
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, Config.roomDrawerWidth + _lastX - mapToGlobal(mouseX, mouseY).x));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,8 @@ Kirigami.OverlayDrawer {
|
||||
|
||||
// If modal has been changed and the drawer is closed automatically then dim on popup open will have been switched off in main.qml so switch it back on after the animation completes.
|
||||
// This is to avoid dim being active for a split second when the drawer is switched to modal which looks terrible.
|
||||
onAnimatingChanged: if (dim === false) dim = undefined
|
||||
onAnimatingChanged: if (dim === false)
|
||||
dim = undefined
|
||||
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
@@ -101,7 +102,12 @@ Kirigami.OverlayDrawer {
|
||||
text: i18n("Room settings")
|
||||
display: QQC2.AbstractButton.IconOnly
|
||||
|
||||
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {room: room, connection: root.connection}, { title: i18n("Room Settings") })
|
||||
onClicked: QQC2.ApplicationWindow.window.pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
room: room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Room Settings")
|
||||
})
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
|
||||
@@ -44,7 +44,12 @@ Kirigami.Page {
|
||||
displayHint: Kirigami.DisplayHint.IconOnly
|
||||
text: i18n("Settings")
|
||||
icon.name: "settings-configure"
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {room: root.room, connection: root.connection}, { title: i18n("Room Settings") })
|
||||
onTriggered: applicationWindow().pageStack.pushDialogLayer('qrc:/org/kde/neochat/qml/Categories.qml', {
|
||||
room: root.room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Room Settings")
|
||||
})
|
||||
}
|
||||
]
|
||||
|
||||
@@ -96,14 +101,14 @@ Kirigami.Page {
|
||||
target: applicationWindow().pageStack
|
||||
onWideModeChanged: {
|
||||
if (applicationWindow().pageStack.wideMode) {
|
||||
console.log("widemode pop")
|
||||
applicationWindow().pageStack.pop()
|
||||
console.log("widemode pop");
|
||||
applicationWindow().pageStack.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onBackRequested: event => {
|
||||
event.accepted = true;
|
||||
applicationWindow().pageStack.pop()
|
||||
applicationWindow().pageStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,12 @@ QQC2.ScrollView {
|
||||
Layout.fillWidth: true
|
||||
|
||||
onClicked: {
|
||||
applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/DevtoolsPage.qml", {room: root.room, connection: root.connection}, {title: i18n("Developer Tools")})
|
||||
applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/DevtoolsPage.qml", {
|
||||
room: root.room,
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18n("Developer Tools")
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +104,7 @@ QQC2.ScrollView {
|
||||
room: root.room
|
||||
}, {
|
||||
title: i18nc("@action:title", "Search")
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +147,11 @@ QQC2.ScrollView {
|
||||
icon.name: "list-add-user"
|
||||
|
||||
onClicked: {
|
||||
applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/InviteUserPage.qml", {room: root.room}, {title: i18nc("@title", "Invite a User")})
|
||||
applicationWindow().pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/InviteUserPage.qml", {
|
||||
room: root.room
|
||||
}, {
|
||||
title: i18nc("@title", "Invite a User")
|
||||
});
|
||||
}
|
||||
|
||||
QQC2.ToolTip.text: i18n("Invite user to room")
|
||||
@@ -160,7 +169,9 @@ QQC2.ScrollView {
|
||||
id: userListSearchField
|
||||
|
||||
visible: !root.room.isDirectChat()
|
||||
onVisibleChanged: if (visible) forceActiveFocus()
|
||||
onVisibleChanged: if (visible) {
|
||||
forceActiveFocus();
|
||||
}
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Kirigami.Units.largeSpacing
|
||||
Layout.rightMargin: Kirigami.Units.largeSpacing
|
||||
@@ -168,7 +179,7 @@ QQC2.ScrollView {
|
||||
|
||||
focusSequence: "Ctrl+Shift+F"
|
||||
|
||||
onAccepted: sortedMessageEventModel.filterString = text;
|
||||
onAccepted: sortedMessageEventModel.filterString = text
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +216,7 @@ QQC2.ScrollView {
|
||||
|
||||
onClicked: {
|
||||
userDelegate.highlighted = true;
|
||||
RoomManager.resolveResource(userDelegate.userId, "mention")
|
||||
RoomManager.resolveResource(userDelegate.userId, "mention");
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
@@ -258,6 +269,6 @@ QQC2.ScrollView {
|
||||
if (root.headerItem) {
|
||||
root.headerItem.userListSearchField.text = "";
|
||||
}
|
||||
userList.currentIndex = -1
|
||||
userList.currentIndex = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ Kirigami.Page {
|
||||
Connections {
|
||||
target: RoomManager
|
||||
function onCurrentRoomChanged() {
|
||||
itemSelection.setCurrentIndex(roomListModel.index(roomListModel.rowForRoom(RoomManager.currentRoom), 0), ItemSelectionModel.SelectCurrent)
|
||||
itemSelection.setCurrentIndex(roomListModel.index(roomListModel.rowForRoom(RoomManager.currentRoom), 0), ItemSelectionModel.SelectCurrent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,24 +74,24 @@ Kirigami.Page {
|
||||
}
|
||||
|
||||
function goToNextRoom() {
|
||||
goToNextRoomFiltered((item) => item.visible);
|
||||
goToNextRoomFiltered(item => item.visible);
|
||||
}
|
||||
|
||||
function goToPreviousRoom() {
|
||||
goToPreviousRoomFiltered((item) => item.visible);
|
||||
goToPreviousRoomFiltered(item => item.visible);
|
||||
}
|
||||
|
||||
function goToNextUnreadRoom() {
|
||||
goToNextRoomFiltered((item) => (item.visible && item.hasUnread));
|
||||
goToNextRoomFiltered(item => (item.visible && item.hasUnread));
|
||||
}
|
||||
|
||||
function goToPreviousUnreadRoom() {
|
||||
goToPreviousRoomFiltered((item) => (item.visible && item.hasUnread));
|
||||
goToPreviousRoomFiltered(item => (item.visible && item.hasUnread));
|
||||
}
|
||||
|
||||
titleDelegate: Loader {
|
||||
Layout.fillWidth: true
|
||||
sourceComponent: Kirigami.Settings.isMobile ? userInfo : exploreComponent
|
||||
sourceComponent: Kirigami.Settings.isMobile ? userInfo : exploreComponent
|
||||
}
|
||||
|
||||
padding: 0
|
||||
@@ -107,7 +107,7 @@ Kirigami.Page {
|
||||
|
||||
connection: root.connection
|
||||
|
||||
onSelectionChanged: root.spaceChanging = true;
|
||||
onSelectionChanged: root.spaceChanging = true
|
||||
onSpacesUpdated: sortFilterRoomListModel.invalidate()
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ Kirigami.Page {
|
||||
rightPadding: Kirigami.Units.largeSpacing
|
||||
bottomPadding: Kirigami.Units.largeSpacing
|
||||
|
||||
onClicked: quickView.item.open();
|
||||
onClicked: quickView.item.open()
|
||||
|
||||
Kirigami.Icon {
|
||||
anchors.centerIn: parent
|
||||
@@ -181,10 +181,10 @@ Kirigami.Page {
|
||||
keyword: sortFilterRoomListModel.filterText
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
})
|
||||
});
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join")
|
||||
})
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +192,11 @@ Kirigami.Page {
|
||||
id: userSearchAction
|
||||
icon.name: sortFilterRoomListModel.filterText.length > 0 ? "search" : "list-add"
|
||||
text: sortFilterRoomListModel.filterText.length > 0 ? i18n("Search in friend directory") : i18n("Find your friends")
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {connection: root.connection}, {title: i18nc("@title", "Find your friends")})
|
||||
onTriggered: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,8 +212,8 @@ Kirigami.Page {
|
||||
sourceModel: root.roomListModel
|
||||
roomSortOrder: SortFilterRoomListModel.Categories
|
||||
onLayoutChanged: {
|
||||
layoutTimer.restart()
|
||||
listView.currentIndex = sortFilterRoomListModel.mapFromSource(itemSelection.currentIndex).row
|
||||
layoutTimer.restart();
|
||||
listView.currentIndex = sortFilterRoomListModel.mapFromSource(itemSelection.currentIndex).row;
|
||||
}
|
||||
activeSpaceId: spaceDrawer.selectedSpaceId
|
||||
mode: spaceDrawer.showDirectChats ? SortFilterRoomListModel.DirectChats : SortFilterRoomListModel.Rooms
|
||||
@@ -317,7 +321,11 @@ Kirigami.Page {
|
||||
icon.width: Kirigami.Units.gridUnit * 2
|
||||
icon.height: Kirigami.Units.gridUnit * 2
|
||||
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {connection: root.connection}, {title: i18nc("@title", "Find your friends")})
|
||||
onClicked: pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/UserSearchPage.qml", {
|
||||
connection: root.connection
|
||||
}, {
|
||||
title: i18nc("@title", "Find your friends")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -402,8 +410,8 @@ Kirigami.Page {
|
||||
ExploreComponentMobile {
|
||||
connection: root.connection
|
||||
|
||||
onTextChanged: (newText) => {
|
||||
sortFilterRoomListModel.filterText = newText
|
||||
onTextChanged: newText => {
|
||||
sortFilterRoomListModel.filterText = newText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ Kirigami.Page {
|
||||
actionsHandler: root.actionsHandler
|
||||
onFocusChatBar: {
|
||||
if (chatBarLoader.item) {
|
||||
chatBarLoader.item.forceActiveFocus()
|
||||
chatBarLoader.item.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,9 +175,9 @@ Kirigami.Page {
|
||||
Connections {
|
||||
target: RoomManager
|
||||
function onCurrentRoomChanged() {
|
||||
if(!RoomManager.currentRoom) {
|
||||
if(pageStack.lastItem === root) {
|
||||
pageStack.pop()
|
||||
if (!RoomManager.currentRoom) {
|
||||
if (pageStack.lastItem === root) {
|
||||
pageStack.pop();
|
||||
}
|
||||
} else if (root.currentRoom.isInvite) {
|
||||
root.currentRoom.clearInvitationNotification();
|
||||
@@ -205,7 +205,7 @@ Kirigami.Page {
|
||||
Connections {
|
||||
target: root.connection
|
||||
function onJoinedRoom(room, invited) {
|
||||
if(root.currentRoom.id === invited.id) {
|
||||
if (root.currentRoom.id === invited.id) {
|
||||
RoomManager.resolveResource(room.id);
|
||||
}
|
||||
}
|
||||
@@ -219,10 +219,10 @@ Kirigami.Page {
|
||||
return;
|
||||
} else if (event.key === Qt.Key_PageUp) {
|
||||
event.accepted = true;
|
||||
timelineViewLoader.item.pageUp()
|
||||
timelineViewLoader.item.pageUp();
|
||||
} else if (event.key === Qt.Key_PageDown) {
|
||||
event.accepted = true;
|
||||
timelineViewLoader.item.pageDown()
|
||||
timelineViewLoader.item.pageDown();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,14 +237,14 @@ Kirigami.Page {
|
||||
|
||||
function warning(title, message) {
|
||||
banner.text = `${title}<br />${message}`;
|
||||
banner.type = Kirigami.MessageType.Warning;
|
||||
banner.type = Kirigami.MessageType.Warning;
|
||||
banner.visible = true;
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: RoomManager
|
||||
function onShowUserDetail(user) {
|
||||
root.showUserDetail(user)
|
||||
root.showUserDetail(user);
|
||||
}
|
||||
|
||||
function onShowEventSource(eventId) {
|
||||
@@ -283,19 +283,19 @@ Kirigami.Page {
|
||||
function onShowMaximizedMedia(index) {
|
||||
var popup = maximizeComponent.createObject(QQC2.Overlay.overlay, {
|
||||
initialIndex: index
|
||||
})
|
||||
});
|
||||
popup.closed.connect(() => {
|
||||
timelineViewLoader.item.interactive = true
|
||||
popup.destroy()
|
||||
})
|
||||
popup.open()
|
||||
timelineViewLoader.item.interactive = true;
|
||||
popup.destroy();
|
||||
});
|
||||
popup.open();
|
||||
}
|
||||
}
|
||||
|
||||
function showUserDetail(user) {
|
||||
userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
room: root.currentRoom,
|
||||
user: root.currentRoom.getUser(user.id),
|
||||
user: root.currentRoom.getUser(user.id)
|
||||
}).open();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,9 @@ FormCard.FormCardPage {
|
||||
enabled: room.canEncryptRoom
|
||||
checked: room.usesEncryption
|
||||
onToggled: if (checked) {
|
||||
let dialog = confirmEncryptionDialog.createObject(applicationWindow().overlay, {room: room});
|
||||
let dialog = confirmEncryptionDialog.createObject(applicationWindow().overlay, {
|
||||
room: room
|
||||
});
|
||||
dialog.open();
|
||||
}
|
||||
}
|
||||
@@ -51,8 +53,7 @@ FormCard.FormCardPage {
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
text: i18nc("@option:check", "Space members")
|
||||
description: i18n("Anyone in the selected spaces can find and join.") +
|
||||
(!["8", "9", "10"].includes(room.version) ? `\n${needUpgradeRoom}` : "")
|
||||
description: i18n("Anyone in the selected spaces can find and join.") + (!["8", "9", "10"].includes(room.version) ? `\n${needUpgradeRoom}` : "")
|
||||
checked: room.joinRule === "restricted"
|
||||
enabled: room.canSendState("m.room.join_rules") && ["8", "9", "10"].includes(room.version)
|
||||
onCheckedChanged: if (checked && room.joinRule != "restricted") {
|
||||
@@ -64,7 +65,7 @@ FormCard.FormCardPage {
|
||||
text: i18n("Select spaces")
|
||||
icon.name: "list-add"
|
||||
|
||||
onClicked: selectSpacesDialog.createObject(applicationWindow().overlay).open();
|
||||
onClicked: selectSpacesDialog.createObject(applicationWindow().overlay).open()
|
||||
|
||||
QQC2.ToolTip.text: text
|
||||
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||
@@ -80,8 +81,7 @@ FormCard.FormCardPage {
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
text: i18nc("@option:check", "Knock")
|
||||
description: i18n("People not in the room need to request an invite to join the room.") +
|
||||
(!["7", "8", "9", "10"].includes(room.version) ? `\n${needUpgradeRoom}` : "")
|
||||
description: i18n("People not in the room need to request an invite to join the room.") + (!["7", "8", "9", "10"].includes(room.version) ? `\n${needUpgradeRoom}` : "")
|
||||
checked: room.joinRule === "knock"
|
||||
// https://spec.matrix.org/v1.4/rooms/#feature-matrix
|
||||
enabled: room.canSendState("m.room.join_rules") && ["7", "8", "9", "10"].includes(room.version)
|
||||
@@ -110,7 +110,7 @@ FormCard.FormCardPage {
|
||||
checked: room.historyVisibility === "world_readable"
|
||||
enabled: room.canSendState("m.room.history_visibility")
|
||||
onCheckedChanged: if (checked) {
|
||||
room.historyVisibility = "world_readable"
|
||||
room.historyVisibility = "world_readable";
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
@@ -119,7 +119,7 @@ FormCard.FormCardPage {
|
||||
checked: room.historyVisibility === "shared"
|
||||
enabled: room.canSendState("m.room.history_visibility")
|
||||
onCheckedChanged: if (checked) {
|
||||
room.historyVisibility = "shared"
|
||||
room.historyVisibility = "shared";
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
@@ -128,7 +128,7 @@ FormCard.FormCardPage {
|
||||
checked: room.historyVisibility === "invited"
|
||||
enabled: room.canSendState("m.room.history_visibility")
|
||||
onCheckedChanged: if (checked) {
|
||||
room.historyVisibility = "invited"
|
||||
room.historyVisibility = "invited";
|
||||
}
|
||||
}
|
||||
FormCard.FormRadioDelegate {
|
||||
@@ -137,7 +137,7 @@ FormCard.FormCardPage {
|
||||
checked: room.historyVisibility === "joined"
|
||||
enabled: room.canSendState("m.room.history_visibility")
|
||||
onCheckedChanged: if (checked) {
|
||||
room.historyVisibility = "joined"
|
||||
room.historyVisibility = "joined";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@ FormCard.FormCardPage {
|
||||
// At the point this is executed, the state in the room is not yet changed.
|
||||
// The value will be updated when room.onEncryption() emitted.
|
||||
// This is in case if user simply closed the dialog.
|
||||
enableEncryptionSwitch.checked = false
|
||||
enableEncryptionSwitch.checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,8 +158,7 @@ FormCard.FormCardPage {
|
||||
property Connections connections: Connections {
|
||||
target: room
|
||||
onEncryption: {
|
||||
enableEncryptionSwitch.checked = room.usesEncryption
|
||||
enableEncryptionSwitch.checked = room.usesEncryption;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ Kirigami.ApplicationWindow {
|
||||
}
|
||||
|
||||
onCurrentRoomChanged: if (!currentRoom) {
|
||||
root.close()
|
||||
root.close();
|
||||
}
|
||||
|
||||
property Item hoverLinkIndicator: QQC2.Control {
|
||||
@@ -58,7 +58,7 @@ Kirigami.ApplicationWindow {
|
||||
}
|
||||
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
||||
background: Rectangle {
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ Kirigami.ScrollablePage {
|
||||
Keys.onEnterPressed: searchButton.clicked()
|
||||
Keys.onReturnPressed: searchButton.clicked()
|
||||
onTextChanged: {
|
||||
searchTimer.restart()
|
||||
searchTimer.restart();
|
||||
if (model) {
|
||||
model.searchText = text;
|
||||
}
|
||||
@@ -121,7 +121,7 @@ Kirigami.ScrollablePage {
|
||||
icon.name: "search"
|
||||
onClicked: {
|
||||
if (typeof model.search === 'function') {
|
||||
model.search()
|
||||
model.search();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ Kirigami.ScrollablePage {
|
||||
interval: 500
|
||||
running: true
|
||||
onTriggered: if (typeof model.search === 'function') {
|
||||
model.search()
|
||||
model.search();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,4 +162,3 @@ Kirigami.ScrollablePage {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ Kirigami.Dialog {
|
||||
text: i18n("OK")
|
||||
icon.name: "dialog-ok"
|
||||
onTriggered: {
|
||||
root.room.addParent(chosenRoomDelegate.roomId, makeCanonicalCheck.checked, existingOfficialCheck.checked)
|
||||
root.room.addParent(chosenRoomDelegate.roomId, makeCanonicalCheck.checked, existingOfficialCheck.checked);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,12 @@ Kirigami.Dialog {
|
||||
visible: !chosenRoomDelegate.visible
|
||||
text: i18nc("@action:button", "Pick room")
|
||||
onClicked: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.room.connection, showOnlySpaces: true}, {title: i18nc("@title", "Choose Parent Space")})
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
connection: root.room.connection,
|
||||
showOnlySpaces: true
|
||||
}, {
|
||||
title: i18nc("@title", "Choose Parent Space")
|
||||
});
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
chosenRoomDelegate.roomId = roomId;
|
||||
chosenRoomDelegate.displayName = displayName;
|
||||
@@ -59,7 +64,7 @@ Kirigami.Dialog {
|
||||
chosenRoomDelegate.memberCount = memberCount;
|
||||
chosenRoomDelegate.isJoined = isJoined;
|
||||
chosenRoomDelegate.visible = true;
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
FormCard.AbstractFormDelegate {
|
||||
@@ -104,7 +109,7 @@ Kirigami.Dialog {
|
||||
QQC2.Label {
|
||||
Layout.fillWidth: true
|
||||
visible: text
|
||||
text: chosenRoomDelegate.topic ? chosenRoomDelegate.topic.replace(/(\r\n\t|\n|\r\t)/gm," ") : ""
|
||||
text: chosenRoomDelegate.topic ? chosenRoomDelegate.topic.replace(/(\r\n\t|\n|\r\t)/gm, " ") : ""
|
||||
textFormat: Text.PlainText
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
@@ -128,7 +133,12 @@ Kirigami.Dialog {
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {connection: root.room.connection, showOnlySpaces: true}, {title: i18nc("@title", "Explore Rooms")})
|
||||
let dialog = pageStack.pushDialogLayer("qrc:/org/kde/neochat/qml/ExploreRoomsPage.qml", {
|
||||
connection: root.room.connection,
|
||||
showOnlySpaces: true
|
||||
}, {
|
||||
title: i18nc("@title", "Explore Rooms")
|
||||
});
|
||||
dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => {
|
||||
chosenRoomDelegate.roomId = roomId;
|
||||
chosenRoomDelegate.displayName = displayName;
|
||||
@@ -138,7 +148,7 @@ Kirigami.Dialog {
|
||||
chosenRoomDelegate.memberCount = memberCount;
|
||||
chosenRoomDelegate.isJoined = isJoined;
|
||||
chosenRoomDelegate.visible = true;
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
FormCard.FormCheckDelegate {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user