summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_gui.h2
-rw-r--r--plugins/AVS/src/options.cpp270
-rw-r--r--plugins/Scriver/src/chat_options.cpp185
-rw-r--r--plugins/Scriver/src/msgoptions.cpp72
-rw-r--r--plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp4
-rw-r--r--plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp31
-rw-r--r--plugins/StatusManager/src/KeepStatus/ks_options.cpp43
-rw-r--r--plugins/StatusManager/src/StartupStatus/ss_options.cpp25
-rw-r--r--plugins/TabSRMM/src/chat_options.cpp52
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp3
-rw-r--r--plugins/TabSRMM/src/muchighlight.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/dialogs.cpp463
-rw-r--r--src/mir_app/src/options.cpp35
-rw-r--r--src/mir_core/src/CCtrlHyperlink.cpp2
-rw-r--r--src/mir_core/src/CDlgBase.cpp13
15 files changed, 632 insertions, 578 deletions
diff --git a/include/m_gui.h b/include/m_gui.h
index 5c3eab3909..94157a9c65 100644
--- a/include/m_gui.h
+++ b/include/m_gui.h
@@ -454,6 +454,8 @@ protected:
// main dialog procedure
virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ CCallback<void> m_OnFinishWizard;
+
// register controls
void AddControl(CCtrlBase *ctrl);
void AddTimer(CTimer *timer);
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index 19024dd883..ffabf9441f 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -205,17 +205,17 @@ static INT_PTR CALLBACK DlgProcOptionsAvatars(HWND hwndDlg, UINT msg, WPARAM wPa
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case IDC_MAKE_TRANSPARENT_BKG:
- {
- BOOL transp_enabled = IsDlgButtonChecked(hwndDlg, IDC_MAKE_TRANSPARENT_BKG);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS_L), transp_enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS_SPIN), transp_enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS), transp_enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE_L), transp_enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE_SPIN), transp_enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE), transp_enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_MAKE_TRANSP_PROPORTIONAL), transp_enabled);
- break;
- }
+ {
+ BOOL transp_enabled = IsDlgButtonChecked(hwndDlg, IDC_MAKE_TRANSPARENT_BKG);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS_L), transp_enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS_SPIN), transp_enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS), transp_enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE_L), transp_enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE_SPIN), transp_enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE), transp_enabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAKE_TRANSP_PROPORTIONAL), transp_enabled);
+ break;
+ }
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
@@ -331,19 +331,19 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar
break;
case WM_DRAWITEM:
- {
- LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
- if (dis->CtlType == ODT_BUTTON && dis->CtlID == IDC_PROTOPIC) {
- AVATARDRAWREQUEST avdrq = { 0 };
- avdrq.cbSize = sizeof(avdrq);
- avdrq.hTargetDC = dis->hDC;
- avdrq.dwFlags |= AVDRQ_PROTOPICT;
- avdrq.szProto = g_selectedProto;
- GetClientRect(GetDlgItem(hwndDlg, IDC_PROTOPIC), &avdrq.rcDraw);
- CallService(MS_AV_DRAWAVATAR, 0, (LPARAM)&avdrq);
+ {
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
+ if (dis->CtlType == ODT_BUTTON && dis->CtlID == IDC_PROTOPIC) {
+ AVATARDRAWREQUEST avdrq = { 0 };
+ avdrq.cbSize = sizeof(avdrq);
+ avdrq.hTargetDC = dis->hDC;
+ avdrq.dwFlags |= AVDRQ_PROTOPICT;
+ avdrq.szProto = g_selectedProto;
+ GetClientRect(GetDlgItem(hwndDlg, IDC_PROTOPIC), &avdrq.rcDraw);
+ CallService(MS_AV_DRAWAVATAR, 0, (LPARAM)&avdrq);
+ }
}
- }
- return TRUE;
+ return TRUE;
case WM_NOTIFY:
if (dialoginit)
@@ -353,20 +353,20 @@ static INT_PTR CALLBACK DlgProcOptionsProtos(HWND hwndDlg, UINT msg, WPARAM wPar
case IDC_PROTOCOLS:
switch (((LPNMHDR)lParam)->code) {
case LVN_KEYDOWN:
- {
- NMLVKEYDOWN* ptkd = (NMLVKEYDOWN*)lParam;
- if (ptkd&&ptkd->wVKey == VK_SPACE&&ListView_GetSelectedCount(ptkd->hdr.hwndFrom) == 1)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- break;
+ {
+ NMLVKEYDOWN* ptkd = (NMLVKEYDOWN*)lParam;
+ if (ptkd&&ptkd->wVKey == VK_SPACE && ListView_GetSelectedCount(ptkd->hdr.hwndFrom) == 1)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ break;
case LVN_ITEMCHANGED:
- {
- NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
- if (IsWindowVisible(GetDlgItem(hwndDlg, IDC_PROTOCOLS)) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK))
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- break;
+ {
+ NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
+ if (IsWindowVisible(GetDlgItem(hwndDlg, IDC_PROTOCOLS)) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK))
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ break;
case NM_CLICK:
EnableWindow(hwndChoosePic, TRUE);
@@ -515,28 +515,28 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
break;
case IDOK:
- {
- BOOL locked = IsDlgButtonChecked(hwndDlg, IDC_PROTECTAVATAR);
- int hidden = IsDlgButtonChecked(hwndDlg, IDC_HIDEAVATAR) ? 1 : 0;
- SetAvatarAttribute(hContact, AVS_HIDEONCLIST, hidden);
- if (hidden != db_get_b(hContact, "ContactPhoto", "Hidden", 0))
- db_set_b(hContact, "ContactPhoto", "Hidden", hidden);
+ {
+ BOOL locked = IsDlgButtonChecked(hwndDlg, IDC_PROTECTAVATAR);
+ int hidden = IsDlgButtonChecked(hwndDlg, IDC_HIDEAVATAR) ? 1 : 0;
+ SetAvatarAttribute(hContact, AVS_HIDEONCLIST, hidden);
+ if (hidden != db_get_b(hContact, "ContactPhoto", "Hidden", 0))
+ db_set_b(hContact, "ContactPhoto", "Hidden", hidden);
- if (!locked && db_get_b(hContact, "ContactPhoto", "NeedUpdate", 0))
- QueueAdd(hContact);
- }
- // Continue to the cancel handle
+ if (!locked && db_get_b(hContact, "ContactPhoto", "NeedUpdate", 0))
+ QueueAdd(hContact);
+ }
+ // Continue to the cancel handle
case IDCANCEL:
DestroyWindow(hwndDlg);
break;
case IDC_PROTECTAVATAR:
- {
- BOOL locked = IsDlgButtonChecked(hwndDlg, IDC_PROTECTAVATAR);
- ProtectAvatar(hContact, locked ? 1 : 0);
- }
- break;
+ {
+ BOOL locked = IsDlgButtonChecked(hwndDlg, IDC_PROTECTAVATAR);
+ ProtectAvatar(hContact, locked ? 1 : 0);
+ }
+ break;
case IDC_CHANGE:
SetAvatar(hContact, 0);
@@ -550,18 +550,18 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
break;
case IDC_MAKETRANSPBKG:
- {
- BOOL enable = IsDlgButtonChecked(hwndDlg, IDC_MAKETRANSPBKG);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS_L), enable);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS_SPIN), enable);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS), enable);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE_L), enable);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE_SPIN), enable);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE), enable);
+ {
+ BOOL enable = IsDlgButtonChecked(hwndDlg, IDC_MAKETRANSPBKG);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS_L), enable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS_SPIN), enable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_NUM_POINTS), enable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE_L), enable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE_SPIN), enable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKG_COLOR_DIFFERENCE), enable);
- SendMessage(hwndDlg, DM_REALODAVATAR, 0, 0);
- }
- break;
+ SendMessage(hwndDlg, DM_REALODAVATAR, 0, 0);
+ }
+ break;
case IDC_RESET:
ProtectAvatar(hContact, 0);
@@ -610,69 +610,69 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
break;
case WM_DRAWITEM:
- {
- LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
- if (dis->CtlType == ODT_BUTTON && dis->CtlID == IDC_PROTOPIC) {
- AVATARDRAWREQUEST avdrq = { 0 };
- GetClientRect(GetDlgItem(hwndDlg, IDC_PROTOPIC), &avdrq.rcDraw);
-
- FillRect(dis->hDC, &avdrq.rcDraw, GetSysColorBrush(COLOR_BTNFACE));
-
- avdrq.hContact = hContact;
- avdrq.cbSize = sizeof(avdrq);
- avdrq.hTargetDC = dis->hDC;
- avdrq.dwFlags |= AVDRQ_DRAWBORDER;
- avdrq.clrBorder = GetSysColor(COLOR_BTNTEXT);
- avdrq.radius = 6;
- if (!CallService(MS_AV_DRAWAVATAR, 0, (LPARAM)&avdrq)) {
- // Get text rectangle
- RECT rc = avdrq.rcDraw;
- rc.top += 10;
- rc.bottom -= 10;
- rc.left += 10;
- rc.right -= 10;
-
- // Calc text size
- RECT rc_ret = rc;
- DrawText(dis->hDC, TranslateT("Contact has no avatar"), -1, &rc_ret,
- DT_WORDBREAK | DT_NOPREFIX | DT_CENTER | DT_CALCRECT);
-
- // Calc needed size
- rc.top += ((rc.bottom - rc.top) - (rc_ret.bottom - rc_ret.top)) / 2;
- rc.bottom = rc.top + (rc_ret.bottom - rc_ret.top);
- DrawText(dis->hDC, TranslateT("Contact has no avatar"), -1, &rc,
- DT_WORDBREAK | DT_NOPREFIX | DT_CENTER);
- }
+ {
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
+ if (dis->CtlType == ODT_BUTTON && dis->CtlID == IDC_PROTOPIC) {
+ AVATARDRAWREQUEST avdrq = { 0 };
+ GetClientRect(GetDlgItem(hwndDlg, IDC_PROTOPIC), &avdrq.rcDraw);
+
+ FillRect(dis->hDC, &avdrq.rcDraw, GetSysColorBrush(COLOR_BTNFACE));
+
+ avdrq.hContact = hContact;
+ avdrq.cbSize = sizeof(avdrq);
+ avdrq.hTargetDC = dis->hDC;
+ avdrq.dwFlags |= AVDRQ_DRAWBORDER;
+ avdrq.clrBorder = GetSysColor(COLOR_BTNTEXT);
+ avdrq.radius = 6;
+ if (!CallService(MS_AV_DRAWAVATAR, 0, (LPARAM)&avdrq)) {
+ // Get text rectangle
+ RECT rc = avdrq.rcDraw;
+ rc.top += 10;
+ rc.bottom -= 10;
+ rc.left += 10;
+ rc.right -= 10;
+
+ // Calc text size
+ RECT rc_ret = rc;
+ DrawText(dis->hDC, TranslateT("Contact has no avatar"), -1, &rc_ret,
+ DT_WORDBREAK | DT_NOPREFIX | DT_CENTER | DT_CALCRECT);
+
+ // Calc needed size
+ rc.top += ((rc.bottom - rc.top) - (rc_ret.bottom - rc_ret.top)) / 2;
+ rc.bottom = rc.top + (rc_ret.bottom - rc_ret.top);
+ DrawText(dis->hDC, TranslateT("Contact has no avatar"), -1, &rc,
+ DT_WORDBREAK | DT_NOPREFIX | DT_CENTER);
+ }
- FrameRect(dis->hDC, &avdrq.rcDraw, GetSysColorBrush(COLOR_BTNSHADOW));
+ FrameRect(dis->hDC, &avdrq.rcDraw, GetSysColorBrush(COLOR_BTNSHADOW));
+ }
}
- }
- return TRUE;
+ return TRUE;
case DM_SETAVATARNAME:
- {
- wchar_t szFinalName[MAX_PATH];
- DBVARIANT dbv = { 0 };
- BYTE is_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
+ {
+ wchar_t szFinalName[MAX_PATH];
+ DBVARIANT dbv = { 0 };
+ BYTE is_locked = db_get_b(hContact, "ContactPhoto", "Locked", 0);
- szFinalName[0] = 0;
+ szFinalName[0] = 0;
- if (is_locked && !db_get_ws(hContact, "ContactPhoto", "Backup", &dbv)) {
- MyPathToAbsolute(dbv.ptszVal, szFinalName);
- db_free(&dbv);
- }
- else if (!db_get_ws(hContact, "ContactPhoto", "RFile", &dbv)) {
- MyPathToAbsolute(dbv.ptszVal, szFinalName);
- db_free(&dbv);
- }
- else if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
- MyPathToAbsolute(dbv.ptszVal, szFinalName);
- db_free(&dbv);
+ if (is_locked && !db_get_ws(hContact, "ContactPhoto", "Backup", &dbv)) {
+ MyPathToAbsolute(dbv.ptszVal, szFinalName);
+ db_free(&dbv);
+ }
+ else if (!db_get_ws(hContact, "ContactPhoto", "RFile", &dbv)) {
+ MyPathToAbsolute(dbv.ptszVal, szFinalName);
+ db_free(&dbv);
+ }
+ else if (!db_get_ws(hContact, "ContactPhoto", "File", &dbv)) {
+ MyPathToAbsolute(dbv.ptszVal, szFinalName);
+ db_free(&dbv);
+ }
+ szFinalName[MAX_PATH - 1] = 0;
+ SetDlgItemText(hwndDlg, IDC_AVATARNAME, szFinalName);
}
- szFinalName[MAX_PATH - 1] = 0;
- SetDlgItemText(hwndDlg, IDC_AVATARNAME, szFinalName);
- }
- break;
+ break;
case DM_REALODAVATAR:
SaveTransparentData(hwndDlg, hContact, IsDlgButtonChecked(hwndDlg, IDC_PROTECTAVATAR));
@@ -1026,28 +1026,28 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP
break;
case WM_NOTIFY:
- {
- LPNMHDR nm = (LPNMHDR)lParam;
- switch (nm->idFrom) {
- case IDC_PROTOCOLS:
- switch (nm->code) {
- case LVN_ITEMCHANGED:
- LPNMLISTVIEW li = (LPNMLISTVIEW)nm;
- if (li->uNewState & LVIS_SELECTED) {
- SendDlgItemMessage(hwndDlg, IDC_PROTOPIC, AVATAR_SETPROTOCOL, 0, li->lParam);
- EnableDisableControls(hwndDlg, (char*)li->lParam);
+ {
+ LPNMHDR nm = (LPNMHDR)lParam;
+ switch (nm->idFrom) {
+ case IDC_PROTOCOLS:
+ switch (nm->code) {
+ case LVN_ITEMCHANGED:
+ LPNMLISTVIEW li = (LPNMLISTVIEW)nm;
+ if (li->uNewState & LVIS_SELECTED) {
+ SendDlgItemMessage(hwndDlg, IDC_PROTOPIC, AVATAR_SETPROTOCOL, 0, li->lParam);
+ EnableDisableControls(hwndDlg, (char*)li->lParam);
+ }
}
- }
- break;
-
- case IDC_PROTOPIC:
- if (nm->code == NM_AVATAR_CHANGED) {
- EnableDisableControls(hwndDlg, GetSelectedProtocol(hwndDlg));
break;
+
+ case IDC_PROTOPIC:
+ if (nm->code == NM_AVATAR_CHANGED) {
+ EnableDisableControls(hwndDlg, GetSelectedProtocol(hwndDlg));
+ break;
+ }
}
}
- }
- break;
+ break;
case WM_COMMAND:
switch (LOWORD(wParam)) {
diff --git a/plugins/Scriver/src/chat_options.cpp b/plugins/Scriver/src/chat_options.cpp
index 7ddb5ac90c..6f6a664edc 100644
--- a/plugins/Scriver/src/chat_options.cpp
+++ b/plugins/Scriver/src/chat_options.cpp
@@ -309,6 +309,11 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
case 0:
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ pci->ReloadSettings();
+ Chat_UpdateOptions();
+ break;
+
case PSN_APPLY:
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_GROUP));
if (iLen > 0) {
@@ -325,9 +330,6 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
db_unset(0, CHAT_MODULE, "NicklistRowDist");
SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch1, _countof(branch1));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch4, _countof(branch4));
-
- pci->ReloadSettings();
- Chat_UpdateOptions();
}
return TRUE;
}
@@ -502,112 +504,115 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
- if (hti.flags&TVHT_ONITEMSTATEICON) {
+ if (hti.flags & TVHT_ONITEMSTATEICON)
SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)hti.hItem);
- }
}
else if (((LPNMHDR)lParam)->code == TVN_KEYDOWN) {
- if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE) {
- SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom,
- (LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
- }
+ if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)
+ SendMessage(hwndDlg, UM_CHECKSTATECHANGE, (WPARAM)((LPNMHDR)lParam)->hwndFrom, (LPARAM)TreeView_GetSelection(((LPNMHDR)lParam)->hwndFrom));
}
}
- else if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) {
- char *pszText = nullptr;
- int iLen;
-
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS));
- if (iLen > 0) {
- wchar_t *ptszText = (wchar_t*)mir_alloc((iLen + 2) * sizeof(wchar_t));
- wchar_t *p2 = nullptr;
-
- if (ptszText) {
- GetDlgItemText(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS, ptszText, iLen + 1);
- p2 = wcschr(ptszText, (wchar_t)',');
- while (p2) {
- *p2 = ' ';
+ else if (((LPNMHDR)lParam)->idFrom == 0) {
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ pci->ReloadSettings();
+ Chat_UpdateOptions();
+ break;
+
+ case PSN_APPLY:
+ char *pszText = nullptr;
+ int iLen;
+
+ iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS));
+ if (iLen > 0) {
+ wchar_t *ptszText = (wchar_t*)mir_alloc((iLen + 2) * sizeof(wchar_t));
+ wchar_t *p2 = nullptr;
+
+ if (ptszText) {
+ GetDlgItemText(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS, ptszText, iLen + 1);
p2 = wcschr(ptszText, (wchar_t)',');
+ while (p2) {
+ *p2 = ' ';
+ p2 = wcschr(ptszText, (wchar_t)',');
+ }
+ db_set_ws(0, CHAT_MODULE, "HighlightWords", ptszText);
+ mir_free(ptszText);
}
- db_set_ws(0, CHAT_MODULE, "HighlightWords", ptszText);
- mir_free(ptszText);
}
- }
- else db_unset(0, CHAT_MODULE, "HighlightWords");
-
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY));
- if (iLen > 0) {
- wchar_t *pszText1 = (wchar_t*)malloc(iLen*sizeof(wchar_t) + 2);
- GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1);
- db_set_ws(0, CHAT_MODULE, "LogDirectory", pszText1);
- free(pszText1);
- }
- else {
- mir_wstrncpy(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
- db_unset(0, CHAT_MODULE, "LogDirectory");
- }
- pci->SM_InvalidateLogDirectories();
+ else db_unset(0, CHAT_MODULE, "HighlightWords");
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGTIMESTAMP));
- if (iLen > 0) {
- pszText = (char*)mir_realloc(pszText, iLen + 1);
- GetDlgItemTextA(hwndDlg, IDC_CHAT_LOGTIMESTAMP, pszText, iLen + 1);
- db_set_s(0, CHAT_MODULE, "LogTimestamp", pszText);
- }
- else db_unset(0, CHAT_MODULE, "LogTimestamp");
+ iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY));
+ if (iLen > 0) {
+ wchar_t *pszText1 = (wchar_t*)malloc(iLen * sizeof(wchar_t) + 2);
+ GetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, pszText1, iLen + 1);
+ db_set_ws(0, CHAT_MODULE, "LogDirectory", pszText1);
+ free(pszText1);
+ }
+ else {
+ mir_wstrncpy(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
+ db_unset(0, CHAT_MODULE, "LogDirectory");
+ }
+ pci->SM_InvalidateLogDirectories();
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_TIMESTAMP));
- if (iLen > 0) {
- pszText = (char*)mir_realloc(pszText, iLen + 1);
- GetDlgItemTextA(hwndDlg, IDC_CHAT_TIMESTAMP, pszText, iLen + 1);
- db_set_s(0, CHAT_MODULE, "HeaderTime", pszText);
- }
- else db_unset(0, CHAT_MODULE, "HeaderTime");
+ iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOGTIMESTAMP));
+ if (iLen > 0) {
+ pszText = (char*)mir_realloc(pszText, iLen + 1);
+ GetDlgItemTextA(hwndDlg, IDC_CHAT_LOGTIMESTAMP, pszText, iLen + 1);
+ db_set_s(0, CHAT_MODULE, "LogTimestamp", pszText);
+ }
+ else db_unset(0, CHAT_MODULE, "LogTimestamp");
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_INSTAMP));
- if (iLen > 0) {
- pszText = (char*)mir_realloc(pszText, iLen + 1);
- GetDlgItemTextA(hwndDlg, IDC_CHAT_INSTAMP, pszText, iLen + 1);
- db_set_s(0, CHAT_MODULE, "HeaderIncoming", pszText);
- }
- else db_unset(0, CHAT_MODULE, "HeaderIncoming");
+ iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_TIMESTAMP));
+ if (iLen > 0) {
+ pszText = (char*)mir_realloc(pszText, iLen + 1);
+ GetDlgItemTextA(hwndDlg, IDC_CHAT_TIMESTAMP, pszText, iLen + 1);
+ db_set_s(0, CHAT_MODULE, "HeaderTime", pszText);
+ }
+ else db_unset(0, CHAT_MODULE, "HeaderTime");
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_OUTSTAMP));
- if (iLen > 0) {
- pszText = (char*)mir_realloc(pszText, iLen + 1);
- GetDlgItemTextA(hwndDlg, IDC_CHAT_OUTSTAMP, pszText, iLen + 1);
- db_set_s(0, CHAT_MODULE, "HeaderOutgoing", pszText);
- }
- else db_unset(0, CHAT_MODULE, "HeaderOutgoing");
+ iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_INSTAMP));
+ if (iLen > 0) {
+ pszText = (char*)mir_realloc(pszText, iLen + 1);
+ GetDlgItemTextA(hwndDlg, IDC_CHAT_INSTAMP, pszText, iLen + 1);
+ db_set_s(0, CHAT_MODULE, "HeaderIncoming", pszText);
+ }
+ else db_unset(0, CHAT_MODULE, "HeaderIncoming");
+
+ iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_CHAT_OUTSTAMP));
+ if (iLen > 0) {
+ pszText = (char*)mir_realloc(pszText, iLen + 1);
+ GetDlgItemTextA(hwndDlg, IDC_CHAT_OUTSTAMP, pszText, iLen + 1);
+ db_set_s(0, CHAT_MODULE, "HeaderOutgoing", pszText);
+ }
+ else db_unset(0, CHAT_MODULE, "HeaderOutgoing");
- g_Settings.bHighlightEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_HIGHLIGHT) == BST_CHECKED ? TRUE : FALSE;
- db_set_b(0, CHAT_MODULE, "HighlightEnabled", (BYTE)g_Settings.bHighlightEnabled);
+ g_Settings.bHighlightEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_HIGHLIGHT) == BST_CHECKED ? TRUE : FALSE;
+ db_set_b(0, CHAT_MODULE, "HighlightEnabled", (BYTE)g_Settings.bHighlightEnabled);
- g_Settings.bLoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED ? TRUE : FALSE;
- db_set_b(0, CHAT_MODULE, "LoggingEnabled", (BYTE)g_Settings.bLoggingEnabled);
+ g_Settings.bLoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED ? TRUE : FALSE;
+ db_set_b(0, CHAT_MODULE, "LoggingEnabled", (BYTE)g_Settings.bLoggingEnabled);
- iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_GETPOS, 0, 0);
- db_set_w(0, CHAT_MODULE, "LogLimit", (WORD)iLen);
- iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_GETPOS, 0, 0);
- db_set_w(0, CHAT_MODULE, "LoggingLimit", (WORD)iLen);
+ iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_GETPOS, 0, 0);
+ db_set_w(0, CHAT_MODULE, "LogLimit", (WORD)iLen);
+ iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_GETPOS, 0, 0);
+ db_set_w(0, CHAT_MODULE, "LoggingLimit", (WORD)iLen);
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch2, _countof(branch2));
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch3, _countof(branch3));
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch2, _countof(branch2));
+ SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch3, _countof(branch3));
- mir_free(pszText);
+ mir_free(pszText);
- g_Settings.dwIconFlags = db_get_dw(0, CHAT_MODULE, "IconFlags", 0x0000);
- g_Settings.dwTrayIconFlags = db_get_dw(0, CHAT_MODULE, "TrayIconFlags", 0x1000);
- g_Settings.dwPopupFlags = db_get_dw(0, CHAT_MODULE, "PopupFlags", 0x0000);
- g_Settings.bStripFormat = db_get_b(0, CHAT_MODULE, "TrimFormatting", 0) != 0;
- g_Settings.bTrayIconInactiveOnly = db_get_b(0, CHAT_MODULE, "TrayIconInactiveOnly", 1) != 0;
- g_Settings.bPopupInactiveOnly = db_get_b(0, CHAT_MODULE, "PopUpInactiveOnly", 1) != 0;
- g_Settings.bLogIndentEnabled = (db_get_b(0, CHAT_MODULE, "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
+ g_Settings.dwIconFlags = db_get_dw(0, CHAT_MODULE, "IconFlags", 0x0000);
+ g_Settings.dwTrayIconFlags = db_get_dw(0, CHAT_MODULE, "TrayIconFlags", 0x1000);
+ g_Settings.dwPopupFlags = db_get_dw(0, CHAT_MODULE, "PopupFlags", 0x0000);
+ g_Settings.bStripFormat = db_get_b(0, CHAT_MODULE, "TrimFormatting", 0) != 0;
+ g_Settings.bTrayIconInactiveOnly = db_get_b(0, CHAT_MODULE, "TrayIconInactiveOnly", 1) != 0;
+ g_Settings.bPopupInactiveOnly = db_get_b(0, CHAT_MODULE, "PopUpInactiveOnly", 1) != 0;
+ g_Settings.bLogIndentEnabled = (db_get_b(0, CHAT_MODULE, "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
- pci->MM_FontsChanged();
- pci->ReloadSettings();
- Chat_UpdateOptions();
- return TRUE;
+ pci->MM_FontsChanged();
+ return TRUE;
+ }
}
break;
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index e790cd41a1..741f64191a 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -230,23 +230,12 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
return flags;
}
-static int changed = 0;
-
-static void ApplyChanges(int i)
-{
- changed &= ~i;
- if (changed == 0) {
- ReloadGlobals();
- WindowList_Broadcast(g_dat.hParentWindowList, DM_OPTIONSAPPLIED, 0, 0);
- Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
- Chat_UpdateOptions();
- }
-}
-
-static void MarkChanges(int i, HWND hWnd)
+static void ApplyOptions()
{
- SendMessage(GetParent(hWnd), PSM_CHANGED, 0, 0);
- changed |= i;
+ ReloadGlobals();
+ WindowList_Broadcast(g_dat.hParentWindowList, DM_OPTIONSAPPLIED, 0, 0);
+ Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0);
+ Chat_UpdateOptions();
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -341,13 +330,17 @@ static INT_PTR CALLBACK DlgProcTabsOptions(HWND hwndDlg, UINT msg, WPARAM wParam
return 0;
break;
}
- MarkChanges(8, hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ ApplyOptions();
+ break;
+
case PSN_APPLY:
db_set_b(0, SRMM_MODULE, SRMSGSET_USETABS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_USETABS));
db_set_b(0, SRMM_MODULE, SRMSGSET_TABSATBOTTOM, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TABSATBOTTOM));
@@ -363,8 +356,6 @@ static INT_PTR CALLBACK DlgProcTabsOptions(HWND hwndDlg, UINT msg, WPARAM wParam
db_set_b(0, SRMM_MODULE, SRMSGSET_SWITCHTOACTIVE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SWITCHTOACTIVE));
db_set_b(0, SRMM_MODULE, SRMSGSET_TABCLOSEBUTTON, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TABCLOSEBUTTON));
db_set_b(0, SRMM_MODULE, SRMSGSET_SEPARATECHATSCONTAINERS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SEPARATECHATSCONTAINERS));
-
- ApplyChanges(8);
return TRUE;
}
}
@@ -429,7 +420,7 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar
return 0;
break;
}
- MarkChanges(16, hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case WM_HSCROLL:
@@ -437,13 +428,17 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar
SetDlgItemTextA(hwndDlg, IDC_ATRANSPARENCYPERC, str);
mir_snprintf(str, "%d%%", (int)(100 * SendDlgItemMessage(hwndDlg, IDC_ITRANSPARENCYVALUE, TBM_GETPOS, 0, 0) / 256));
SetDlgItemTextA(hwndDlg, IDC_ITRANSPARENCYPERC, str);
- MarkChanges(16, hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ ApplyOptions();
+ break;
+
case PSN_APPLY:
db_set_b(0, SRMM_MODULE, SRMSGSET_SHOWSTATUSBAR, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSTATUSBAR));
db_set_b(0, SRMM_MODULE, SRMSGSET_SHOWTITLEBAR, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWTITLEBAR));
@@ -461,8 +456,6 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar
db_set_w(0, SRMM_MODULE, SRMSGSET_AUTORESIZELINES, (WORD)SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_GETPOS, 0, 0));
LoadInfobarFonts();
-
- ApplyChanges(16);
return TRUE;
}
}
@@ -527,7 +520,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
CheckDlgButton(hwndDlg, IDC_CASCADE, BST_UNCHECKED);
break;
}
- MarkChanges(2, hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
@@ -546,18 +539,22 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
tvi.iImage = tvi.iSelectedImage = tvi.iImage == 1 ? 2 : 1;
TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- MarkChanges(2, hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
}
}
else if (((LPNMHDR)lParam)->code == TVN_KEYDOWN) {
if (((LPNMTVKEYDOWN)lParam)->wVKey == VK_SPACE)
- MarkChanges(2, hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
break;
case 0:
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ ApplyOptions();
+ break;
+
case PSN_APPLY:
db_set_dw(0, SRMM_MODULE, SRMSGSET_POPFLAGS, MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_POPLIST)));
db_set_b(0, SRMM_MODULE, SRMSGSET_AUTOPOPUP, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOPOPUP));
@@ -574,9 +571,6 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
db_set_b(0, SRMM_MODULE, SRMSGSET_CASCADE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CASCADE));
db_set_b(0, SRMM_MODULE, SRMSGSET_HIDECONTAINERS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_HIDECONTAINERS));
-
- ApplyChanges(2);
-
return TRUE;
}
}
@@ -768,13 +762,17 @@ public:
case IDC_SRMM_LOG:
return 0;
}
- MarkChanges(4, m_hwnd);
+ SendMessage(GetParent(m_hwnd), PSM_CHANGED, 0, 0);
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ ApplyOptions();
+ break;
+
case PSN_APPLY:
if (IsDlgButtonChecked(m_hwnd, IDC_LOADCOUNT))
db_set_b(0, SRMM_MODULE, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
@@ -801,7 +799,6 @@ public:
FreeMsgLogIcons();
LoadMsgLogIcons();
- ApplyChanges(4);
return TRUE;
}
}
@@ -895,7 +892,7 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
EnableWindow(GetDlgItem(hwndDlg, IDC_NOTIFYTRAY), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_NOTIFYBALLOON), FALSE);
}
- MarkChanges(4, hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case IDC_SHOWNOTIFY:
@@ -909,7 +906,7 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
case IDC_NOTIFYTRAY:
case IDC_NOTIFYBALLOON:
case IDC_TYPINGSWITCH:
- MarkChanges(4, hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
}
break;
@@ -922,7 +919,7 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
ResetCList(hwndDlg);
break;
case CLN_CHECKCHANGED:
- MarkChanges(4, hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case CLN_LISTREBUILT:
RebuildList(hwndDlg, hItemNew, hItemUnknown);
@@ -983,16 +980,17 @@ int OptInitialise(WPARAM wParam, LPARAM)
odp.pDialog = nullptr;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS1);
odp.pfnDlgProc = DlgProcOptions1;
- odp.szTab.a = LPGEN("Group chat");
+ odp.szGroup.a = LPGEN("Message sessions");
+ odp.szTitle.a = LPGEN("Group chats");
+ odp.szTab.a = LPGEN("General");
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS2);
odp.pfnDlgProc = DlgProcOptions2;
- odp.szTab.a = LPGEN("Group chat log");
+ odp.szTab.a = LPGEN("Event log");
Options_AddPage(wParam, &odp);
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGTYPE);
- odp.szGroup.a = LPGEN("Message sessions");
odp.szTitle.a = LPGEN("Typing notify");
odp.pfnDlgProc = DlgProcTypeOptions;
odp.szTab.a = nullptr;
diff --git a/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp b/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp
index ef10baf786..3d98745d1a 100644
--- a/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp
+++ b/plugins/StatusManager/src/AdvancedAutoAway/aaa_msgoptions.cpp
@@ -160,6 +160,10 @@ INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ AAALoadOptions();
+ break;
+
case PSN_APPLY:
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_STATUS, CBN_SELCHANGE), 0);
for (int i = 0; i < count; i++) {
diff --git a/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp b/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp
index 5e3f18e92c..3e69ef472a 100644
--- a/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp
+++ b/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp
@@ -329,6 +329,10 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM
}
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ AAALoadOptions();
+ break;
+
case PSN_APPLY:
if (bSettingSame)
WriteAutoAwaySetting(*sameSetting, SETTING_ALL);
@@ -336,7 +340,6 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM
for (auto &it : optionSettings)
WriteAutoAwaySetting(*it, it->m_szName);
}
- AAALoadOptions();
}
break;
@@ -392,16 +395,22 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA
break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- db_set_b(0, AAAMODULENAME, SETTING_IGNLOCK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK));
- db_set_b(0, AAAMODULENAME, SETTING_IGNSYSKEYS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS));
- db_set_b(0, AAAMODULENAME, SETTING_IGNALTCOMBO, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO));
- db_set_b(0, AAAMODULENAME, SETTING_SAMESETTINGS, (BYTE)bSettingSame);
- db_set_w(0, AAAMODULENAME, SETTING_AWAYCHECKTIMEINSECS, (WORD)GetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, nullptr, FALSE));
- db_set_w(0, AAAMODULENAME, SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, nullptr, FALSE));
- db_set_b(0, AAAMODULENAME, SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE));
- db_set_b(0, AAAMODULENAME, SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD));
- AAALoadOptions();
+ if (((LPNMHDR)lParam)->idFrom == 0) {
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ AAALoadOptions();
+ break;
+
+ case PSN_APPLY:
+ db_set_b(0, AAAMODULENAME, SETTING_IGNLOCK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK));
+ db_set_b(0, AAAMODULENAME, SETTING_IGNSYSKEYS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS));
+ db_set_b(0, AAAMODULENAME, SETTING_IGNALTCOMBO, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO));
+ db_set_b(0, AAAMODULENAME, SETTING_SAMESETTINGS, (BYTE)bSettingSame);
+ db_set_w(0, AAAMODULENAME, SETTING_AWAYCHECKTIMEINSECS, (WORD)GetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, nullptr, FALSE));
+ db_set_w(0, AAAMODULENAME, SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, nullptr, FALSE));
+ db_set_b(0, AAAMODULENAME, SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE));
+ db_set_b(0, AAAMODULENAME, SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD));
+ }
}
break;
}
diff --git a/plugins/StatusManager/src/KeepStatus/ks_options.cpp b/plugins/StatusManager/src/KeepStatus/ks_options.cpp
index 3a34470d06..812d26ad6c 100644
--- a/plugins/StatusManager/src/KeepStatus/ks_options.cpp
+++ b/plugins/StatusManager/src/KeepStatus/ks_options.cpp
@@ -111,19 +111,19 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam
if (((NMHDR*)lParam)->idFrom == IDC_PROTOCOLLIST) {
switch (((NMHDR*)lParam)->code) {
case LVN_ITEMCHANGED:
- {
- NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
- if (IsWindowVisible(GetDlgItem(hwndDlg, IDC_PROTOCOLLIST)) && ((nmlv->uNewState^nmlv->uOldState)&LVIS_STATEIMAGEMASK))
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
+ if (IsWindowVisible(GetDlgItem(hwndDlg, IDC_PROTOCOLLIST)) && ((nmlv->uNewState^nmlv->uOldState)&LVIS_STATEIMAGEMASK))
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
}
}
- if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- int i;
- LVITEM lvItem;
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ KSLoadOptions();
+ break;
+ case PSN_APPLY:
db_set_b(0, KSMODULENAME, SETTING_MAXRETRIES, (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXRETRIES, nullptr, FALSE));
db_set_b(0, KSMODULENAME, SETTING_CHECKCONNECTION, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION));
db_set_b(0, KSMODULENAME, SETTING_SHOWCONNECTIONPOPUPS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCONNECTIONPOPUPS));
@@ -132,22 +132,18 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam
db_set_b(0, KSMODULENAME, SETTING_CONTCHECK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK));
db_set_b(0, KSMODULENAME, SETTING_BYPING, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BYPING));
if (IsDlgButtonChecked(hwndDlg, IDC_BYPING)) {
- char *host;
-
int len = SendDlgItemMessage(hwndDlg, IDC_PINGHOST, WM_GETTEXTLENGTH, 0, 0);
if (len > 0) {
- host = (char*)mir_alloc(len + 1);
- if (host != nullptr) {
- memset(host, '\0', len + 1);
- GetDlgItemTextA(hwndDlg, IDC_PINGHOST, host, len + 1);
- db_set_s(0, KSMODULENAME, SETTING_PINGHOST, host);
- }
+ ptrA host((char*)mir_alloc(len + 1));
+ GetDlgItemTextA(hwndDlg, IDC_PINGHOST, host, len + 1);
+ db_set_s(0, KSMODULENAME, SETTING_PINGHOST, host);
}
}
+
HWND hList = GetDlgItem(hwndDlg, IDC_PROTOCOLLIST);
- memset(&lvItem, 0, sizeof(lvItem));
+ LVITEM lvItem;
lvItem.mask = LVIF_PARAM;
- for (i = 0; i < ListView_GetItemCount(hList); i++) {
+ for (int i = 0; i < ListView_GetItemCount(hList); i++) {
lvItem.iItem = i;
lvItem.iSubItem = 0;
ListView_GetItem(hList, &lvItem);
@@ -196,7 +192,6 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_CANCEL), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR));
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_SETDELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR));
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_DELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY) && IsDlgButtonChecked(hwndDlg, IDC_LOGINERR));
-
break;
case WM_COMMAND:
@@ -210,6 +205,7 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_SETDELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR));
EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_DELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY) && IsDlgButtonChecked(hwndDlg, IDC_LOGINERR));
break;
+
case IDC_LOGINERR_CANCEL:
case IDC_LOGINERR_SETDELAY:
CheckRadioButton(hwndDlg, IDC_LOGINERR_CANCEL, IDC_LOGINERR_SETDELAY, LOWORD(wParam));
@@ -219,7 +215,12 @@ static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY) {
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ KSLoadOptions();
+ break;
+
+ case PSN_APPLY:
db_set_b(0, KSMODULENAME, SETTING_INCREASEEXPONENTIAL, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL));
db_set_dw(0, KSMODULENAME, SETTING_MAXDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_MAXDELAY, nullptr, FALSE));
db_set_dw(0, KSMODULENAME, SETTING_MAXCONNECTINGTIME, (DWORD)GetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, nullptr, FALSE));
@@ -274,6 +275,7 @@ static INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
CheckDlgButton(hwndDlg, IDC_LNOTHING, BST_CHECKED);
break;
}
+
// right action
switch (db_get_b(0, KSMODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CANCEL)) {
case POPUP_ACT_CLOSEPOPUP:
@@ -289,6 +291,7 @@ static INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
CheckDlgButton(hwndDlg, IDC_RNOTHING, BST_CHECKED);
break;
}
+
// delay
EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYCUSTOM), ServiceExists(MS_POPUP_ADDPOPUPT));
EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYFROMPU), ServiceExists(MS_POPUP_ADDPOPUPT));
diff --git a/plugins/StatusManager/src/StartupStatus/ss_options.cpp b/plugins/StatusManager/src/StartupStatus/ss_options.cpp
index c3400120bd..af4e8f79c9 100644
--- a/plugins/StatusManager/src/StartupStatus/ss_options.cpp
+++ b/plugins/StatusManager/src/StartupStatus/ss_options.cpp
@@ -394,16 +394,18 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w
break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == PSN_APPLY) {
- int val;
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ SSLoadMainOptions();
+ break;
+ case PSN_APPLY:
db_set_b(0, SSMODULENAME, SETTING_SETPROFILE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE));
if (IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE))
db_set_dw(0, SSMODULENAME, SETTING_SETPROFILEDELAY, GetDlgItemInt(hwndDlg, IDC_SETPROFILEDELAY, nullptr, FALSE));
if (IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE) || IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)) {
- val = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA,
- SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0);
+ int val = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0);
db_set_w(0, SSMODULENAME, SETTING_DEFAULTPROFILE, (WORD)val);
}
db_set_b(0, SSMODULENAME, SETTING_OVERRIDE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE));
@@ -413,14 +415,12 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg, UINT msg, WPARAM w
db_set_b(0, SSMODULENAME, SETTING_SETWINSTATE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE));
if (IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE)) {
- val = (int)SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_GETITEMDATA,
- SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_GETCURSEL, 0, 0), 0);
+ int val = (int)SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_GETCURSEL, 0, 0), 0);
db_set_b(0, SSMODULENAME, SETTING_WINSTATE, (BYTE)val);
}
db_set_b(0, SSMODULENAME, SETTING_SETDOCKED, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED));
if (IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED)) {
- val = (int)SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_GETITEMDATA,
- SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_GETCURSEL, 0, 0), 0);
+ int val = (int)SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_GETCURSEL, 0, 0), 0);
db_set_b(0, SSMODULENAME, SETTING_DOCKED, (BYTE)val);
}
db_set_b(0, SSMODULENAME, SETTING_SETWINLOCATION, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION));
@@ -623,6 +623,13 @@ public:
lstStatus.OnSelChange = Callback(this, &CSSAdvancedOptDlg::onChange_Status);
lstAccount.OnSelChange = Callback(this, &CSSAdvancedOptDlg::onChange_Account);
+
+ m_OnFinishWizard = Callback(this, &CSSAdvancedOptDlg::OnFinishWizard);
+ }
+
+ void OnFinishWizard(void*)
+ {
+ SSLoadMainOptions();
}
virtual void OnInitDialog() override
@@ -713,8 +720,6 @@ public:
// Rebuild status menu
if (bNeedRebuildMenu)
pcli->pfnReloadProtoMenus();
-
- SSLoadMainOptions();
}
// add a profile
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp
index ad7c49b08a..c53cfd235a 100644
--- a/plugins/TabSRMM/src/chat_options.cpp
+++ b/plugins/TabSRMM/src/chat_options.cpp
@@ -302,6 +302,19 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM)
return 0;
}
+void Chat_ApplyOptions()
+{
+ pci->ReloadSettings();
+ pci->MM_IconsChanged();
+ pci->MM_FontsChanged();
+ Chat_UpdateOptions();
+ SM_ReconfigureFilters();
+
+ PluginConfig.reloadSettings();
+ CacheMsgLogIcons();
+ CacheLogFonts();
+}
+
static IconItem _icons[] =
{
{ LPGEN("Window Icon"), "chat_window", IDI_CHANMGR },
@@ -422,6 +435,10 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
case 0:
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ Chat_ApplyOptions();
+ break;
+
case PSN_APPLY:
int iLen;
wchar_t *pszText = nullptr;
@@ -440,12 +457,6 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
b = M.GetByte(CHAT_MODULE, "Tabs", 1);
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch1, _countof(branch1));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch2, _countof(branch2));
-
- pci->ReloadSettings();
- pci->MM_IconsChanged();
- pci->MM_FontsChanged();
- Chat_UpdateOptions();
- SM_ReconfigureFilters();
return TRUE;
}
}
@@ -804,12 +815,20 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
break;
case WM_NOTIFY:
- if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) {
+ if (((LPNMHDR)lParam)->idFrom != 0)
+ break;
+
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ Chat_ApplyOptions();
+ break;
+
+ case PSN_APPLY:
char *pszText = nullptr;
int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY));
if (iLen > 0) {
- wchar_t *pszText1 = (wchar_t*)mir_alloc(iLen*sizeof(wchar_t) + 2);
+ wchar_t *pszText1 = (wchar_t*)mir_alloc(iLen * sizeof(wchar_t) + 2);
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText1, iLen + 1);
db_set_ws(0, CHAT_MODULE, "LogDirectory", pszText1);
mir_free(pszText1);
@@ -870,14 +889,6 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (pci->hListBkgBrush)
DeleteObject(pci->hListBkgBrush);
pci->hListBkgBrush = CreateSolidBrush(M.GetDword(CHAT_MODULE, "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
-
- pci->ReloadSettings();
- pci->MM_FontsChanged();
- Chat_UpdateOptions();
-
- PluginConfig.reloadSettings();
- CacheMsgLogIcons();
- CacheLogFonts();
return TRUE;
}
break;
@@ -955,6 +966,10 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM, LPARAM lParam)
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ Chat_ApplyOptions();
+ break;
+
case PSN_APPLY:
DWORD dwFilterFlags = 0, dwTrayFlags = 0,
dwPopupFlags = 0, dwLogFlags = 0;
@@ -978,11 +993,6 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM, LPARAM lParam)
db_set_b(0, CHAT_MODULE, "LogSymbols", lr == 2 ? 1 : 0);
db_set_b(0, CHAT_MODULE, "TrayIconInactiveOnly", IsDlgButtonChecked(hwndDlg, IDC_TRAYONLYFORINACTIVE) ? 1 : 0);
-
- pci->ReloadSettings();
- pci->MM_FontsChanged();
- Chat_UpdateOptions();
- SM_ReconfigureFilters();
return TRUE;
}
}
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 6ab0d4fb6d..e2caa252ed 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -1371,8 +1371,7 @@ static int OptInitialise(WPARAM wParam, LPARAM lParam)
odp.pfnDlgProc = DlgProcTabConfig;
Options_AddPage(wParam, &odp);
- /* group chats */
-
+ // group chats
odp.szGroup.a = LPGEN("Message sessions");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS1);
odp.szTitle.a = LPGEN("Group chats");
diff --git a/plugins/TabSRMM/src/muchighlight.cpp b/plugins/TabSRMM/src/muchighlight.cpp
index 01390be456..d0744e2dcf 100644
--- a/plugins/TabSRMM/src/muchighlight.cpp
+++ b/plugins/TabSRMM/src/muchighlight.cpp
@@ -28,6 +28,8 @@
#include "stdafx.h"
+void Chat_ApplyOptions();
+
void CMUCHighlight::cleanup()
{
mir_free(m_NickPatternString);
@@ -238,8 +240,11 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
switch (((LPNMHDR)lParam)->code) {
+ case PSN_WIZFINISH:
+ Chat_ApplyOptions();
+ break;
+
case PSN_APPLY:
- {
wchar_t* szBuf = nullptr;
int iLen = ::GetWindowTextLength(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTNICKPATTERN));
if (iLen) {
@@ -267,8 +272,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
db_set_b(0, CHAT_MODULE, "HighlightEnabled", dwFlags);
db_set_b(0, CHAT_MODULE, "HighlightMe", ::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTME) ? 1 : 0);
g_Settings.Highlight->init();
- }
- return TRUE;
+ return TRUE;
}
}
break;
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp
index e74e1461ac..5777640a25 100644
--- a/protocols/Gadu-Gadu/src/dialogs.cpp
+++ b/protocols/Gadu-Gadu/src/dialogs.cpp
@@ -168,8 +168,7 @@ void GaduProto::checknewuser(uin_t uin, const char* passwd)
DBVARIANT dbv;
oldpasswd[0] = '\0';
- if (!getString(GG_KEY_PASSWORD, &dbv))
- {
+ if (!getString(GG_KEY_PASSWORD, &dbv)) {
if (dbv.pszVal)
mir_strcpy(oldpasswd, dbv.pszVal);
db_free(&dbv);
@@ -216,87 +215,83 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
switch (msg) {
case WM_INITDIALOG:
- {
- DBVARIANT dbv;
- DWORD num;
- gg = (GaduProto *)lParam;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
-
- TranslateDialogDefault(hwndDlg);
- if (num = gg->getDword(GG_KEY_UIN, 0))
- {
- SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
- ShowWindow(GetDlgItem(hwndDlg, IDC_CREATEACCOUNT), SW_HIDE);
- }
- else
{
- ShowWindow(GetDlgItem(hwndDlg, IDC_CHPASS), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg, IDC_REMOVEACCOUNT), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg, IDC_LOSTPASS), SW_HIDE);
- }
- if (!gg->getString(GG_KEY_PASSWORD, &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
- db_free(&dbv);
- }
- if (!gg->getString(GG_KEY_EMAIL, &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_EMAIL, dbv.pszVal);
- db_free(&dbv);
- }
- else
- {
- ShowWindow(GetDlgItem(hwndDlg, IDC_LOSTPASS), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg, IDC_CHPASS), SW_HIDE);
- }
+ DBVARIANT dbv;
+ DWORD num;
+ gg = (GaduProto *)lParam;
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
+
+ TranslateDialogDefault(hwndDlg);
+ if (num = gg->getDword(GG_KEY_UIN, 0)) {
+ SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
+ ShowWindow(GetDlgItem(hwndDlg, IDC_CREATEACCOUNT), SW_HIDE);
+ }
+ else {
+ ShowWindow(GetDlgItem(hwndDlg, IDC_CHPASS), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_REMOVEACCOUNT), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_LOSTPASS), SW_HIDE);
+ }
+ if (!gg->getString(GG_KEY_PASSWORD, &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
+ db_free(&dbv);
+ }
+ if (!gg->getString(GG_KEY_EMAIL, &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_EMAIL, dbv.pszVal);
+ db_free(&dbv);
+ }
+ else {
+ ShowWindow(GetDlgItem(hwndDlg, IDC_LOSTPASS), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_CHPASS), SW_HIDE);
+ }
- CheckDlgButton(hwndDlg, IDC_FRIENDSONLY, gg->getByte(GG_KEY_FRIENDSONLY, GG_KEYDEF_FRIENDSONLY) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWINVISIBLE, gg->getByte(GG_KEY_SHOWINVISIBLE, GG_KEYDEF_SHOWINVISIBLE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_LEAVESTATUSMSG, gg->getByte(GG_KEY_LEAVESTATUSMSG, GG_KEYDEF_LEAVESTATUSMSG) ? BST_CHECKED : BST_UNCHECKED);
- if (gg->gc_enabled)
- CheckDlgButton(hwndDlg, IDC_IGNORECONF, gg->getByte(GG_KEY_IGNORECONF, GG_KEYDEF_IGNORECONF) ? BST_CHECKED : BST_UNCHECKED);
- else
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_IGNORECONF), FALSE);
- CheckDlgButton(hwndDlg, IDC_IGNORECONF, BST_CHECKED);
- }
- CheckDlgButton(hwndDlg, IDC_IMGRECEIVE, gg->getByte(GG_KEY_IMGRECEIVE, GG_KEYDEF_IMGRECEIVE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWLINKS, gg->getByte(GG_KEY_SHOWLINKS, GG_KEYDEF_SHOWLINKS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ENABLEAVATARS, gg->getByte(GG_KEY_ENABLEAVATARS, GG_KEYDEF_ENABLEAVATARS) ? BST_CHECKED : BST_UNCHECKED);
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_LEAVESTATUS), IsDlgButtonChecked(hwndDlg, IDC_LEAVESTATUSMSG));
- EnableWindow(GetDlgItem(hwndDlg, IDC_IMGMETHOD), IsDlgButtonChecked(hwndDlg, IDC_IMGRECEIVE));
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)TranslateT("<Last Status>")); // 0
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_ONLINE, 0));
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_AWAY, 0));
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_DND, 0));
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_FREECHAT, 0));
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_INVISIBLE, 0));
-
- switch (gg->getWord(GG_KEY_LEAVESTATUS, GG_KEYDEF_LEAVESTATUS)) {
- case ID_STATUS_ONLINE:
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 1, 0);
- break;
- case ID_STATUS_AWAY:
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 2, 0);
- break;
- case ID_STATUS_DND:
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 3, 0);
- break;
- case ID_STATUS_FREECHAT:
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 4, 0);
- break;
- case ID_STATUS_INVISIBLE:
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 5, 0);
- break;
- default:
- SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 0, 0);
- }
+ CheckDlgButton(hwndDlg, IDC_FRIENDSONLY, gg->getByte(GG_KEY_FRIENDSONLY, GG_KEYDEF_FRIENDSONLY) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWINVISIBLE, gg->getByte(GG_KEY_SHOWINVISIBLE, GG_KEYDEF_SHOWINVISIBLE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_LEAVESTATUSMSG, gg->getByte(GG_KEY_LEAVESTATUSMSG, GG_KEYDEF_LEAVESTATUSMSG) ? BST_CHECKED : BST_UNCHECKED);
+ if (gg->gc_enabled)
+ CheckDlgButton(hwndDlg, IDC_IGNORECONF, gg->getByte(GG_KEY_IGNORECONF, GG_KEYDEF_IGNORECONF) ? BST_CHECKED : BST_UNCHECKED);
+ else {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_IGNORECONF), FALSE);
+ CheckDlgButton(hwndDlg, IDC_IGNORECONF, BST_CHECKED);
+ }
+ CheckDlgButton(hwndDlg, IDC_IMGRECEIVE, gg->getByte(GG_KEY_IMGRECEIVE, GG_KEYDEF_IMGRECEIVE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWLINKS, gg->getByte(GG_KEY_SHOWLINKS, GG_KEYDEF_SHOWLINKS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ENABLEAVATARS, gg->getByte(GG_KEY_ENABLEAVATARS, GG_KEYDEF_ENABLEAVATARS) ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("System tray icon"));
- SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("Popup window"));
- SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("Message with [img] BBCode"));
- SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_SETCURSEL, gg->getByte(GG_KEY_IMGMETHOD, GG_KEYDEF_IMGMETHOD), 0);
- }
- break;
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LEAVESTATUS), IsDlgButtonChecked(hwndDlg, IDC_LEAVESTATUSMSG));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_IMGMETHOD), IsDlgButtonChecked(hwndDlg, IDC_IMGRECEIVE));
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)TranslateT("<Last Status>")); // 0
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_ONLINE, 0));
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_AWAY, 0));
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_DND, 0));
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_FREECHAT, 0));
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(ID_STATUS_INVISIBLE, 0));
+
+ switch (gg->getWord(GG_KEY_LEAVESTATUS, GG_KEYDEF_LEAVESTATUS)) {
+ case ID_STATUS_ONLINE:
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 1, 0);
+ break;
+ case ID_STATUS_AWAY:
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 2, 0);
+ break;
+ case ID_STATUS_DND:
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 3, 0);
+ break;
+ case ID_STATUS_FREECHAT:
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 4, 0);
+ break;
+ case ID_STATUS_INVISIBLE:
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 5, 0);
+ break;
+ default:
+ SendDlgItemMessage(hwndDlg, IDC_LEAVESTATUS, CB_SETCURSEL, 0, 0);
+ }
+
+ SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("System tray icon"));
+ SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("Popup window"));
+ SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_ADDSTRING, 0, (LPARAM)TranslateT("Message with [img] BBCode"));
+ SendDlgItemMessage(hwndDlg, IDC_IMGMETHOD, CB_SETCURSEL, gg->getByte(GG_KEY_IMGMETHOD, GG_KEYDEF_IMGMETHOD), 0);
+ }
+ break;
case WM_COMMAND:
if ((LOWORD(wParam) == IDC_UIN || LOWORD(wParam) == IDC_PASSWORD || LOWORD(wParam) == IDC_EMAIL)
@@ -318,26 +313,25 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case IDC_LOSTPASS:
- {
- char email[128];
- uin_t uin;
- GetDlgItemTextA(hwndDlg, IDC_UIN, email, _countof(email));
- uin = atoi(email);
- GetDlgItemTextA(hwndDlg, IDC_EMAIL, email, _countof(email));
- if (!mir_strlen(email))
- MessageBox(nullptr, TranslateT("You need to specify your registration e-mail first."),
- gg->m_tszUserName, MB_OK | MB_ICONEXCLAMATION);
- else if (MessageBox(nullptr,
- TranslateT("Your password will be sent to your registration e-mail.\nDo you want to continue?"),
- gg->m_tszUserName,
- MB_OKCANCEL | MB_ICONQUESTION) == IDOK)
- gg->remindpassword(uin, email);
- return FALSE;
- }
+ {
+ char email[128];
+ uin_t uin;
+ GetDlgItemTextA(hwndDlg, IDC_UIN, email, _countof(email));
+ uin = atoi(email);
+ GetDlgItemTextA(hwndDlg, IDC_EMAIL, email, _countof(email));
+ if (!mir_strlen(email))
+ MessageBox(nullptr, TranslateT("You need to specify your registration e-mail first."),
+ gg->m_tszUserName, MB_OK | MB_ICONEXCLAMATION);
+ else if (MessageBox(nullptr,
+ TranslateT("Your password will be sent to your registration e-mail.\nDo you want to continue?"),
+ gg->m_tszUserName,
+ MB_OKCANCEL | MB_ICONQUESTION) == IDOK)
+ gg->remindpassword(uin, email);
+ return FALSE;
+ }
case IDC_CREATEACCOUNT:
case IDC_REMOVEACCOUNT:
- if (gg->isonline())
- {
+ if (gg->isonline()) {
if (MessageBox(
nullptr,
TranslateT("You should disconnect before making any permanent changes with your account.\nDo you want to disconnect now?"),
@@ -349,86 +343,80 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
}
case IDC_CHPASS:
case IDC_CHEMAIL:
- {
- // Readup data
- GGUSERUTILDLGDATA dat;
- int ret;
- char pass[128], email[128];
- GetDlgItemTextA(hwndDlg, IDC_UIN, pass, _countof(pass));
- dat.uin = atoi(pass);
- GetDlgItemTextA(hwndDlg, IDC_PASSWORD, pass, _countof(pass));
- GetDlgItemTextA(hwndDlg, IDC_EMAIL, email, _countof(email));
- dat.pass = pass;
- dat.email = email;
- dat.gg = gg;
- if (LOWORD(wParam) == IDC_CREATEACCOUNT)
- {
- dat.mode = GG_USERUTIL_CREATE;
- ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CREATEACCOUNT), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
- }
- else if (LOWORD(wParam) == IDC_CHPASS)
{
- dat.mode = GG_USERUTIL_PASS;
- ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CHPASS), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
- }
- else if (LOWORD(wParam) == IDC_CHEMAIL)
- {
- dat.mode = GG_USERUTIL_EMAIL;
- ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CHEMAIL), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
- }
- else
- {
- dat.mode = GG_USERUTIL_REMOVE;
- ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_REMOVEACCOUNT), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
- }
-
- if (ret == IDOK)
- {
- DBVARIANT dbv;
- DWORD num;
- // Show reload required window
- ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW);
-
- // Update uin
- if (num = gg->getDword(GG_KEY_UIN, 0))
- SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
- else
- SetDlgItemTextA(hwndDlg, IDC_UIN, "");
-
- // Update password
- if (!gg->getString(GG_KEY_PASSWORD, &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
- db_free(&dbv);
+ // Readup data
+ GGUSERUTILDLGDATA dat;
+ int ret;
+ char pass[128], email[128];
+ GetDlgItemTextA(hwndDlg, IDC_UIN, pass, _countof(pass));
+ dat.uin = atoi(pass);
+ GetDlgItemTextA(hwndDlg, IDC_PASSWORD, pass, _countof(pass));
+ GetDlgItemTextA(hwndDlg, IDC_EMAIL, email, _countof(email));
+ dat.pass = pass;
+ dat.email = email;
+ dat.gg = gg;
+ if (LOWORD(wParam) == IDC_CREATEACCOUNT) {
+ dat.mode = GG_USERUTIL_CREATE;
+ ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CREATEACCOUNT), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
}
- else SetDlgItemTextA(hwndDlg, IDC_PASSWORD, "");
-
- // Update e-mail
- if (!gg->getString(GG_KEY_EMAIL, &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_EMAIL, dbv.pszVal);
- db_free(&dbv);
+ else if (LOWORD(wParam) == IDC_CHPASS) {
+ dat.mode = GG_USERUTIL_PASS;
+ ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CHPASS), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
+ }
+ else if (LOWORD(wParam) == IDC_CHEMAIL) {
+ dat.mode = GG_USERUTIL_EMAIL;
+ ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CHEMAIL), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
+ }
+ else {
+ dat.mode = GG_USERUTIL_REMOVE;
+ ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_REMOVEACCOUNT), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
}
- else SetDlgItemTextA(hwndDlg, IDC_EMAIL, "");
- // Update links
- gg_optsdlgcheck(hwndDlg);
+ if (ret == IDOK) {
+ DBVARIANT dbv;
+ DWORD num;
+ // Show reload required window
+ ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW);
+
+ // Update uin
+ if (num = gg->getDword(GG_KEY_UIN, 0))
+ SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
+ else
+ SetDlgItemTextA(hwndDlg, IDC_UIN, "");
+
+ // Update password
+ if (!gg->getString(GG_KEY_PASSWORD, &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
+ db_free(&dbv);
+ }
+ else SetDlgItemTextA(hwndDlg, IDC_PASSWORD, "");
- // Remove details
- if (LOWORD(wParam) != IDC_CHPASS && LOWORD(wParam) != IDC_CHEMAIL)
- {
- gg->delSetting(GG_KEY_NICK);
- gg->delSetting(GG_KEY_PD_NICKNAME);
- gg->delSetting(GG_KEY_PD_CITY);
- gg->delSetting(GG_KEY_PD_FIRSTNAME);
- gg->delSetting(GG_KEY_PD_LASTNAME);
- gg->delSetting(GG_KEY_PD_FAMILYNAME);
- gg->delSetting(GG_KEY_PD_FAMILYCITY);
- gg->delSetting(GG_KEY_PD_AGE);
- gg->delSetting(GG_KEY_PD_BIRTHYEAR);
- gg->delSetting(GG_KEY_PD_GANDER);
+ // Update e-mail
+ if (!gg->getString(GG_KEY_EMAIL, &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_EMAIL, dbv.pszVal);
+ db_free(&dbv);
+ }
+ else SetDlgItemTextA(hwndDlg, IDC_EMAIL, "");
+
+ // Update links
+ gg_optsdlgcheck(hwndDlg);
+
+ // Remove details
+ if (LOWORD(wParam) != IDC_CHPASS && LOWORD(wParam) != IDC_CHEMAIL) {
+ gg->delSetting(GG_KEY_NICK);
+ gg->delSetting(GG_KEY_PD_NICKNAME);
+ gg->delSetting(GG_KEY_PD_CITY);
+ gg->delSetting(GG_KEY_PD_FIRSTNAME);
+ gg->delSetting(GG_KEY_PD_LASTNAME);
+ gg->delSetting(GG_KEY_PD_FAMILYNAME);
+ gg->delSetting(GG_KEY_PD_FAMILYCITY);
+ gg->delSetting(GG_KEY_PD_AGE);
+ gg->delSetting(GG_KEY_PD_BIRTHYEAR);
+ gg->delSetting(GG_KEY_PD_GANDER);
+ }
}
}
- }
- break;
+ break;
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
@@ -585,8 +573,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
dat->updating = FALSE;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
// Add genders
- if (!dat->hContact)
- {
+ if (!dat->hContact) {
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)L""); // 0
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Female")); // 1
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)TranslateT("Male")); // 2
@@ -602,14 +589,12 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case PSN_INFOCHANGED:
- if (dat)
- {
+ if (dat) {
MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam;
GaduProto *gg = dat->gg;
// Show updated message
- if (dat->updating)
- {
+ if (dat->updating) {
MessageBox(nullptr, TranslateT("Your details has been uploaded to the public directory."),
gg->m_tszUserName, MB_OK | MB_ICONINFORMATION);
dat->updating = FALSE;
@@ -636,8 +621,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
SetValue(hwndDlg, IDC_FAMILYNAME, hContact, szProto, GG_KEY_PD_FAMILYNAME, SVS_NORMAL, hContact != NULL);
SetValue(hwndDlg, IDC_CITYORIGIN, hContact, szProto, GG_KEY_PD_FAMILYCITY, SVS_NORMAL, hContact != NULL);
- if (hContact)
- {
+ if (hContact) {
SetValue(hwndDlg, IDC_GENDER, hContact, szProto, GG_KEY_PD_GANDER, SVS_GENDER, hContact != NULL);
SetValue(hwndDlg, IDC_STATUSDESCR, hContact, "CList", GG_KEY_STATUSDESCR, SVS_NORMAL, hContact != NULL);
}
@@ -693,8 +677,7 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam,
wchar_t text[256];
GaduProto *gg = dat->gg;
- if (!gg->isonline())
- {
+ if (!gg->isonline()) {
MessageBox(nullptr,
TranslateT("You have to be logged in before you can change your details."),
gg->m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -850,73 +833,71 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
switch (msg) {
case WM_INITDIALOG:
- {
- DBVARIANT dbv;
- gg = (GaduProto *)lParam;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
-
- TranslateDialogDefault(hwndDlg);
- DWORD num = gg->getDword(GG_KEY_UIN, 0);
- if (num)
- SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
- if (!gg->getString(GG_KEY_PASSWORD, &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
- db_free(&dbv);
- }
- if (!gg->getString(GG_KEY_EMAIL, &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_EMAIL, dbv.pszVal);
- db_free(&dbv);
+ {
+ DBVARIANT dbv;
+ gg = (GaduProto *)lParam;
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
+
+ TranslateDialogDefault(hwndDlg);
+ DWORD num = gg->getDword(GG_KEY_UIN, 0);
+ if (num)
+ SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
+ if (!gg->getString(GG_KEY_PASSWORD, &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
+ db_free(&dbv);
+ }
+ if (!gg->getString(GG_KEY_EMAIL, &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_EMAIL, dbv.pszVal);
+ db_free(&dbv);
+ }
+ break;
}
- break;
- }
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_CREATEACCOUNT:
- {
- // Readup data
- GGUSERUTILDLGDATA dat;
- char pass[128], email[128];
- GetDlgItemTextA(hwndDlg, IDC_UIN, pass, _countof(pass));
- dat.uin = atoi(pass);
- GetDlgItemTextA(hwndDlg, IDC_PASSWORD, pass, _countof(pass));
- GetDlgItemTextA(hwndDlg, IDC_EMAIL, email, _countof(email));
- dat.pass = pass;
- dat.email = email;
- dat.gg = gg;
- dat.mode = GG_USERUTIL_CREATE;
- int ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CREATEACCOUNT), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
-
- if (ret == IDOK)
{
- DBVARIANT dbv;
- DWORD num;
- // Show reload required window
- ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW);
-
- // Update uin
- if (num = gg->getDword(GG_KEY_UIN, 0))
- SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
- else
- SetDlgItemTextA(hwndDlg, IDC_UIN, "");
-
- // Update password
- if (!gg->getString(GG_KEY_PASSWORD, &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
- db_free(&dbv);
- }
- else
- SetDlgItemTextA(hwndDlg, IDC_PASSWORD, "");
+ // Readup data
+ GGUSERUTILDLGDATA dat;
+ char pass[128], email[128];
+ GetDlgItemTextA(hwndDlg, IDC_UIN, pass, _countof(pass));
+ dat.uin = atoi(pass);
+ GetDlgItemTextA(hwndDlg, IDC_PASSWORD, pass, _countof(pass));
+ GetDlgItemTextA(hwndDlg, IDC_EMAIL, email, _countof(email));
+ dat.pass = pass;
+ dat.email = email;
+ dat.gg = gg;
+ dat.mode = GG_USERUTIL_CREATE;
+ int ret = DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CREATEACCOUNT), hwndDlg, gg_userutildlgproc, (LPARAM)&dat);
+
+ if (ret == IDOK) {
+ DBVARIANT dbv;
+ DWORD num;
+ // Show reload required window
+ ShowWindow(GetDlgItem(hwndDlg, IDC_RELOADREQD), SW_SHOW);
+
+ // Update uin
+ if (num = gg->getDword(GG_KEY_UIN, 0))
+ SetDlgItemTextA(hwndDlg, IDC_UIN, ditoa(num));
+ else
+ SetDlgItemTextA(hwndDlg, IDC_UIN, "");
+
+ // Update password
+ if (!gg->getString(GG_KEY_PASSWORD, &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
+ db_free(&dbv);
+ }
+ else SetDlgItemTextA(hwndDlg, IDC_PASSWORD, "");
- // Update e-mail
- if (!gg->getString(GG_KEY_EMAIL, &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_EMAIL, dbv.pszVal);
- db_free(&dbv);
+ // Update e-mail
+ if (!gg->getString(GG_KEY_EMAIL, &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_EMAIL, dbv.pszVal);
+ db_free(&dbv);
+ }
+ else SetDlgItemTextA(hwndDlg, IDC_EMAIL, "");
}
- else
- SetDlgItemTextA(hwndDlg, IDC_EMAIL, "");
}
- }
- break;
+ break;
+
case IDC_UIN:
case IDC_PASSWORD:
case IDC_EMAIL:
@@ -932,7 +913,6 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- {
char str[128];
// Write Gadu-Gadu number & password
@@ -947,7 +927,6 @@ INT_PTR CALLBACK gg_acc_mgr_guidlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetDlgItemTextA(hwndDlg, IDC_EMAIL, str, _countof(str));
gg->setString(GG_KEY_EMAIL, str);
}
- }
}
break;
}
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp
index 62a549b9bc..a9fe26c40a 100644
--- a/src/mir_app/src/options.cpp
+++ b/src/mir_app/src/options.cpp
@@ -289,6 +289,16 @@ struct OptionsPageData : public MZeroedObject
}
};
+static int CompareOPD(const OptionsPageData *p1, const OptionsPageData *p2)
+{
+ int res = mir_wstrcmp(p1->ptszGroup, p2->ptszGroup);
+ if (!res)
+ res = mir_wstrcmp(p1->ptszTitle, p2->ptszTitle);
+ if (!res)
+ res = mir_wstrcmp(p1->ptszTab, p2->ptszTab);
+ return res;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// Options dialog
@@ -812,13 +822,12 @@ public:
virtual void OnApply() override
{
- PSHNOTIFY pshn;
m_btnApply.Disable();
SetFocus(m_pageTree.GetHwnd());
OptionsPageData *opd = getCurrent();
if (opd != nullptr) {
- pshn.hdr.idFrom = 0;
+ PSHNOTIFY pshn = {};
pshn.lParam = IDC_APPLY;
pshn.hdr.code = PSN_KILLACTIVE;
pshn.hdr.hwndFrom = opd->getHwnd();
@@ -826,10 +835,16 @@ public:
return;
}
+ LIST<OptionsPageData> arChanged(10, CompareOPD);
+
+ PSHNOTIFY pshn = {};
pshn.hdr.code = PSN_APPLY;
for (int i = 0; i < m_arOpd.getCount(); i++) {
OptionsPageData *p = m_arOpd[i];
- if (p->getHwnd() == nullptr || !p->changed) continue;
+ if (p->getHwnd() == nullptr || !p->changed)
+ continue;
+
+ arChanged.insert(p);
p->changed = 0;
pshn.hdr.hwndFrom = p->getHwnd();
if (SendMessage(p->getHwnd(), WM_NOTIFY, 0, (LPARAM)&pshn) == PSNRET_INVALID_NOCHANGEPAGE) {
@@ -843,6 +858,20 @@ public:
return;
}
}
+
+ pshn.hdr.code = PSN_WIZFINISH;
+ for (int i = 0; i < arChanged.getCount(); i++) {
+ OptionsPageData *p = arChanged[i];
+ if (p->ptszTab == nullptr)
+ continue;
+
+ // calculate last changed tab
+ OptionsPageData *p2 = arChanged[i+1];
+ if (p2 != nullptr && !mir_wstrcmp(p->ptszTitle, p2->ptszTitle) && !mir_wstrcmp(p->ptszGroup, p2->ptszGroup))
+ continue;
+
+ SendMessage(p->pDialog->GetHwnd(), WM_NOTIFY, 0, (LPARAM)&pshn);
+ }
}
void btnApply_Click(CCtrlButton*)
diff --git a/src/mir_core/src/CCtrlHyperlink.cpp b/src/mir_core/src/CCtrlHyperlink.cpp
index fb0ab7f7ae..4b0499479d 100644
--- a/src/mir_core/src/CCtrlHyperlink.cpp
+++ b/src/mir_core/src/CCtrlHyperlink.cpp
@@ -32,7 +32,7 @@ CCtrlHyperlink::CCtrlHyperlink(CDlgBase* wnd, int idCtrl, const char* url)
OnClick = Callback(this, &CCtrlHyperlink::Default_OnClick);
}
-BOOL CCtrlHyperlink::OnCommand(HWND, WORD, WORD idCode)
+BOOL CCtrlHyperlink::OnCommand(HWND, WORD, WORD)
{
OnClick(this);
return FALSE;
diff --git a/src/mir_core/src/CDlgBase.cpp b/src/mir_core/src/CDlgBase.cpp
index dc938f1fc4..3fb76249bc 100644
--- a/src/mir_core/src/CDlgBase.cpp
+++ b/src/mir_core/src/CDlgBase.cpp
@@ -247,7 +247,8 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
int idCtrl = wParam;
NMHDR *pnmh = (NMHDR *)lParam;
if (pnmh->idFrom == 0) {
- if (pnmh->code == PSN_APPLY) {
+ switch (pnmh->code) {
+ case PSN_APPLY:
if (LPPSHNOTIFY(lParam)->lParam != 3) // IDC_APPLY
m_bExiting = true;
@@ -255,10 +256,16 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
NotifyControls(&CCtrlBase::OnApply);
if (m_lresult)
OnApply();
- }
- else if (pnmh->code == PSN_RESET) {
+ break;
+
+ case PSN_RESET:
NotifyControls(&CCtrlBase::OnReset);
OnReset();
+ break;
+
+ case PSN_WIZFINISH:
+ m_OnFinishWizard(this);
+ break;
}
}