From 5acec5fbbd063b2d6aabed5afef8bf945dcbe1f3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 1 Mar 2014 11:11:12 +0000 Subject: 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 --- plugins/Db3x_mmap/src/dbintf.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'plugins/Db3x_mmap') 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)); } -- cgit v1.2.3