diff options
Diffstat (limited to 'kodereviewer/qml/Main.qml')
-rw-r--r-- | kodereviewer/qml/Main.qml | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/kodereviewer/qml/Main.qml b/kodereviewer/qml/Main.qml index dc807fe..6c13d1e 100644 --- a/kodereviewer/qml/Main.qml +++ b/kodereviewer/qml/Main.qml @@ -28,6 +28,8 @@ Kirigami.ApplicationWindow { project: root.project } + property PullRequest pullRequest + Settings { id: settings property alias width: root.width @@ -37,6 +39,28 @@ Kirigami.ApplicationWindow { pageStack.initialPage: initPage + property list<Kirigami.Action> commonActions: [ + Kirigami.Action { + id: reviewChangesAction + text: "Review changes" + icon.name: "preview-symbolic" + enabled: !!root.pullRequest + onTriggered: reviewChangesDialog.open() + } + ] + + + ReviewDialog { + id: reviewChangesDialog + onAccepted: { + root.connection.createReview( + root.pullRequest.number, root.pullRequest.last_commit, + reviewBodyText, event + ) + clearForm() + } + } + Component { id: initPage WelcomePage { @@ -50,7 +74,7 @@ Kirigami.ApplicationWindow { Loader { id: treeFileModelLoader active: !!pullRequest - property var pullRequest: undefined + property var pullRequest: root.pullRequest sourceComponent: TreeFileModel { pullRequest: treeFileModelLoader.pullRequest @@ -66,10 +90,6 @@ Kirigami.ApplicationWindow { id: contextDrawer enabled: treeFileModelLoader.active model: treeFileModelLoader.item - - onEnabledChanged: { - print("Enabled? " + enabled) - } } @@ -83,10 +103,7 @@ 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 + root.pullRequest = pullRequest treeFileModelLoader.pullRequest = pullRequest } } @@ -102,6 +119,7 @@ Kirigami.ApplicationWindow { active: root.isProjectSelected sourceComponent: CommentPage { connection: root.connection + pullRequest: root.pullRequest } } @@ -110,6 +128,7 @@ Kirigami.ApplicationWindow { active: root.isProjectSelected sourceComponent: PullRequestDescriptionPage { connection: root.connection + pullRequest: root.pullRequest } } @@ -118,6 +137,7 @@ Kirigami.ApplicationWindow { active: root.isProjectSelected sourceComponent: ReviewListPage { connection: root.connection + pullRequest: root.pullRequest } } @@ -126,6 +146,7 @@ Kirigami.ApplicationWindow { active: root.isProjectSelected sourceComponent: FilesChangedPage { connection: root.connection + pullRequest: root.pullRequest } } |