summaryrefslogtreecommitdiff
path: root/plugins/Import/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-08-15 14:31:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-08-15 14:31:56 +0300
commit0026f0f655e1bb5a39a81f56ed40672926208290 (patch)
tree55aca31c0364b152a7b93553fdd656f4750fb9b2 /plugins/Import/src/main.cpp
parentee57c7fe7f30f82a2a2c637125ce3ee31d008576 (diff)
Import: ability to check duplicates during a contact import
Diffstat (limited to 'plugins/Import/src/main.cpp')
-rw-r--r--plugins/Import/src/main.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp
index baeaad4e9a..0cf5f42e70 100644
--- a/plugins/Import/src/main.cpp
+++ b/plugins/Import/src/main.cpp
@@ -97,7 +97,7 @@ static INT_PTR ServiceMode(WPARAM, LPARAM)
ptrW wszFullName(Utils_ReplaceVarsW(L"%miranda_userdata%\\%miranda_profilename%.dat.bak"));
if (!_waccess(wszFullName, 0)) {
- g_iImportOptions = IOPT_ADDUNKNOWN + IOPT_COMPLETE;
+ g_iImportOptions = IOPT_ADDUNKNOWN + IOPT_COMPLETE + IOPT_CHECKDUPS;
wcsncpy_s(importFile, MAX_PATH, wszFullName, _TRUNCATE);
WizardDlgParam param = { IDD_PROGRESS, (LPARAM)ProgressPageProc };
@@ -125,22 +125,12 @@ static INT_PTR CustomImport(WPARAM wParam, LPARAM)
static INT_PTR ImportContact(WPARAM hContact, LPARAM)
{
- CMStringW text(FORMAT, L"%s (*.dat,*.bak)%c*.dat;*.bak%c%s (*.*)%c*.*%c%c", TranslateT("Miranda NG database"), 0, 0, TranslateT("All Files"), 0, 0, 0);
-
- OPENFILENAME ofn = { 0 };
- ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.lpstrFilter = text;
- ofn.lpstrDefExt = L"dat";
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_EXPLORER | OFN_NOCHANGEDIR | OFN_DONTADDTORECENT;
- ofn.lpstrFile = importFile;
- ofn.nMaxFile = _countof(importFile);
- if (!GetOpenFileName(&ofn)) {
- importFile[0] = 0;
+ CContactImportDlg dlg(hContact);
+ if (!dlg.DoModal())
return 0;
- }
g_hImportContact = hContact;
- g_iImportOptions = IOPT_HISTORY;
+ g_iImportOptions = IOPT_HISTORY + dlg.getFlags();
WizardDlgParam param = { IDD_PROGRESS, (LPARAM)ProgressPageProc };
return DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc, LPARAM(&param));