AttachmentView: no duplicate signals, disable downloadbuttons on download
The signals for the m_openingsManager are now connected in the
constructor, not in AttachmentView::slotOpenAttachment(). This prevents
duplicate connections being created.
While here, also disable the downloadbutton when downloading an
attachment. To implement this, I added a started() signal to
FileDownloadManager, used to indicate when the transfer starts.
Just disabling the downloadbutton in
AttachmentView::slotDownloadAttachment() causes problems when the user
clicks "Download" and then closes the File Dialog without selecting a
file. manager->downloadPart() then returns without downloading the file,
so it doesn't emit a succeeded() or transferError() signal. By creating
a started() signal, we know for sure that the downloadbutton only is
disabled when a transfer really happens. The downloadbutton will be
enabled upon success or failure.
For consistency, FileDownloadManager::downloadMessage() also emits
a started() signal when it starts downloading, although that signal is
not used anywhere.
This commit also renames slotTransferSucceeded() to
slotDeleteTemporaryFile(). I did this because slotTransferSucceeded()
seems to be a general name that can be used for both "Open directly"
and "Download", but it wasn't in the old situation. The "new"
slotTransferSucceeded() only enables the downloadbutton.
AttachmentView::slotOpenAttachment() will only download the attachment
if the temporary file does not exist yet.