mirror of
https://github.com/redis/RedisDesktopManager.git
synced 2026-10-28 19:17:36 +08:00
Fix #3867: Use different MessageDialog to show errors from ConnectionSettingsDialog
This commit is contained in:
@@ -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
@@ -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"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user