moved xray higher on the list of containers during installation
This commit is contained in:
parent
2bceb9f7ba
commit
cf8492240e
6 changed files with 29 additions and 2 deletions
|
@ -389,3 +389,18 @@ QJsonObject ContainerProps::getProtocolConfigFromContainer(const Proto protocol,
|
||||||
|
|
||||||
return QJsonDocument::fromJson(protocolConfigString.toUtf8()).object();
|
return QJsonDocument::fromJson(protocolConfigString.toUtf8()).object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ContainerProps::installPageOrder(DockerContainer container)
|
||||||
|
{
|
||||||
|
switch (container) {
|
||||||
|
case DockerContainer::OpenVpn: return 4;
|
||||||
|
case DockerContainer::Cloak: return 5;
|
||||||
|
case DockerContainer::ShadowSocks: return 6;
|
||||||
|
case DockerContainer::WireGuard: return 2;
|
||||||
|
case DockerContainer::Awg: return 1;
|
||||||
|
case DockerContainer::Xray: return 3;
|
||||||
|
case DockerContainer::Ipsec: return 7;
|
||||||
|
case DockerContainer::SSXray: return 8;
|
||||||
|
default: return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -72,6 +72,8 @@ namespace amnezia
|
||||||
static bool isShareable(amnezia::DockerContainer container);
|
static bool isShareable(amnezia::DockerContainer container);
|
||||||
|
|
||||||
static QJsonObject getProtocolConfigFromContainer(const amnezia::Proto protocol, const QJsonObject &containerConfig);
|
static QJsonObject getProtocolConfigFromContainer(const amnezia::Proto protocol, const QJsonObject &containerConfig);
|
||||||
|
|
||||||
|
static int installPageOrder(amnezia::DockerContainer container);
|
||||||
};
|
};
|
||||||
|
|
||||||
static void declareQmlContainerEnum()
|
static void declareQmlContainerEnum()
|
||||||
|
|
|
@ -41,6 +41,7 @@ QVariant ContainersModel::data(const QModelIndex &index, int role) const
|
||||||
case IsCurrentlyProcessedRole: return container == static_cast<DockerContainer>(m_processedContainerIndex);
|
case IsCurrentlyProcessedRole: return container == static_cast<DockerContainer>(m_processedContainerIndex);
|
||||||
case IsSupportedRole: return ContainerProps::isSupportedByCurrentPlatform(container);
|
case IsSupportedRole: return ContainerProps::isSupportedByCurrentPlatform(container);
|
||||||
case IsShareableRole: return ContainerProps::isShareable(container);
|
case IsShareableRole: return ContainerProps::isShareable(container);
|
||||||
|
case InstallPageOrderRole: return ContainerProps::installPageOrder(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
@ -112,5 +113,7 @@ QHash<int, QByteArray> ContainersModel::roleNames() const
|
||||||
roles[IsCurrentlyProcessedRole] = "isCurrentlyProcessed";
|
roles[IsCurrentlyProcessedRole] = "isCurrentlyProcessed";
|
||||||
roles[IsSupportedRole] = "isSupported";
|
roles[IsSupportedRole] = "isSupported";
|
||||||
roles[IsShareableRole] = "isShareable";
|
roles[IsShareableRole] = "isShareable";
|
||||||
|
|
||||||
|
roles[InstallPageOrderRole] = "installPageOrder";
|
||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,9 @@ public:
|
||||||
IsCurrentlyProcessedRole,
|
IsCurrentlyProcessedRole,
|
||||||
IsDefaultRole,
|
IsDefaultRole,
|
||||||
IsSupportedRole,
|
IsSupportedRole,
|
||||||
IsShareableRole
|
IsShareableRole,
|
||||||
|
|
||||||
|
InstallPageOrderRole
|
||||||
};
|
};
|
||||||
|
|
||||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
|
|
@ -60,7 +60,8 @@ PageType {
|
||||||
id: proxyContainersModel
|
id: proxyContainersModel
|
||||||
sourceModel: ContainersModel
|
sourceModel: ContainersModel
|
||||||
sorters: [
|
sorters: [
|
||||||
RoleSorter { roleName: "isInstalled"; sortOrder: Qt.DescendingOrder }
|
RoleSorter { roleName: "isInstalled"; sortOrder: Qt.DescendingOrder },
|
||||||
|
RoleSorter { roleName: "installPageOrder"; sortOrder: Qt.AscendingOrder }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,10 @@ PageType {
|
||||||
value: true
|
value: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
sorters: RoleSorter {
|
||||||
|
roleName: "installPageOrder"
|
||||||
|
sortOrder: Qt.AscendingOrder
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue