moved handling of connection states from qml in connectionController
- added a check for already installed containers before installing the server/container - added a button to scan the server for installed containers - added separation for read/write and readonly servers for pageHome
This commit is contained in:
parent
3a264e6baf
commit
249be451f7
21 changed files with 466 additions and 245 deletions
|
@ -21,8 +21,8 @@ PageType {
|
|||
|
||||
property string borderColor: "#2C2D30"
|
||||
|
||||
property string currentServerName: serversMenuContent.currentItem.delegateData.name
|
||||
property string currentServerHostName: serversMenuContent.currentItem.delegateData.hostName
|
||||
property string currentServerName
|
||||
property string currentServerHostName
|
||||
property string currentContainerName
|
||||
|
||||
ConnectButton {
|
||||
|
@ -93,7 +93,15 @@ PageType {
|
|||
Layout.bottomMargin: 44
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
text: root.currentContainerName + " | " + root.currentServerHostName
|
||||
text: {
|
||||
var string = ""
|
||||
if (SettingsController.isAmneziaDnsEnabled()) {
|
||||
string += "Amnezia DNS | "
|
||||
}
|
||||
|
||||
string += root.currentContainerName + " | " + root.currentServerHostName
|
||||
return string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -153,6 +161,8 @@ 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)
|
||||
containersDropDown.menuVisible = true
|
||||
|
@ -161,20 +171,45 @@ PageType {
|
|||
listView: HomeContainersListView {
|
||||
rootWidth: root.width
|
||||
|
||||
Connections {
|
||||
target: ServersModel
|
||||
|
||||
function onCurrentlyProcessedServerIndexChanged() {
|
||||
updateContainersModelFilters()
|
||||
}
|
||||
|
||||
function updateContainersModelFilters() {
|
||||
if (ServersModel.isCurrentlyProcessedServerHasWriteAccess()) {
|
||||
proxyContainersModel.filters = [serviceTypeFilter, supportedFilter]
|
||||
} else {
|
||||
proxyContainersModel.filters = installedFilter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
filters: [
|
||||
ValueFilter {
|
||||
roleName: "serviceType"
|
||||
value: ProtocolEnum.Vpn
|
||||
},
|
||||
ValueFilter {
|
||||
roleName: "isSupported"
|
||||
value: true
|
||||
}
|
||||
]
|
||||
|
||||
Component.onCompleted: updateContainersModelFilters()
|
||||
}
|
||||
|
||||
currentIndex: ContainersModel.getDefaultContainer()
|
||||
}
|
||||
}
|
||||
|
@ -272,6 +307,9 @@ PageType {
|
|||
|
||||
isDefault = true
|
||||
ContainersModel.setCurrentlyProcessedServerIndex(index)
|
||||
|
||||
root.currentServerName = name
|
||||
root.currentServerHostName = hostName
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
@ -302,6 +340,13 @@ PageType {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (serversMenuContent.currentIndex === index) {
|
||||
root.currentServerName = name
|
||||
root.currentServerHostName = hostName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue