diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-16 18:57:28 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-16 18:57:28 +0000 |
commit | 2053ba5bd4f1f43d960ddeb40fa10568e2254f25 (patch) | |
tree | 86c928bc95929ad4a200afe69905b82a304b863e /protocols/IcqOscarJ | |
parent | 7c9988c78c4543aa09c5e2da15c26956d0f73ece (diff) |
patch for "Save changes" button activation
git-svn-id: http://svn.miranda-ng.org/main/trunk@8143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ')
-rw-r--r-- | protocols/IcqOscarJ/src/changeinfo/editlist.cpp | 49 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_fieldnames.cpp | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_fieldnames.h | 2 |
3 files changed, 27 insertions, 26 deletions
diff --git a/protocols/IcqOscarJ/src/changeinfo/editlist.cpp b/protocols/IcqOscarJ/src/changeinfo/editlist.cpp index 33c0a1e53a..a7092a7165 100644 --- a/protocols/IcqOscarJ/src/changeinfo/editlist.cpp +++ b/protocols/IcqOscarJ/src/changeinfo/editlist.cpp @@ -149,36 +149,37 @@ void ChangeInfoData::EndListEdit(int save) int i = SendMessage(hwndListEdit, LB_GETITEMDATA, iItem, 0);
if (iItem != -1 && i != -1) {
FieldNamesItem *list = (FieldNamesItem*)si.pList;
- if (list == timezonesField)
+ if (list == timezonesField) {
tmi.storeListResults(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB);
- else {
- FieldNamesItem &pItem = list[i];
-
- if (si.dbType == DBVT_ASCIIZ) {
- char *szNewValue = pItem.text;
- if (pItem.code || (si.displayType & LIF_ZEROISVALID)) {
- sid.changed = strcmpnull(szNewValue, (char*)sid.value);
- SAFE_FREE((void**)&sid.value);
- sid.value = (LPARAM)null_strdup(szNewValue);
- }
- else {
- sid.changed = (char*)sid.value != NULL;
- SAFE_FREE((void**)&sid.value);
- }
+ list[i = 0].code = ppro->getDword("Timezone", 0);
+ }
+
+ FieldNamesItem &pItem = list[i];
+
+ if (si.dbType == DBVT_ASCIIZ) {
+ char *szNewValue = pItem.text;
+ if (pItem.code || (si.displayType & LIF_ZEROISVALID)) {
+ sid.changed = strcmpnull(szNewValue, (char*)sid.value);
+ SAFE_FREE((void**)&sid.value);
+ sid.value = (LPARAM)null_strdup(szNewValue);
}
else {
- sid.changed = pItem.code != sid.value;
- sid.value = pItem.code;
+ sid.changed = (char*)sid.value != NULL;
+ SAFE_FREE((void**)&sid.value);
}
+ }
+ else {
+ sid.changed = pItem.code != sid.value;
+ sid.value = pItem.code;
+ }
- if (sid.changed) {
- char buf[MAX_PATH];
- TCHAR tbuf[MAX_PATH];
- if (utf8_to_tchar_static(ICQTranslateUtfStatic(pItem.text, buf, SIZEOF(buf)), tbuf, SIZEOF(buf)))
- ListView_SetItemText(hwndList, iEditItem, 1, tbuf);
+ if (sid.changed) {
+ char buf[MAX_PATH];
+ TCHAR tbuf[MAX_PATH];
+ if (utf8_to_tchar_static(ICQTranslateUtfStatic(pItem.text, buf, SIZEOF(buf)), tbuf, SIZEOF(buf)))
+ ListView_SetItemText(hwndList, iEditItem, 1, tbuf);
- EnableDlgItem(GetParent(hwndList), IDC_SAVE, TRUE);
- }
+ EnableDlgItem(GetParent(hwndList), IDC_SAVE, TRUE);
}
}
}
diff --git a/protocols/IcqOscarJ/src/icq_fieldnames.cpp b/protocols/IcqOscarJ/src/icq_fieldnames.cpp index a5aed0f8f9..136b838af0 100644 --- a/protocols/IcqOscarJ/src/icq_fieldnames.cpp +++ b/protocols/IcqOscarJ/src/icq_fieldnames.cpp @@ -30,7 +30,7 @@ #include "icqoscar.h"
-const FieldNamesItem timezonesField[] =
+FieldNamesItem timezonesField[] =
{
{ -100, NULL }
};
diff --git a/protocols/IcqOscarJ/src/icq_fieldnames.h b/protocols/IcqOscarJ/src/icq_fieldnames.h index de11bbe961..31f29c292e 100644 --- a/protocols/IcqOscarJ/src/icq_fieldnames.h +++ b/protocols/IcqOscarJ/src/icq_fieldnames.h @@ -33,7 +33,7 @@ struct FieldNamesItem char *text;
};
-extern const FieldNamesItem timezonesField[];
+extern FieldNamesItem timezonesField[];
extern const FieldNamesItem countryField[];
extern const FieldNamesItem interestsField[];
extern const FieldNamesItem languageField[];
|