Import encrypted messages as is

This commit is contained in:
Michal Horejsek
2020-11-19 12:30:09 +01:00
parent f96cd167ef
commit ca962ce5ad
18 changed files with 289 additions and 25 deletions

View File

@ -355,6 +355,25 @@ Dialog {
InlineLabelSelect {
id: globalLabels
}
Row {
spacing: Style.dialog.spacing
CheckBoxLabel {
id: importEncrypted
text: qsTr("Import encrypted emails as they are")
anchors {
bottom: parent.bottom
bottomMargin: Style.dialog.fontSize/1.8
}
}
InfoToolTip {
anchors {
verticalCenter: importEncrypted.verticalCenter
}
info: qsTr("When this option is enabled, encrypted emails will be imported as ciphertext. Otherwise, such messages will be skipped.", "todo")
}
}
}
// Buttons
@ -1018,7 +1037,7 @@ Dialog {
)
break
case DialogImport.Page.Progress:
go.startImport(root.address)
go.startImport(root.address, importEncrypted.checked)
break
}
}

View File

@ -73,7 +73,7 @@ func (f *FrontendQt) loadStructuresForImport() error {
return nil
}
func (f *FrontendQt) StartImport(email string) { // TODO email not needed
func (f *FrontendQt) StartImport(email string, importEncrypted bool) { // TODO email not needed
log.Trace("Starting import")
f.Qml.SetProgressDescription("init") // TODO use const
@ -84,6 +84,7 @@ func (f *FrontendQt) StartImport(email string) { // TODO email not needed
f.Qml.SetTotal(1)
f.Qml.SetImportLogFileName("")
f.transfer.SetSkipEncryptedMessages(!importEncrypted)
progress := f.transfer.Start()
f.Qml.SetImportLogFileName(progress.FileReport())

View File

@ -95,7 +95,7 @@ type GoQMLInterface struct {
_ func() string `slot:"leastUsedColor"`
_ func(username string, name string, color string, isLabel bool, sourceID string) bool `slot:"createLabelOrFolder"`
_ func(fpath, address, fileType string, attachEncryptedBody bool) `slot:"startExport"`
_ func(email string) `slot:"startImport"`
_ func(email string, importEncrypted bool) `slot:"startImport"`
_ func() `slot:"resetSource"`
_ func(isFromIMAP bool, sourcePath, sourceEmail, sourcePassword, sourceServe, sourcePort, targetAddress string) `slot:"setupAndLoadForImport"`