From e27d22b5f7e3d2eec4f3f7a0e4ca14313795120e Mon Sep 17 00:00:00 2001 From: Roman Vladimirov Date: Fri, 8 Dec 2023 20:42:59 +0300 Subject: [PATCH] > Fixes image for emptybox in OpenAPI window + Show message if user don't fill field Scheme URL --- src/ViewModels/openapiexporterviewmodel.cpp | 8 ++++++++ src/Views/OpenApiExportWindow.qml | 1 + 2 files changed, 9 insertions(+) diff --git a/src/ViewModels/openapiexporterviewmodel.cpp b/src/ViewModels/openapiexporterviewmodel.cpp index 89077d7..1ff5251 100644 --- a/src/ViewModels/openapiexporterviewmodel.cpp +++ b/src/ViewModels/openapiexporterviewmodel.cpp @@ -135,6 +135,14 @@ void OpenApiExporterViewModel::cancelCurrentRequest() noexcept void OpenApiExporterViewModel::loadOpenApiScheme() noexcept { if (m_loading) return; + + clearErrorMessage(); + if (m_url.isEmpty()) { + m_errorMessage = "To download the diagram, you must fill in the Scheme URL field!"; + emit errorMessageChanged(); + return; + } + if (m_routes.contains(m_url)) removeLoadedRoutes(m_url); QNetworkRequest request(m_url); diff --git a/src/Views/OpenApiExportWindow.qml b/src/Views/OpenApiExportWindow.qml index ce127b7..7b78bef 100644 --- a/src/Views/OpenApiExportWindow.qml +++ b/src/Views/OpenApiExportWindow.qml @@ -485,6 +485,7 @@ ApplicationWindow { anchors.centerIn: parent width: 60 height: 60 + mipmap: true source: storagePaths.icons + "emptybox.svg" } Text {