From b2c91edc9646daa331de71d589e4fec6bdef4945 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Jul 2018 17:09:17 +0300 Subject: GUI change: - methods OnInitDialog, OnApply & OnClose of CDlgBase now return true if successful. return of false prevents a dialog from being loaded or left respectively; - massive code cleaning considering the 'virtual' attribute of overridden methods; - also fixes #1476 (Don't close "Create new account" window if user not set account name) --- plugins/Db_autobackups/src/options.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/Db_autobackups/src/options.cpp') diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index 424c8961e1..a795f06e30 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -172,7 +172,7 @@ public: m_foldersPageLink.OnClick = Callback(this, &COptionsDlg::FoldersPageLink_OnClick); } - void OnInitDialog() override + bool OnInitDialog() override { m_disable.SetState(options.backup_types == BT_DISABLED); m_backupOnStart.SetState(options.backup_types & BT_START ? TRUE : FALSE); @@ -220,9 +220,10 @@ public: } SetDialogState(); + return true; } - void OnApply() override + bool OnApply() override { BYTE backupTypes = BT_DISABLED; @@ -256,7 +257,7 @@ public: wchar_t msg[512]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, nullptr, err, 0, msg, 512, nullptr); MessageBox(nullptr, msg, TranslateT("Error creating backup folder"), MB_OK | MB_ICONERROR); - return; + return false; } wcsncpy_s(options.folder, folder, _TRUNCATE); @@ -266,6 +267,7 @@ public: options.cloudfile_service = currentService >= 0 ? (char*)m_cloudFileService.GetItemData(currentService) : nullptr; + return true; } void OnTimer(CTimer*) override -- cgit v1.2.3