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 | |
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')
-rw-r--r-- | src/modules/langpack/lpopts.cpp | 28 | ||||
-rw-r--r-- | src/modules/options/options.cpp | 4 |
2 files changed, 22 insertions, 10 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);
}
}
}
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 4812506681..74464fd333 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -1115,10 +1115,10 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L opd = dat->getCurrent();
if (opd != NULL) {
- pshn.lParam = 0;
+ pshn.hdr.idFrom = 0;
+ pshn.lParam = LOWORD(wParam);
pshn.hdr.code = PSN_KILLACTIVE;
pshn.hdr.hwndFrom = opd->hwnd;
- pshn.hdr.idFrom = LOWORD(wParam);
if (SendMessage(opd->hwnd, WM_NOTIFY, 0, (LPARAM)&pshn))
break;
}
|