diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/StartupSilence/res/StartupSilence.rc | 49 | ||||
-rw-r--r-- | plugins/StartupSilence/src/StartupSilence.h | 1 | ||||
-rw-r--r-- | plugins/StartupSilence/src/main.cpp | 72 | ||||
-rw-r--r-- | plugins/StartupSilence/src/resource.h | 9 | ||||
-rw-r--r-- | plugins/StartupSilence/src/version.h | 2 |
5 files changed, 105 insertions, 28 deletions
diff --git a/plugins/StartupSilence/res/StartupSilence.rc b/plugins/StartupSilence/res/StartupSilence.rc index e71ec62d3d..74bb4407a2 100644 --- a/plugins/StartupSilence/res/StartupSilence.rc +++ b/plugins/StartupSilence/res/StartupSilence.rc @@ -13,7 +13,7 @@ #undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
-// NEUTRAL resources
+// NEUTRAL resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
@@ -24,30 +24,33 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL // Dialog
//
-IDD_SSOPT DIALOGEX 0, 0, 312, 216
+IDD_SSOPT DIALOGEX 0, 0, 312, 238
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_BORDER
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Silence at Startup",IDC_STATIC,3,0,304,211
- LTEXT "Settings for the next Computer Name:",IDC_STATIC,13,15,182,8
- EDITTEXT IDC_HST,24,27,271,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
- CONTROL "Enable silence at startup",IDC_DELAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,46,259,9
- EDITTEXT IDC_SSTIME,47,59,34,14,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "spin1",IDC_SSSPIN,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,77,59,12,15
- RTEXT "for",IDC_STATIC,13,61,25,9
- LTEXT "10-300 seconds (Default 20)",IDC_STATIC,84,61,161,9
- CONTROL "Show Popup notification",IDC_DELAY2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,81,259,9
- EDITTEXT IDC_SSPOPUPTIME,47,95,34,14,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "spin2",IDC_SSSPIN2,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,77,95,12,15
- LTEXT "Popup time 1-30 seconds (Default 5)",IDC_STATIC,83,97,161,9
- CONTROL "Main Menu Item (plugin reload or Miranda restart required)",IDC_MENU,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,115,259,9
- CONTROL "TopToolBar button (Miranda restart required)",IDC_TTB,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,134,259,9
- PUSHBUTTON "Reset to default\r\n(for this computer)",IDC_RESETDEFAULT,202,183,100,23,BS_CENTER | BS_VCENTER | BS_MULTILINE | NOT WS_TABSTOP
- CTEXT "You need to configure it once for each computer, where you run your Miranda NG.",IDC_STATIC,11,152,286,28
- LTEXT "No Apply button required.",IDC_STATIC,12,196,184,8
+ GROUPBOX "Silence at Startup",IDC_STATIC,3,0,304,133
+ LTEXT "Settings for the next Computer Name:",IDC_STATIC,11,11,182,8
+ EDITTEXT IDC_HST,24,22,271,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
+ CONTROL "Enable silence at startup",IDC_DELAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,34,259,9
+ EDITTEXT IDC_SSTIME,47,45,34,14,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "spin1",IDC_SSSPIN,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,77,45,12,15
+ RTEXT "for",IDC_STATIC,13,47,25,9
+ LTEXT "10-300 seconds (Default 20)",IDC_STATIC,84,47,161,9
+ CONTROL "Show Popup notification",IDC_DELAY2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,61,259,9
+ EDITTEXT IDC_SSPOPUPTIME,47,75,34,14,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "spin2",IDC_SSSPIN2,"msctls_updown32",UDS_WRAP | UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,77,75,12,15
+ LTEXT "Popup time 1-30 seconds (Default 5)",IDC_STATIC,83,77,161,9
+ CONTROL "Main Menu Item (plugin reload or Miranda restart required)",IDC_MENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,92,259,9
+ CONTROL "TopToolBar button (Miranda restart required)",IDC_TTB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,105,259,9
+ PUSHBUTTON "Reset to default\r\n(for this computer)",IDC_RESETDEFAULT,207,215,100,20,BS_CENTER | BS_VCENTER | BS_MULTILINE | NOT WS_TABSTOP
+ CTEXT "You need to configure it once for each computer, where you run your Miranda NG.",IDC_STATIC,7,195,295,20
+ LTEXT "No Apply button required.",IDC_STATIC,11,220,184,8
+ GROUPBOX "After startup set:",IDC_STATIC,3,136,303,57
+ CONTROL "Filtered popups only (leave uncheck to no popups)",IDC_DEFPOPUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,167,274,9
+ CONTROL "Enable sounds",IDC_DEFSOUNDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,181,287,9
+ CONTROL "Allow to set sounds and filtered popups only after startup (uncheck for all popups and sounds)",IDC_RESTORE,"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,11,147,290,19
+ CONTROL "Allow mRadio or Weather popups, etc...",IDC_NONSTATUSES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,118,259,9
END
@@ -100,12 +103,12 @@ GUIDELINES DESIGNINFO BEGIN
IDD_SSOPT, DIALOG
BEGIN
- BOTTOMMARGIN, 211
+ BOTTOMMARGIN, 235
END
END
#endif // APSTUDIO_INVOKED
-#endif // NEUTRAL resources
+#endif // NEUTRAL resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/StartupSilence/src/StartupSilence.h b/plugins/StartupSilence/src/StartupSilence.h index af5e65d2c0..41f0ae88d2 100644 --- a/plugins/StartupSilence/src/StartupSilence.h +++ b/plugins/StartupSilence/src/StartupSilence.h @@ -11,6 +11,7 @@ #include <m_database.h>
#include <m_icolib.h>
#include <m_options.h>
+#include <m_protocols.h>
#include <m_system.h>
#include <m_system_cpp.h>
#include "win2k.h"
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index a35b0e792c..208f2a2f9a 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -44,6 +44,10 @@ BYTE PopUp; DWORD PopUpTime;
BYTE MenuItem;
BYTE TTBButtons;
+BYTE DefSound;
+BYTE DefPopup;
+BYTE DefEnabled;
+BYTE NonStatusAllow;
BYTE timer;
char hostname[MAX_PATH] = "";
char EnabledComp[MAX_PATH] = "";
@@ -52,6 +56,10 @@ char PopUpComp[MAX_PATH] = ""; char PopUpTimeComp[MAX_PATH] = "";
char MenuitemComp[MAX_PATH] = "";
char TTBButtonsComp[MAX_PATH] = "";
+char DefSoundComp[MAX_PATH] = "";
+char DefPopupComp[MAX_PATH] = "";
+char DefEnabledComp[MAX_PATH] = "";
+char NonStatusAllowComp[MAX_PATH] = "";
static LIST<void> ttbButtons(1);
@@ -120,9 +128,22 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) int DisablePopup(WPARAM wParam, LPARAM lParam)
{
- if (timer == 2)
+ if (DefEnabled == 1 && DefPopup == 0) //All popups are blocked
return 1;
- return 0;
+
+ if ((timer == 2 && NonStatusAllow == 1) //filtering while timer
+ || (DefPopup == 1 && DefEnabled == 1)) //also filtered only: We do not run next lines every time
+ //if "Filtered only..." is unchecked --->
+ {
+ HANDLE hContact = (HANDLE)wParam;
+ if (hContact != NULL) {
+ char* cp = GetContactProto(hContact);
+ if ( !strcmp(cp, "Weather") || !strcmp(cp, "mRadio") )
+ return 0;
+ }
+ return 1; //filtering while timer
+ }
+ return 0; //---> just allow all popups with this return
}
void EnablePopupModule()
@@ -144,6 +165,10 @@ void InitSettings() mir_snprintf(PopUpTimeComp, SIZEOF(PopUpTimeComp), "%s_PopUpTime", hostname);
mir_snprintf(MenuitemComp, SIZEOF(MenuitemComp), "%s_MenuItem", hostname);
mir_snprintf(TTBButtonsComp, SIZEOF(TTBButtonsComp), "%s_TTBButtons", hostname);
+ mir_snprintf(DefSoundComp, SIZEOF(DefSoundComp), "%s_DefSound", hostname);
+ mir_snprintf(DefPopupComp, SIZEOF(DefPopupComp), "%s_DefPopup", hostname);
+ mir_snprintf(DefEnabledComp, SIZEOF(DefEnabledComp), "%s_DefEnabled", hostname);
+ mir_snprintf(NonStatusAllowComp, SIZEOF(NonStatusAllowComp), "%s_NonStatusAllow", hostname);
}
//first run on the host, initial setting
if (!(delay = db_get_dw(NULL, MODULE_NAME, DelayComp, 0)))
@@ -159,6 +184,10 @@ void DefSettings() db_set_dw(NULL, MODULE_NAME, PopUpTimeComp, 5);
db_set_b(NULL, MODULE_NAME, MenuitemComp, 1);
db_set_b(NULL, MODULE_NAME, TTBButtonsComp, 0);
+ db_set_b(NULL, MODULE_NAME, DefSoundComp, 1);
+ db_set_b(NULL, MODULE_NAME, DefPopupComp, 0);
+ db_set_b(NULL, MODULE_NAME, DefEnabledComp, 0);
+ db_set_b(NULL, MODULE_NAME, NonStatusAllowComp, 1);
LoadSettings();
}
void LoadSettings()
@@ -169,6 +198,10 @@ void LoadSettings() PopUpTime = db_get_dw(NULL, MODULE_NAME, PopUpTimeComp, 0);
MenuItem = db_get_b(NULL, MODULE_NAME, MenuitemComp, 0);
TTBButtons = db_get_b(NULL, MODULE_NAME, TTBButtonsComp, 0);
+ DefSound = db_get_b(NULL, MODULE_NAME, DefSoundComp, 0);
+ DefPopup = db_get_b(NULL, MODULE_NAME, DefPopupComp, 0);
+ DefEnabled = db_get_b(NULL, MODULE_NAME, DefEnabledComp, 0);
+ NonStatusAllow = db_get_b(NULL, MODULE_NAME, NonStatusAllowComp, 0);
if (PopUpTime < 1)
PopUpTime = (DWORD)1;
if (PopUpTime > 30)
@@ -212,12 +245,15 @@ static INT_PTR AdvSt() Sleep(delay * 1000);
timer = 0;
- db_set_b(NULL, "Skin", "UseSound", 1);
if (PopUp == 1) {
lptzText = ALL_ENABLED;
wcsncpy_s(ppd.lptzText, lptzText, size_t(lptzText));
PUAddPopupT(&ppd);
}
+ if (DefEnabled == 1) { //predefined sound setting
+ db_set_b(NULL, "Skin", "UseSound", DefSound);
+ }
+ else db_set_b(NULL, "Skin", "UseSound", 1); //or enable sounds every starts
}
return 0;
}
@@ -339,6 +375,11 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP 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);
+ CheckDlgButton(hwndDlg, IDC_RESTORE, (DefEnabled == 1) ? BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NONSTATUSES, (NonStatusAllow == 1) ? BST_CHECKED:BST_UNCHECKED);
}
break;
@@ -386,6 +427,27 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
else TTBButtons = (BYTE)db_set_b(NULL, MODULE_NAME, TTBButtonsComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_TTB) == BST_CHECKED ? 1 : 0));
break;
+
+ case IDC_DEFPOPUP:
+ db_set_b(NULL, MODULE_NAME, DefPopupComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DEFPOPUP) == BST_CHECKED ? 1 : 0));
+ DefPopup = db_get_b(NULL, MODULE_NAME, DefPopupComp, 0);
+ break;
+
+ case IDC_DEFSOUNDS:
+ db_set_b(NULL, MODULE_NAME, DefSoundComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DEFSOUNDS) == BST_CHECKED ? 1 : 0));
+ DefSound = db_get_b(NULL, MODULE_NAME, DefSoundComp, 0);
+ break;
+
+ case IDC_RESTORE:
+ db_set_b(NULL, MODULE_NAME, DefEnabledComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_RESTORE) == BST_CHECKED ? 1 : 0));
+ DefEnabled = db_get_b(NULL, MODULE_NAME, DefEnabledComp, 0);
+ break;
+
+ case IDC_NONSTATUSES:
+ db_set_b(NULL, MODULE_NAME, NonStatusAllowComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NONSTATUSES) == BST_CHECKED ? 1 : 0));
+ NonStatusAllow = db_get_b(NULL, MODULE_NAME, NonStatusAllowComp, 0);
+ break;
+
case IDC_RESETDEFAULT:
DefSettings();
CheckDlgButton(hwndDlg, IDC_DELAY, (Enabled == 1) ? BST_CHECKED:BST_UNCHECKED);
@@ -394,6 +456,10 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP 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);
+ CheckDlgButton(hwndDlg, IDC_RESTORE, (DefEnabled == 1) ? BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NONSTATUSES, (NonStatusAllow == 1) ? BST_CHECKED:BST_UNCHECKED);
break;
}
break;
diff --git a/plugins/StartupSilence/src/resource.h b/plugins/StartupSilence/src/resource.h index 1abbf2e44b..df8183de0e 100644 --- a/plugins/StartupSilence/src/resource.h +++ b/plugins/StartupSilence/src/resource.h @@ -19,13 +19,20 @@ #define IDC_RESETDEFAULT 40009
#define IDC_HST 40010
#define IDC_HOSTNAME 40011
+#define IDC_NONSTATUSES 40012
+#define IDC_NONSTATUSES 40012
+#define IDC_RESTORE 40013
+#define IDC_DEFSOUNDS 40014
+#define IDC_DEFPOPUP 40015
+
+
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 107
-#define _APS_NEXT_COMMAND_VALUE 40012
+#define _APS_NEXT_COMMAND_VALUE 40016
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
diff --git a/plugins/StartupSilence/src/version.h b/plugins/StartupSilence/src/version.h index bebde25d8a..23b3375a5c 100644 --- a/plugins/StartupSilence/src/version.h +++ b/plugins/StartupSilence/src/version.h @@ -6,7 +6,7 @@ // plugin version part
#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 1
+#define __MINOR_VERSION 2
#define __RELEASE_NUM 0
#define __BUILD_NUM 0
|