summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-03-25 18:36:30 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-03-25 18:36:30 +0000
commit6d89d8719cbf532734f785fd420d90975c4b0981 (patch)
treeca36218348ef9db95d7bb76c5a7036eb4d724be8 /src
parentedc83404876270de7b896624b5cc8ddab96912b7 (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')
-rw-r--r--src/modules/langpack/lpopts.cpp26
-rw-r--r--src/modules/options/options.cpp2
-rw-r--r--src/resource.h1
-rw-r--r--src/resource.rc13
4 files changed, 37 insertions, 5 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;
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index 0e59b4e943..38efd94b32 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.hdr.idFrom = 0;
pshn.lParam = 0;
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;
}
diff --git a/src/resource.h b/src/resource.h
index 5d353b048f..b1dd8682bc 100644
--- a/src/resource.h
+++ b/src/resource.h
@@ -189,6 +189,7 @@
#define IDC_LNK_NETWORK 1010
#define IDC_LANGDATE 1010
#define IDC_LNK_ADDONS 1011
+#define IDC_RELOAD 1011
#define IDC_SPECIFYPORTS 1013
#define IDC_ST_ENTERMSG 1013
#define IDC_LANGLOCALELABEL 1013
diff --git a/src/resource.rc b/src/resource.rc
index 612260c8ad..2eabe4ceae 100644
--- a/src/resource.rc
+++ b/src/resource.rc
@@ -830,7 +830,7 @@ EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
COMBOBOX IDC_LANGUAGES,86,4,210,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- GROUPBOX "",IDC_LANGINFOFRAME,5,22,291,118,WS_GROUP
+ GROUPBOX "",IDC_LANGINFOFRAME,5,22,291,139,WS_GROUP
RTEXT "Author(s):",IDC_LANGAUTHORSLABEL,9,32,72,9,SS_NOPREFIX
EDITTEXT IDC_LANGAUTHORS,86,32,206,25,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL
RTEXT "E-mail:",IDC_LANGEMAILLABEL,9,61,72,8,SS_NOPREFIX
@@ -841,10 +841,11 @@ BEGIN
EDITTEXT IDC_LANGDATE,86,87,206,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
RTEXT "Locale:",IDC_LANGLOCALELABEL,9,99,72,9,SS_NOPREFIX
EDITTEXT IDC_LANGLOCALE,86,99,206,12,ES_READONLY | NOT WS_BORDER
- CONTROL "Download more language packs",IDC_MORELANG,"Hyperlink",WS_GROUP | WS_TABSTOP | 0x1,9,144,283,10
+ CONTROL "Download more language packs",IDC_MORELANG,"Hyperlink",WS_GROUP | WS_TABSTOP | 0x1,9,164,283,10
RTEXT "Current language:",IDC_STATIC,5,7,76,8
RTEXT "Plugins included:",IDC_PLUGINSINCLUDEDLABEL,9,112,72,9,SS_NOPREFIX
EDITTEXT IDC_PLUGINSINCLUDED,86,112,205,24,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL
+ PUSHBUTTON "Reload langpack",IDC_RELOAD,169,140,123,17
END
@@ -856,6 +857,10 @@ END
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
+ IDD_ACCFORM, DIALOG
+ BEGIN
+ END
+
IDD_ADDCONTACT, DIALOG
BEGIN
LEFTMARGIN, 7
@@ -1008,6 +1013,10 @@ BEGIN
TOPMARGIN, 4
END
+ IDD_CUSTOM_FONT, DIALOG
+ BEGIN
+ END
+
IDD_OPT_GENMENU, DIALOG
BEGIN
END