Skip to content
Snippets Groups Projects
Commit e2d324b4 authored by rswindell's avatar rswindell
Browse files

Added support for hack attempt sound (wave) file.

parent 977d17fc
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,7 @@ void __fastcall TFtpCfgDlg::FormShow(TObject *Sender)
HtmlJavaScriptEdit->Text=AnsiString(MainForm->ftp_startup.html_index_script);
AnswerSoundEdit->Text=AnsiString(MainForm->ftp_startup.answer_sound);
HangupSoundEdit->Text=AnsiString(MainForm->ftp_startup.hangup_sound);
HackAttemptSoundEdit->Text=AnsiString(MainForm->ftp_startup.hack_sound);
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;
......@@ -144,6 +145,10 @@ void __fastcall TFtpCfgDlg::OKBtnClick(TObject *Sender)
sprintf(MainForm->ftp_startup.hangup_sound,"%.*s"
,sizeof(MainForm->ftp_startup.hangup_sound)-1
,HangupSoundEdit->Text.c_str());
sprintf(MainForm->ftp_startup.hack_sound,"%.*s"
,sizeof(MainForm->ftp_startup.hack_sound)-1
,HackAttemptSoundEdit->Text.c_str());
if(DebugTxCheckBox->Checked==true)
MainForm->ftp_startup.options|=FTP_OPT_DEBUG_TX;
else
......@@ -204,6 +209,15 @@ void __fastcall TFtpCfgDlg::HangupSoundButtonClick(TObject *Sender)
}
}
//---------------------------------------------------------------------------
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)
{
......@@ -229,3 +243,4 @@ void __fastcall TFtpCfgDlg::HtmlIndexCheckBoxClick(TObject *Sender)
}
//---------------------------------------------------------------------------
......@@ -17,7 +17,7 @@ object FtpCfgDlg: TFtpCfgDlg
Top = 4
Width = 342
Height = 245
ActivePage = IndexTabSheet
ActivePage = SoundTabSheet
TabOrder = 0
object GeneralTabSheet: TTabSheet
Caption = 'General'
......@@ -296,7 +296,7 @@ object FtpCfgDlg: TFtpCfgDlg
AutoSize = False
Caption = 'Connect'
end
object HnagupSoundLabel: TLabel
object HangupSoundLabel: TLabel
Left = 9
Top = 44
Width = 80
......@@ -304,6 +304,14 @@ object FtpCfgDlg: TFtpCfgDlg
AutoSize = False
Caption = 'Disconnect'
end
object HackAttemptSoundLabel: TLabel
Left = 9
Top = 76
Width = 80
Height = 25
AutoSize = False
Caption = 'Hack Attempt'
end
object AnswerSoundEdit: TEdit
Left = 105
Top = 12
......@@ -342,6 +350,25 @@ object FtpCfgDlg: TFtpCfgDlg
TabOrder = 3
OnClick = HangupSoundButtonClick
end
object HackAttemptSoundEdit: TEdit
Left = 105
Top = 76
Width = 192
Height = 24
Hint = 'Sound file to play when users disconnect'
ParentShowHint = False
ShowHint = True
TabOrder = 4
end
object HackAttemptSoundButton: TButton
Left = 304
Top = 76
Width = 25
Height = 26
Caption = '...'
TabOrder = 5
OnClick = HackAttemptSoundButtonClick
end
end
end
object OKBtn: TButton
......
......@@ -66,7 +66,7 @@ __published:
TLabel *AnswerSoundLabel;
TEdit *AnswerSoundEdit;
TButton *AnswerSoundButton;
TLabel *HnagupSoundLabel;
TLabel *HangupSoundLabel;
TEdit *HangupSoundEdit;
TButton *HangupSoundButton;
TLabel *MaxClientesLabel;
......@@ -93,6 +93,9 @@ __published:
TEdit *HtmlJavaScriptEdit;
TLabel *QwkTimeoutLabel;
TEdit *QwkTimeoutEdit;
TLabel *HackAttemptSoundLabel;
TEdit *HackAttemptSoundEdit;
TButton *HackAttemptSoundButton;
void __fastcall FormShow(TObject *Sender);
void __fastcall OKBtnClick(TObject *Sender);
void __fastcall AnswerSoundButtonClick(TObject *Sender);
......@@ -100,6 +103,7 @@ __published:
void __fastcall AutoIndexCheckBoxClick(TObject *Sender);
void __fastcall HtmlJavaScriptButtonClick(TObject *Sender);
void __fastcall HtmlIndexCheckBoxClick(TObject *Sender);
void __fastcall HackAttemptSoundButtonClick(TObject *Sender);
private:
public:
virtual __fastcall TFtpCfgDlg(TComponent* AOwner);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment