summaryrefslogtreecommitdiff
path: root/kodereviewer/qml/Main.qml
diff options
context:
space:
mode:
authorMatias Linares <matias.linares@comprandoengrupo.net>2024-10-29 18:12:20 -0300
committerMatias Linares <matias.linares@comprandoengrupo.net>2024-10-30 16:26:35 -0300
commitd46b4e7470e3115df34fc96ba2f8e59974f713be (patch)
tree04de00684a353c969bbe52fb96d658d0144ccdbf /kodereviewer/qml/Main.qml
parenta88655cd202dc43a64a7107f6f533bd386079386 (diff)
downloadkodereviewer-d46b4e7470e3115df34fc96ba2f8e59974f713be.tar.gz
Split PullRequestPage into different ScrollablePages
Diffstat (limited to 'kodereviewer/qml/Main.qml')
-rw-r--r--kodereviewer/qml/Main.qml89
1 files changed, 84 insertions, 5 deletions
diff --git a/kodereviewer/qml/Main.qml b/kodereviewer/qml/Main.qml
index c1be6b9..dc807fe 100644
--- a/kodereviewer/qml/Main.qml
+++ b/kodereviewer/qml/Main.qml
@@ -22,6 +22,7 @@ Kirigami.ApplicationWindow {
signal projectSelected()
property Project project
+ property bool isProjectSelected: false
property NetworkManager connection: NetworkManager {
project: root.project
@@ -54,6 +55,11 @@ Kirigami.ApplicationWindow {
sourceComponent: TreeFileModel {
pullRequest: treeFileModelLoader.pullRequest
}
+
+ onPullRequestChanged: {
+ if (pullRequest)
+ root.connection.getFiles(pullRequest.number)
+ }
}
contextDrawer: FilesDrawer {
@@ -69,7 +75,7 @@ Kirigami.ApplicationWindow {
Loader {
id: projectListPageLoader
- active: false
+ active: root.isProjectSelected
sourceComponent: Component {
ProjectListPage {
connection: root.connection
@@ -78,24 +84,97 @@ Kirigami.ApplicationWindow {
onPullRequestSelected: number => {
const pullRequest = project.pullRequest(number)
pullRequestPageLoader.item.pullRequest = pullRequest
+ commentsPageLoader.item.pullRequest = pullRequest
+ reviewListPageLoader.item.pullRequest = pullRequest
+ filesChangedPageLoader.item.pullRequest = pullRequest
treeFileModelLoader.pullRequest = pullRequest
}
}
}
}
+ Kirigami.PagePool {
+ id: pagePool
+ }
+
+ Loader {
+ id: commentsPageLoader
+ active: root.isProjectSelected
+ sourceComponent: CommentPage {
+ connection: root.connection
+ }
+ }
+
Loader {
id: pullRequestPageLoader
- active: false
- sourceComponent: PullRequestPage {
+ active: root.isProjectSelected
+ sourceComponent: PullRequestDescriptionPage {
+ connection: root.connection
+ }
+ }
+
+ Loader {
+ id: reviewListPageLoader
+ active: root.isProjectSelected
+ sourceComponent: ReviewListPage {
+ connection: root.connection
+ }
+ }
+
+ Loader {
+ id: filesChangedPageLoader
+ active: root.isProjectSelected
+ sourceComponent: FilesChangedPage {
connection: root.connection
}
}
onProjectSelected: {
- projectListPageLoader.active = true
- pullRequestPageLoader.active = true
+ navigationFooter.visible = true
+
+ root.isProjectSelected = true
+
pageStack.replace(projectListPageLoader.item)
pageStack.push(pullRequestPageLoader.item)
}
+
+ footer: Kirigami.NavigationTabBar {
+ id: navigationFooter
+ visible: false
+ actions: [
+ Kirigami.Action {
+ icon.name: "info"
+ text: i18n("Info")
+ onTriggered: {
+ root.pageStack.pop()
+ root.pageStack.push(pullRequestPageLoader.item)
+ }
+ },
+ Kirigami.Action {
+ icon.name: "comment-symbolic"
+ text: i18n("Comments")
+ onTriggered: {
+ root.pageStack.pop()
+ root.pageStack.push(commentsPageLoader.item)
+ }
+
+ },
+ Kirigami.Action {
+ icon.name: "file-catalog-symbolic"
+ text: i18n("Files")
+ onTriggered: {
+ root.pageStack.pop()
+ root.pageStack.push(filesChangedPageLoader.item)
+ }
+ },
+ Kirigami.Action {
+ icon.name: "document-preview-symbolic"
+ text: i18n("Reviews")
+ onTriggered: {
+ root.pageStack.pop()
+ root.pageStack.push(reviewListPageLoader.item)
+ }
+ }
+ ]
+ }
}