diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-26 17:22:43 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-26 17:22:43 +0000 |
commit | de80d614711fbfbc4cff03684094f00c0501cefb (patch) | |
tree | b0f9283f64fb4c92b0398b7778d68dcf90bff1ac /src/modules/langpack | |
parent | 79af5e37a9454654d08f9f31745a81baa28ea635 (diff) |
- fix for applying options;
- fix for reloading language
git-svn-id: http://svn.miranda-ng.org/main/trunk@8758 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/langpack')
-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);
}
}
}
|