redirected to pagesetupwizardeasy when none containers installed
This commit is contained in:
parent
a6d660e708
commit
51497d87e0
4 changed files with 25 additions and 1 deletions
|
@ -214,6 +214,20 @@ bool ContainersModel::isAmneziaDnsContainerInstalled(const int serverIndex)
|
||||||
return containers.contains(DockerContainer::Dns);
|
return containers.contains(DockerContainer::Dns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ContainersModel::isAnyContainerInstalled()
|
||||||
|
{
|
||||||
|
for (int row=0; row < rowCount(); row++) {
|
||||||
|
QModelIndex idx = this->index(row, 0);
|
||||||
|
|
||||||
|
if (this->data(idx, IsInstalledRole).toBool() &&
|
||||||
|
this->data(idx, ServiceTypeRole).toInt() == ServiceType::Vpn) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QHash<int, QByteArray> ContainersModel::roleNames() const
|
QHash<int, QByteArray> ContainersModel::roleNames() const
|
||||||
{
|
{
|
||||||
QHash<int, QByteArray> roles;
|
QHash<int, QByteArray> roles;
|
||||||
|
|
|
@ -63,7 +63,7 @@ public slots:
|
||||||
bool isAmneziaDnsContainerInstalled();
|
bool isAmneziaDnsContainerInstalled();
|
||||||
bool isAmneziaDnsContainerInstalled(const int serverIndex);
|
bool isAmneziaDnsContainerInstalled(const int serverIndex);
|
||||||
|
|
||||||
// bool isOnlyServicesInstalled(const int serverIndex);
|
bool isAnyContainerInstalled();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QHash<int, QByteArray> roleNames() const override;
|
QHash<int, QByteArray> roleNames() const override;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import QtQuick.Shapes
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
import ConnectionState 1.0
|
import ConnectionState 1.0
|
||||||
|
import PageEnum 1.0
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: root
|
id: root
|
||||||
|
@ -137,6 +138,13 @@ Button {
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
if (!ContainersModel.isAnyContainerInstalled()) {
|
||||||
|
ServersModel.currentlyProcessedIndex = ServersModel.getDefaultServerIndex()
|
||||||
|
PageController.goToPage(PageEnum.PageSetupWizardEasy)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (ConnectionController.isConnectionInProgress) {
|
if (ConnectionController.isConnectionInProgress) {
|
||||||
ConnectionController.closeConnection()
|
ConnectionController.closeConnection()
|
||||||
} else if (ConnectionController.isConnected) {
|
} else if (ConnectionController.isConnected) {
|
||||||
|
|
|
@ -183,6 +183,8 @@ PageType {
|
||||||
textColor: "#D7D8DB"
|
textColor: "#D7D8DB"
|
||||||
borderWidth: 1
|
borderWidth: 1
|
||||||
|
|
||||||
|
visible: ContainersModel.isAnyContainerInstalled()
|
||||||
|
|
||||||
text: qsTr("Set up later")
|
text: qsTr("Set up later")
|
||||||
|
|
||||||
onClicked: function() {
|
onClicked: function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue