Warning, /maui/strike/src/views/widgets/ProjectConfigDialog.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.14
0002 import QtQuick.Controls 2.14
0003 import QtQuick.Layouts 1.3
0004 
0005 import org.mauikit.controls 1.3 as Maui
0006 import org.slike.strike 1.0 as Strike
0007 
0008 Maui.PopupPage
0009 {
0010     id: control
0011 
0012     title: i18n("Configure")
0013     headBar.visible: false
0014     closeButtonVisible: false
0015     persistent: true
0016 
0017     actions: [
0018         Action
0019         {
0020             text: _stackView.depth > 1 ? i18n("Go back") : i18n ("Abort")
0021 
0022             onTriggered:
0023             {
0024                 switch(_stackView.depth)
0025                 {
0026                 case 1: control.close()
0027                     break
0028                 case 2: _stackView.pop()
0029                     break
0030                 }
0031             }
0032         },
0033 
0034         Action
0035         {
0036             text: stepLabel(_stackView.depth)
0037 
0038             onTriggered:
0039             {
0040                 switch(_stackView.depth)
0041                 {
0042                 case 1:
0043                     _project.configure()
0044                     _stackView.push(_step2Component)
0045                     break
0046                 case 2: control.close()
0047                     break
0048                 }
0049             }
0050         }
0051     ]
0052 
0053     stack: StackView
0054     {
0055         id: _stackView
0056 
0057         Layout.fillHeight: true
0058         Layout.fillWidth: true
0059         Layout.margins: Maui.Style.space.big
0060 
0061         initialItem: Item
0062         {
0063             ColumnLayout
0064             {
0065                 anchors.centerIn: parent
0066                 width: parent.width
0067                 spacing: Maui.Style.space.medium
0068 
0069                 Maui.Holder
0070                 {
0071                     Layout.fillWidth: true
0072                     Layout.preferredHeight: 160
0073                     Layout.alignment: Qt.AlignCenter
0074                     title: i18n("Configure")
0075                     body: i18n("Set the preferences to start hacking!")
0076                     emoji: "alienarena"
0077                     isMask: false
0078                     emojiSize: 64
0079                 }
0080 
0081 
0082                 Maui.ListItemTemplate
0083                 {
0084                     Layout.fillWidth: true
0085                     label1.text: i18n("Build Directory")
0086                     label2.text: i18n("Pick a build directory or keep the default one")
0087                 }
0088 
0089 
0090                 TextField
0091                 {
0092                     Layout.fillWidth: true
0093                     placeholderText: i18n("Build directory path")
0094                     text: _project.preferences.buildDir
0095                 }
0096 
0097                 //                Maui.ListItemTemplate
0098                 //                {
0099                 //                    Layout.fillWidth: true
0100                 //                    label1.text: i18n("Install Prefix")
0101                 //                    label2.text: i18n("Where do you want to install the project")
0102                 //                    leftLabels.data: TextField
0103                 //                    {
0104                 //                        Layout.fillWidth: true
0105                 //                        placeholderText: i18n("Prefix path")
0106                 //                        text: _project.preferences.installPrefix
0107                 //                    }
0108                 //                }
0109             }
0110         }
0111 
0112         Component
0113         {
0114             id: _step2Component
0115 
0116             Item
0117             {
0118                 ColumnLayout
0119                 {
0120                     anchors.centerIn: parent
0121                     width: parent.width
0122                     spacing: Maui.Style.space.medium
0123 
0124                     Maui.Holder
0125                     {
0126                         Layout.fillWidth: true
0127                         Layout.preferredHeight: 160
0128                         Layout.alignment: Qt.AlignCenter
0129                         isMask: false
0130                         title: i18n("Project")
0131                         body: i18n("Select the target project")
0132                         emoji: _project.projectLogo
0133                         emojiSize: 64
0134                     }
0135 
0136                     Item
0137                     {
0138                         Layout.fillWidth: true
0139                         Layout.preferredHeight: 120
0140 
0141                         BusyIndicator
0142                         {
0143                             anchors.centerIn: parent
0144                             running: _project.manager.status === Strike.Manager.Loading
0145                         }
0146 
0147                         Maui.ListBrowser
0148                         {
0149                             id: _projectsListView
0150                             height: 100
0151                             width: parent.width
0152                             anchors.centerIn: parent
0153                             model: _project.manager.projectsModel
0154                             spacing: Maui.Style.space.medium
0155                             delegate: Maui.GridBrowserDelegate
0156                             {
0157                                 isCurrentItem: ListView.isCurrentItem
0158                                 checked: _cmakeProject.title === model.title
0159                                 anchors.verticalCenter: parent.verticalCenter
0160                                 width: 64
0161                                 height: 80
0162                                 label1.text: model.title
0163                                 iconSource: "run-build"
0164 
0165                                 onClicked:
0166                                 {
0167                                     _projectsListView.currentIndex = index
0168                                     _cmakeProject.setData(model.data)
0169                                 }
0170                             }
0171                         }
0172                     }
0173                 }
0174             }
0175         }
0176     }
0177 
0178     function stepLabel(index)
0179     {
0180         switch(index)
0181         {
0182         case 1: return i18n("Configure")
0183         case 2: return i18n("Finish")
0184         }
0185     }
0186 }