From 601b42a503e798f789e8c4888ee01f3f54ef7711 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 3 Sep 2020 17:33:19 -0400 Subject: [PATCH] =?UTF-8?q?Rename=20PageLoader.showPage()=20=E2=86=92=20Pa?= =?UTF-8?q?geLoader.show()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gui/MainPane/AccountContextMenu.qml | 4 ++-- src/gui/MainPane/AccountDelegate.qml | 2 +- src/gui/MainPane/BottomBar.qml | 2 +- src/gui/MainPane/RoomList.qml | 2 +- src/gui/PageLoader.qml | 12 +++++------- src/gui/Pages/AddAccount/SignInBase.qml | 2 +- src/gui/Popups/ForgetRoomPopup.qml | 2 +- src/gui/Popups/SignOutPopup.qml | 2 +- 8 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/gui/MainPane/AccountContextMenu.qml b/src/gui/MainPane/AccountContextMenu.qml index f7a54a17..be83c04b 100644 --- a/src/gui/MainPane/AccountContextMenu.qml +++ b/src/gui/MainPane/AccountContextMenu.qml @@ -110,7 +110,7 @@ HMenu { icon.name: "account-settings" text: qsTr("Account settings") onTriggered: { - pageLoader.showPage( + pageLoader.show( "Pages/AccountSettings/AccountSettings.qml", { "userId": userId }, ) @@ -122,7 +122,7 @@ HMenu { icon.name: "menu-add-chat" text: qsTr("Add new chat") onTriggered: { - pageLoader.showPage("Pages/AddChat/AddChat.qml", {userId: userId}) + pageLoader.show("Pages/AddChat/AddChat.qml", {userId: userId}) wentToAccountPage() } } diff --git a/src/gui/MainPane/AccountDelegate.qml b/src/gui/MainPane/AccountDelegate.qml index 5a7e892e..99ef645f 100644 --- a/src/gui/MainPane/AccountDelegate.qml +++ b/src/gui/MainPane/AccountDelegate.qml @@ -146,7 +146,7 @@ HTile { backgroundColor: "transparent" toolTip.text: qsTr("Add new chat") onClicked: { - pageLoader.showPage( + pageLoader.show( "Pages/AddChat/AddChat.qml", {userId: model.id}, ) account.wentToAccountPage() diff --git a/src/gui/MainPane/BottomBar.qml b/src/gui/MainPane/BottomBar.qml index deda1097..15bf044f 100644 --- a/src/gui/MainPane/BottomBar.qml +++ b/src/gui/MainPane/BottomBar.qml @@ -24,7 +24,7 @@ Rectangle { toolTip.text: qsTr("Add another account") backgroundColor: theme.mainPane.bottomBar.settingsButtonBackground onClicked: { - pageLoader.showPage("Pages/AddAccount/AddAccount.qml") + pageLoader.show("Pages/AddAccount/AddAccount.qml") roomList.startCorrectItemSearch() } diff --git a/src/gui/MainPane/RoomList.qml b/src/gui/MainPane/RoomList.qml index f12ab968..e3f06534 100644 --- a/src/gui/MainPane/RoomList.qml +++ b/src/gui/MainPane/RoomList.qml @@ -61,7 +61,7 @@ HListView { const item = model.get(index) item.type === "Account" ? - pageLoader.showPage( + pageLoader.show( "Pages/AccountSettings/AccountSettings.qml", { "userId": item.id }, ) : pageLoader.showRoom(item.for_account, item.id) diff --git a/src/gui/PageLoader.qml b/src/gui/PageLoader.qml index 0a284b29..0b42a7a3 100644 --- a/src/gui/PageLoader.qml +++ b/src/gui/PageLoader.qml @@ -18,7 +18,7 @@ HLoader { signal recycled() signal previousShown(string componentUrl, var properties) - function showPage(componentUrl, properties={}) { + function show(componentUrl, properties={}) { history.unshift([componentUrl, properties]) if (history.length > historyLength) history.pop() @@ -42,7 +42,7 @@ HLoader { } function showRoom(userId, roomId) { - showPage("Pages/Chat/Chat.qml", {userId, roomId}) + show("Pages/Chat/Chat.qml", {userId, roomId}) } function showPrevious(timesBack=1) { @@ -50,7 +50,7 @@ HLoader { if (timesBack < 1) return false const [componentUrl, properties] = history[timesBack] - showPage(componentUrl, properties) + show(componentUrl, properties) previousShown(componentUrl, properties) return true } @@ -72,13 +72,11 @@ HLoader { Component.onCompleted: { if (! py.startupAnyAccountsSaved) { - pageLoader.showPage( - "AddAccount/AddAccount", {"header.show": false}, - ) + pageLoader.show("AddAccount/AddAccount", {"header.show": false}) return } - pageLoader.showPage(window.uiState.page, window.uiState.pageProperties) + pageLoader.show(window.uiState.page, window.uiState.pageProperties) } HNumberAnimation { diff --git a/src/gui/Pages/AddAccount/SignInBase.qml b/src/gui/Pages/AddAccount/SignInBase.qml index dc5ad5b2..69f86422 100644 --- a/src/gui/Pages/AddAccount/SignInBase.qml +++ b/src/gui/Pages/AddAccount/SignInBase.qml @@ -45,7 +45,7 @@ HFlickableColumnPage { [receivedUserId] ) - pageLoader.showPage( + pageLoader.show( "Pages/AccountSettings/AccountSettings.qml", {userId: receivedUserId}, ) diff --git a/src/gui/Popups/ForgetRoomPopup.qml b/src/gui/Popups/ForgetRoomPopup.qml index edc8d58a..54d345dd 100644 --- a/src/gui/Popups/ForgetRoomPopup.qml +++ b/src/gui/Popups/ForgetRoomPopup.qml @@ -20,7 +20,7 @@ HFlickableColumnPopup { window.uiState.pageProperties.roomId === roomId) { window.mainUI.pageLoader.showPrevious() || - window.mainUI.pageLoader.showPage("Pages/Default.qml") + window.mainUI.pageLoader.show("Pages/Default.qml") Qt.callLater(popup.destroy) } diff --git a/src/gui/Popups/SignOutPopup.qml b/src/gui/Popups/SignOutPopup.qml index 57303646..8de43f04 100644 --- a/src/gui/Popups/SignOutPopup.qml +++ b/src/gui/Popups/SignOutPopup.qml @@ -39,7 +39,7 @@ HFlickableColumnPopup { window.uiState.pageProperties.userId === userId) { const page = "Pages/AddAccount/AddAccount.qml" - window.mainUI.pageLoader.showPage(page) + window.mainUI.pageLoader.show(page) } py.callCoro("logout_client", [userId])