From a4c99e1741a20ca70978c5207612cf22ccd77cc8 Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Wed, 20 Sep 2017 15:59:40 +0000 Subject: [PATCH] Fix #3867: Use different MessageDialog to show errors from ConnectionSettingsDialog --- src/qml/ConnectionSettignsDialog.qml | 29 ++++++++++++++++++++++++++++ src/qml/app.qml | 6 +++--- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/qml/ConnectionSettignsDialog.qml b/src/qml/ConnectionSettignsDialog.qml index db42056a..3b2a9c5a 100644 --- a/src/qml/ConnectionSettignsDialog.qml +++ b/src/qml/ConnectionSettignsDialog.qml @@ -82,6 +82,14 @@ Dialog { uiBlocker.visible = true } + function showMsg(msg) { + dialog_notification.showMsg(msg) + } + + function showError(err) { + dialog_notification.showError(err) + } + onVisibleChanged: { if (visible) settingsTabs.currentIndex = 0 @@ -483,5 +491,26 @@ Dialog { anchors.fill: parent } } + + MessageDialog { + id: dialog_notification + objectName: "rdm_qml_connection_settings_error_dialog" + visible: false + modality: Qt.WindowModal + icon: StandardIcon.Warning + standardButtons: StandardButton.Ok + + function showError(msg) { + icon = StandardIcon.Warning + text = msg + open() + } + + function showMsg(msg) { + icon = StandardIcon.Information + text = msg + open() + } + } } } diff --git a/src/qml/app.qml b/src/qml/app.qml index e5468cfa..1decb67d 100644 --- a/src/qml/app.qml +++ b/src/qml/app.qml @@ -68,13 +68,13 @@ ApplicationWindow { objectName: "rdm_connection_settings_dialog" - onTestConnection: { + onTestConnection: { if (connectionsManager.testConnectionSettings(settings)) { hideLoader() - notification.showMsg(qsTr("Successful connection to redis-server")) + showMsg(qsTr("Successful connection to redis-server")) } else { hideLoader() - notification.showError(qsTr("Can't connect to redis-server")) + showError(qsTr("Can't connect to redis-server")) } }