diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-03-25 18:36:30 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-03-25 18:36:30 +0000 |
commit | 6d89d8719cbf532734f785fd420d90975c4b0981 (patch) | |
tree | ca36218348ef9db95d7bb76c5a7036eb4d724be8 /src/modules/langpack | |
parent | edc83404876270de7b896624b5cc8ddab96912b7 (diff) |
- added Reload button in languages options
- option will be reopened after langpack change
git-svn-id: http://svn.miranda-ng.org/main/trunk@8747 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/langpack')
-rw-r--r-- | src/modules/langpack/lpopts.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/modules/langpack/lpopts.cpp b/src/modules/langpack/lpopts.cpp index 440d22bf7b..8e9922cf76 100644 --- a/src/modules/langpack/lpopts.cpp +++ b/src/modules/langpack/lpopts.cpp @@ -104,6 +104,7 @@ static BOOL InsertPackItemEnumProc(LANGPACK_INFO *pack, WPARAM wParam, LPARAM lP if (pack->flags & LPF_ENABLED) {
SendMessage((HWND)wParam, CB_SETCURSEL, idx, 0);
DisplayPackInfo(GetParent((HWND)wParam), pack);
+ EnableWindow(GetDlgItem(GetParent((HWND)wParam), IDC_RELOAD), !(pack->flags & LPF_DEFAULT));
}
return TRUE;
@@ -151,7 +152,20 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DisplayPackInfo(hwndDlg, pack);
if (!(pack->flags & LPF_ENABLED))
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RELOAD), (pack->flags & LPF_ENABLED) && !(pack->flags & LPF_DEFAULT));
}
+ break;
+
+ case IDC_RELOAD:
+ {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RELOAD), FALSE);
+ int idx = ComboBox_GetCurSel(hwndList);
+ LANGPACK_INFO *pack = (LANGPACK_INFO*)ComboBox_GetItemData(hwndList, idx);
+ ReloadLangpack(pack->tszFullPath);
+ DisplayPackInfo(hwndDlg, pack);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RELOAD), TRUE);
+ }
+ break;
}
break;
@@ -172,8 +186,16 @@ INT_PTR CALLBACK DlgLangpackOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (tszPath[0]) {
ReloadLangpack(tszPath);
- CloseWindow(GetParent(hwndDlg));
- DestroyWindow(GetParent(hwndDlg));
+
+ 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);
+ }
}
}
break;
|