summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-30 16:18:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-30 16:18:28 +0000
commit540f5010d9ebdec65b09bdc71fcd6cdf2010beaf (patch)
tree1a91bc7164a8072b1bc8859197945a6064d865ee
parent362fe96c972d71a7d9994212794d54cc93da7139 (diff)
"Hide in status bar" option removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@2566 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/MetaContacts/res/MetaContacts.rc1
-rw-r--r--plugins/MetaContacts/src/meta_options.cpp7
-rw-r--r--plugins/MetaContacts/src/meta_services.cpp56
-rw-r--r--plugins/MetaContacts/src/meta_utils.cpp12
-rw-r--r--plugins/MetaContacts/src/metacontacts.h35
-rw-r--r--plugins/MetaContacts/src/resource.h1
6 files changed, 50 insertions, 62 deletions
diff --git a/plugins/MetaContacts/res/MetaContacts.rc b/plugins/MetaContacts/res/MetaContacts.rc
index c6f783f10b..c9eb73a59b 100644
--- a/plugins/MetaContacts/res/MetaContacts.rc
+++ b/plugins/MetaContacts/res/MetaContacts.rc
@@ -230,7 +230,6 @@ BEGIN
GROUPBOX "Contact List",IDC_STATIC,4,139,289,33,WS_GROUP
CONTROL "Display subcontact nickname",IDC_RAD_NICK,"Button",BS_AUTORADIOBUTTON | WS_GROUP,9,149,144,10
CONTROL "Display subcontact display name",IDC_RAD_NAME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,9,160,144,10
- CONTROL "Hide in status bar and status menu (*requires restart, uncheck to set proto icons)",IDC_CHK_SUPPRESSPROTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,53,290,10
CONTROL "Use subcontact message windows",IDC_CHK_SUBWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,64,155,10
CONTROL "Copy subcontact data",IDC_CHK_COPYDATA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,64,133,10
CONTROL "Lock name to first contact",IDC_CHK_LOCKHANDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,155,115,10
diff --git a/plugins/MetaContacts/src/meta_options.cpp b/plugins/MetaContacts/src/meta_options.cpp
index f56582984b..a64b36b891 100644
--- a/plugins/MetaContacts/src/meta_options.cpp
+++ b/plugins/MetaContacts/src/meta_options.cpp
@@ -47,7 +47,6 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
CheckDlgButton(hwndDlg, IDC_CHK_ALWAYSUSEDEFAULT, options_changes.always_use_default ? TRUE : FALSE);
CheckDlgButton(hwndDlg, IDC_CHK_SUPPRESSSTATUS, options_changes.suppress_status ? TRUE : FALSE);
- CheckDlgButton(hwndDlg, IDC_CHK_SUPPRESSPROTO, options_changes.suppress_proto ? TRUE : FALSE);
CheckDlgButton(hwndDlg, IDC_RAD_UID, options_changes.menu_contact_label == DNT_UID);
CheckDlgButton(hwndDlg, IDC_RAD_DID, options_changes.menu_contact_label == DNT_DID);
@@ -99,10 +98,6 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
options_changes.suppress_status = IsDlgButtonChecked(hwndDlg, IDC_CHK_SUPPRESSSTATUS);
SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- case IDC_CHK_SUPPRESSPROTO:
- options_changes.suppress_proto = IsDlgButtonChecked(hwndDlg, IDC_CHK_SUPPRESSPROTO);
- SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
case IDC_CHK_COPYHISTORY:
options_changes.copy_subcontact_history = IsDlgButtonChecked(hwndDlg, IDC_CHK_COPYHISTORY);
SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -228,7 +223,6 @@ int Meta_WriteOptions(MetaOptions *opt)
db_set_w(NULL, META_PROTO, "MenuContactLabel", (WORD)opt->menu_contact_label);
db_set_w(NULL, META_PROTO, "MenuContactFunction", (WORD)opt->menu_function);
db_set_w(NULL, META_PROTO, "CListContactName", (WORD)opt->clist_contact_name);
- db_set_b(NULL, META_PROTO, "SuppressProto", (BYTE)(opt->suppress_proto ? 1 : 0));
db_set_b(NULL, META_PROTO, "CopyHistory", (BYTE)(opt->copy_subcontact_history ? 1 : 0));
db_set_dw(NULL, META_PROTO, "DaysHistory", (DWORD)(opt->days_history));
db_set_dw(NULL, META_PROTO, "SetStatusFromOfflineDelay", (DWORD)(opt->set_status_from_offline_delay));
@@ -261,7 +255,6 @@ int Meta_ReadOptions(MetaOptions *opt)
opt->menu_contact_label = (int)db_get_w(NULL, META_PROTO, "MenuContactLabel", DNT_UID);
opt->menu_function = (int)db_get_w(NULL, META_PROTO, "MenuContactFunction", FT_MENU);
opt->clist_contact_name = (int)db_get_w(NULL, META_PROTO, "CListContactName", CNNT_NICK);
- opt->suppress_proto = (db_get_b(NULL, META_PROTO, "SuppressProto", 0) == 1 ? TRUE : FALSE);
opt->copy_subcontact_history = (db_get_b(NULL, META_PROTO, "CopyHistory", 1) == 1 ? TRUE : FALSE);
opt->days_history = (int)db_get_dw(NULL, META_PROTO, "DaysHistory", 0);
opt->set_status_from_offline_delay = (int)db_get_dw(NULL, META_PROTO, "SetStatusFromOfflineDelay", DEFAULT_SET_STATUS_SLEEP_TIME);
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp
index eec929bf38..03c154c430 100644
--- a/plugins/MetaContacts/src/meta_services.cpp
+++ b/plugins/MetaContacts/src/meta_services.cpp
@@ -73,48 +73,39 @@ BOOL firstSetOnline = TRUE; // see Meta_SetStatus function
*/
INT_PTR Meta_GetCaps(WPARAM wParam,LPARAM lParam)
{
- int ret = 0;
switch (wParam) {
case PFLAGNUM_1:
- ret = PF1_IM | PF1_CHAT | PF1_FILESEND | PF1_MODEMSGRECV | PF1_NUMERICUSERID;
- break;
+ return PF1_IM | PF1_CHAT | PF1_FILESEND | PF1_MODEMSGRECV | PF1_NUMERICUSERID;
case PFLAGNUM_2:
- if ( !options.suppress_proto)
- ret = PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE;
- break;
+ return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE;
case PFLAGNUM_3:
- ret = PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE;
- break;
+ return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE;
case PFLAGNUM_4:
- ret = PF4_SUPPORTTYPING | PF4_AVATARS;
- break;
+ return PF4_SUPPORTTYPING | PF4_AVATARS;
case PFLAGNUM_5:
- ret = PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE;
- break;
+ return PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE;
case PFLAG_UNIQUEIDTEXT:
- ret = (INT_PTR) Translate("Meta ID");
- break;
+ return (INT_PTR) Translate("Meta ID");
case PFLAG_MAXLENOFMESSAGE:
- ret = 2000;
- break;
+ return 2000;
case PFLAG_UNIQUEIDSETTING:
- ret = (INT_PTR)META_ID;
- break;
+ return (INT_PTR)META_ID;
}
- return ret;
+ return 0;
}
/** Copy the name of the protocole into lParam
* @param wParam : max size of the name
* @param lParam : reference to a char *, which will hold the name
*/
+
INT_PTR Meta_GetName(WPARAM wParam,LPARAM lParam)
{
char *name = (char *)Translate(META_PROTO);
@@ -131,6 +122,7 @@ INT_PTR Meta_GetName(WPARAM wParam,LPARAM lParam)
<tt>PLI_PROTOCOL | PLI_ONLINE | PLI_OFFLINE</tt>
* @return an \c HICON in which the icon has been loaded.
*/
+
INT_PTR Meta_LoadIcon(WPARAM wParam,LPARAM lParam)
{
UINT id;
@@ -153,7 +145,6 @@ INT_PTR Meta_LoadIcon(WPARAM wParam,LPARAM lParam)
GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0);
}
-//static DWORD CALLBACK SetStatusThread( LPVOID param )
void CALLBACK SetStatusThread(HWND hWnd, UINT msg, UINT_PTR id, DWORD dw)
{
previousMode = mcStatus;
@@ -177,7 +168,8 @@ INT_PTR Meta_SetStatus(WPARAM wParam,LPARAM lParam)
//CloseHandle( CreateThread( NULL, 0, SetStatusThread, (void *)wParam, 0, 0 ));
setStatusTimerId = SetTimer(0, 0, options.set_status_from_offline_delay, SetStatusThread);
firstSetOnline = FALSE;
- } else {
+ }
+ else {
previousMode = mcStatus;
mcStatus = (int)wParam;
ProtoBroadcastAck(META_PROTO, NULL,ACKTYPE_STATUS,ACKRESULT_SUCCESS, (HANDLE)previousMode, mcStatus);
@@ -229,7 +221,7 @@ static DWORD CALLBACK sttFakeAckFail( LPVOID param )
INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *) lParam;
+ CCSDATA *ccs = (CCSDATA*)lParam;
HANDLE hMeta;
if ((hMeta = (HANDLE)db_get_dw(ccs->hContact, META_PROTO, "Handle", 0)) == 0)
@@ -262,7 +254,7 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam)
dbei.cbBlob *= ( sizeof( wchar_t )+1 );
dbei.pBlob = (PBYTE)ccs->lParam;
- CallService(MS_DB_EVENT_ADD, (WPARAM) hMeta, (LPARAM)&dbei);
+ CallService(MS_DB_EVENT_ADD, (WPARAM)hMeta, (LPARAM)&dbei);
}
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
@@ -293,7 +285,7 @@ INT_PTR Meta_SendNudge(WPARAM wParam,LPARAM lParam)
*/
INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *) lParam;
+ CCSDATA *ccs = (CCSDATA*)lParam;
char *proto = 0;
DWORD default_contact_number;
@@ -382,7 +374,7 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam)
INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam)
{
DBEVENTINFO dbei;
- CCSDATA *ccs = (CCSDATA *) lParam;
+ CCSDATA *ccs = (CCSDATA*)lParam;
PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam;
HANDLE hMeta;
@@ -485,7 +477,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam)
*/
INT_PTR Meta_RecvMessage(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *) lParam;
+ CCSDATA *ccs = (CCSDATA*)lParam;
PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam;
char *proto = GetContactProto(ccs->hContact);
@@ -626,11 +618,11 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
Meta_SetHandles();
{
HANDLE hContact = db_find_first();
- int meta_id;
while ( hContact != NULL ) {
- if ((meta_id = db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1))!=(DWORD)-1) {
+ int meta_id;
+ if ((meta_id = db_get_dw(hContact, META_PROTO, META_ID,(DWORD)-1)) != (DWORD)-1)
Meta_CopyData(hContact);
- }
+
hContact = db_find_next(hContact);
}
}
@@ -1210,7 +1202,7 @@ INT_PTR Meta_ContactMenuFunc(WPARAM wParam, LPARAM lParam)
INT_PTR Meta_FileSend(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *) lParam;
+ CCSDATA *ccs = (CCSDATA*)lParam;
char *proto = 0;
DWORD default_contact_number;
@@ -1256,7 +1248,7 @@ INT_PTR Meta_FileSend(WPARAM wParam, LPARAM lParam)
INT_PTR Meta_GetAwayMsg(WPARAM wParam, LPARAM lParam)
{
- CCSDATA *ccs = (CCSDATA *) lParam;
+ CCSDATA *ccs = (CCSDATA*)lParam;
char *proto = 0;
DWORD default_contact_number;
@@ -1325,7 +1317,7 @@ INT_PTR Meta_GetAvatarInfo(WPARAM wParam, LPARAM lParam) {
}
INT_PTR Meta_GetInfo(WPARAM wParam, LPARAM lParam) {
- CCSDATA *ccs = (CCSDATA *) lParam;
+ CCSDATA *ccs = (CCSDATA*)lParam;
char *proto = 0;
DWORD default_contact_number;
diff --git a/plugins/MetaContacts/src/meta_utils.cpp b/plugins/MetaContacts/src/meta_utils.cpp
index 2217834d22..8f51404d61 100644
--- a/plugins/MetaContacts/src/meta_utils.cpp
+++ b/plugins/MetaContacts/src/meta_utils.cpp
@@ -711,7 +711,8 @@ void CopyStatusData(HANDLE hMeta)
}
}
- if (bDoneStatus && bDoneXStatus) break;
+ if (bDoneStatus && bDoneXStatus)
+ break;
}
if ( !bDoneStatus) db_unset(hMeta, "CList", "StatusMsg");
@@ -1285,7 +1286,8 @@ int Meta_CopyContactNick(HANDLE hMeta, HANDLE hContact) {
return 1;
}
-int Meta_SetAllNicks() {
+int Meta_SetAllNicks()
+{
HANDLE hContact = db_find_first(), most_online;
while ( hContact != NULL ) {
@@ -1301,8 +1303,10 @@ int Meta_SetAllNicks() {
return 0;
}
-int Meta_IsHiddenGroup(const char *group_name) {
- if (group_name && !strcmp(group_name, META_HIDDEN_GROUP)) return 1;
+int Meta_IsHiddenGroup(const char *group_name)
+{
+ if (group_name && !strcmp(group_name, META_HIDDEN_GROUP))
+ return 1;
return 0;
}
diff --git a/plugins/MetaContacts/src/metacontacts.h b/plugins/MetaContacts/src/metacontacts.h
index 8a0abca59f..a41c8e4ba9 100644
--- a/plugins/MetaContacts/src/metacontacts.h
+++ b/plugins/MetaContacts/src/metacontacts.h
@@ -146,27 +146,28 @@ enum MenuDisplayNameType {DNT_UID = 0, DNT_DID = 1};
enum MenuFunctionType {FT_MSG = 0, FT_MENU = 1, FT_INFO = 2};
enum CListDisplayNameType {CNNT_NICK = 0, CNNT_DISPLAYNAME = 1};
-typedef struct tag_MetaOptions {
- BOOL set_default_on_recv;
- BOOL always_use_default;
- BOOL suppress_status;
+struct MetaOptions
+{
+ BYTE set_default_on_recv;
+ BYTE always_use_default;
+ BYTE suppress_status;
+ BYTE copy_subcontact_history;
+ BYTE subcontact_windows;
+ BYTE metahistory;
+ BYTE subhistory;
+ BYTE copydata;
+ BYTE lockHandle;
+ BYTE temp_default;
+ BYTE flash_meta_message_icon;
+ BYTE copy_userinfo;
+ BYTE use_proto_recv;
+
int menu_contact_label;
- int clist_contact_name;
int menu_function;
- BOOL suppress_proto;
- BOOL copy_subcontact_history;
+ int clist_contact_name;
int days_history;
int set_status_from_offline_delay;
- BOOL subcontact_windows;
- BOOL metahistory;
- BOOL subhistory;
- BOOL copydata;
- BOOL lockHandle;
- BOOL temp_default;
- BOOL flash_meta_message_icon;
- BOOL copy_userinfo;
- BOOL use_proto_recv;
-} MetaOptions;
+};
extern MetaOptions options;
diff --git a/plugins/MetaContacts/src/resource.h b/plugins/MetaContacts/src/resource.h
index fe813d2ccf..87507e2f35 100644
--- a/plugins/MetaContacts/src/resource.h
+++ b/plugins/MetaContacts/src/resource.h
@@ -38,7 +38,6 @@
#define IDC_RAD_NICK 1024
#define IDC_RAD_NAME 1025
#define IDC_LST_CONTACTS 1026
-#define IDC_CHK_SUPPRESSPROTO 1026
#define IDC_BTN_SETDEFAULT 1027
#define IDC_CHK_COPYHISTORY 1027
#define IDC_BTN_UP 1028