Fix #3867: Use different MessageDialog to show errors from ConnectionSettingsDialog

This commit is contained in:
Igor Malinovskiy
2017-09-20 15:59:40 +00:00
parent d6f526b31a
commit a4c99e1741
2 changed files with 32 additions and 3 deletions
+29
View File
@@ -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()
}
}
}
}
+3 -3
View File
@@ -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"))
}
}