summaryrefslogtreecommitdiff
path: root/plugins/SimpleStatusMsg/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-04-04 20:21:24 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-04-04 20:21:24 +0300
commit4656e75294f503f4689ad057dbf03ba559364703 (patch)
treedc373a1cdf2a5141188dc8ef8685fcb6d9216170 /plugins/SimpleStatusMsg/src
parent5af1168b7f7b246a74927d01dda2d9b9a016667d (diff)
fixes #2833 (SimpleStatusMsg: remove "Show Status message ..." item in status menu)
Diffstat (limited to 'plugins/SimpleStatusMsg/src')
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp2
-rw-r--r--plugins/SimpleStatusMsg/src/options.cpp28
-rw-r--r--plugins/SimpleStatusMsg/src/resource.h3
-rw-r--r--plugins/SimpleStatusMsg/src/version.h2
4 files changed, 12 insertions, 23 deletions
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index 96ea1e0525..dae491137a 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -1268,8 +1268,6 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM)
CMenuItem mi(&g_plugin);
mi.flags = CMIF_UNICODE;
- if (!g_plugin.getByte("ShowStatusMenuItem", 1))
- mi.flags |= CMIF_HIDDEN;
mi.hIcolibItem = g_plugin.getIconHandle(IDI_CSMSG);
mi.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
mi.name.w = LPGENW("Status message...");
diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp
index d733c4a376..37bb197a73 100644
--- a/plugins/SimpleStatusMsg/src/options.cpp
+++ b/plugins/SimpleStatusMsg/src/options.cpp
@@ -120,15 +120,12 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
SendDlgItemMessage(hwndDlg, IDC_SMAXLENGTH, UDM_SETRANGE32, 1, 1024);
SendDlgItemMessage(hwndDlg, IDC_EMAXLENGTH, EM_LIMITTEXT, 4, 0);
- data->status_msg = (struct SingleStatusMsg *)mir_alloc(sizeof(struct SingleStatusMsg)*(accounts->count + 1));
+ data->status_msg = (struct SingleStatusMsg *)mir_alloc(sizeof(struct SingleStatusMsg) * (accounts->count + 1));
for (i = ID_STATUS_ONLINE; i <= ID_STATUS_MAX; i++) {
if (accounts->statusMsgFlags & Proto_Status2Flag(i)) {
index = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_INSERTSTRING, -1, (LPARAM)Clist_GetStatusModeDescription(i, 0));
if (index != CB_ERR && index != CB_ERRSPACE) {
- int j;
- char setting[80];
-
SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETITEMDATA, (WPARAM)index, (LPARAM)i - ID_STATUS_ONLINE);
val = g_plugin.getByte((char *)StatusModeToDbSetting(i, "Flags"), STATUS_DEFAULT);
@@ -136,11 +133,12 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
ptrW text(db_get_wsa(0, "SRAway", StatusModeToDbSetting(i, "Default"), GetDefaultMessage(i)));
mir_wstrncpy(data->status_msg[0].msg[i - ID_STATUS_ONLINE], text, 1024);
- for (j = 0; j < accounts->count; j++) {
+ for (int j = 0; j < accounts->count; j++) {
auto *pa = accounts->pa[j];
if (!pa->IsEnabled() || !CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) || !(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND))
continue;
+ char setting[80];
mir_snprintf(setting, "%sFlags", pa->szModuleName);
val = g_plugin.getByte((char *)StatusModeToDbSetting(i, setting), STATUS_DEFAULT);
data->status_msg[j + 1].flags[i - ID_STATUS_ONLINE] = val;
@@ -153,7 +151,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
}
SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETCURSEL, 0, 0);
- data->proto_msg = (struct SingleProtoMsg *)mir_alloc(sizeof(struct SingleProtoMsg)*(accounts->count + 1));
+ data->proto_msg = (struct SingleProtoMsg *)mir_alloc(sizeof(struct SingleProtoMsg) * (accounts->count + 1));
if (!data->proto_msg) {
// TODO not really needed?
EnableWindow(GetDlgItem(hwndDlg, IDC_CBOPTPROTO), FALSE);
@@ -256,16 +254,14 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
case EN_KILLFOCUS:
{
BOOL translated;
- int val, i;
-
- val = GetDlgItemInt(hwndDlg, IDC_EMAXLENGTH, &translated, FALSE);
+ int val = GetDlgItemInt(hwndDlg, IDC_EMAXLENGTH, &translated, FALSE);
if (translated && val > 1024)
SetDlgItemInt(hwndDlg, IDC_EMAXLENGTH, 1024, FALSE);
if (translated && val < 1)
SetDlgItemInt(hwndDlg, IDC_EMAXLENGTH, 1, FALSE);
val = GetDlgItemInt(hwndDlg, IDC_EMAXLENGTH, &translated, FALSE);
- i = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0);
+ int i = SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTPROTO, CB_GETCURSEL, 0, 0), 0);
data->proto_msg[i].max_length = val;
break;
}
@@ -280,7 +276,6 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
int l, k, status_modes = 0, newindex = 0;
int i = SendMessage((HWND)lParam, CB_GETITEMDATA, (WPARAM)SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0), 0);
-
if (i == 0) {
EnableWindow(GetDlgItem(hwndDlg, IDC_MAXLENGTH), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_EMAXLENGTH), FALSE);
@@ -381,8 +376,7 @@ INT_PTR CALLBACK DlgOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETCURSEL, 0, 0);
j = SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETITEMDATA, (WPARAM)SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_GETCURSEL, 0, 0), 0);
}
- else
- SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETCURSEL, (WPARAM)newindex, 0);
+ else SendDlgItemMessage(hwndDlg, IDC_CBOPTSTATUS, CB_SETCURSEL, (WPARAM)newindex, 0);
if (data->status_msg[i].flags[j] & STATUS_SHOW_DLG)
CheckDlgButton(hwndDlg, IDC_COPTMSG1, BST_CHECKED);
@@ -1128,7 +1122,6 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w
CheckDlgButton(hwndDlg, IDC_CCLOSEWND, g_plugin.getByte("AutoClose", 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CRPOSWND, !g_plugin.getByte("WinCentered", 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_CREMOVECR, g_plugin.getByte("RemoveCR", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CSHOWSMSG, g_plugin.getByte("ShowStatusMenuItem", 1) ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndDlg, WM_USER + 2, 0, 0);
return TRUE;
@@ -1264,9 +1257,8 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w
g_plugin.setByte("DlgTime", (BYTE)GetDlgItemInt(hwndDlg, IDC_ETIMEOUT, nullptr, FALSE));
g_plugin.setByte("WinCentered", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CRPOSWND) != BST_CHECKED));
g_plugin.setByte("RemoveCR", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CREMOVECR) == BST_CHECKED));
- g_plugin.setByte("ShowStatusMenuItem", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CSHOWSMSG) == BST_CHECKED));
- RebuildStatusMenu();
+ RebuildStatusMenu();
return TRUE;
}
break;
@@ -1296,7 +1288,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
data->setdelay = (int *)mir_alloc(sizeof(int) * accounts->count);
for (int i = 0; i < accounts->count; ++i) {
auto *pa = accounts->pa[i];
- if (!pa->IsEnabled() || !(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) &~CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
+ if (!pa->IsEnabled() || !(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
int index = SendDlgItemMessage(hwndDlg, IDC_LISTPROTO, LB_ADDSTRING, 0, (LPARAM)pa->tszAccountName);
@@ -1462,7 +1454,7 @@ static INT_PTR CALLBACK DlgStatusOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wPa
if (((LPNMHDR)lParam)->idFrom == 0 && ((LPNMHDR)lParam)->code == PSN_APPLY) {
for (int i = 0; i < accounts->count; i++) {
auto *pa = accounts->pa[i];
- if (!pa->IsEnabled() || !(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
+ if (!pa->IsEnabled() || !(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_5, 0)))
continue;
char szSetting[80];
diff --git a/plugins/SimpleStatusMsg/src/resource.h b/plugins/SimpleStatusMsg/src/resource.h
index a7a25c8396..1270b4544f 100644
--- a/plugins/SimpleStatusMsg/src/resource.h
+++ b/plugins/SimpleStatusMsg/src/resource.h
@@ -55,7 +55,6 @@
#define IDC_COPTMSG2 1036
#define IDC_VARSHELP 1037
#define IDC_CBOPTBUTTONS 1038
-#define IDC_CSHOWSMSG 1039
#define IDC_CRPOSWND 1040
#define IDC_ESECUPDTMSG 1041
#define IDC_CUPDATEMSG 1042
@@ -117,7 +116,7 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 117
+#define _APS_NEXT_RESOURCE_VALUE 118
#define _APS_NEXT_COMMAND_VALUE 40037
#define _APS_NEXT_CONTROL_VALUE 1061
#define _APS_NEXT_SYMED_VALUE 100
diff --git a/plugins/SimpleStatusMsg/src/version.h b/plugins/SimpleStatusMsg/src/version.h
index 0e2449ad2e..afa8258d8e 100644
--- a/plugins/SimpleStatusMsg/src/version.h
+++ b/plugins/SimpleStatusMsg/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 1
#define __MINOR_VERSION 9
#define __RELEASE_NUM 0
-#define __BUILD_NUM 8
+#define __BUILD_NUM 9
#include <stdver.h>