summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-01 11:11:12 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-01 11:11:12 +0000
commit5acec5fbbd063b2d6aabed5afef8bf945dcbe1f3 (patch)
tree68359afbbfa40e0e5cda1a2ded21fb164e0f7850 /plugins
parent9bb5bf9f9bd2fa307ecbae246682031cce2624d9 (diff)
warning added before a conversion not to forget about backups
git-svn-id: http://svn.miranda-ng.org/main/trunk@8339 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Db3x_mmap/src/dbintf.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/Db3x_mmap/src/dbintf.cpp b/plugins/Db3x_mmap/src/dbintf.cpp
index d481fd1afa..7b50e80263 100644
--- a/plugins/Db3x_mmap/src/dbintf.cpp
+++ b/plugins/Db3x_mmap/src/dbintf.cpp
@@ -108,6 +108,9 @@ CDb3Mmap::~CDb3Mmap()
free(m_pNull);
}
+static TCHAR szMsgConvert[] =
+ LPGENT("Your database must be converted into the new format. This is potentially dangerous operation, so please make a backup before.\n\nClick Yes to proceed with conversion or No to exit Miranda");
+
int CDb3Mmap::Load(bool bSkipInit)
{
log0("DB logging running");
@@ -135,18 +138,14 @@ int CDb3Mmap::Load(bool bSkipInit)
// everything is ok, go on
if (!m_bReadOnly) {
- bool bConversion = false;
- if (m_dbHeader.version < DB_095_VERSION) {
- ConvertContacts();
- bConversion = true;
- }
-
if (m_dbHeader.version < DB_095_1_VERSION) {
+ if (IDYES != MessageBox(NULL, TranslateTS(szMsgConvert), TranslateT("Database conversion warning"), MB_YESNOCANCEL | MB_ICONQUESTION))
+ return EGROKPRF_CANTREAD;
+
+ if (m_dbHeader.version < DB_095_VERSION)
+ ConvertContacts();
ConvertEvents();
- bConversion = true;
- }
- if (bConversion) {
m_dbHeader.version = DB_095_1_VERSION;
DBWrite(sizeof(dbSignatureU), &m_dbHeader.version, sizeof(m_dbHeader.version));
}