diff options
| -rw-r--r-- | src/m_email/EMailImapController.cpp | 28 | ||||
| -rw-r--r-- | src/m_email/EMailImapController.h | 5 | ||||
| -rw-r--r-- | src/m_email/EMailModule.cpp | 2 |
3 files changed, 13 insertions, 22 deletions
diff --git a/src/m_email/EMailImapController.cpp b/src/m_email/EMailImapController.cpp index e21617a..2874ef3 100644 --- a/src/m_email/EMailImapController.cpp +++ b/src/m_email/EMailImapController.cpp @@ -148,8 +148,10 @@ class MessageRowDelegate : public QStyledItemDelegate { } // namespace EMailImapController::EMailImapController(QWidget* parent) : QDialog(parent) { + // No size of its own: it is a child of the Host's dialog frame, which + // opens at the size this module declares for it and then at whatever the + // user leaves it at. setWindowTitle(tr("IMAP Controller")); - resize(960, 600); build_ui(); accounts_ = EMailAccountStore::ImapAccounts(); @@ -292,7 +294,14 @@ void EMailImapController::disable_account(const QString& account_id, refresh_account_availability(); } -EMailImapController::~EMailImapController() { stop_worker(); } +EMailImapController::~EMailImapController() { + // Here rather than in done() or closeEvent(): mounted in the Host's frame, + // this widget is not a window, and the frame's own close button closes it + // without ever asking. Destruction is the one step every way of leaving the + // window shares. + remember_current_account(); + stop_worker(); +} auto EMailImapController::HasUsableAccount() -> bool { return !EMailAccountStore::ImapAccounts().isEmpty(); @@ -694,21 +703,6 @@ void EMailImapController::closeEvent(QCloseEvent* event) { QDialog::closeEvent(event); } -void EMailImapController::done(int result) { - // Here rather than in closeEvent(), which is the whole reason the cache - // appeared not to work: the Close button and Escape both go through - // reject(), and reject() does NOT deliver a close event -- only the window's - // own X button does. done() is the one path every dismissal takes. - // - // Leaving the picker is the ordinary way to finish with it, so it is the - // case the cache exists to survive; remembering only on an account switch - // meant the cache was written by the one path a user with a single account - // never takes. - remember_current_account(); - - QDialog::done(result); -} - void EMailImapController::connect_to_selected_account() { const auto index = account_combo_->currentIndex(); if (index < 0 || index >= accounts_.size()) { diff --git a/src/m_email/EMailImapController.h b/src/m_email/EMailImapController.h index 6985355..14e75a3 100644 --- a/src/m_email/EMailImapController.h +++ b/src/m_email/EMailImapController.h @@ -28,9 +28,9 @@ #pragma once -#include <QDateTime> #include <GFModule.h> +#include <QDateTime> #include <QDialog> #include <QHash> #include <QList> @@ -86,9 +86,6 @@ class EMailImapController : public QDialog, public gf::ui::DialogWidget { protected: void closeEvent(QCloseEvent* event) override; - /// Every dismissal -- Close, Escape, accept -- passes through here, which - /// closeEvent() does not: reject() never delivers one. - void done(int result) override; void changeEvent(QEvent* event) override; /// Watches the Message-ID label so its elision follows the pane's width. auto eventFilter(QObject* watched, QEvent* event) -> bool override; diff --git a/src/m_email/EMailModule.cpp b/src/m_email/EMailModule.cpp index 8032063..ce36887 100644 --- a/src/m_email/EMailModule.cpp +++ b/src/m_email/EMailModule.cpp @@ -446,7 +446,7 @@ auto OnActivate() -> GFResult { "", "", 0, 0}, [](const QCborMap& /*args*/) { return new EMailAccountSettingsPage(); }); const bool imap = gf::ui::RegisterNativeWidget<EMailImapController>( - "imap", {GC_TR("IMAP Controller"), "", "", "", "", 0, 0}, + "imap", {GC_TR("IMAP Controller"), "", "", "", "", 1100, 720}, [](const QCborMap& /*args*/) { auto* controller = new EMailImapController(); // The narrow boundary: raw bytes in, a document out. The controller |
