summaryrefslogtreecommitdiff
path: root/plugins/Db_autobackups/src/options.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-11 17:09:17 +0300
commitb2c91edc9646daa331de71d589e4fec6bdef4945 (patch)
tree847a77d0686d26e25b126313fbaa8262c81f8d1a /plugins/Db_autobackups/src/options.cpp
parentae081843e9663b3cb36b17309fbce1d2967315f1 (diff)
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)
Diffstat (limited to 'plugins/Db_autobackups/src/options.cpp')
-rw-r--r--plugins/Db_autobackups/src/options.cpp8
1 files changed, 5 insertions, 3 deletions
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