diff options
Diffstat (limited to 'src/modules/langpack/lpopts.cpp')
-rw-r--r-- | src/modules/langpack/lpopts.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/modules/langpack/lpopts.cpp b/src/modules/langpack/lpopts.cpp index 33fd36e2a0..80d657c31e 100644 --- a/src/modules/langpack/lpopts.cpp +++ b/src/modules/langpack/lpopts.cpp @@ -97,6 +97,22 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM lP return TRUE;
}
+static void CALLBACK OpenOptions(void*)
+{
+ OPENOPTIONSDIALOG ood = { sizeof(ood) };
+ ood.pszGroup = "Customize";
+ ood.pszPage = "Languages";
+ Options_Open(&ood);
+}
+
+static void ReloadOptions(void *hWnd)
+{
+ while (IsWindow((HWND)hWnd))
+ Sleep(50);
+
+ CallFunctionAsync(OpenOptions, 0);
+}
+
INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_LANGUAGES);
@@ -174,14 +190,10 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (tszPath[0]) {
ReloadLangpack(tszPath);
- if (LPNMHDR(lParam)->idFrom == IDC_APPLY) {
- CloseWindow(GetParent(hwndDlg));
- DestroyWindow(GetParent(hwndDlg));
-
- OPENOPTIONSDIALOG ood = { sizeof(ood) };
- ood.pszGroup = "Customize";
- ood.pszPage = "Languages";
- Options_Open(&ood);
+ if (LPPSHNOTIFY(lParam)->lParam == IDC_APPLY) {
+ HWND hwndParent = GetParent(hwndDlg);
+ PostMessage(hwndParent, WM_CLOSE, 1, 0);
+ mir_forkthread(ReloadOptions, hwndParent);
}
}
}
|