From cb0c1e83a2ce8a4e14cec5350915f84e73712c75 Mon Sep 17 00:00:00 2001 From: Rob Swindell <rob@synchro.net> Date: Sat, 17 Apr 2021 21:12:42 -0700 Subject: [PATCH] Move all common sound (WAV) file configuration to its own dialog Increment the version in the project file to v3.19a. --- src/sbbs3/ctrl/FtpCfgDlgUnit.cpp | 49 ++----- src/sbbs3/ctrl/FtpCfgDlgUnit.dfm | 94 ++------------ src/sbbs3/ctrl/FtpCfgDlgUnit.h | 14 +- src/sbbs3/ctrl/MailCfgDlgUnit.cpp | 9 ++ src/sbbs3/ctrl/MailCfgDlgUnit.dfm | 21 ++- src/sbbs3/ctrl/MailCfgDlgUnit.h | 2 + src/sbbs3/ctrl/PropertiesDlgUnit.cpp | 10 ++ src/sbbs3/ctrl/PropertiesDlgUnit.dfm | 81 +++++++----- src/sbbs3/ctrl/PropertiesDlgUnit.h | 9 +- src/sbbs3/ctrl/ServicesCfgDlgUnit.cpp | 38 ++---- src/sbbs3/ctrl/ServicesCfgDlgUnit.dfm | 73 ++--------- src/sbbs3/ctrl/ServicesCfgDlgUnit.h | 11 +- src/sbbs3/ctrl/SoundCfgDlgUnit.cpp | 85 +++++++++++++ src/sbbs3/ctrl/SoundCfgDlgUnit.dfm | 177 ++++++++++++++++++++++++++ src/sbbs3/ctrl/SoundCfgDlgUnit.h | 54 ++++++++ src/sbbs3/ctrl/TelnetCfgDlgUnit.cpp | 36 ++---- src/sbbs3/ctrl/TelnetCfgDlgUnit.dfm | 63 ++------- src/sbbs3/ctrl/TelnetCfgDlgUnit.h | 10 +- src/sbbs3/ctrl/WebCfgDlgUnit.cpp | 48 ++----- src/sbbs3/ctrl/WebCfgDlgUnit.dfm | 94 ++------------ src/sbbs3/ctrl/WebCfgDlgUnit.h | 14 +- src/sbbs3/ctrl/sbbsctrl.bpr | 29 +++-- src/sbbs3/ctrl/sbbsctrl.cpp | 2 + src/sbbs3/ctrl/sbbsctrl.res | Bin 1636 -> 1708 bytes 24 files changed, 506 insertions(+), 517 deletions(-) create mode 100644 src/sbbs3/ctrl/SoundCfgDlgUnit.cpp create mode 100644 src/sbbs3/ctrl/SoundCfgDlgUnit.dfm create mode 100644 src/sbbs3/ctrl/SoundCfgDlgUnit.h diff --git a/src/sbbs3/ctrl/FtpCfgDlgUnit.cpp b/src/sbbs3/ctrl/FtpCfgDlgUnit.cpp index 57610c4e42..5c8e8d753c 100644 --- a/src/sbbs3/ctrl/FtpCfgDlgUnit.cpp +++ b/src/sbbs3/ctrl/FtpCfgDlgUnit.cpp @@ -26,8 +26,8 @@ #include "MainFormUnit.h" #include "FtpCfgDlgUnit.h" #include "TextFileEditUnit.h" +#include "SoundCfgDlgUnit.h" #include <stdio.h> // sprintf() -#include <mmsystem.h> // sndPlaySound() //--------------------------------------------------------------------- #pragma resource "*.dfm" TFtpCfgDlg *FtpCfgDlg; @@ -72,9 +72,6 @@ void __fastcall TFtpCfgDlg::FormShow(TObject *Sender) MaxConConEdit->Text = AnsiString((int)MainForm->ftp_startup.max_concurrent_connections); IndexFileNameEdit->Text=AnsiString(MainForm->ftp_startup.index_file_name); - AnswerSoundEdit->Text=AnsiString(MainForm->ftp_startup.sound.answer); - HangupSoundEdit->Text=AnsiString(MainForm->ftp_startup.sound.hangup); - HackAttemptSoundEdit->Text=AnsiString(MainForm->ftp_startup.sound.hack); CmdLogCheckBox->Checked=MainForm->ftp_startup.options&FTP_OPT_DEBUG_RX; DebugTxCheckBox->Checked=MainForm->ftp_startup.options&FTP_OPT_DEBUG_TX; DebugDataCheckBox->Checked=MainForm->ftp_startup.options&FTP_OPT_DEBUG_DATA; @@ -135,13 +132,6 @@ void __fastcall TFtpCfgDlg::OKBtnClick(TObject *Sender) SAFECOPY(MainForm->ftp_startup.index_file_name ,IndexFileNameEdit->Text.c_str()); - SAFECOPY(MainForm->ftp_startup.sound.answer - ,AnswerSoundEdit->Text.c_str()); - SAFECOPY(MainForm->ftp_startup.sound.hangup - ,HangupSoundEdit->Text.c_str()); - SAFECOPY(MainForm->ftp_startup.sound.hack - ,HackAttemptSoundEdit->Text.c_str()); - if(DebugTxCheckBox->Checked==true) MainForm->ftp_startup.options|=FTP_OPT_DEBUG_TX; else @@ -183,35 +173,6 @@ void __fastcall TFtpCfgDlg::OKBtnClick(TObject *Sender) } //--------------------------------------------------------------------------- -void __fastcall TFtpCfgDlg::AnswerSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=AnswerSoundEdit->Text; - if(OpenDialog->Execute()==true) { - AnswerSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} -//--------------------------------------------------------------------------- - -void __fastcall TFtpCfgDlg::HangupSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=HangupSoundEdit->Text; - if(OpenDialog->Execute()==true) { - HangupSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} -//--------------------------------------------------------------------------- -void __fastcall TFtpCfgDlg::HackAttemptSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=HackAttemptSoundEdit->Text; - if(OpenDialog->Execute()==true) { - HackAttemptSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} -//--------------------------------------------------------------------------- - void __fastcall TFtpCfgDlg::AutoIndexCheckBoxClick(TObject *Sender) { IndexFileNameEdit->Enabled=AutoIndexCheckBox->Checked; @@ -232,3 +193,11 @@ void __fastcall TFtpCfgDlg::AllowQWKCheckBoxClick(TObject *Sender) } //--------------------------------------------------------------------------- +void __fastcall TFtpCfgDlg::ConfigureSoundButtonClick(TObject *Sender) +{ + SoundCfgDlg->sound = &MainForm->ftp_startup.sound; + SoundCfgDlg->Caption = "FTP Server Sound Configuration"; + SoundCfgDlg->ShowModal(); +} +//--------------------------------------------------------------------------- + diff --git a/src/sbbs3/ctrl/FtpCfgDlgUnit.dfm b/src/sbbs3/ctrl/FtpCfgDlgUnit.dfm index 3164e24070..43044d1ee0 100644 --- a/src/sbbs3/ctrl/FtpCfgDlgUnit.dfm +++ b/src/sbbs3/ctrl/FtpCfgDlgUnit.dfm @@ -1,6 +1,6 @@ object FtpCfgDlg: TFtpCfgDlg - Left = 1282 - Top = 534 + Left = 1021 + Top = 407 BorderStyle = bsDialog Caption = 'FTP Server Configuration' ClientHeight = 245 @@ -20,8 +20,8 @@ object FtpCfgDlg: TFtpCfgDlg Top = 3 Width = 278 Height = 199 - ActivePage = GeneralTabSheet - TabIndex = 0 + ActivePage = SoundTabSheet + TabIndex = 4 TabOrder = 0 object GeneralTabSheet: TTabSheet Caption = 'General' @@ -348,86 +348,14 @@ object FtpCfgDlg: TFtpCfgDlg object SoundTabSheet: TTabSheet Caption = 'Sound' ImageIndex = 2 - object AnswerSoundLabel: TLabel - Left = 7 - Top = 10 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Connect' - end - object HangupSoundLabel: TLabel - Left = 7 - Top = 36 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Disconnect' - end - object HackAttemptSoundLabel: TLabel - Left = 7 - Top = 62 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Hack Attempt' - end - object AnswerSoundEdit: TEdit - Left = 85 - Top = 10 - Width = 156 - Height = 24 - Hint = 'Sound file to play when users connect' - ParentShowHint = False - ShowHint = True + object ConfigureSoundButton: TButton + Left = 8 + Top = 8 + Width = 257 + Height = 25 + Caption = 'Configure Common Server Event Sounds' TabOrder = 0 - end - object AnswerSoundButton: TButton - Left = 247 - Top = 10 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 1 - OnClick = AnswerSoundButtonClick - end - object HangupSoundEdit: TEdit - Left = 85 - Top = 36 - Width = 156 - Height = 24 - Hint = 'Sound file to play when users disconnect' - ParentShowHint = False - ShowHint = True - TabOrder = 2 - end - object HangupSoundButton: TButton - Left = 247 - Top = 36 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 3 - OnClick = HangupSoundButtonClick - end - object HackAttemptSoundEdit: TEdit - Left = 85 - Top = 62 - Width = 156 - Height = 24 - Hint = 'Sound file to play when hack attempts are detected' - ParentShowHint = False - ShowHint = True - TabOrder = 4 - end - object HackAttemptSoundButton: TButton - Left = 247 - Top = 62 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 5 - OnClick = HackAttemptSoundButtonClick + OnClick = ConfigureSoundButtonClick end end end diff --git a/src/sbbs3/ctrl/FtpCfgDlgUnit.h b/src/sbbs3/ctrl/FtpCfgDlgUnit.h index 932a2d7ac5..2a92294730 100644 --- a/src/sbbs3/ctrl/FtpCfgDlgUnit.h +++ b/src/sbbs3/ctrl/FtpCfgDlgUnit.h @@ -49,12 +49,6 @@ __published: TCheckBox *DebugDataCheckBox; TCheckBox *LogFileCheckBox; TTabSheet *SoundTabSheet; - TLabel *AnswerSoundLabel; - TEdit *AnswerSoundEdit; - TButton *AnswerSoundButton; - TLabel *HangupSoundLabel; - TEdit *HangupSoundEdit; - TButton *HangupSoundButton; TLabel *MaxClientesLabel; TEdit *MaxClientsEdit; TLabel *MaxInactivityLabel; @@ -75,9 +69,6 @@ __published: TEdit *IndexFileNameEdit; TLabel *QwkTimeoutLabel; TEdit *QwkTimeoutEdit; - TLabel *HackAttemptSoundLabel; - TEdit *HackAttemptSoundEdit; - TButton *HackAttemptSoundButton; TTabSheet *PasvTabSheet; TLabel *PasvIpLabel; TEdit *PasvIPv4AddrEdit; @@ -88,14 +79,13 @@ __published: TCheckBox *PasvIpLookupCheckBox; TLabel *MaxConConLabel; TEdit *MaxConConEdit; + TButton *ConfigureSoundButton; void __fastcall FormShow(TObject *Sender); void __fastcall OKBtnClick(TObject *Sender); - void __fastcall AnswerSoundButtonClick(TObject *Sender); - void __fastcall HangupSoundButtonClick(TObject *Sender); void __fastcall AutoIndexCheckBoxClick(TObject *Sender); - void __fastcall HackAttemptSoundButtonClick(TObject *Sender); void __fastcall PasvIpLookupCheckBoxClick(TObject *Sender); void __fastcall AllowQWKCheckBoxClick(TObject *Sender); + void __fastcall ConfigureSoundButtonClick(TObject *Sender); private: public: virtual __fastcall TFtpCfgDlg(TComponent* AOwner); diff --git a/src/sbbs3/ctrl/MailCfgDlgUnit.cpp b/src/sbbs3/ctrl/MailCfgDlgUnit.cpp index 204b630606..47acc62e0e 100644 --- a/src/sbbs3/ctrl/MailCfgDlgUnit.cpp +++ b/src/sbbs3/ctrl/MailCfgDlgUnit.cpp @@ -26,6 +26,7 @@ #include "MainFormUnit.h" #include "MailCfgDlgUnit.h" #include "TextFileEditUnit.h" +#include "SoundCfgDlgUnit.h" #include <stdio.h> // sprintf() #include <mmsystem.h> // sndPlaySound() //--------------------------------------------------------------------- @@ -494,3 +495,11 @@ void __fastcall TMailCfgDlg::TLSSubPortCheckBoxClick(TObject *Sender) //--------------------------------------------------------------------------- +void __fastcall TMailCfgDlg::ConfigureSoundButtonClick(TObject *Sender) +{ + SoundCfgDlg->sound = &MainForm->mail_startup.sound; + SoundCfgDlg->Caption = "Mail Server Sound Configuration"; + SoundCfgDlg->ShowModal(); +} +//--------------------------------------------------------------------------- + diff --git a/src/sbbs3/ctrl/MailCfgDlgUnit.dfm b/src/sbbs3/ctrl/MailCfgDlgUnit.dfm index 53f164514f..1213c662c0 100644 --- a/src/sbbs3/ctrl/MailCfgDlgUnit.dfm +++ b/src/sbbs3/ctrl/MailCfgDlgUnit.dfm @@ -53,8 +53,8 @@ object MailCfgDlg: TMailCfgDlg Top = 3 Width = 278 Height = 199 - ActivePage = GeneralTabSheet - TabIndex = 0 + ActivePage = SoundTabSheet + TabIndex = 5 TabOrder = 3 object GeneralTabSheet: TTabSheet Caption = 'General' @@ -502,7 +502,7 @@ object MailCfgDlg: TMailCfgDlg Checked = True ParentShowHint = False ShowHint = True - TabOrder = 4 + TabOrder = 3 TabStop = True OnClick = DNSRadioButtonClick end @@ -514,7 +514,7 @@ object MailCfgDlg: TMailCfgDlg Hint = 'Host name or IP address of your ISP'#39's DNS server' ParentShowHint = False ShowHint = True - TabOrder = 6 + TabOrder = 5 end object TcpDnsCheckBox: TCheckBox Left = 203 @@ -536,7 +536,7 @@ object MailCfgDlg: TMailCfgDlg Caption = 'Use Relay Server' ParentShowHint = False ShowHint = True - TabOrder = 5 + TabOrder = 4 OnClick = DNSRadioButtonClick end object DeliveryAttemptsEdit: TEdit @@ -581,7 +581,7 @@ object MailCfgDlg: TMailCfgDlg 'efinite)' ParentShowHint = False ShowHint = True - TabOrder = 8 + TabOrder = 6 end end object RelayTabSheet: TTabSheet @@ -793,6 +793,15 @@ object MailCfgDlg: TMailCfgDlg TabOrder = 3 OnClick = OutboundSoundButtonClick end + object ConfigureSoundButton: TButton + Left = 4 + Top = 88 + Width = 261 + Height = 25 + Caption = 'Configure Common Server Event Sounds' + TabOrder = 6 + OnClick = ConfigureSoundButtonClick + end end object DNSBLTabSheet: TTabSheet Caption = 'DNSBL' diff --git a/src/sbbs3/ctrl/MailCfgDlgUnit.h b/src/sbbs3/ctrl/MailCfgDlgUnit.h index 73f96d23a0..91dad9981a 100644 --- a/src/sbbs3/ctrl/MailCfgDlgUnit.h +++ b/src/sbbs3/ctrl/MailCfgDlgUnit.h @@ -140,6 +140,7 @@ __published: TLabel *TLSPOP3PortLabel; TEdit *TLSPOP3PortEdit; TCheckBox *TLSPOP3EnabledCheckBox; + TButton *ConfigureSoundButton; void __fastcall InboundSoundButtonClick(TObject *Sender); void __fastcall OutboundSoundButtonClick(TObject *Sender); void __fastcall FormShow(TObject *Sender); @@ -154,6 +155,7 @@ __published: void __fastcall RelayAuthRadioButtonClick(TObject *Sender); void __fastcall UseSubPortCheckBoxClick(TObject *Sender); void __fastcall TLSSubPortCheckBoxClick(TObject *Sender); + void __fastcall ConfigureSoundButtonClick(TObject *Sender); private: public: virtual __fastcall TMailCfgDlg(TComponent* AOwner); diff --git a/src/sbbs3/ctrl/PropertiesDlgUnit.cpp b/src/sbbs3/ctrl/PropertiesDlgUnit.cpp index 4f312b4e33..39a62f6244 100644 --- a/src/sbbs3/ctrl/PropertiesDlgUnit.cpp +++ b/src/sbbs3/ctrl/PropertiesDlgUnit.cpp @@ -44,6 +44,7 @@ #include "MailFormUnit.h" #include "ServicesFormUnit.h" #include "PropertiesDlgUnit.h" +#include "SoundCfgDlgUnit.h" #include <mmsystem.h> // sndPlaySound() //--------------------------------------------------------------------- #pragma resource "*.dfm" @@ -217,3 +218,12 @@ void __fastcall TPropertiesDlg::HelpBtnClick(TObject *Sender) } //--------------------------------------------------------------------------- +void __fastcall TPropertiesDlg::ConfigureSoundButtonClick(TObject *Sender) +{ + SoundCfgDlg->sound = &MainForm->global.sound; + SoundCfgDlg->Caption = "Server Event Sound Configuration"; + SoundCfgDlg->ShowModal(); +} +//--------------------------------------------------------------------------- + + diff --git a/src/sbbs3/ctrl/PropertiesDlgUnit.dfm b/src/sbbs3/ctrl/PropertiesDlgUnit.dfm index 5fd868861c..f3c6294c61 100644 --- a/src/sbbs3/ctrl/PropertiesDlgUnit.dfm +++ b/src/sbbs3/ctrl/PropertiesDlgUnit.dfm @@ -1,6 +1,6 @@ object PropertiesDlg: TPropertiesDlg - Left = 688 - Top = 261 + Left = 1041 + Top = 844 BorderStyle = bsDialog Caption = 'Control Panel Properties' ClientHeight = 234 @@ -43,9 +43,9 @@ object PropertiesDlg: TPropertiesDlg Top = 7 Width = 254 Height = 221 - ActivePage = SettingsTabSheet + ActivePage = Sound Anchors = [akLeft, akTop, akBottom] - TabIndex = 0 + TabIndex = 5 TabOrder = 2 object SettingsTabSheet: TTabSheet Caption = 'Settings' @@ -482,14 +482,6 @@ object PropertiesDlg: TPropertiesDlg AutoSize = False Caption = 'Temp Directory' end - object ErrorSoundLabel: TLabel - Left = 7 - Top = 114 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Error Sound' - end object CtrlDirEdit: TEdit Left = 98 Top = 10 @@ -541,7 +533,7 @@ object PropertiesDlg: TPropertiesDlg Caption = 'Undockable Windows' ParentShowHint = False ShowHint = True - TabOrder = 6 + TabOrder = 4 end object FileAssociationsCheckBox: TCheckBox Left = 7 @@ -552,26 +544,7 @@ object PropertiesDlg: TPropertiesDlg Caption = 'Use File Associations' ParentShowHint = False ShowHint = True - TabOrder = 7 - end - object ErrorSoundEdit: TEdit - Left = 98 - Top = 114 - Width = 112 - Height = 21 - Hint = 'Sound file to play when an error condition is logged' - ParentShowHint = False - ShowHint = True - TabOrder = 4 - end - object ErrorSoundButton: TButton - Left = 214 - Top = 114 - Width = 20 - Height = 21 - Caption = '...' TabOrder = 5 - OnClick = ErrorSoundButtonClick end end object JavaScriptTabSheet: TTabSheet @@ -592,7 +565,7 @@ object PropertiesDlg: TPropertiesDlg Height = 19 AutoSize = False Caption = 'Context Stack' - Enabled = false + Enabled = False end object Label12: TLabel Left = 7 @@ -644,10 +617,10 @@ object PropertiesDlg: TPropertiesDlg Width = 137 Height = 21 Hint = 'Size of context stack (in bytes)' + Enabled = False ParentShowHint = False ShowHint = True TabOrder = 1 - Enabled = false end object JS_TimeLimitEdit: TEdit Left = 98 @@ -694,6 +667,46 @@ object PropertiesDlg: TPropertiesDlg TabOrder = 5 end end + object Sound: TTabSheet + Caption = 'Sound' + ImageIndex = 5 + object ErrorSoundLabel: TLabel + Left = 7 + Top = 10 + Width = 65 + Height = 20 + AutoSize = False + Caption = 'Error Sound' + end + object ConfigureSoundButton: TButton + Left = 8 + Top = 40 + Width = 225 + Height = 25 + Caption = 'Configure Common Server Event Sounds' + TabOrder = 0 + OnClick = ConfigureSoundButtonClick + end + object ErrorSoundEdit: TEdit + Left = 72 + Top = 10 + Width = 138 + Height = 21 + Hint = 'Sound file to play when an error condition is logged' + ParentShowHint = False + ShowHint = True + TabOrder = 1 + end + object ErrorSoundButton: TButton + Left = 214 + Top = 10 + Width = 20 + Height = 21 + Caption = '...' + TabOrder = 2 + OnClick = ErrorSoundButtonClick + end + end end object HelpBtn: TButton Left = 267 diff --git a/src/sbbs3/ctrl/PropertiesDlgUnit.h b/src/sbbs3/ctrl/PropertiesDlgUnit.h index a544dc69cb..8e8ab7f066 100644 --- a/src/sbbs3/ctrl/PropertiesDlgUnit.h +++ b/src/sbbs3/ctrl/PropertiesDlgUnit.h @@ -109,9 +109,6 @@ __published: TLabel *LogLevelLabel; TLabel *Label16; TEdit *JS_LoadPathEdit; - TLabel *ErrorSoundLabel; - TEdit *ErrorSoundEdit; - TButton *ErrorSoundButton; TOpenDialog *OpenDialog; TTabSheet *SecurityTabSheet; TGroupBox *FailedLoginAttemptGroupBox; @@ -128,6 +125,11 @@ __published: TLabel *LoginAttemptFilterThresholdLabel; TEdit *LoginAttemptFilterThresholdEdit; TButton *HelpBtn; + TTabSheet *Sound; + TButton *ConfigureSoundButton; + TLabel *ErrorSoundLabel; + TEdit *ErrorSoundEdit; + TButton *ErrorSoundButton; void __fastcall FormShow(TObject *Sender); void __fastcall TrayIconCheckBoxClick(TObject *Sender); void __fastcall SourceComboBoxChange(TObject *Sender); @@ -138,6 +140,7 @@ __published: void __fastcall LogFontButtonClick(TObject *Sender); void __fastcall ErrorSoundButtonClick(TObject *Sender); void __fastcall HelpBtnClick(TObject *Sender); + void __fastcall ConfigureSoundButtonClick(TObject *Sender); private: public: virtual __fastcall TPropertiesDlg(TComponent* AOwner); diff --git a/src/sbbs3/ctrl/ServicesCfgDlgUnit.cpp b/src/sbbs3/ctrl/ServicesCfgDlgUnit.cpp index f12a7b76f4..a9b6e86117 100644 --- a/src/sbbs3/ctrl/ServicesCfgDlgUnit.cpp +++ b/src/sbbs3/ctrl/ServicesCfgDlgUnit.cpp @@ -7,8 +7,8 @@ #include "TextFileEditUnit.h" #include "ServicesCfgDlgUnit.h" #include "CodeInputFormUnit.h" +#include "SoundCfgDlgUnit.h" #include <stdio.h> // sprintf() -#include <mmsystem.h> // sndPlaySound() //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" @@ -32,8 +32,6 @@ void __fastcall TServicesCfgDlg::FormShow(TObject *Sender) } AutoStartCheckBox->Checked=MainForm->ServicesAutoStart; - AnswerSoundEdit->Text=AnsiString(MainForm->services_startup.sound.answer); - HangupSoundEdit->Text=AnsiString(MainForm->services_startup.sound.hangup); HostnameCheckBox->Checked =!(MainForm->services_startup.options&BBS_OPT_NO_HOST_LOOKUP); @@ -82,11 +80,6 @@ void __fastcall TServicesCfgDlg::OKButtonClick(TObject *Sender) MainForm->ServicesAutoStart=AutoStartCheckBox->Checked; - SAFECOPY(MainForm->services_startup.sound.answer - ,AnswerSoundEdit->Text.c_str()); - SAFECOPY(MainForm->services_startup.sound.hangup - ,HangupSoundEdit->Text.c_str()); - if(HostnameCheckBox->Checked==false) MainForm->services_startup.options|=BBS_OPT_NO_HOST_LOOKUP; else @@ -101,26 +94,6 @@ void __fastcall TServicesCfgDlg::OKButtonClick(TObject *Sender) MainForm->SaveSettings(Sender); } -//--------------------------------------------------------------------------- - -void __fastcall TServicesCfgDlg::AnswerSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=AnswerSoundEdit->Text; - if(OpenDialog->Execute()==true) { - AnswerSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} -//--------------------------------------------------------------------------- - -void __fastcall TServicesCfgDlg::HangupSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=HangupSoundEdit->Text; - if(OpenDialog->Execute()==true) { - HangupSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} //--------------------------------------------------------------------------- void __fastcall TServicesCfgDlg::FormClose(TObject *Sender, @@ -218,6 +191,11 @@ void __fastcall TServicesCfgDlg::GlobalValueListEditorValidate( ,KeyName.c_str(), KeyValue.c_str(), /* style: */NULL); } //--------------------------------------------------------------------------- - - +void __fastcall TServicesCfgDlg::ConfigureSoundButtonClick(TObject *Sender) +{ + SoundCfgDlg->sound = &MainForm->services_startup.sound; + SoundCfgDlg->Caption = "Services Sound Configuration"; + SoundCfgDlg->ShowModal(); +} +//--------------------------------------------------------------------------- diff --git a/src/sbbs3/ctrl/ServicesCfgDlgUnit.dfm b/src/sbbs3/ctrl/ServicesCfgDlgUnit.dfm index 808d4acf4e..73088f8188 100644 --- a/src/sbbs3/ctrl/ServicesCfgDlgUnit.dfm +++ b/src/sbbs3/ctrl/ServicesCfgDlgUnit.dfm @@ -1,6 +1,6 @@ object ServicesCfgDlg: TServicesCfgDlg - Left = 893 - Top = 235 + Left = 841 + Top = 296 BorderStyle = bsDialog Caption = 'Services Configuration' ClientHeight = 245 @@ -50,8 +50,8 @@ object ServicesCfgDlg: TServicesCfgDlg Top = 3 Width = 278 Height = 199 - ActivePage = ServicesTabSheet - TabIndex = 1 + ActivePage = SoundTabSheet + TabIndex = 2 TabOrder = 0 object GeneralTabSheet: TTabSheet Caption = 'General' @@ -159,59 +159,14 @@ object ServicesCfgDlg: TServicesCfgDlg object SoundTabSheet: TTabSheet Caption = 'Sound' ImageIndex = 2 - object AnswerSoundLabel: TLabel - Left = 7 - Top = 10 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Connect' - end - object HangupSoundLabel: TLabel - Left = 7 - Top = 36 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Disconnect' - end - object AnswerSoundEdit: TEdit - Left = 85 - Top = 10 - Width = 156 - Height = 21 - Hint = 'Sound file to play when users connect' - ParentShowHint = False - ShowHint = True + object ConfigureSoundButton: TButton + Left = 8 + Top = 8 + Width = 257 + Height = 25 + Caption = 'Configure Common Server Event Sounds' TabOrder = 0 - end - object AnswerSoundButton: TButton - Left = 247 - Top = 10 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 1 - OnClick = AnswerSoundButtonClick - end - object HangupSoundEdit: TEdit - Left = 85 - Top = 36 - Width = 156 - Height = 21 - Hint = 'Sound file to play when users disconnect' - ParentShowHint = False - ShowHint = True - TabOrder = 2 - end - object HangupSoundButton: TButton - Left = 247 - Top = 36 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 3 - OnClick = HangupSoundButtonClick + OnClick = ConfigureSoundButtonClick end end end @@ -281,12 +236,6 @@ object ServicesCfgDlg: TServicesCfgDlg TabOrder = 6 OnClick = OKButtonClick end - object OpenDialog: TOpenDialog - Filter = 'Wave Files|*.wav' - Options = [ofHideReadOnly, ofNoChangeDir, ofEnableSizing, ofDontAddToRecent] - Left = 104 - Top = 32 - end object ServicesCfgPopupMenu: TPopupMenu Left = 136 Top = 56 diff --git a/src/sbbs3/ctrl/ServicesCfgDlgUnit.h b/src/sbbs3/ctrl/ServicesCfgDlgUnit.h index f02a03482a..4cbad9216f 100644 --- a/src/sbbs3/ctrl/ServicesCfgDlgUnit.h +++ b/src/sbbs3/ctrl/ServicesCfgDlgUnit.h @@ -25,19 +25,12 @@ __published: // IDE-managed Components TEdit *NetworkInterfaceEdit; TCheckBox *HostnameCheckBox; TTabSheet *SoundTabSheet; - TLabel *AnswerSoundLabel; - TLabel *HangupSoundLabel; - TEdit *AnswerSoundEdit; - TButton *AnswerSoundButton; - TEdit *HangupSoundEdit; - TButton *HangupSoundButton; TButton *OKBtn; TButton *CancelBtn; TButton *ApplyBtn; TButton *OKButton; TButton *CancelButton; TButton *ApplyButton; - TOpenDialog *OpenDialog; TTabSheet *ServicesTabSheet; TCheckListBox *CheckListBox; TValueListEditor *ValueListEditor; @@ -46,10 +39,9 @@ __published: // IDE-managed Components TMenuItem *ServiceRemove; TValueListEditor *GlobalValueListEditor; TLabel *GlobalSettingsLabel; + TButton *ConfigureSoundButton; void __fastcall FormShow(TObject *Sender); void __fastcall OKButtonClick(TObject *Sender); - void __fastcall AnswerSoundButtonClick(TObject *Sender); - void __fastcall HangupSoundButtonClick(TObject *Sender); void __fastcall FormClose(TObject *Sender, TCloseAction &Action); void __fastcall CheckListBoxClick(TObject *Sender); void __fastcall ValueListEditorValidate(TObject *Sender, int ACol, @@ -61,6 +53,7 @@ __published: // IDE-managed Components void __fastcall GlobalValueListEditorValidate(TObject *Sender, int ACol, int ARow, const AnsiString KeyName, const AnsiString KeyValue); + void __fastcall ConfigureSoundButtonClick(TObject *Sender); private: // User declarations char iniFilename[MAX_PATH+1]; str_list_t ini; diff --git a/src/sbbs3/ctrl/SoundCfgDlgUnit.cpp b/src/sbbs3/ctrl/SoundCfgDlgUnit.cpp new file mode 100644 index 0000000000..b1ec0d0426 --- /dev/null +++ b/src/sbbs3/ctrl/SoundCfgDlgUnit.cpp @@ -0,0 +1,85 @@ +//--------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +#include "SoundCfgDlgUnit.h" +#include <mmsystem.h> // sndPlaySound() +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +TSoundCfgDlg *SoundCfgDlg; +//--------------------------------------------------------------------- +__fastcall TSoundCfgDlg::TSoundCfgDlg(TComponent* AOwner) + : TForm(AOwner) +{ +} +//--------------------------------------------------------------------- +void __fastcall TSoundCfgDlg::AnswerSoundButtonClick(TObject *Sender) +{ + OpenDialog->FileName=AnswerSoundEdit->Text; + if(OpenDialog->Execute()==true) { + AnswerSoundEdit->Text=OpenDialog->FileName; + sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TSoundCfgDlg::HangupSoundButtonClick(TObject *Sender) +{ + OpenDialog->FileName=HangupSoundEdit->Text; + if(OpenDialog->Execute()==true) { + HangupSoundEdit->Text=OpenDialog->FileName; + sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TSoundCfgDlg::LoginSoundButtonClick(TObject *Sender) +{ + OpenDialog->FileName=LoginSoundEdit->Text; + if(OpenDialog->Execute()==true) { + LoginSoundEdit->Text=OpenDialog->FileName; + sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TSoundCfgDlg::LogoutSoundButtonClick(TObject *Sender) +{ + OpenDialog->FileName=LogoutSoundEdit->Text; + if(OpenDialog->Execute()==true) { + LogoutSoundEdit->Text=OpenDialog->FileName; + sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TSoundCfgDlg::HackAttemptSoundButtonClick(TObject *Sender) +{ + OpenDialog->FileName=HackAttemptSoundEdit->Text; + if(OpenDialog->Execute()==true) { + HackAttemptSoundEdit->Text=OpenDialog->FileName; + sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TSoundCfgDlg::FormShow(TObject *Sender) +{ + AnswerSoundEdit->Text=AnsiString(sound->answer); + HangupSoundEdit->Text=AnsiString(sound->hangup); + LoginSoundEdit->Text=AnsiString(sound->login); + LogoutSoundEdit->Text=AnsiString(sound->logout); + HackAttemptSoundEdit->Text=AnsiString(sound->hack); +} +//--------------------------------------------------------------------------- + +void __fastcall TSoundCfgDlg::OKBtnClick(TObject *Sender) +{ + SAFECOPY(sound->answer, AnswerSoundEdit->Text.c_str()); + SAFECOPY(sound->hangup, HangupSoundEdit->Text.c_str()); + SAFECOPY(sound->login, LoginSoundEdit->Text.c_str()); + SAFECOPY(sound->logout, LogoutSoundEdit->Text.c_str()); + SAFECOPY(sound->hack, HackAttemptSoundEdit->Text.c_str()); +} +//--------------------------------------------------------------------------- + diff --git a/src/sbbs3/ctrl/SoundCfgDlgUnit.dfm b/src/sbbs3/ctrl/SoundCfgDlgUnit.dfm new file mode 100644 index 0000000000..5f0e0a2346 --- /dev/null +++ b/src/sbbs3/ctrl/SoundCfgDlgUnit.dfm @@ -0,0 +1,177 @@ +object SoundCfgDlg: TSoundCfgDlg + Left = 910 + Top = 472 + BorderStyle = bsDialog + Caption = 'Sound Configuration' + ClientHeight = 186 + ClientWidth = 313 + Color = clBtnFace + ParentFont = True + OldCreateOrder = True + Position = poScreenCenter + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object AnswerSoundLabel: TLabel + Left = 9 + Top = 18 + Width = 65 + Height = 20 + AutoSize = False + Caption = 'Connect' + end + object HnagupSoundLabel: TLabel + Left = 9 + Top = 44 + Width = 65 + Height = 20 + AutoSize = False + Caption = 'Disconnect' + end + object LoginSoundLabel: TLabel + Left = 9 + Top = 70 + Width = 65 + Height = 20 + AutoSize = False + Caption = 'Login' + end + object LogoutSoundLabel: TLabel + Left = 9 + Top = 96 + Width = 65 + Height = 20 + AutoSize = False + Caption = 'Logout' + end + object HackAttemptSoundLabel: TLabel + Left = 9 + Top = 122 + Width = 65 + Height = 20 + AutoSize = False + Caption = 'Hack Attempt' + end + object OKBtn: TButton + Left = 79 + Top = 156 + Width = 75 + Height = 25 + Caption = 'OK' + Default = True + ModalResult = 1 + TabOrder = 10 + OnClick = OKBtnClick + end + object CancelBtn: TButton + Left = 159 + Top = 156 + Width = 75 + Height = 25 + Cancel = True + Caption = 'Cancel' + ModalResult = 2 + TabOrder = 11 + end + object AnswerSoundEdit: TEdit + Left = 80 + Top = 18 + Width = 201 + Height = 21 + Hint = 'Sound file to play when accepting an incoming connection' + ParentShowHint = False + ShowHint = True + TabOrder = 0 + end + object HangupSoundEdit: TEdit + Left = 80 + Top = 44 + Width = 201 + Height = 21 + Hint = 'Sound file to play when disconnecting' + ParentShowHint = False + ShowHint = True + TabOrder = 2 + end + object AnswerSoundButton: TButton + Left = 287 + Top = 18 + Width = 20 + Height = 21 + Caption = '...' + TabOrder = 1 + OnClick = AnswerSoundButtonClick + end + object HangupSoundButton: TButton + Left = 287 + Top = 44 + Width = 20 + Height = 21 + Caption = '...' + TabOrder = 3 + OnClick = HangupSoundButtonClick + end + object LoginSoundButton: TButton + Left = 287 + Top = 70 + Width = 20 + Height = 21 + Caption = '...' + TabOrder = 5 + OnClick = LoginSoundButtonClick + end + object LoginSoundEdit: TEdit + Left = 80 + Top = 70 + Width = 201 + Height = 21 + Hint = 'Sound file to play when accepting an incoming connection' + ParentShowHint = False + ShowHint = True + TabOrder = 4 + end + object LogoutSoundEdit: TEdit + Left = 80 + Top = 96 + Width = 201 + Height = 21 + Hint = 'Sound file to play when disconnecting' + ParentShowHint = False + ShowHint = True + TabOrder = 6 + end + object LogoutSoundButton: TButton + Left = 287 + Top = 96 + Width = 20 + Height = 21 + Caption = '...' + TabOrder = 7 + OnClick = LogoutSoundButtonClick + end + object HackAttemptSoundEdit: TEdit + Left = 80 + Top = 122 + Width = 201 + Height = 21 + Hint = 'Sound file to play when disconnecting' + ParentShowHint = False + ShowHint = True + TabOrder = 8 + end + object HackAttemptSoundButton: TButton + Left = 287 + Top = 122 + Width = 20 + Height = 21 + Caption = '...' + TabOrder = 9 + OnClick = HackAttemptSoundButtonClick + end + object OpenDialog: TOpenDialog + Filter = 'Wave Files|*.wav' + Options = [ofNoChangeDir, ofEnableSizing] + Left = 8 + Top = 144 + end +end diff --git a/src/sbbs3/ctrl/SoundCfgDlgUnit.h b/src/sbbs3/ctrl/SoundCfgDlgUnit.h new file mode 100644 index 0000000000..b54e222fe4 --- /dev/null +++ b/src/sbbs3/ctrl/SoundCfgDlgUnit.h @@ -0,0 +1,54 @@ +//---------------------------------------------------------------------------- +#ifndef SoundCfgDlgUnitH +#define SoundCfgDlgUnitH +//---------------------------------------------------------------------------- +#include <vcl\System.hpp> +#include <vcl\Windows.hpp> +#include <vcl\SysUtils.hpp> +#include <vcl\Classes.hpp> +#include <vcl\Graphics.hpp> +#include <vcl\StdCtrls.hpp> +#include <vcl\Forms.hpp> +#include <vcl\Controls.hpp> +#include <vcl\Buttons.hpp> +#include <vcl\ExtCtrls.hpp> +#include <Dialogs.hpp> +#include "startup.h" +//---------------------------------------------------------------------------- +class TSoundCfgDlg : public TForm +{ +__published: + TButton *OKBtn; + TButton *CancelBtn; + TLabel *AnswerSoundLabel; + TEdit *AnswerSoundEdit; + TLabel *HnagupSoundLabel; + TEdit *HangupSoundEdit; + TButton *AnswerSoundButton; + TButton *HangupSoundButton; + TButton *LoginSoundButton; + TEdit *LoginSoundEdit; + TLabel *LoginSoundLabel; + TLabel *LogoutSoundLabel; + TEdit *LogoutSoundEdit; + TButton *LogoutSoundButton; + TLabel *HackAttemptSoundLabel; + TEdit *HackAttemptSoundEdit; + TButton *HackAttemptSoundButton; + TOpenDialog *OpenDialog; + void __fastcall AnswerSoundButtonClick(TObject *Sender); + void __fastcall HangupSoundButtonClick(TObject *Sender); + void __fastcall LoginSoundButtonClick(TObject *Sender); + void __fastcall LogoutSoundButtonClick(TObject *Sender); + void __fastcall HackAttemptSoundButtonClick(TObject *Sender); + void __fastcall FormShow(TObject *Sender); + void __fastcall OKBtnClick(TObject *Sender); +private: +public: + virtual __fastcall TSoundCfgDlg(TComponent* AOwner); + struct startup_sound_settings* sound; +}; +//---------------------------------------------------------------------------- +extern PACKAGE TSoundCfgDlg *SoundCfgDlg; +//---------------------------------------------------------------------------- +#endif diff --git a/src/sbbs3/ctrl/TelnetCfgDlgUnit.cpp b/src/sbbs3/ctrl/TelnetCfgDlgUnit.cpp index 8c230c360e..04bff4de6e 100644 --- a/src/sbbs3/ctrl/TelnetCfgDlgUnit.cpp +++ b/src/sbbs3/ctrl/TelnetCfgDlgUnit.cpp @@ -40,6 +40,7 @@ #include "MainFormUnit.h" #include "TextFileEditUnit.h" #include "TelnetCfgDlgUnit.h" +#include "soundCfgDlgUnit.h" #include <stdio.h> // sprintf() #include <mmsystem.h> // sndPlaySound() //--------------------------------------------------------------------- @@ -88,8 +89,6 @@ void __fastcall TTelnetCfgDlg::FormShow(TObject *Sender) else MaxConConEdit->Text=AnsiString((int)MainForm->bbs_startup.max_concurrent_connections); AutoStartCheckBox->Checked=MainForm->SysAutoStart; - AnswerSoundEdit->Text=AnsiString(MainForm->bbs_startup.sound.answer); - HangupSoundEdit->Text=AnsiString(MainForm->bbs_startup.sound.hangup); CmdLogCheckBox->Checked=MainForm->bbs_startup.options&BBS_OPT_DEBUG_TELNET; TelnetGaCheckBox->Checked =!(MainForm->bbs_startup.options&BBS_OPT_NO_TELNET_GA); @@ -137,10 +136,6 @@ void __fastcall TTelnetCfgDlg::OKBtnClick(TObject *Sender) MainForm->bbs_startup.max_concurrent_connections=MaxConConEdit->Text.ToIntDef(0); MainForm->SysAutoStart=AutoStartCheckBox->Checked; - SAFECOPY(MainForm->bbs_startup.sound.answer - ,AnswerSoundEdit->Text.c_str()); - SAFECOPY(MainForm->bbs_startup.sound.hangup - ,HangupSoundEdit->Text.c_str()); if(TelnetGaCheckBox->Checked==false) MainForm->bbs_startup.options|=BBS_OPT_NO_TELNET_GA; else @@ -189,26 +184,6 @@ void __fastcall TTelnetCfgDlg::OKBtnClick(TObject *Sender) } //--------------------------------------------------------------------------- -void __fastcall TTelnetCfgDlg::AnswerSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=AnswerSoundEdit->Text; - if(OpenDialog->Execute()==true) { - AnswerSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} -//--------------------------------------------------------------------------- - -void __fastcall TTelnetCfgDlg::HangupSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=HangupSoundEdit->Text; - if(OpenDialog->Execute()==true) { - HangupSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} -//--------------------------------------------------------------------------- - void __fastcall TTelnetCfgDlg::RLoginEnabledCheckBoxClick(TObject *Sender) { RLoginPortEdit->Enabled = RLoginEnabledCheckBox->Checked; @@ -242,6 +217,11 @@ void __fastcall TTelnetCfgDlg::SshEnabledCheckBoxClick(TObject *Sender) } //--------------------------------------------------------------------------- - - +void __fastcall TTelnetCfgDlg::ConfigureSoundButtonClick(TObject *Sender) +{ + SoundCfgDlg->sound = &MainForm->bbs_startup.sound; + SoundCfgDlg->Caption = "Terminal Server Sound Configuration"; + SoundCfgDlg->ShowModal(); +} +//--------------------------------------------------------------------------- diff --git a/src/sbbs3/ctrl/TelnetCfgDlgUnit.dfm b/src/sbbs3/ctrl/TelnetCfgDlgUnit.dfm index 6065db6c94..2ccbd8dc21 100644 --- a/src/sbbs3/ctrl/TelnetCfgDlgUnit.dfm +++ b/src/sbbs3/ctrl/TelnetCfgDlgUnit.dfm @@ -17,8 +17,8 @@ object TelnetCfgDlg: TTelnetCfgDlg Top = 3 Width = 278 Height = 186 - ActivePage = GeneralTabSheet - TabIndex = 0 + ActivePage = SoundTabSheet + TabIndex = 4 TabOrder = 0 object GeneralTabSheet: TTabSheet Caption = 'General' @@ -365,59 +365,14 @@ object TelnetCfgDlg: TTelnetCfgDlg object SoundTabSheet: TTabSheet Caption = 'Sound' ImageIndex = 2 - object AnswerSoundLabel: TLabel - Left = 7 - Top = 10 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Connect' - end - object HnagupSoundLabel: TLabel - Left = 7 - Top = 36 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Disconnect' - end - object AnswerSoundEdit: TEdit - Left = 72 - Top = 10 - Width = 169 - Height = 21 - Hint = 'Sound file to play when accepting an incoming connection' - ParentShowHint = False - ShowHint = True + object ConfigureSoundButton: TButton + Left = 8 + Top = 8 + Width = 257 + Height = 25 + Caption = 'Configure Common Server Event Sounds' TabOrder = 0 - end - object AnswerSoundButton: TButton - Left = 247 - Top = 10 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 1 - OnClick = AnswerSoundButtonClick - end - object HangupSoundEdit: TEdit - Left = 72 - Top = 36 - Width = 169 - Height = 21 - Hint = 'Sound file to play when disconnecting' - ParentShowHint = False - ShowHint = True - TabOrder = 2 - end - object HangupSoundButton: TButton - Left = 247 - Top = 36 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 3 - OnClick = HangupSoundButtonClick + OnClick = ConfigureSoundButtonClick end end end diff --git a/src/sbbs3/ctrl/TelnetCfgDlgUnit.h b/src/sbbs3/ctrl/TelnetCfgDlgUnit.h index e67648eb03..b10705a237 100644 --- a/src/sbbs3/ctrl/TelnetCfgDlgUnit.h +++ b/src/sbbs3/ctrl/TelnetCfgDlgUnit.h @@ -58,12 +58,6 @@ __published: TTabSheet *GeneralTabSheet; TTabSheet *TelnetTabSheet; TTabSheet *SoundTabSheet; - TLabel *AnswerSoundLabel; - TEdit *AnswerSoundEdit; - TButton *AnswerSoundButton; - TLabel *HnagupSoundLabel; - TEdit *HangupSoundEdit; - TButton *HangupSoundButton; TCheckBox *CmdLogCheckBox; TCheckBox *AutoStartCheckBox; TLabel *FirstNodeLabel; @@ -101,13 +95,13 @@ __published: TEdit *MaxConConEdit; TLabel *SshConnectTimeoutLabel; TEdit *SshConnTimeoutEdit; + TButton *ConfigureSoundButton; void __fastcall FormShow(TObject *Sender); void __fastcall OKBtnClick(TObject *Sender); - void __fastcall AnswerSoundButtonClick(TObject *Sender); - void __fastcall HangupSoundButtonClick(TObject *Sender); void __fastcall RLoginEnabledCheckBoxClick(TObject *Sender); void __fastcall RLoginIPallowButtonClick(TObject *Sender); void __fastcall SshEnabledCheckBoxClick(TObject *Sender); + void __fastcall ConfigureSoundButtonClick(TObject *Sender); private: public: virtual __fastcall TTelnetCfgDlg(TComponent* AOwner); diff --git a/src/sbbs3/ctrl/WebCfgDlgUnit.cpp b/src/sbbs3/ctrl/WebCfgDlgUnit.cpp index cad6925513..41b800385b 100644 --- a/src/sbbs3/ctrl/WebCfgDlgUnit.cpp +++ b/src/sbbs3/ctrl/WebCfgDlgUnit.cpp @@ -41,8 +41,8 @@ #include "MainFormUnit.h" #include "WebCfgDlgUnit.h" #include "TextFileEditUnit.h" +#include "SoundCfgDlgUnit.h" #include <stdio.h> // sprintf() -#include <mmsystem.h> // sndPlaySound() //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" @@ -104,10 +104,6 @@ void __fastcall TWebCfgDlg::FormShow(TObject *Sender) CGICheckBox->Checked=!(MainForm->web_startup.options&WEB_OPT_NO_CGI); - AnswerSoundEdit->Text=AnsiString(MainForm->web_startup.sound.answer); - HangupSoundEdit->Text=AnsiString(MainForm->web_startup.sound.hangup); - HackAttemptSoundEdit->Text=AnsiString(MainForm->web_startup.sound.hack); - DebugTxCheckBox->Checked=MainForm->web_startup.options&WEB_OPT_DEBUG_TX; DebugRxCheckBox->Checked=MainForm->web_startup.options&WEB_OPT_DEBUG_RX; AccessLogCheckBox->Checked=MainForm->web_startup.options&WEB_OPT_HTTP_LOGGING; @@ -173,13 +169,6 @@ void __fastcall TWebCfgDlg::OKBtnClick(TObject *Sender) else MainForm->web_startup.options&=~WEB_OPT_NO_CGI; - SAFECOPY(MainForm->web_startup.sound.answer - ,AnswerSoundEdit->Text.c_str()); - SAFECOPY(MainForm->web_startup.sound.hangup - ,HangupSoundEdit->Text.c_str()); - SAFECOPY(MainForm->web_startup.sound.hack - ,HackAttemptSoundEdit->Text.c_str()); - if(DebugTxCheckBox->Checked==true) MainForm->web_startup.options|=WEB_OPT_DEBUG_TX; else @@ -204,33 +193,6 @@ void __fastcall TWebCfgDlg::OKBtnClick(TObject *Sender) MainForm->SaveIniSettings(Sender); } //--------------------------------------------------------------------------- -void __fastcall TWebCfgDlg::AnswerSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=AnswerSoundEdit->Text; - if(OpenDialog->Execute()==true) { - AnswerSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} -//--------------------------------------------------------------------------- -void __fastcall TWebCfgDlg::HangupSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=HangupSoundEdit->Text; - if(OpenDialog->Execute()==true) { - HangupSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} -//--------------------------------------------------------------------------- -void __fastcall TWebCfgDlg::HackAttemptSoundButtonClick(TObject *Sender) -{ - OpenDialog->FileName=HackAttemptSoundEdit->Text; - if(OpenDialog->Execute()==true) { - HackAttemptSoundEdit->Text=OpenDialog->FileName; - sndPlaySound(OpenDialog->FileName.c_str(),SND_ASYNC); - } -} -//--------------------------------------------------------------------------- void __fastcall TWebCfgDlg::AccessLogCheckBoxClick(TObject *Sender) { @@ -293,3 +255,11 @@ void __fastcall TWebCfgDlg::TlsEnableCheckBoxClick(TObject *Sender) } //--------------------------------------------------------------------------- +void __fastcall TWebCfgDlg::ConfigureSoundButtonClick(TObject *Sender) +{ + SoundCfgDlg->sound = &MainForm->web_startup.sound; + SoundCfgDlg->Caption = "Web Server Sound Configuration"; + SoundCfgDlg->ShowModal(); +} +//--------------------------------------------------------------------------- + diff --git a/src/sbbs3/ctrl/WebCfgDlgUnit.dfm b/src/sbbs3/ctrl/WebCfgDlgUnit.dfm index 2f1cac2676..2bc266163c 100644 --- a/src/sbbs3/ctrl/WebCfgDlgUnit.dfm +++ b/src/sbbs3/ctrl/WebCfgDlgUnit.dfm @@ -1,6 +1,6 @@ object WebCfgDlg: TWebCfgDlg - Left = 492 - Top = 403 + Left = 856 + Top = 332 BorderStyle = bsDialog Caption = 'Web Server Configuration' ClientHeight = 245 @@ -25,8 +25,8 @@ object WebCfgDlg: TWebCfgDlg Top = 3 Width = 278 Height = 199 - ActivePage = TlsTabSheet - TabIndex = 1 + ActivePage = SoundTabSheet + TabIndex = 5 TabOrder = 0 object GeneralTabSheet: TTabSheet Caption = 'General' @@ -468,86 +468,14 @@ object WebCfgDlg: TWebCfgDlg object SoundTabSheet: TTabSheet Caption = 'Sound' ImageIndex = 2 - object AnswerSoundLabel: TLabel - Left = 7 - Top = 10 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Connect' - end - object HangupSoundLabel: TLabel - Left = 7 - Top = 36 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Disconnect' - end - object HackAttemptSoundLabel: TLabel - Left = 7 - Top = 62 - Width = 65 - Height = 20 - AutoSize = False - Caption = 'Hack Attempt' - end - object AnswerSoundEdit: TEdit - Left = 85 - Top = 10 - Width = 156 - Height = 21 - Hint = 'Sound file to play when users connect' - ParentShowHint = False - ShowHint = True + object ConfigureSoundButton: TButton + Left = 8 + Top = 8 + Width = 257 + Height = 25 + Caption = 'Configure Common Server Event Sounds' TabOrder = 0 - end - object AnswerSoundButton: TButton - Left = 247 - Top = 10 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 1 - OnClick = AnswerSoundButtonClick - end - object HangupSoundEdit: TEdit - Left = 85 - Top = 36 - Width = 156 - Height = 21 - Hint = 'Sound file to play when users disconnect' - ParentShowHint = False - ShowHint = True - TabOrder = 2 - end - object HangupSoundButton: TButton - Left = 247 - Top = 36 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 3 - OnClick = HangupSoundButtonClick - end - object HackAttemptSoundEdit: TEdit - Left = 85 - Top = 62 - Width = 156 - Height = 21 - Hint = 'Sound file to play when hack attempts are detected' - ParentShowHint = False - ShowHint = True - TabOrder = 4 - end - object HackAttemptSoundButton: TButton - Left = 247 - Top = 62 - Width = 20 - Height = 21 - Caption = '...' - TabOrder = 5 - OnClick = HackAttemptSoundButtonClick + OnClick = ConfigureSoundButtonClick end end end diff --git a/src/sbbs3/ctrl/WebCfgDlgUnit.h b/src/sbbs3/ctrl/WebCfgDlgUnit.h index 1b4083111d..ead3637c4d 100644 --- a/src/sbbs3/ctrl/WebCfgDlgUnit.h +++ b/src/sbbs3/ctrl/WebCfgDlgUnit.h @@ -68,15 +68,6 @@ __published: // IDE-managed Components TCheckBox *DebugRxCheckBox; TCheckBox *AccessLogCheckBox; TTabSheet *SoundTabSheet; - TLabel *AnswerSoundLabel; - TLabel *HangupSoundLabel; - TLabel *HackAttemptSoundLabel; - TEdit *AnswerSoundEdit; - TButton *AnswerSoundButton; - TEdit *HangupSoundEdit; - TButton *HangupSoundButton; - TEdit *HackAttemptSoundEdit; - TButton *HackAttemptSoundButton; TButton *OKBtn; TButton *CancelBtn; TButton *ApplyBtn; @@ -109,16 +100,15 @@ __published: // IDE-managed Components TLabel *AuthTypesLabel; TEdit *AuthTypesEdit; TCheckBox *HSTSEnableCheckBox; + TButton *ConfigureSoundButton; void __fastcall FormShow(TObject *Sender); - void __fastcall AnswerSoundButtonClick(TObject *Sender); - void __fastcall HangupSoundButtonClick(TObject *Sender); - void __fastcall HackAttemptSoundButtonClick(TObject *Sender); void __fastcall OKBtnClick(TObject *Sender); void __fastcall AccessLogCheckBoxClick(TObject *Sender); void __fastcall CGIEnvButtonClick(TObject *Sender); void __fastcall WebHandlersButtonClick(TObject *Sender); void __fastcall CGICheckBoxClick(TObject *Sender); void __fastcall TlsEnableCheckBoxClick(TObject *Sender); + void __fastcall ConfigureSoundButtonClick(TObject *Sender); private: // User declarations public: // User declarations __fastcall TWebCfgDlg(TComponent* Owner); diff --git a/src/sbbs3/ctrl/sbbsctrl.bpr b/src/sbbs3/ctrl/sbbsctrl.bpr index 46803f62b9..470b168bb4 100644 --- a/src/sbbs3/ctrl/sbbsctrl.bpr +++ b/src/sbbs3/ctrl/sbbsctrl.bpr @@ -12,7 +12,8 @@ EventsFormUnit.obj ConfigWizardUnit.obj ServicesFormUnit.obj TelnetCfgDlgUnit.obj MailCfgDlgUnit.obj FtpCfgDlgUnit.obj ServicesCfgDlgUnit.obj ..\sbbs_ini.obj PreviewFormUnit.obj WebFormUnit.obj - WebCfgDlgUnit.obj LoginAttemptsFormUnit.obj"/> + WebCfgDlgUnit.obj LoginAttemptsFormUnit.obj + SoundCfgDlgUnit.obj"/> <RESFILES value="sbbsctrl.res"/> <IDLFILES value=""/> <IDLGENFILES value=""/> @@ -25,7 +26,8 @@ EventsFormUnit.dfm ConfigWizardUnit.dfm ServicesFormUnit.dfm TelnetCfgDlgUnit.dfm MailCfgDlgUnit.dfm FtpCfgDlgUnit.dfm ServicesCfgDlgUnit.dfm PreviewFormUnit.dfm WebFormUnit.dfm - WebCfgDlgUnit.dfm LoginAttemptsFormUnit.dfm"/> + WebCfgDlgUnit.dfm LoginAttemptsFormUnit.dfm + SoundCfgDlgUnit.dfm"/> <LIBFILES value="sbbs.lib mailsrvr.lib ftpsrvr.lib services.lib ..\..\xpdev\bcc.win32.lib.debug\xpdev_mt.lib websrvr.lib"/> <LIBRARIES value="bcb2kaxserver.lib indy.lib dbxcds.lib dclocx.lib soaprtl.lib bcbie.lib @@ -58,8 +60,8 @@ <OTHERFILES value=""/> </MACROS> <OPTIONS> - <IDLCFLAGS value="-I..\. -I.. -I$(BCB)\Projects -I..\..\xpdev -I..\..\smblib - -I$(BCB)\include -I$(BCB)\include\vcl + <IDLCFLAGS value="-I..\. -I.. -I$(BCB)\Projects -I..\..\xpdev + -I..\..\smblib -I..\..\hash -I$(BCB)\include -I$(BCB)\include\vcl -I..\..\..\3rdp\win32.release\cryptlib\include -I..\..\comio -src_suffix cpp -DSBBS -DRINGBUF_SEM -DRINGBUF_MUTEX -DUSE_CRYPTLIB -D_DEBUG -boa"/> <CFLAG1 value="-Od -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -c @@ -115,6 +117,7 @@ <FILE FILENAME="websrvr.lib" FORMNAME="" UNITNAME="websrvr.lib" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/> <FILE FILENAME="WebCfgDlgUnit.cpp" FORMNAME="WebCfgDlg" UNITNAME="WebCfgDlgUnit" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> <FILE FILENAME="LoginAttemptsFormUnit.cpp" FORMNAME="LoginAttemptsForm" UNITNAME="LoginAttemptsFormUnit" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="SoundCfgDlgUnit.cpp" FORMNAME="SoundCfgDlg" UNITNAME="SoundCfgDlgUnit" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> </FILELIST> <BUILDTOOLS> </BUILDTOOLS> @@ -124,8 +127,8 @@ IncludeVerInfo=1 AutoIncBuild=1 MajorVer=3 -MinorVer=18 -Release=1 +MinorVer=19 +Release=0 Build=0 Debug=0 PreRelease=0 @@ -138,13 +141,13 @@ CodePage=1252 [Version Info Keys] CompanyName=Rob Swindell FileDescription=Synchronet BBS Control Panel -FileVersion=3.18.1.0 +FileVersion=3.19.0.0 InternalName= -LegalCopyright=(C) 2020 Rob Swindell +LegalCopyright=(C) 2021 Rob Swindell LegalTrademarks= OriginalFilename=sbbsctrl.exe ProductName=Synchronet BBS -ProductVersion=3.18b +ProductVersion=3.19a Comments= [Excluded Packages] @@ -214,9 +217,7 @@ Item26=..\..\..\Borland\CBuilder4\Projects;..\Lib;$(BCB)\lib\obj;$(BCB)\lib [HistoryLists\hlDebugSourcePath] Count=3 -Item0=$(BCB)\source\vcl;C:\src\xpdev\;C:\src\sbbs3\ -Item1=$(BCB)\source\vcl;C:\src\xpdev\ -Item2=$(BCB)\source\vcl +Item0=$(BCB)\source\vcl [HistoryLists\hlConditionals] Count=9 @@ -231,14 +232,14 @@ Item7=SBBS;SMB_GETMSGTXT;_DEBUG Item8=SBBS;SMB_GETMSGTXT [Debugging] -DebugSourceDirs=$(BCB)\source\vcl;C:\src\xpdev\;C:\src\sbbs3\ +DebugSourceDirs=$(BCB)\source\vcl [Parameters] RunParams= Launcher= UseLauncher=0 DebugCWD= -HostApplication=C:\src\sbbs3\ctrl\sbbsctrl.exe +HostApplication= RemoteHost= RemotePath= RemoteLauncher= diff --git a/src/sbbs3/ctrl/sbbsctrl.cpp b/src/sbbs3/ctrl/sbbsctrl.cpp index 4acb9ee82d..b113544eeb 100644 --- a/src/sbbs3/ctrl/sbbsctrl.cpp +++ b/src/sbbs3/ctrl/sbbsctrl.cpp @@ -63,6 +63,7 @@ USEFORM("PreviewFormUnit.cpp", PreviewForm); USEFORM("WebFormUnit.cpp", WebForm); USEFORM("WebCfgDlgUnit.cpp", WebCfgDlg); USEFORM("LoginAttemptsFormUnit.cpp", LoginAttemptsForm); +USEFORM("C:\src\sbbs3\ctrl\SoundCfgDlgUnit.cpp", SoundCfgDlg); //--------------------------------------------------------------------------- #include "MainFormUnit.h" #include "SpyFormUnit.h" @@ -89,6 +90,7 @@ WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR cmd, int) Application->CreateForm(__classid(TEventsForm), &EventsForm); Application->CreateForm(__classid(TServicesForm), &ServicesForm); Application->CreateForm(__classid(TLoginAttemptsForm), &LoginAttemptsForm); + Application->CreateForm(__classid(TSoundCfgDlg), &SoundCfgDlg); if(cmd[0] && isdir(cmd)) SAFECOPY(MainForm->global.ctrl_dir,cmd); sbbs_get_ini_fname(MainForm->ini_file, MainForm->global.ctrl_dir, NULL /* auto-hostname */); diff --git a/src/sbbs3/ctrl/sbbsctrl.res b/src/sbbs3/ctrl/sbbsctrl.res index 9df7b5e30a44d684ccdebf860a204e457e37f41d..3dd96973dd65bcf5e27a76f709d24e01aeaf8d65 100644 GIT binary patch delta 159 zcmaFDvxav=4l|Pi^W;2cIS|#yY{bdLz{nuPz|6oj`6RPEYaJ5<1H<IE%<{rfAQpoG zg9(EHgC&@Doh;9CnbBzSXO>D$Ee1vgMg|{-REBhhM1~xO5QZX#M1~ZGREAuJM1~@U pY=&Y6FqoXlx?NEUtlF6&pCOkamm!rQkD&x6&)@=5Hd&R;9spK78@m7i delta 89 zcmZ3(`-Eph4l~mYrpbBCav-XY*@%;YfssLofti6}@=0cSRtqKu2FA&6ndOB=Kr99W k1``GY21_uVI$56OGNZxd&n%UbXRvNzbzuOh&1JI(0D^E6XaE2J -- GitLab