added separation for read/write and readonly servers for pageSettingsServerProtocols, PageSettingsServerServices, PageSettingsServerData
- added fields validations for pageSetupWizardCredentials
This commit is contained in:
parent
249be451f7
commit
2ef53c6df9
22 changed files with 466 additions and 325 deletions
|
|
@ -8,96 +8,115 @@ Item {
|
|||
id: root
|
||||
|
||||
property string headerText
|
||||
property string textFieldPlaceholderText
|
||||
property bool textFieldEditable: true
|
||||
property alias errorText: errorField.text
|
||||
|
||||
property string buttonText
|
||||
property var clickedFunc
|
||||
|
||||
property alias textField: textField
|
||||
property alias textFieldText: textField.text
|
||||
property string textFieldPlaceholderText
|
||||
property bool textFieldEditable: true
|
||||
|
||||
implicitHeight: 74
|
||||
implicitWidth: content.implicitWidth
|
||||
implicitHeight: content.implicitHeight
|
||||
|
||||
Rectangle {
|
||||
id: backgroud
|
||||
ColumnLayout {
|
||||
id: content
|
||||
anchors.fill: parent
|
||||
color: "#1c1d21"
|
||||
radius: 16
|
||||
border.color: textField.focus ? "#d7d8db" : "#2C2D30"
|
||||
border.width: 1
|
||||
|
||||
Behavior on border.color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: backgroud
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 74
|
||||
color: "#1c1d21"
|
||||
radius: 16
|
||||
border.color: textField.focus ? "#d7d8db" : "#2C2D30"
|
||||
border.width: 1
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: backgroud
|
||||
ColumnLayout {
|
||||
|
||||
LabelTextType {
|
||||
text: root.headerText
|
||||
color: "#878b91"
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
Layout.topMargin: 16
|
||||
Behavior on border.color {
|
||||
PropertyAnimation { duration: 200 }
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: textField
|
||||
RowLayout {
|
||||
anchors.fill: backgroud
|
||||
ColumnLayout {
|
||||
LabelTextType {
|
||||
text: root.headerText
|
||||
color: "#878b91"
|
||||
|
||||
enabled: root.textFieldEditable
|
||||
color: "#d7d8db"
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
Layout.topMargin: 16
|
||||
}
|
||||
|
||||
placeholderText: textFieldPlaceholderText
|
||||
placeholderTextColor: "#494B50"
|
||||
TextField {
|
||||
id: textField
|
||||
|
||||
selectionColor: "#412102"
|
||||
selectedTextColor: "#D7D8DB"
|
||||
enabled: root.textFieldEditable
|
||||
color: "#d7d8db"
|
||||
|
||||
font.pixelSize: 16
|
||||
font.weight: 400
|
||||
font.family: "PT Root UI VF"
|
||||
placeholderText: textFieldPlaceholderText
|
||||
placeholderTextColor: "#494B50"
|
||||
|
||||
height: 24
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
topPadding: 0
|
||||
rightPadding: 0
|
||||
leftPadding: 0
|
||||
bottomPadding: 0
|
||||
selectionColor: "#412102"
|
||||
selectedTextColor: "#D7D8DB"
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#1c1d21"
|
||||
font.pixelSize: 16
|
||||
font.weight: 400
|
||||
font.family: "PT Root UI VF"
|
||||
|
||||
height: 24
|
||||
Layout.fillWidth: true
|
||||
Layout.rightMargin: 16
|
||||
Layout.leftMargin: 16
|
||||
Layout.bottomMargin: 16
|
||||
topPadding: 0
|
||||
rightPadding: 0
|
||||
leftPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#1c1d21"
|
||||
}
|
||||
|
||||
onTextChanged: {
|
||||
root.errorText = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
visible: root.buttonText !== ""
|
||||
|
||||
defaultColor: "transparent"
|
||||
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
|
||||
pressedColor: Qt.rgba(1, 1, 1, 0.12)
|
||||
disabledColor: "#878B91"
|
||||
textColor: "#D7D8DB"
|
||||
borderWidth: 0
|
||||
|
||||
text: buttonText
|
||||
|
||||
Layout.rightMargin: 24
|
||||
|
||||
onClicked: {
|
||||
if (clickedFunc && typeof clickedFunc === "function") {
|
||||
clickedFunc()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BasicButtonType {
|
||||
visible: root.buttonText !== ""
|
||||
SmallTextType {
|
||||
id: errorField
|
||||
|
||||
defaultColor: "transparent"
|
||||
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
|
||||
pressedColor: Qt.rgba(1, 1, 1, 0.12)
|
||||
disabledColor: "#878B91"
|
||||
textColor: "#D7D8DB"
|
||||
borderWidth: 0
|
||||
|
||||
text: buttonText
|
||||
|
||||
Layout.rightMargin: 24
|
||||
|
||||
onClicked: {
|
||||
if (clickedFunc && typeof clickedFunc === "function") {
|
||||
clickedFunc()
|
||||
}
|
||||
}
|
||||
text: root.errorText
|
||||
visible: root.errorText !== ""
|
||||
color: "#EB5757"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
47
client/ui/qml/Filters/ContainersModelFilters.qml
Normal file
47
client/ui/qml/Filters/ContainersModelFilters.qml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
pragma Singleton
|
||||
|
||||
import QtQuick 2.15
|
||||
|
||||
import SortFilterProxyModel 0.2
|
||||
|
||||
import ProtocolEnum 1.0
|
||||
|
||||
Item {
|
||||
ValueFilter {
|
||||
id: vpnTypeFilter
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Vpn
|
||||
}
|
||||
|
||||
ValueFilter {
|
||||
id: serviceTypeFilter
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Other
|
||||
}
|
||||
|
||||
ValueFilter {
|
||||
id: supportedFilter
|
||||
roleName: "isSupported"
|
||||
value: true
|
||||
}
|
||||
|
||||
ValueFilter {
|
||||
id: installedFilter
|
||||
roleName: "isInstalled"
|
||||
value: true
|
||||
}
|
||||
|
||||
function getWriteAccessProtocolsListFilters() {
|
||||
return [vpnTypeFilter, supportedFilter]
|
||||
}
|
||||
function getReadAccessProtocolsListFilters() {
|
||||
return [vpnTypeFilter, supportedFilter, installedFilter]
|
||||
}
|
||||
|
||||
function getWriteAccessServicesListFilters() {
|
||||
return [serviceTypeFilter, supportedFilter]
|
||||
}
|
||||
function getReadAccessServicesListFilters() {
|
||||
return [serviceTypeFilter, supportedFilter, installedFilter]
|
||||
}
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import SortFilterProxyModel 0.2
|
|||
import PageEnum 1.0
|
||||
import ProtocolEnum 1.0
|
||||
import ContainerProps 1.0
|
||||
import ContainersModelFilters 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
|
|
@ -161,10 +162,7 @@ PageType {
|
|||
headerBackButtonImage: "qrc:/images/controls/arrow-left.svg"
|
||||
|
||||
rootButtonClickedFunction: function() {
|
||||
// todo check if server index changed before set Currently processed
|
||||
// todo make signal slot for change server index in containersModel
|
||||
ServersModel.setCurrentlyProcessedServerIndex(serversMenuContent.currentIndex)
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(serversMenuContent.currentIndex)
|
||||
ServersModel.currentlyProcessedIndex = serversMenuContent.currentIndex
|
||||
containersDropDown.menuVisible = true
|
||||
}
|
||||
|
||||
|
|
@ -177,39 +175,22 @@ PageType {
|
|||
function onCurrentlyProcessedServerIndexChanged() {
|
||||
updateContainersModelFilters()
|
||||
}
|
||||
}
|
||||
|
||||
function updateContainersModelFilters() {
|
||||
if (ServersModel.isCurrentlyProcessedServerHasWriteAccess()) {
|
||||
proxyContainersModel.filters = [serviceTypeFilter, supportedFilter]
|
||||
} else {
|
||||
proxyContainersModel.filters = installedFilter
|
||||
}
|
||||
function updateContainersModelFilters() {
|
||||
if (ServersModel.isCurrentlyProcessedServerHasWriteAccess()) {
|
||||
proxyContainersModel.filters = ContainersModelFilters.getWriteAccessProtocolsListFilters()
|
||||
} else {
|
||||
proxyContainersModel.filters = ContainersModelFilters.getReadAccessProtocolsListFilters()
|
||||
}
|
||||
}
|
||||
|
||||
ValueFilter {
|
||||
id: serviceTypeFilter
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Vpn
|
||||
}
|
||||
ValueFilter {
|
||||
id: supportedFilter
|
||||
roleName: "isSupported"
|
||||
value: true
|
||||
}
|
||||
ValueFilter {
|
||||
id: installedFilter
|
||||
roleName: "isInstalled"
|
||||
value: true
|
||||
}
|
||||
|
||||
model: SortFilterProxyModel {
|
||||
id: proxyContainersModel
|
||||
sourceModel: ContainersModel
|
||||
|
||||
Component.onCompleted: updateContainersModelFilters()
|
||||
}
|
||||
|
||||
Component.onCompleted: updateContainersModelFilters()
|
||||
currentIndex: ContainersModel.getDefaultContainer()
|
||||
}
|
||||
}
|
||||
|
|
@ -267,7 +248,7 @@ PageType {
|
|||
height: serversMenuContent.contentItem.height
|
||||
|
||||
model: ServersModel
|
||||
currentIndex: ServersModel.getDefaultServerIndex()
|
||||
currentIndex: ServersModel.defaultIndex
|
||||
|
||||
clip: true
|
||||
interactive: false
|
||||
|
|
@ -305,8 +286,8 @@ PageType {
|
|||
onClicked: {
|
||||
serversMenuContent.currentIndex = index
|
||||
|
||||
isDefault = true
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(index)
|
||||
ServersModel.currentlyProcessedIndex = index
|
||||
ServersModel.defaultIndex = index
|
||||
|
||||
root.currentServerName = name
|
||||
root.currentServerHostName = hostName
|
||||
|
|
@ -328,8 +309,7 @@ PageType {
|
|||
z: 1
|
||||
|
||||
onClicked: function() {
|
||||
ServersModel.setCurrentlyProcessedServerIndex(index)
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(index)
|
||||
ServersModel.currentlyProcessedIndex = index
|
||||
goToPage(PageEnum.PageSettingsServerInfo)
|
||||
menu.visible = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,14 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ServersModel
|
||||
|
||||
function onCurrentlyProcessedServerIndexChanged() {
|
||||
content.isServerWithWriteAccess = ServersModel.isCurrentlyProcessedServerHasWriteAccess()
|
||||
}
|
||||
}
|
||||
|
||||
FlickableType {
|
||||
id: fl
|
||||
anchors.top: parent.top
|
||||
|
|
@ -42,7 +50,10 @@ PageType {
|
|||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
property bool isServerWithWriteAccess: ServersModel.isCurrentlyProcessedServerHasWriteAccess() //todo make it property?
|
||||
|
||||
LabelWithButtonType {
|
||||
visible: content.isServerWithWriteAccess
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Clear Amnezia cache")
|
||||
|
|
@ -65,9 +76,12 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
DividerType {
|
||||
visible: content.isServerWithWriteAccess
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
visible: content.isServerWithWriteAccess
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: qsTr("Проверить сервер на наличие ранее установленных сервисов Amnezia")
|
||||
|
|
@ -78,12 +92,14 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
DividerType {
|
||||
visible: content.isServerWithWriteAccess
|
||||
}
|
||||
|
||||
LabelWithButtonType {
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: "Remove server from application"
|
||||
text: qsTr("Remove server from application")
|
||||
textColor: "#EB5757"
|
||||
|
||||
clickedFunction: function() {
|
||||
|
|
@ -115,9 +131,10 @@ PageType {
|
|||
DividerType {}
|
||||
|
||||
LabelWithButtonType {
|
||||
visible: content.isServerWithWriteAccess
|
||||
Layout.fillWidth: true
|
||||
|
||||
text: "Clear server from Amnezia software"
|
||||
text: qsTr("Clear server from Amnezia software")
|
||||
textColor: "#EB5757"
|
||||
|
||||
clickedFunction: function() {
|
||||
|
|
@ -142,7 +159,9 @@ PageType {
|
|||
}
|
||||
}
|
||||
|
||||
DividerType {}
|
||||
DividerType {
|
||||
visible: content.isServerWithWriteAccess
|
||||
}
|
||||
|
||||
QuestionDrawer {
|
||||
id: questionDrawer
|
||||
|
|
|
|||
|
|
@ -54,7 +54,13 @@ PageType {
|
|||
actionButtonImage: "qrc:/images/controls/edit-3.svg"
|
||||
|
||||
headerText: name
|
||||
descriptionText: credentialsLogin + " · " + hostName
|
||||
descriptionText: {
|
||||
if (ServersModel.isCurrentlyProcessedServerHasWriteAccess()) {
|
||||
return credentialsLogin + " · " + hostName
|
||||
} else {
|
||||
return hostName
|
||||
}
|
||||
}
|
||||
|
||||
actionButtonFunction: function() {
|
||||
serverNameEditDrawer.visible = true
|
||||
|
|
@ -123,10 +129,14 @@ PageType {
|
|||
}
|
||||
|
||||
TabButtonType {
|
||||
visible: protocolsPage.installedProtocolsCount
|
||||
width: protocolsPage.installedProtocolsCount ? undefined : 0
|
||||
isSelected: tabBar.currentIndex === 0
|
||||
text: qsTr("Protocols")
|
||||
}
|
||||
TabButtonType {
|
||||
visible: servicesPage.installedServicesCount
|
||||
width: servicesPage.installedServicesCount ? undefined : 0
|
||||
isSelected: tabBar.currentIndex === 1
|
||||
text: qsTr("Services")
|
||||
}
|
||||
|
|
@ -143,9 +153,11 @@ PageType {
|
|||
currentIndex: tabBar.currentIndex
|
||||
|
||||
PageSettingsServerProtocols {
|
||||
id: protocolsPage
|
||||
stackView: root.stackView
|
||||
}
|
||||
PageSettingsServerServices {
|
||||
id: servicesPage
|
||||
stackView: root.stackView
|
||||
}
|
||||
PageSettingsServerData {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import SortFilterProxyModel 0.2
|
|||
import PageEnum 1.0
|
||||
import ProtocolEnum 1.0
|
||||
import ContainerProps 1.0
|
||||
import ContainersModelFilters 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
|
|
@ -17,22 +18,31 @@ import "../Components"
|
|||
PageType {
|
||||
id: root
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: containersProxyModel
|
||||
sourceModel: ContainersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Vpn
|
||||
},
|
||||
ValueFilter {
|
||||
roleName: "isSupported"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
property var installedProtocolsCount
|
||||
|
||||
SettingsContainersListView {
|
||||
model: containersProxyModel
|
||||
Connections {
|
||||
target: ServersModel
|
||||
|
||||
function onCurrentlyProcessedServerIndexChanged() {
|
||||
updateContainersModelFilters()
|
||||
}
|
||||
}
|
||||
|
||||
function updateContainersModelFilters() {
|
||||
if (ServersModel.isCurrentlyProcessedServerHasWriteAccess()) {
|
||||
proxyContainersModel.filters = ContainersModelFilters.getWriteAccessProtocolsListFilters()
|
||||
} else {
|
||||
proxyContainersModel.filters = ContainersModelFilters.getReadAccessProtocolsListFilters()
|
||||
}
|
||||
root.installedProtocolsCount = proxyContainersModel.count
|
||||
}
|
||||
|
||||
model: SortFilterProxyModel {
|
||||
id: proxyContainersModel
|
||||
sourceModel: ContainersModel
|
||||
}
|
||||
|
||||
Component.onCompleted: updateContainersModelFilters()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import SortFilterProxyModel 0.2
|
|||
import PageEnum 1.0
|
||||
import ProtocolEnum 1.0
|
||||
import ContainerProps 1.0
|
||||
import ContainersModelFilters 1.0
|
||||
|
||||
import "./"
|
||||
import "../Controls2"
|
||||
|
|
@ -17,22 +18,31 @@ import "../Components"
|
|||
PageType {
|
||||
id: root
|
||||
|
||||
SortFilterProxyModel {
|
||||
id: containersProxyModel
|
||||
sourceModel: ContainersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Other
|
||||
},
|
||||
ValueFilter {
|
||||
roleName: "isSupported"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
property var installedServicesCount
|
||||
|
||||
SettingsContainersListView {
|
||||
model: containersProxyModel
|
||||
Connections {
|
||||
target: ServersModel
|
||||
|
||||
function onCurrentlyProcessedServerIndexChanged() {
|
||||
updateContainersModelFilters()
|
||||
}
|
||||
}
|
||||
|
||||
function updateContainersModelFilters() {
|
||||
if (ServersModel.isCurrentlyProcessedServerHasWriteAccess()) {
|
||||
proxyContainersModel.filters = ContainersModelFilters.getWriteAccessServicesListFilters()
|
||||
} else {
|
||||
proxyContainersModel.filters = ContainersModelFilters.getReadAccessServicesListFilters()
|
||||
}
|
||||
root.installedServicesCount = proxyContainersModel.count
|
||||
}
|
||||
|
||||
model: SortFilterProxyModel {
|
||||
id: proxyContainersModel
|
||||
sourceModel: ContainersModel
|
||||
}
|
||||
|
||||
Component.onCompleted: updateContainersModelFilters()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,8 +89,7 @@ PageType {
|
|||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
clickedFunction: function() {
|
||||
ServersModel.setCurrentlyProcessedServerIndex(index)
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(index)
|
||||
ServersModel.currentlyProcessedIndex = index
|
||||
goToPage(PageEnum.PageSettingsServerInfo)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,10 @@ PageType {
|
|||
text: qsTr("Set up a server the easy way")
|
||||
|
||||
onClicked: function() {
|
||||
if (!isCredentialsFilled()) {
|
||||
return
|
||||
}
|
||||
|
||||
InstallController.setShouldCreateServer(true)
|
||||
InstallController.setCurrentlyInstalledServerCredentials(hostname.textField.text, username.textField.text, secretData.textField.text)
|
||||
|
||||
|
|
@ -100,6 +104,10 @@ PageType {
|
|||
text: qsTr("Select protocol to install")
|
||||
|
||||
onClicked: function() {
|
||||
if (!isCredentialsFilled()) {
|
||||
return
|
||||
}
|
||||
|
||||
InstallController.setShouldCreateServer(true)
|
||||
InstallController.setCurrentlyInstalledServerCredentials(hostname.textField.text, username.textField.text, secretData.textField.text)
|
||||
|
||||
|
|
@ -108,4 +116,25 @@ PageType {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isCredentialsFilled() {
|
||||
var hasEmptyField = false
|
||||
|
||||
if (hostname.textFieldText === "") {
|
||||
hostname.errorText = qsTr("ip address cannot be empty")
|
||||
hasEmptyField = true
|
||||
} else if (!hostname.textField.acceptableInput) {
|
||||
hostname.errorText = qsTr("Enter the address in the format 255.255.255.255:88")
|
||||
}
|
||||
|
||||
if (username.textFieldText === "") {
|
||||
username.errorText = qsTr("login cannot be empty")
|
||||
hasEmptyField = true
|
||||
}
|
||||
if (secretData.textFieldText === "") {
|
||||
secretData.errorText = qsTr("password/private key cannot be empty")
|
||||
hasEmptyField = true
|
||||
}
|
||||
return !hasEmptyField
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ PageType {
|
|||
|
||||
function onServerAlreadyExists(serverIndex) {
|
||||
goToStartPage()
|
||||
ServersModel.setCurrentlyProcessedServerIndex(serverIndex)
|
||||
ServersModel.currentlyProcessedIndex = serverIndex
|
||||
goToPage(PageEnum.PageSettingsServerInfo, false)
|
||||
|
||||
PageController.showErrorMessage(qsTr("The server has already been added to the application"))
|
||||
|
|
|
|||
|
|
@ -147,18 +147,28 @@ PageType {
|
|||
|
||||
imageSource: "qrc:/images/controls/chevron-right.svg"
|
||||
|
||||
model: ServersModel
|
||||
currentIndex: ServersModel.getDefaultServerIndex()
|
||||
model: SortFilterProxyModel {
|
||||
id: proxyServersModel
|
||||
sourceModel: ServersModel
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "hasWriteAccess"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
currentIndex: 0
|
||||
|
||||
clickedFunction: function() {
|
||||
serverSelector.text = selectedText
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(currentIndex)
|
||||
ServersModel.currentlyProcessedIndex = currentIndex
|
||||
protocolSelector.visible = true
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
serverSelector.text = selectedText
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(currentIndex)
|
||||
ServersModel.currentlyProcessedIndex = currentIndex
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -169,7 +179,7 @@ PageType {
|
|||
height: parent.height * 0.5
|
||||
|
||||
ColumnLayout {
|
||||
id: header
|
||||
id: protocolSelectorHeader
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
|
|
@ -187,12 +197,12 @@ PageType {
|
|||
}
|
||||
|
||||
FlickableType {
|
||||
anchors.top: header.bottom
|
||||
anchors.top: protocolSelectorHeader.bottom
|
||||
anchors.topMargin: 16
|
||||
contentHeight: col.implicitHeight
|
||||
contentHeight: protocolSelectorContent.implicitHeight
|
||||
|
||||
Column {
|
||||
id: col
|
||||
id: protocolSelectorContent
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
|
@ -265,7 +275,7 @@ PageType {
|
|||
}
|
||||
|
||||
DropDownType {
|
||||
id: connectionTypeSelector
|
||||
id: exportTypeSelector
|
||||
|
||||
property int currentIndex
|
||||
|
||||
|
|
@ -283,8 +293,6 @@ PageType {
|
|||
headerText: qsTr("Connection format")
|
||||
|
||||
listView: ListViewType {
|
||||
id: connectionTypeSelectorListView
|
||||
|
||||
rootWidth: root.width
|
||||
dividerVisible: true
|
||||
|
||||
|
|
@ -294,14 +302,14 @@ PageType {
|
|||
currentIndex: 0
|
||||
|
||||
clickedFunction: function() {
|
||||
connectionTypeSelector.text = selectedText
|
||||
connectionTypeSelector.currentIndex = currentIndex
|
||||
connectionTypeSelector.menuVisible = false
|
||||
exportTypeSelector.text = selectedText
|
||||
exportTypeSelector.currentIndex = currentIndex
|
||||
exportTypeSelector.menuVisible = false
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
connectionTypeSelector.text = selectedText
|
||||
connectionTypeSelector.currentIndex = currentIndex
|
||||
exportTypeSelector.text = selectedText
|
||||
exportTypeSelector.currentIndex = currentIndex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,8 +50,7 @@ PageType {
|
|||
|
||||
Component.onCompleted: {
|
||||
var pagePath = PageController.getPagePath(PageEnum.PageHome)
|
||||
ServersModel.setCurrentlyProcessedServerIndex(ServersModel.getDefaultServerIndex())
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(ServersModel.getDefaultServerIndex())
|
||||
ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex
|
||||
tabBarStackView.push(pagePath, { "objectName" : pagePath })
|
||||
}
|
||||
}
|
||||
|
|
@ -65,8 +64,8 @@ PageType {
|
|||
|
||||
topPadding: 8
|
||||
bottomPadding: 8//34
|
||||
leftPadding: 96
|
||||
rightPadding: 96
|
||||
leftPadding: shareTabButton.visible ? 96 : 128
|
||||
rightPadding: shareTabButton.visible ? 96 : 128
|
||||
|
||||
background: Rectangle {
|
||||
border.width: 1
|
||||
|
|
@ -78,11 +77,25 @@ PageType {
|
|||
isSelected: tabBar.currentIndex === 0
|
||||
image: "qrc:/images/controls/home.svg"
|
||||
onClicked: {
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(ServersModel.getDefaultServerIndex())
|
||||
ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex
|
||||
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
|
||||
}
|
||||
}
|
||||
TabImageButtonType {
|
||||
id: shareTabButton
|
||||
|
||||
Connections {
|
||||
target: ServersModel
|
||||
|
||||
function onDefaultServerIndexChanged() {
|
||||
shareTabButton.visible = ServersModel.isCurrentlyProcessedServerHasWriteAccess()
|
||||
shareTabButton.width = ServersModel.isCurrentlyProcessedServerHasWriteAccess() ? undefined : 0
|
||||
}
|
||||
}
|
||||
|
||||
visible: ServersModel.isCurrentlyProcessedServerHasWriteAccess()
|
||||
width: visible ? undefined : 0
|
||||
|
||||
isSelected: tabBar.currentIndex === 1
|
||||
image: "qrc:/images/controls/share-2.svg"
|
||||
onClicked: {
|
||||
|
|
@ -100,8 +113,8 @@ PageType {
|
|||
|
||||
MouseArea {
|
||||
anchors.fill: tabBar
|
||||
anchors.leftMargin: 96
|
||||
anchors.rightMargin: 96
|
||||
anchors.leftMargin: shareTabButton.visible ? 96 : 128
|
||||
anchors.rightMargin: shareTabButton.visible ? 96 : 128
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
enabled: false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue