added FlickableType to PageSettingsServerProtocols and PageSettingsServerServices
This commit is contained in:
parent
b4eb317b00
commit
9b07909ed8
6 changed files with 103 additions and 71 deletions
|
@ -3114,22 +3114,22 @@ AmneziaVPN detected this profile may contain malicious scripts. Please, carefull
|
||||||
<context>
|
<context>
|
||||||
<name>main</name>
|
<name>main</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/qml/main.qml" line="267"/>
|
<location filename="../ui/qml/main.qml" line="271"/>
|
||||||
<source>It's public key. Private key required</source>
|
<source>It's public key. Private key required</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/qml/main.qml" line="308"/>
|
<location filename="../ui/qml/main.qml" line="312"/>
|
||||||
<source>Ssh log</source>
|
<source>Ssh log</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/qml/main.qml" line="318"/>
|
<location filename="../ui/qml/main.qml" line="322"/>
|
||||||
<source>App log</source>
|
<source>App log</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../ui/qml/main.qml" line="322"/>
|
<location filename="../ui/qml/main.qml" line="326"/>
|
||||||
<source>Wrap words</source>
|
<source>Wrap words</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
|
@ -1,19 +1,15 @@
|
||||||
#include "protocolSettingsController.h"
|
#include "protocolSettingsController.h"
|
||||||
|
|
||||||
ProtocolSettingsController::ProtocolSettingsController(
|
ProtocolSettingsController::ProtocolSettingsController(const QSharedPointer<ServersModel> &serversModel,
|
||||||
const QSharedPointer<ServersModel> &serversModel,
|
const QSharedPointer<ContainersModel> &containersModel,
|
||||||
const QSharedPointer<ContainersModel> &containersModel,
|
const std::shared_ptr<Settings> &settings, QObject *parent)
|
||||||
const std::shared_ptr<Settings> &settings,
|
: QObject(parent), m_serversModel(serversModel), m_containersModel(containersModel), m_settings(settings)
|
||||||
QObject *parent)
|
{
|
||||||
: QObject(parent)
|
}
|
||||||
, m_serversModel(serversModel)
|
|
||||||
, m_containersModel(containersModel)
|
|
||||||
, m_settings(settings)
|
|
||||||
{}
|
|
||||||
|
|
||||||
QByteArray ProtocolSettingsController::getOpenVpnConfig()
|
QByteArray ProtocolSettingsController::getOpenVpnConfig()
|
||||||
{
|
{
|
||||||
auto containerIndex = m_containersModel->index(
|
auto containerIndex = m_containersModel->index(m_containersModel->getCurrentlyProcessedContainerIndex());
|
||||||
m_containersModel->getCurrentlyProcessedContainerIndex());
|
|
||||||
auto config = m_containersModel->data(containerIndex, ContainersModel::Roles::ConfigRole);
|
auto config = m_containersModel->data(containerIndex, ContainersModel::Roles::ConfigRole);
|
||||||
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ PageType {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
property bool isServerWithWriteAccess: ServersModel.isCurrentlyProcessedServerHasWriteAccess() //todo make it property?
|
property bool isServerWithWriteAccess: ServersModel.isCurrentlyProcessedServerHasWriteAccess()
|
||||||
|
|
||||||
LabelWithButtonType {
|
LabelWithButtonType {
|
||||||
visible: content.isServerWithWriteAccess
|
visible: content.isServerWithWriteAccess
|
||||||
|
|
|
@ -20,30 +20,45 @@ PageType {
|
||||||
|
|
||||||
property var installedProtocolsCount
|
property var installedProtocolsCount
|
||||||
|
|
||||||
SettingsContainersListView {
|
FlickableType {
|
||||||
id: settingsContainersListView
|
id: fl
|
||||||
Connections {
|
anchors.top: parent.top
|
||||||
target: ServersModel
|
anchors.bottom: parent.bottom
|
||||||
|
contentHeight: content.implicitHeight
|
||||||
|
|
||||||
function onCurrentlyProcessedServerIndexChanged() {
|
Column {
|
||||||
settingsContainersListView.updateContainersModelFilters()
|
id: content
|
||||||
|
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
SettingsContainersListView {
|
||||||
|
id: settingsContainersListView
|
||||||
|
Connections {
|
||||||
|
target: ServersModel
|
||||||
|
|
||||||
|
function onCurrentlyProcessedServerIndexChanged() {
|
||||||
|
settingsContainersListView.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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,30 +20,45 @@ PageType {
|
||||||
|
|
||||||
property var installedServicesCount
|
property var installedServicesCount
|
||||||
|
|
||||||
SettingsContainersListView {
|
FlickableType {
|
||||||
id: settingsContainersListView
|
id: fl
|
||||||
Connections {
|
anchors.top: parent.top
|
||||||
target: ServersModel
|
anchors.bottom: parent.bottom
|
||||||
|
contentHeight: content.implicitHeight
|
||||||
|
|
||||||
function onCurrentlyProcessedServerIndexChanged() {
|
Column {
|
||||||
settingsContainersListView.updateContainersModelFilters()
|
id: content
|
||||||
|
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
SettingsContainersListView {
|
||||||
|
id: settingsContainersListView
|
||||||
|
Connections {
|
||||||
|
target: ServersModel
|
||||||
|
|
||||||
|
function onCurrentlyProcessedServerIndexChanged() {
|
||||||
|
settingsContainersListView.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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,15 +26,27 @@ PageType {
|
||||||
roleName: "isSupported"
|
roleName: "isSupported"
|
||||||
value: true
|
value: true
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: backButton
|
||||||
|
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
anchors.topMargin: 20
|
||||||
|
|
||||||
|
BackButtonType {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FlickableType {
|
FlickableType {
|
||||||
id: fl
|
id: fl
|
||||||
anchors.top: parent.top
|
anchors.top: backButton.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
contentHeight: content.height
|
contentHeight: content.implicitHeight + content.anchors.topMargin + content.anchors.bottomMargin
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: content
|
id: content
|
||||||
|
@ -42,13 +54,7 @@ PageType {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.topMargin: 20
|
anchors.bottomMargin: 20
|
||||||
|
|
||||||
spacing: 16
|
|
||||||
|
|
||||||
BackButtonType {
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue