Add "Inspect Room Data" button in the room sidebar
I find myself doing the same routine: I want to inspect a room's state, so I have to go hunting for the Developer Tools button. And then I have to do a few clicks to even get the correct room, what a waste of time! So I added a new button to the sidebar to open the Developer Tools for the current room.
This commit is contained in:
@@ -17,6 +17,7 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
property NeoChatRoom room
|
property NeoChatRoom room
|
||||||
required property NeoChatConnection connection
|
required property NeoChatConnection connection
|
||||||
|
property alias currentTabIndex: tabBar.currentIndex
|
||||||
|
|
||||||
title: i18nc("@title", "Developer Tools")
|
title: i18nc("@title", "Developer Tools")
|
||||||
|
|
||||||
|
|||||||
@@ -166,6 +166,25 @@ QQC2.ScrollView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Delegates.RoundedItemDelegate {
|
||||||
|
text: i18nc("@action:inmenu", "Inspect Room Data")
|
||||||
|
icon.name: "tools"
|
||||||
|
visible: NeoChatConfig.developerTools
|
||||||
|
activeFocusOnTab: true
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
onClicked: ((QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow).pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
|
||||||
|
connection: root.room.connection,
|
||||||
|
currentTabIndex: 1, // Room data tab
|
||||||
|
room: root.room
|
||||||
|
}, {
|
||||||
|
title: i18nc("@title:window", "Developer Tools"),
|
||||||
|
width: Kirigami.Units.gridUnit * 50,
|
||||||
|
height: Kirigami.Units.gridUnit * 42
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
Delegates.RoundedItemDelegate {
|
Delegates.RoundedItemDelegate {
|
||||||
id: leaveButton
|
id: leaveButton
|
||||||
icon.name: "arrow-left-symbolic"
|
icon.name: "arrow-left-symbolic"
|
||||||
|
|||||||
Reference in New Issue
Block a user