diff --git a/src/sbbs3/ctrl/MainFormUnit.cpp b/src/sbbs3/ctrl/MainFormUnit.cpp index 32ee68e57203309c0a3a457274891d65d224c36f..b832c81d320e7d53d5a0ce386cb7e3fde2db70be 100644 --- a/src/sbbs3/ctrl/MainFormUnit.cpp +++ b/src/sbbs3/ctrl/MainFormUnit.cpp @@ -2641,8 +2641,6 @@ void __fastcall TMainForm::ViewStatusBarMenuItemClick(TObject *Sender) ViewStatusBarMenuItem->Checked=StatusBar->Visible; } //--------------------------------------------------------------------------- - - void __fastcall TMainForm::HelpAboutMenuItemClick(TObject *Sender) { Application->CreateForm(__classid(TAboutBoxForm), &AboutBoxForm); @@ -2650,26 +2648,39 @@ void __fastcall TMainForm::HelpAboutMenuItemClick(TObject *Sender) delete AboutBoxForm; } //--------------------------------------------------------------------------- +BOOL MuteService(SC_HANDLE svc, SERVICE_STATUS* status, BOOL mute) +{ + if(svc==NULL || controlService==NULL) + return(FALSE); - - + return controlService(svc + ,mute ? SERVICE_CONTROL_MUTE:SERVICE_CONTROL_UNMUTE, status); +} +//--------------------------------------------------------------------------- void __fastcall TMainForm::SoundToggleExecute(TObject *Sender) { SoundToggle->Checked=!SoundToggle->Checked; + if(!SoundToggle->Checked) { bbs_startup.options|=BBS_OPT_MUTE; ftp_startup.options|=FTP_OPT_MUTE; + web_startup.options|=FTP_OPT_MUTE; mail_startup.options|=MAIL_OPT_MUTE; + services_startup.options|=MAIL_OPT_MUTE; } else { bbs_startup.options&=~BBS_OPT_MUTE; ftp_startup.options&=~FTP_OPT_MUTE; + web_startup.options&=~FTP_OPT_MUTE; mail_startup.options&=~MAIL_OPT_MUTE; + services_startup.options&=~MAIL_OPT_MUTE; } + MuteService(bbs_svc,&bbs_svc_status,!SoundToggle->Checked); + MuteService(ftp_svc,&ftp_svc_status,!SoundToggle->Checked); + MuteService(web_svc,&web_svc_status,!SoundToggle->Checked); + MuteService(mail_svc,&mail_svc_status,!SoundToggle->Checked); + MuteService(services_svc,&services_svc_status,!SoundToggle->Checked); } //--------------------------------------------------------------------------- - - - void __fastcall TMainForm::BBSStatisticsLogMenuItemClick(TObject *Sender) { StatsForm->LogButtonClick(Sender); @@ -2839,6 +2850,10 @@ void __fastcall TMainForm::ChatToggleExecute(TObject *Sender) else bbs_startup.options&=~BBS_OPT_SYSOP_AVAILABLE; + if(bbs_svc!=NULL && controlService!=NULL) + controlService(bbs_svc + ,ChatToggle->Checked ? SERVICE_CONTROL_SYSOP_AVAILABLE : SERVICE_CONTROL_SYSOP_UNAVAILABLE + ,&bbs_svc_status); } //--------------------------------------------------------------------------- void __fastcall TMainForm::UserEditExecute(TObject *Sender) @@ -3147,11 +3162,12 @@ void __fastcall TMainForm::UserTruncateMenuItemClick(TObject *Sender) BOOL RecycleService(SC_HANDLE svc, SERVICE_STATUS* status) { - if(controlService==NULL) + if(svc==NULL || controlService==NULL) return(FALSE); return controlService(svc, SERVICE_CONTROL_RECYCLE, status); } + //--------------------------------------------------------------------------- void __fastcall TMainForm::MailRecycleExecute(TObject *Sender) {