summaryrefslogtreecommitdiff
path: root/plugins/StartupSilence/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-03-18 12:46:23 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-03-18 12:46:23 +0300
commit64c29727ee3ccca5581a2103d16536f323fafe57 (patch)
tree278ccf094849c2f0e8d2a12cc0f6295996c77fc1 /plugins/StartupSilence/src
parentd07899c7630040511591755c86371a9fbd58da34 (diff)
fixes #2784 (StartupSilence: remove "Main menu item" option)
Diffstat (limited to 'plugins/StartupSilence/src')
-rw-r--r--plugins/StartupSilence/src/main.cpp27
-rw-r--r--plugins/StartupSilence/src/resource.h1
-rw-r--r--plugins/StartupSilence/src/version.h8
3 files changed, 12 insertions, 24 deletions
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp
index 40f0f9741d..2b524c864d 100644
--- a/plugins/StartupSilence/src/main.cpp
+++ b/plugins/StartupSilence/src/main.cpp
@@ -26,18 +26,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
CMPlugin g_plugin;
-HGENMENU hSSMenuToggleOnOff;
-HANDLE hOptionsInitialize;
HANDLE hTTBarloaded = nullptr;
HANDLE Buttons = nullptr;
-int DisablePopup(WPARAM wParam, LPARAM lParam);
-void RemoveTTButtons();
BYTE Enabled;
DWORD delay;
BYTE PopUp;
DWORD PopUpTime;
-BYTE MenuItem;
BYTE TTBButtons;
BYTE DefSound;
BYTE DefPopup;
@@ -183,7 +178,6 @@ void LoadSettings()
delay = g_plugin.getDword(DelayComp);
PopUp = g_plugin.getByte(PopUpComp);
PopUpTime = g_plugin.getDword(PopUpTimeComp);
- MenuItem = g_plugin.getByte(MenuitemComp);
TTBButtons = g_plugin.getByte(TTBButtonsComp);
DefSound = g_plugin.getByte(DefSoundComp);
DefPopup = g_plugin.getByte(DefPopupComp);
@@ -207,8 +201,7 @@ static INT_PTR StartupSilenceEnabled(WPARAM, LPARAM)
{
g_plugin.setByte(EnabledComp, !Enabled);
LoadSettings();
- if (MenuItem == 1)
- UpdateMenu();
+ UpdateMenu();
if (PopUp == 1) {
wchar_t * lpwzText = Enabled == 1 ? S_MODE_CHANGEDON : S_MODE_CHANGEDOFF;
POPUPDATAW ppd;
@@ -231,6 +224,8 @@ static INT_PTR SilenceConnection(WPARAM wParam, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
+HGENMENU hSSMenuToggleOnOff;
+
static INT_PTR InitMenu()
{
CMenuItem mi(&g_plugin);
@@ -283,6 +278,9 @@ void RemoveTTButtons()
ttbButtons.destroy();
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// Options
+
static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
@@ -302,8 +300,6 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_SSSPIN2, UDM_SETPOS, 0, MAKELONG((PopUpTime), 0));
SendDlgItemMessage(hwndDlg, IDC_SSPOPUPTIME, EM_LIMITTEXT, (WPARAM)3, 0);
- CheckDlgButton(hwndDlg, IDC_MENU, (MenuItem == 1) ? BST_CHECKED : BST_UNCHECKED);
-
CheckDlgButton(hwndDlg, IDC_TTB, (TTBButtons == 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DEFPOPUP, (DefPopup == 1) ? BST_CHECKED : BST_UNCHECKED);
@@ -339,10 +335,6 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
PopUp = db_set_b(0, MODULENAME, PopUpComp, IsDlgButtonChecked(hwndDlg, IDC_DELAY2) == BST_CHECKED);
break;
- case IDC_MENU:
- MenuItem = db_set_b(0, MODULENAME, MenuitemComp, IsDlgButtonChecked(hwndDlg, IDC_MENU) == BST_CHECKED);
- break;
-
case IDC_TTB:
if (!hTTBarloaded) {
MessageBox(nullptr, NEEDTTBMOD, NOTICE, MB_OK);
@@ -378,7 +370,6 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_SSSPIN, UDM_SETPOS, 0, MAKELONG((delay), 0));
CheckDlgButton(hwndDlg, IDC_DELAY2, (PopUp == 1) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_SSSPIN2, UDM_SETPOS, 0, MAKELONG((PopUpTime), 0));
- CheckDlgButton(hwndDlg, IDC_MENU, (MenuItem == 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TTB, (TTBButtons == 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DEFPOPUP, (DefPopup == 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DEFSOUNDS, (DefSound == 1) ? BST_CHECKED : BST_UNCHECKED);
@@ -429,10 +420,8 @@ int CMPlugin::Load()
CreateServiceFunction(SS_SERVICE_NAME, StartupSilenceEnabled);
CreateServiceFunction(SS_SILENCE_CONNECTION, SilenceConnection);
- if (MenuItem == 1) {
- g_plugin.registerIcon(MENU_NAME, iconList, MENU_NAME);
- InitMenu();
- }
+ g_plugin.registerIcon(MENU_NAME, iconList, MENU_NAME);
+ InitMenu();
return 0;
}
diff --git a/plugins/StartupSilence/src/resource.h b/plugins/StartupSilence/src/resource.h
index a14aa93342..e7ba0e7214 100644
--- a/plugins/StartupSilence/src/resource.h
+++ b/plugins/StartupSilence/src/resource.h
@@ -15,7 +15,6 @@
#define IDC_DELAY2 40004
#define IDC_SSPOPUPTIME 40005
#define IDC_SSSPIN2 40006
-#define IDC_MENU 40007
#define IDC_TTB 40008
#define IDC_RESETDEFAULT 40009
#define IDC_HST 40010
diff --git a/plugins/StartupSilence/src/version.h b/plugins/StartupSilence/src/version.h
index 1c9eafbd35..8c062d3577 100644
--- a/plugins/StartupSilence/src/version.h
+++ b/plugins/StartupSilence/src/version.h
@@ -5,10 +5,10 @@
// find it under Project properties - Configuration properties - Resource - General - Preprocessor definitions)
// plugin version part
-#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 2
-#define __RELEASE_NUM 0
-#define __BUILD_NUM 0
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 2
+#define __RELEASE_NUM 0
+#define __BUILD_NUM 1
// stuff that will be used in PluginInfo section and in Version resource
#define __PLUGIN_NAME "StartupSilence"