Rename PageLoader.showPage() → PageLoader.show()

This commit is contained in:
miruka 2020-09-03 17:33:19 -04:00
parent 90929691c6
commit 601b42a503
8 changed files with 13 additions and 15 deletions

View File

@ -110,7 +110,7 @@ HMenu {
icon.name: "account-settings" icon.name: "account-settings"
text: qsTr("Account settings") text: qsTr("Account settings")
onTriggered: { onTriggered: {
pageLoader.showPage( pageLoader.show(
"Pages/AccountSettings/AccountSettings.qml", "Pages/AccountSettings/AccountSettings.qml",
{ "userId": userId }, { "userId": userId },
) )
@ -122,7 +122,7 @@ HMenu {
icon.name: "menu-add-chat" icon.name: "menu-add-chat"
text: qsTr("Add new chat") text: qsTr("Add new chat")
onTriggered: { onTriggered: {
pageLoader.showPage("Pages/AddChat/AddChat.qml", {userId: userId}) pageLoader.show("Pages/AddChat/AddChat.qml", {userId: userId})
wentToAccountPage() wentToAccountPage()
} }
} }

View File

@ -146,7 +146,7 @@ HTile {
backgroundColor: "transparent" backgroundColor: "transparent"
toolTip.text: qsTr("Add new chat") toolTip.text: qsTr("Add new chat")
onClicked: { onClicked: {
pageLoader.showPage( pageLoader.show(
"Pages/AddChat/AddChat.qml", {userId: model.id}, "Pages/AddChat/AddChat.qml", {userId: model.id},
) )
account.wentToAccountPage() account.wentToAccountPage()

View File

@ -24,7 +24,7 @@ Rectangle {
toolTip.text: qsTr("Add another account") toolTip.text: qsTr("Add another account")
backgroundColor: theme.mainPane.bottomBar.settingsButtonBackground backgroundColor: theme.mainPane.bottomBar.settingsButtonBackground
onClicked: { onClicked: {
pageLoader.showPage("Pages/AddAccount/AddAccount.qml") pageLoader.show("Pages/AddAccount/AddAccount.qml")
roomList.startCorrectItemSearch() roomList.startCorrectItemSearch()
} }

View File

@ -61,7 +61,7 @@ HListView {
const item = model.get(index) const item = model.get(index)
item.type === "Account" ? item.type === "Account" ?
pageLoader.showPage( pageLoader.show(
"Pages/AccountSettings/AccountSettings.qml", { "userId": item.id }, "Pages/AccountSettings/AccountSettings.qml", { "userId": item.id },
) : ) :
pageLoader.showRoom(item.for_account, item.id) pageLoader.showRoom(item.for_account, item.id)

View File

@ -18,7 +18,7 @@ HLoader {
signal recycled() signal recycled()
signal previousShown(string componentUrl, var properties) signal previousShown(string componentUrl, var properties)
function showPage(componentUrl, properties={}) { function show(componentUrl, properties={}) {
history.unshift([componentUrl, properties]) history.unshift([componentUrl, properties])
if (history.length > historyLength) history.pop() if (history.length > historyLength) history.pop()
@ -42,7 +42,7 @@ HLoader {
} }
function showRoom(userId, roomId) { function showRoom(userId, roomId) {
showPage("Pages/Chat/Chat.qml", {userId, roomId}) show("Pages/Chat/Chat.qml", {userId, roomId})
} }
function showPrevious(timesBack=1) { function showPrevious(timesBack=1) {
@ -50,7 +50,7 @@ HLoader {
if (timesBack < 1) return false if (timesBack < 1) return false
const [componentUrl, properties] = history[timesBack] const [componentUrl, properties] = history[timesBack]
showPage(componentUrl, properties) show(componentUrl, properties)
previousShown(componentUrl, properties) previousShown(componentUrl, properties)
return true return true
} }
@ -72,13 +72,11 @@ HLoader {
Component.onCompleted: { Component.onCompleted: {
if (! py.startupAnyAccountsSaved) { if (! py.startupAnyAccountsSaved) {
pageLoader.showPage( pageLoader.show("AddAccount/AddAccount", {"header.show": false})
"AddAccount/AddAccount", {"header.show": false},
)
return return
} }
pageLoader.showPage(window.uiState.page, window.uiState.pageProperties) pageLoader.show(window.uiState.page, window.uiState.pageProperties)
} }
HNumberAnimation { HNumberAnimation {

View File

@ -45,7 +45,7 @@ HFlickableColumnPage {
[receivedUserId] [receivedUserId]
) )
pageLoader.showPage( pageLoader.show(
"Pages/AccountSettings/AccountSettings.qml", "Pages/AccountSettings/AccountSettings.qml",
{userId: receivedUserId}, {userId: receivedUserId},
) )

View File

@ -20,7 +20,7 @@ HFlickableColumnPopup {
window.uiState.pageProperties.roomId === roomId) window.uiState.pageProperties.roomId === roomId)
{ {
window.mainUI.pageLoader.showPrevious() || window.mainUI.pageLoader.showPrevious() ||
window.mainUI.pageLoader.showPage("Pages/Default.qml") window.mainUI.pageLoader.show("Pages/Default.qml")
Qt.callLater(popup.destroy) Qt.callLater(popup.destroy)
} }

View File

@ -39,7 +39,7 @@ HFlickableColumnPopup {
window.uiState.pageProperties.userId === userId) window.uiState.pageProperties.userId === userId)
{ {
const page = "Pages/AddAccount/AddAccount.qml" const page = "Pages/AddAccount/AddAccount.qml"
window.mainUI.pageLoader.showPage(page) window.mainUI.pageLoader.show(page)
} }
py.callCoro("logout_client", [userId]) py.callCoro("logout_client", [userId])