summaryrefslogtreecommitdiff
path: root/kodereviewer/qml/Main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'kodereviewer/qml/Main.qml')
-rw-r--r--kodereviewer/qml/Main.qml85
1 files changed, 85 insertions, 0 deletions
diff --git a/kodereviewer/qml/Main.qml b/kodereviewer/qml/Main.qml
new file mode 100644
index 0000000..0b41a05
--- /dev/null
+++ b/kodereviewer/qml/Main.qml
@@ -0,0 +1,85 @@
+pragma ComponentBehavior: Bound
+import QtQuick
+import QtCore
+import QtQuick.Controls as Controls
+import QtQuick.Layouts
+
+import org.kde.kirigami as Kirigami
+import org.kde.kirigamiaddons.formcard as FormCard
+
+import org.deprecated.kodereviewer 1.0
+
+Kirigami.ApplicationWindow {
+ id: root
+
+ title: qsTr("Kode Reviewer")
+
+ minimumWidth: Kirigami.Units.gridUnit * 20
+ minimumHeight: Kirigami.Units.gridUnit * 20
+ width: minimumWidth
+ height: minimumHeight
+
+ signal projectSelected()
+
+ property Project project
+
+ property NetworkManager connection: NetworkManager {
+ project: root.project
+ }
+
+ Settings {
+ id: settings
+ property alias width: root.width
+ property alias height: root.height
+ property string githubToken: ""
+ }
+
+ pageStack.initialPage: initPage
+
+ Component {
+ id: initPage
+ WelcomePage {
+ onProjectSelected: project => {
+ root.project = project
+ root.projectSelected()
+ }
+ }
+ }
+
+ Loader {
+ id: projectListPageLoader
+ active: false
+ sourceComponent: Component {
+ ProjectListPage {
+ connection: root.connection
+ project: root.project
+ }
+ }
+ }
+
+ Loader {
+ id: placeHolderPageLoader
+ active: false
+ sourceComponent: Component {
+ Kirigami.Page {
+
+ Kirigami.Theme.colorSet: Kirigami.Theme.View
+ Kirigami.Theme.inherit: false
+ title: "Select a pull request"
+ spacing: Kirigami.Units.largeSpacing * 2
+ Kirigami.PlaceholderMessage {
+ anchors.centerIn: parent
+ icon.name: "org.deprecated.kodereviewer"
+ text: "Select a pull request"
+ }
+ }
+ }
+ }
+
+ onProjectSelected: {
+ projectListPageLoader.active = true
+ placeHolderPageLoader.active = true
+ pageStack.replace(projectListPageLoader.item)
+ pageStack.push(placeHolderPageLoader.item)
+ }
+}