diff options
Diffstat (limited to 'plugins/Import/src/main.cpp')
-rw-r--r-- | plugins/Import/src/main.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index 151e8509c9..02214a87dd 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -57,7 +57,10 @@ static INT_PTR ImportCommand(WPARAM, LPARAM) SetForegroundWindow(hwndWizard);
SetFocus(hwndWizard);
}
- else hwndWizard = CreateDialog(hInst, MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc);
+ else {
+ hwndWizard = CreateDialog(hInst, MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc);
+ PostMessage(hwndWizard, WIZM_GOTOPAGE, IDD_WIZARDINTRO, (LPARAM)WizardIntroPageProc);
+ }
return 0;
}
@@ -106,16 +109,29 @@ static int OnExit(WPARAM, LPARAM) static INT_PTR ServiceMode(WPARAM, LPARAM)
{
g_bServiceMode = true;
- CreateDialog(hInst, MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc);
+ hwndWizard = CreateDialog(hInst, MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc);
+ PostMessage(hwndWizard, WIZM_GOTOPAGE, IDD_WIZARDINTRO, (LPARAM)WizardIntroPageProc);
return SERVICE_ONLYDB;
}
+static INT_PTR CustomImport(WPARAM wParam, LPARAM)
+{
+ MImportOptions *param = (MImportOptions*)wParam;
+ wcsncpy_s(importFile, MAX_PATH, param->pwszFileName, _TRUNCATE);
+ nImportOptions = param->dwFlags;
+
+ hwndWizard = CreateDialog(hInst, MAKEINTRESOURCE(IDD_WIZARD), nullptr, WizardDlgProc);
+ PostMessage(hwndWizard, WIZM_GOTOPAGE, IDD_PROGRESS, (LPARAM)ProgressPageProc);
+ return 0;
+}
+
extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfo);
CreateServiceFunction(IMPORT_SERVICE, ImportCommand);
CreateServiceFunction(MS_SERVICEMODE_LAUNCH, ServiceMode);
+ CreateServiceFunction(MS_IMPORT_RUN, CustomImport);
RegisterIcons();
// menu item
|