Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit cb0c1e83 authored by Rob Swindell's avatar Rob Swindell 💬

Move all common sound (WAV) file configuration to its own dialog

Increment the version in the project file to v3.19a.
parent 053477fe
Pipeline #1943 passed with stage
in 8 minutes and 22 seconds
......@@ -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();
}
//---------------------------------------------------------------------------
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
......
......@@ -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);
......
......@@ -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();
}
//---------------------------------------------------------------------------
......@@ -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'
......
......@@ -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);
......
......@@ -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();
}
//---------------------------------------------------------------------------
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
......
......@@ -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);
......
......@@ -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();
}
//---------------------------------------------------------------------------
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