Change all remaining QML file ids to "root"
This commit is contained in:
@@ -6,27 +6,27 @@ import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.10
|
||||
|
||||
Labs.Menu {
|
||||
id: editMenu
|
||||
id: root
|
||||
|
||||
required property Item field
|
||||
|
||||
Labs.MenuItem {
|
||||
enabled: editMenu.field !== null && editMenu.field.canUndo
|
||||
enabled: root.field !== null && root.field.canUndo
|
||||
text: i18nc("text editing menu action", "Undo")
|
||||
shortcut: StandardKey.Undo
|
||||
onTriggered: {
|
||||
editMenu.field.undo()
|
||||
editMenu.close()
|
||||
root.field.undo()
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
Labs.MenuItem {
|
||||
enabled: editMenu.field !== null && editMenu.field.canRedo
|
||||
enabled: root.field !== null && root.field.canRedo
|
||||
text: i18nc("text editing menu action", "Redo")
|
||||
shortcut: StandardKey.Redo
|
||||
onTriggered: {
|
||||
editMenu.field.undo()
|
||||
editMenu.close()
|
||||
root.field.undo()
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,42 +34,42 @@ Labs.Menu {
|
||||
}
|
||||
|
||||
Labs.MenuItem {
|
||||
enabled: editMenu.field !== null && editMenu.field.selectedText
|
||||
enabled: root.field !== null && root.field.selectedText
|
||||
text: i18nc("text editing menu action", "Cut")
|
||||
shortcut: StandardKey.Cut
|
||||
onTriggered: {
|
||||
editMenu.field.cut()
|
||||
editMenu.close()
|
||||
root.field.cut()
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
Labs.MenuItem {
|
||||
enabled: editMenu.field !== null && editMenu.field.selectedText
|
||||
enabled: root.field !== null && root.field.selectedText
|
||||
text: i18nc("text editing menu action", "Copy")
|
||||
shortcut: StandardKey.Copy
|
||||
onTriggered: {
|
||||
editMenu.field.copy()
|
||||
editMenu.close()
|
||||
root.field.copy()
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
Labs.MenuItem {
|
||||
enabled: editMenu.field !== null && editMenu.field.canPaste
|
||||
enabled: root.field !== null && root.field.canPaste
|
||||
text: i18nc("text editing menu action", "Paste")
|
||||
shortcut: StandardKey.Paste
|
||||
onTriggered: {
|
||||
editMenu.field.paste()
|
||||
editMenu.close()
|
||||
root.field.paste()
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
Labs.MenuItem {
|
||||
enabled: editMenu.field !== null && editMenu.field.selectedText !== ""
|
||||
enabled: root.field !== null && root.field.selectedText !== ""
|
||||
text: i18nc("text editing menu action", "Delete")
|
||||
shortcut: ""
|
||||
onTriggered: {
|
||||
editMenu.field.remove(editMenu.field.selectionStart, editMenu.field.selectionEnd)
|
||||
editMenu.close()
|
||||
root.field.remove(root.field.selectionStart, root.field.selectionEnd)
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,12 +77,12 @@ Labs.Menu {
|
||||
}
|
||||
|
||||
Labs.MenuItem {
|
||||
enabled: editMenu.field !== null
|
||||
enabled: root.field !== null
|
||||
text: i18nc("text editing menu action", "Select All")
|
||||
shortcut: StandardKey.SelectAll
|
||||
onTriggered: {
|
||||
editMenu.field.selectAll()
|
||||
editMenu.close()
|
||||
root.field.selectAll()
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,8 @@ import org.kde.kirigami 2.14 as Kirigami
|
||||
* TODO add Android support
|
||||
*/
|
||||
Kirigami.Action {
|
||||
id: shareAction
|
||||
id: root
|
||||
|
||||
icon.name: "emblem-shared-symbolic"
|
||||
text: i18n("Share")
|
||||
tooltip: i18n("Share the selected media")
|
||||
@@ -40,12 +41,12 @@ Kirigami.Action {
|
||||
const purposeModel = Qt.createQmlObject('import org.kde.purpose 1.0 as Purpose;
|
||||
Purpose.PurposeAlternativesModel {
|
||||
pluginType: "Export"
|
||||
}', shareAction._instantiator);
|
||||
}', root._instantiator);
|
||||
purposeModel.inputData = Qt.binding(function() {
|
||||
return shareAction.inputData;
|
||||
return root.inputData;
|
||||
});
|
||||
_instantiator.model = purposeModel;
|
||||
shareAction.visible = true;
|
||||
root.visible = true;
|
||||
}
|
||||
|
||||
delegate: Kirigami.Action {
|
||||
@@ -55,16 +56,16 @@ Purpose.PurposeAlternativesModel {
|
||||
onTriggered: {
|
||||
doBeforeSharing();
|
||||
applicationWindow().pageStack.pushDialogLayer('qrc:/ShareDialog.qml', {
|
||||
title: shareAction.tooltip,
|
||||
title: root.tooltip,
|
||||
index: index,
|
||||
model: shareAction._instantiator.model
|
||||
model: root._instantiator.model
|
||||
})
|
||||
}
|
||||
}
|
||||
onObjectAdded: (index, object) => {
|
||||
object.index = index;
|
||||
shareAction.children.push(object)
|
||||
root.children.push(object)
|
||||
}
|
||||
onObjectRemoved: (index, object) => shareAction.children = Array.from(shareAction.children).filter(obj => obj.pluginId !== object.pluginId)
|
||||
onObjectRemoved: (index, object) => root.children = Array.from(root.children).filter(obj => obj.pluginId !== object.pluginId)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.kde.notification 1.0
|
||||
import org.kde.kirigami 2.14 as Kirigami
|
||||
|
||||
Kirigami.Page {
|
||||
id: window
|
||||
id: root
|
||||
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
@@ -25,7 +25,7 @@ Kirigami.Page {
|
||||
|
||||
QQC2.Action {
|
||||
shortcut: 'Escape'
|
||||
onTriggered: window.closeDialog()
|
||||
onTriggered: root.closeDialog()
|
||||
}
|
||||
|
||||
Notification {
|
||||
@@ -54,15 +54,15 @@ Kirigami.Page {
|
||||
sharingSuccess.sendEvent();
|
||||
Clipboard.saveText(jobView.output.url);
|
||||
}
|
||||
window.closeDialog()
|
||||
root.closeDialog()
|
||||
} else if (state === Purpose.PurposeJobController.Error) {
|
||||
// Show failure notification
|
||||
sharingFailed.sendEvent();
|
||||
|
||||
window.closeDialog()
|
||||
root.closeDialog()
|
||||
} else if (state === Purpose.PurposeJobController.Cancelled) {
|
||||
// Do nothing
|
||||
window.closeDialog()
|
||||
root.closeDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
Kirigami.Page {
|
||||
id: banSheet
|
||||
id: root
|
||||
|
||||
property NeoChatRoom room
|
||||
property string userId
|
||||
@@ -35,14 +35,14 @@ Kirigami.Page {
|
||||
icon.name: "im-ban-user"
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
||||
onClicked: {
|
||||
banSheet.room.ban(banSheet.userId, reason.text)
|
||||
banSheet.closeDialog()
|
||||
root.room.ban(root.userId, reason.text)
|
||||
root.closeDialog()
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
text: i18nc("@action", "Cancel")
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.RejectRole
|
||||
onClicked: banSheet.closeDialog()
|
||||
onClicked: root.closeDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.kde.kirigamiaddons.labs.components 1.0 as KirigamiComponents
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
Loader {
|
||||
id: loadRoot
|
||||
id: root
|
||||
|
||||
required property var author
|
||||
required property string eventId
|
||||
@@ -31,7 +31,7 @@ Loader {
|
||||
currentRoom.chatBoxEditId = eventId;
|
||||
currentRoom.chatBoxReplyId = "";
|
||||
}
|
||||
visible: author.id === Controller.activeConnection.localUserId && (loadRoot.eventType === DelegateType.Emote || loadRoot.eventType === DelegateType.Message)
|
||||
visible: author.id === Controller.activeConnection.localUserId && (root.eventType === DelegateType.Emote || root.eventType === DelegateType.Message)
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: i18n("Reply")
|
||||
@@ -50,7 +50,7 @@ Loader {
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
})
|
||||
page.chosen.connect(function(targetRoomId) {
|
||||
Controller.activeConnection.room(targetRoomId).postHtmlMessage(loadRoot.plainText, loadRoot.htmlText ? loadRoot.htmlText : loadRoot.plainText)
|
||||
Controller.activeConnection.room(targetRoomId).postHtmlMessage(root.plainText, root.htmlText ? root.htmlText : root.plainText)
|
||||
page.closeDialog()
|
||||
})
|
||||
}
|
||||
@@ -68,7 +68,7 @@ Loader {
|
||||
Kirigami.Action {
|
||||
text: i18n("Copy")
|
||||
icon.name: "edit-copy"
|
||||
onTriggered: Clipboard.saveText(loadRoot.selectedText === "" ? loadRoot.plainText : loadRoot.selectedText)
|
||||
onTriggered: Clipboard.saveText(root.selectedText === "" ? root.plainText : root.selectedText)
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: i18nc("@action:button 'Report' as in 'Report this event to the administrators'", "Report")
|
||||
@@ -84,7 +84,7 @@ Loader {
|
||||
icon.name: "code-context"
|
||||
onTriggered: {
|
||||
applicationWindow().pageStack.pushDialogLayer('qrc:/MessageSourceSheet.qml', {
|
||||
sourceText: loadRoot.source
|
||||
sourceText: root.eventSource
|
||||
}, {
|
||||
title: i18n("Message Source"),
|
||||
width: Kirigami.Units.gridUnit * 25
|
||||
@@ -95,7 +95,7 @@ Loader {
|
||||
text: i18n("Copy Link")
|
||||
icon.name: "edit-copy"
|
||||
onTriggered: {
|
||||
Clipboard.saveText("https://matrix.to/#/" + currentRoom.id + "/" + loadRoot.eventId)
|
||||
Clipboard.saveText("https://matrix.to/#/" + currentRoom.id + "/" + root.eventId)
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -106,7 +106,7 @@ Loader {
|
||||
QQC2.Menu {
|
||||
id: menu
|
||||
Instantiator {
|
||||
model: loadRoot.nestedActions
|
||||
model: root.nestedActions
|
||||
delegate: QQC2.Menu {
|
||||
id: menuItem
|
||||
visible: modelData.visible
|
||||
@@ -131,12 +131,12 @@ Loader {
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: loadRoot.actions
|
||||
model: root.actions
|
||||
QQC2.MenuItem {
|
||||
id: menuItem
|
||||
visible: modelData.visible
|
||||
action: modelData
|
||||
onClicked: loadRoot.item.close();
|
||||
onClicked: root.item.close();
|
||||
}
|
||||
}
|
||||
QQC2.Menu {
|
||||
@@ -150,7 +150,7 @@ Loader {
|
||||
Instantiator {
|
||||
model: WebShortcutModel {
|
||||
id: webshortcutmodel
|
||||
selectedText: loadRoot.selectedText ? loadRoot.selectedText : loadRoot.plainText
|
||||
selectedText: root.selectedText ? root.selectedText : root.plainText
|
||||
onOpenUrl: RoomManager.visitNonMatrix(url)
|
||||
}
|
||||
delegate: QQC2.MenuItem {
|
||||
@@ -222,7 +222,7 @@ Loader {
|
||||
text: modelData.text
|
||||
onClicked: {
|
||||
modelData.triggered()
|
||||
loadRoot.item.close();
|
||||
root.item.close();
|
||||
}
|
||||
implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0
|
||||
}
|
||||
@@ -285,7 +285,7 @@ Loader {
|
||||
|
||||
onClicked: {
|
||||
currentRoom.toggleReaction(eventId, modelData);
|
||||
loadRoot.item.close();
|
||||
root.item.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -295,7 +295,7 @@ Loader {
|
||||
}
|
||||
Repeater {
|
||||
id: listViewAction
|
||||
model: loadRoot.actions
|
||||
model: root.actions
|
||||
|
||||
Kirigami.BasicListItem {
|
||||
icon: modelData.icon.name
|
||||
@@ -305,14 +305,14 @@ Loader {
|
||||
text: modelData.text
|
||||
onClicked: {
|
||||
modelData.triggered()
|
||||
loadRoot.item.close();
|
||||
root.item.close();
|
||||
}
|
||||
implicitHeight: visible ? Kirigami.Units.gridUnit * 3 : 0
|
||||
}
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: loadRoot.nestedActions
|
||||
model: root.nestedActions
|
||||
|
||||
Kirigami.BasicListItem {
|
||||
action: modelData
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
Kirigami.Page {
|
||||
id: deleteSheet
|
||||
id: root
|
||||
|
||||
property NeoChatRoom room
|
||||
property string eventId
|
||||
@@ -37,18 +37,18 @@ Kirigami.Page {
|
||||
icon.name: "delete"
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
||||
onClicked: {
|
||||
if (deleteSheet.userId.length > 0) {
|
||||
deleteSheet.room.deleteMessagesByUser(deleteSheet.userId, reason.text)
|
||||
if (root.userId.length > 0) {
|
||||
root.room.deleteMessagesByUser(root.userId, reason.text)
|
||||
} else {
|
||||
deleteSheet.room.redactEvent(deleteSheet.eventId, reason.text);
|
||||
root.room.redactEvent(root.eventId, reason.text);
|
||||
}
|
||||
deleteSheet.closeDialog()
|
||||
root.closeDialog()
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
text: i18nc("@action", "Cancel")
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.RejectRole
|
||||
onClicked: deleteSheet.closeDialog()
|
||||
onClicked: root.closeDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.neochat 1.0
|
||||
|
||||
Kirigami.Page {
|
||||
id: reportSheet
|
||||
id: root
|
||||
|
||||
property NeoChatRoom room
|
||||
property string eventId
|
||||
@@ -35,14 +35,14 @@ Kirigami.Page {
|
||||
icon.name: "dialog-warning-symbolic"
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
||||
onClicked: {
|
||||
reportSheet.room.reportEvent(eventId, reason.text)
|
||||
reportSheet.closeDialog()
|
||||
root.room.reportEvent(eventId, reason.text)
|
||||
root.closeDialog()
|
||||
}
|
||||
}
|
||||
QQC2.Button {
|
||||
text: i18nc("@action", "Cancel")
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.RejectRole
|
||||
onClicked: reportSheet.closeDialog()
|
||||
onClicked: root.closeDialog()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user