diff --git a/client/ui/models/protocols_model.cpp b/client/ui/models/protocols_model.cpp index 019b2d2f..231a3fbf 100644 --- a/client/ui/models/protocols_model.cpp +++ b/client/ui/models/protocols_model.cpp @@ -68,6 +68,13 @@ QVariant ProtocolsModel::data(const QModelIndex &index, int role) const return QVariant(); } +void ProtocolsModel::reload() +{ + beginResetModel(); + endResetModel(); +} + + void ProtocolsModel::updateModel(const QJsonObject &content) { m_container = ContainerProps::containerFromString(content.value(config_key::container).toString()); diff --git a/client/ui/models/protocols_model.h b/client/ui/models/protocols_model.h index 5c52ee86..986390ec 100644 --- a/client/ui/models/protocols_model.h +++ b/client/ui/models/protocols_model.h @@ -26,6 +26,8 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + Q_INVOKABLE void reload(); + public slots: void updateModel(const QJsonObject &content); diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index 2de82531..8e1792db 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -24,12 +24,19 @@ PageType { ColumnLayout { id: header - Connections { + /*Connections { target: InstallController function onCachedProfileCleared(message) { - ProtocolsModel.updateModel(ProtocolsModel.getConfig()) + console.log("СИГНАЛ cachedProfileCleared СРАБОТАЛ:", message) + //ProtocolsModel.updateModel(ProtocolsModel.getConfig()) + ProtocolsModel.clear() + console.log("isClientProtocolExists =", ProtocolsModel.get(0).isClientProtocolExists) + /*PageController.goToPage(PageEnum.PageMainSettings) + Qt.callLater(function() { + PageController.goToPage(PageEnum.PageSettingsServerProtocol) + }) } - } + }*/ anchors.top: parent.top anchors.left: parent.left @@ -193,6 +200,7 @@ PageType { PageController.showBusyIndicator(true) InstallController.clearCachedProfile() + ProtocolsModel.reload() PageController.showBusyIndicator(false) } var noButtonFunction = function() {