chore(dialogs): extract MailserverConnectionDialog

iterates: status-im/StatusQ#760
This commit is contained in:
Patryk Osmaczko 2022-07-12 10:56:47 +02:00 committed by osmaczko
parent 5aea3d26a8
commit eb05eb8044
2 changed files with 48 additions and 36 deletions

View File

@ -34,6 +34,8 @@ import AppLayouts.Browser.stores 1.0 as BrowserStores
import AppLayouts.stores 1.0 import AppLayouts.stores 1.0
import "popups"
Item { Item {
id: appMain id: appMain
anchors.fill: parent anchors.fill: parent
@ -681,43 +683,12 @@ Item {
Component { Component {
id: mailserverNotWorkingPopupComponent id: mailserverNotWorkingPopupComponent
StatusModal {
id: msNotWorkingPopup MailserverConnectionDialog {
anchors.centerIn: parent
header.title: qsTr("Can not connect to mailserver")
onClosed: { onClosed: {
appLayout.mailserverNotWorkingPopup = null appLayout.mailserverNotWorkingPopup = null
destroy() destroy()
} }
contentItem: Item {
width: msNotWorkingPopup.width
implicitHeight: 100
StatusBaseText {
text: qsTr("The mailserver you're connecting to is unavailable.")
color: Theme.palette.directColor1
anchors.centerIn: parent
}
}
rightButtons: [
StatusButton {
text: qsTr("Pick another")
onClicked: {
Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.messaging)
msNotWorkingPopup.close()
}
},
StatusButton {
text: qsTr("Retry")
onClicked: {
// Retrying already happens automatically, so doing nothing
// here is the same as retrying...
msNotWorkingPopup.close()
}
}
]
} }
} }

View File

@ -0,0 +1,41 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import QtQml.Models 2.14
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups.Dialog 0.1
import utils 1.0
StatusDialog {
id: root
title: qsTr("Can not connect to mailserver")
StatusBaseText {
anchors.fill: parent
text: qsTr("The mailserver you're connecting to is unavailable.")
}
footer: StatusDialogFooter {
rightButtons: ObjectModel {
StatusButton {
text: qsTr("Pick another")
onClicked: {
Global.changeAppSectionBySectionType(Constants.appSection.profile, Constants.settingsSubsection.messaging)
root.close()
}
}
StatusButton {
text: qsTr("Retry")
onClicked: {
// Retrying already happens automatically, so doing nothing
// here is the same as retrying...
root.close()
}
}
}
}
}