From 71640c403d5ad76f5c3ba9cfe59e9e16bf80d408 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Sat, 24 Jan 2009 22:23:49 +0000 Subject: [PATCH] Log level output is adjustable for all servers now. --- src/sbbs3/ctrl/FtpFormUnit.cpp | 14 +++++++++- src/sbbs3/ctrl/FtpFormUnit.dfm | 41 +++++++++++++++++++++++++---- src/sbbs3/ctrl/FtpFormUnit.h | 7 ++++- src/sbbs3/ctrl/MailFormUnit.cpp | 14 +++++++++- src/sbbs3/ctrl/MailFormUnit.dfm | 37 +++++++++++++++++++++++--- src/sbbs3/ctrl/MailFormUnit.h | 7 ++++- src/sbbs3/ctrl/MainFormUnit.cpp | 4 +++ src/sbbs3/ctrl/ServicesFormUnit.cpp | 17 +++++++++++- src/sbbs3/ctrl/ServicesFormUnit.dfm | 31 ++++++++++++++++++++++ src/sbbs3/ctrl/ServicesFormUnit.h | 7 ++++- src/sbbs3/ctrl/TelnetFormUnit.cpp | 2 +- src/sbbs3/ctrl/TelnetFormUnit.h | 2 +- src/sbbs3/ctrl/WebFormUnit.cpp | 17 +++++++++++- src/sbbs3/ctrl/WebFormUnit.dfm | 31 ++++++++++++++++++++++ src/sbbs3/ctrl/WebFormUnit.h | 7 ++++- 15 files changed, 220 insertions(+), 18 deletions(-) diff --git a/src/sbbs3/ctrl/FtpFormUnit.cpp b/src/sbbs3/ctrl/FtpFormUnit.cpp index a6c1764984..8ff29c8efa 100644 --- a/src/sbbs3/ctrl/FtpFormUnit.cpp +++ b/src/sbbs3/ctrl/FtpFormUnit.cpp @@ -6,7 +6,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -55,4 +55,16 @@ void __fastcall TFtpForm::FormHide(TObject *Sender) } //--------------------------------------------------------------------------- +void __fastcall TFtpForm::LogLevelUpDownChangingEx(TObject *Sender, + bool &AllowChange, short NewValue, TUpDownDirection Direction) +{ + if(NewValue < 0 || NewValue > LOG_DEBUG) + AllowChange = false; + else { + MainForm->ftp_startup.log_level = NewValue; + LogLevelText->Caption = LogLevelDesc[NewValue]; + MainForm->SaveIniSettings(Sender); + } +} +//--------------------------------------------------------------------------- diff --git a/src/sbbs3/ctrl/FtpFormUnit.dfm b/src/sbbs3/ctrl/FtpFormUnit.dfm index 481e27ec37..56febc15bd 100644 --- a/src/sbbs3/ctrl/FtpFormUnit.dfm +++ b/src/sbbs3/ctrl/FtpFormUnit.dfm @@ -1,7 +1,7 @@ object FtpForm: TFtpForm - Left = 856 - Top = 689 - Width = 350 + Left = 709 + Top = 771 + Width = 469 Height = 150 Caption = 'FTP Server' Color = clBtnFace @@ -19,7 +19,7 @@ object FtpForm: TFtpForm object ToolBar: TToolBar Left = 0 Top = 0 - Width = 342 + Width = 461 Height = 25 Caption = 'ToolBar' EdgeBorders = [] @@ -98,11 +98,42 @@ object FtpForm: TFtpForm Step = 1 TabOrder = 1 end + object ToolButton4: TToolButton + Left = 341 + Top = 0 + Width = 8 + Caption = 'ToolButton4' + ImageIndex = 7 + Style = tbsSeparator + end + object LogLevelText: TStaticText + Left = 349 + Top = 0 + Width = 75 + Height = 22 + Hint = 'Web Server Log Level' + AutoSize = False + BorderStyle = sbsSunken + TabOrder = 2 + end + object LogLevelUpDown: TUpDown + Left = 424 + Top = 0 + Width = 16 + Height = 22 + Hint = 'Log Level Adjustment' + Min = 0 + Max = 7 + Position = 0 + TabOrder = 3 + Wrap = False + OnChangingEx = LogLevelUpDownChangingEx + end end object Log: TRichEdit Left = 0 Top = 25 - Width = 342 + Width = 461 Height = 92 Align = alClient Font.Charset = DEFAULT_CHARSET diff --git a/src/sbbs3/ctrl/FtpFormUnit.h b/src/sbbs3/ctrl/FtpFormUnit.h index 8eaf9de8fa..5851cb93a6 100644 --- a/src/sbbs3/ctrl/FtpFormUnit.h +++ b/src/sbbs3/ctrl/FtpFormUnit.h @@ -6,7 +6,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -61,7 +61,12 @@ __published: // IDE-managed Components TProgressBar *ProgressBar; TToolButton *RecycleButton; TRichEdit *Log; + TToolButton *ToolButton4; + TStaticText *LogLevelText; + TUpDown *LogLevelUpDown; void __fastcall FormHide(TObject *Sender); + void __fastcall LogLevelUpDownChangingEx(TObject *Sender, + bool &AllowChange, short NewValue, TUpDownDirection Direction); private: // User declarations public: // User declarations __fastcall TFtpForm(TComponent* Owner); diff --git a/src/sbbs3/ctrl/MailFormUnit.cpp b/src/sbbs3/ctrl/MailFormUnit.cpp index f521f6ecf4..9ff3ce2929 100644 --- a/src/sbbs3/ctrl/MailFormUnit.cpp +++ b/src/sbbs3/ctrl/MailFormUnit.cpp @@ -6,7 +6,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -54,4 +54,16 @@ void __fastcall TMailForm::FormHide(TObject *Sender) } //--------------------------------------------------------------------------- +void __fastcall TMailForm::LogLevelUpDownChangingEx(TObject *Sender, + bool &AllowChange, short NewValue, TUpDownDirection Direction) +{ + if(NewValue < 0 || NewValue > LOG_DEBUG) + AllowChange = false; + else { + MainForm->mail_startup.log_level = NewValue; + LogLevelText->Caption = LogLevelDesc[NewValue]; + MainForm->SaveIniSettings(Sender); + } +} +//--------------------------------------------------------------------------- diff --git a/src/sbbs3/ctrl/MailFormUnit.dfm b/src/sbbs3/ctrl/MailFormUnit.dfm index 592331d625..9d3faf9e4e 100644 --- a/src/sbbs3/ctrl/MailFormUnit.dfm +++ b/src/sbbs3/ctrl/MailFormUnit.dfm @@ -1,7 +1,7 @@ object MailForm: TMailForm Left = 670 Top = 170 - Width = 350 + Width = 480 Height = 150 Caption = 'Mail Server' Color = clBtnFace @@ -21,7 +21,7 @@ object MailForm: TMailForm object ToolBar: TToolBar Left = 0 Top = 0 - Width = 342 + Width = 472 Height = 25 Caption = 'ToolBar' EdgeBorders = [] @@ -101,11 +101,42 @@ object MailForm: TMailForm Step = 1 TabOrder = 1 end + object ToolButton2: TToolButton + Left = 341 + Top = 0 + Width = 8 + Caption = 'ToolButton2' + ImageIndex = 7 + Style = tbsSeparator + end + object LogLevelText: TStaticText + Left = 349 + Top = 0 + Width = 75 + Height = 22 + Hint = 'Web Server Log Level' + AutoSize = False + BorderStyle = sbsSunken + TabOrder = 2 + end + object LogLevelUpDown: TUpDown + Left = 424 + Top = 0 + Width = 16 + Height = 22 + Hint = 'Log Level Adjustment' + Min = 0 + Max = 7 + Position = 0 + TabOrder = 3 + Wrap = False + OnChangingEx = LogLevelUpDownChangingEx + end end object Log: TRichEdit Left = 0 Top = 25 - Width = 342 + Width = 472 Height = 92 Align = alClient Font.Charset = DEFAULT_CHARSET diff --git a/src/sbbs3/ctrl/MailFormUnit.h b/src/sbbs3/ctrl/MailFormUnit.h index 0360970086..e1685b665b 100644 --- a/src/sbbs3/ctrl/MailFormUnit.h +++ b/src/sbbs3/ctrl/MailFormUnit.h @@ -6,7 +6,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -61,7 +61,12 @@ __published: // IDE-managed Components TProgressBar *ProgressBar; TToolButton *RecycleButton; TRichEdit *Log; + TToolButton *ToolButton2; + TStaticText *LogLevelText; + TUpDown *LogLevelUpDown; void __fastcall FormHide(TObject *Sender); + void __fastcall LogLevelUpDownChangingEx(TObject *Sender, + bool &AllowChange, short NewValue, TUpDownDirection Direction); private: // User declarations public: // User declarations __fastcall TMailForm(TComponent* Owner); diff --git a/src/sbbs3/ctrl/MainFormUnit.cpp b/src/sbbs3/ctrl/MainFormUnit.cpp index 46fb0be329..224b7ad8d3 100644 --- a/src/sbbs3/ctrl/MainFormUnit.cpp +++ b/src/sbbs3/ctrl/MainFormUnit.cpp @@ -2416,6 +2416,10 @@ void __fastcall TMainForm::StartupTimerTick(TObject *Sender) ServiceStatusTimer->Enabled=true; TelnetForm->LogLevelUpDown->Position=bbs_startup.log_level; + FtpForm->LogLevelUpDown->Position=ftp_startup.log_level; + MailForm->LogLevelUpDown->Position=mail_startup.log_level; + WebForm->LogLevelUpDown->Position=web_startup.log_level; + ServicesForm->LogLevelUpDown->Position=services_startup.log_level; if(!Application->Active) /* Starting up minimized? */ FormMinimize(Sender); /* Put icon in systray */ diff --git a/src/sbbs3/ctrl/ServicesFormUnit.cpp b/src/sbbs3/ctrl/ServicesFormUnit.cpp index 31812f1b2d..0f60241f93 100644 --- a/src/sbbs3/ctrl/ServicesFormUnit.cpp +++ b/src/sbbs3/ctrl/ServicesFormUnit.cpp @@ -6,7 +6,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -54,3 +54,18 @@ void __fastcall TServicesForm::FormHide(TObject *Sender) } //--------------------------------------------------------------------------- + + +void __fastcall TServicesForm::LogLevelUpDownChangingEx(TObject *Sender, + bool &AllowChange, short NewValue, TUpDownDirection Direction) +{ + if(NewValue < 0 || NewValue > LOG_DEBUG) + AllowChange = false; + else { + MainForm->services_startup.log_level = NewValue; + LogLevelText->Caption = LogLevelDesc[NewValue]; + MainForm->SaveIniSettings(Sender); + } +} +//--------------------------------------------------------------------------- + diff --git a/src/sbbs3/ctrl/ServicesFormUnit.dfm b/src/sbbs3/ctrl/ServicesFormUnit.dfm index 0acf1b0365..9391524b0e 100644 --- a/src/sbbs3/ctrl/ServicesFormUnit.dfm +++ b/src/sbbs3/ctrl/ServicesFormUnit.dfm @@ -83,6 +83,37 @@ object ServicesForm: TServicesForm Caption = 'Down' TabOrder = 0 end + object ToolButton3: TToolButton + Left = 258 + Top = 0 + Width = 8 + Caption = 'ToolButton3' + ImageIndex = 6 + Style = tbsSeparator + end + object LogLevelText: TStaticText + Left = 266 + Top = 0 + Width = 75 + Height = 22 + Hint = 'Web Server Log Level' + AutoSize = False + BorderStyle = sbsSunken + TabOrder = 1 + end + object LogLevelUpDown: TUpDown + Left = 341 + Top = 0 + Width = 16 + Height = 22 + Hint = 'Log Level Adjustment' + Min = 0 + Max = 7 + Position = 0 + TabOrder = 2 + Wrap = False + OnChangingEx = LogLevelUpDownChangingEx + end end object Log: TRichEdit Left = 0 diff --git a/src/sbbs3/ctrl/ServicesFormUnit.h b/src/sbbs3/ctrl/ServicesFormUnit.h index a187bc8b38..03441f6a13 100644 --- a/src/sbbs3/ctrl/ServicesFormUnit.h +++ b/src/sbbs3/ctrl/ServicesFormUnit.h @@ -6,7 +6,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -58,7 +58,12 @@ __published: // IDE-managed Components TStaticText *Status; TToolButton *RecycleButton; TRichEdit *Log; + TToolButton *ToolButton3; + TStaticText *LogLevelText; + TUpDown *LogLevelUpDown; void __fastcall FormHide(TObject *Sender); + void __fastcall LogLevelUpDownChangingEx(TObject *Sender, + bool &AllowChange, short NewValue, TUpDownDirection Direction); private: // User declarations public: // User declarations __fastcall TServicesForm(TComponent* Owner); diff --git a/src/sbbs3/ctrl/TelnetFormUnit.cpp b/src/sbbs3/ctrl/TelnetFormUnit.cpp index 1318961842..0620b35347 100644 --- a/src/sbbs3/ctrl/TelnetFormUnit.cpp +++ b/src/sbbs3/ctrl/TelnetFormUnit.cpp @@ -60,7 +60,7 @@ void __fastcall TTelnetForm::LogLevelUpDownChangingEx(TObject *Sender, AllowChange = false; else { MainForm->bbs_startup.log_level = NewValue; - LogLevelText->Caption = LogLevelDesc[MainForm->bbs_startup.log_level]; + LogLevelText->Caption = LogLevelDesc[NewValue]; MainForm->SaveIniSettings(Sender); } } diff --git a/src/sbbs3/ctrl/TelnetFormUnit.h b/src/sbbs3/ctrl/TelnetFormUnit.h index 8fa60c4c4c..c0ac818068 100644 --- a/src/sbbs3/ctrl/TelnetFormUnit.h +++ b/src/sbbs3/ctrl/TelnetFormUnit.h @@ -6,7 +6,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * diff --git a/src/sbbs3/ctrl/WebFormUnit.cpp b/src/sbbs3/ctrl/WebFormUnit.cpp index da03318b20..210d4958cb 100644 --- a/src/sbbs3/ctrl/WebFormUnit.cpp +++ b/src/sbbs3/ctrl/WebFormUnit.cpp @@ -4,7 +4,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -47,3 +47,18 @@ __fastcall TWebForm::TWebForm(TComponent* Owner) MainForm=(TMainForm*)Application->MainForm; } //--------------------------------------------------------------------------- + + +void __fastcall TWebForm::LogLevelUpDownChangingEx(TObject *Sender, + bool &AllowChange, short NewValue, TUpDownDirection Direction) +{ + if(NewValue < 0 || NewValue > LOG_DEBUG) + AllowChange = false; + else { + MainForm->web_startup.log_level = NewValue; + LogLevelText->Caption = LogLevelDesc[NewValue]; + MainForm->SaveIniSettings(Sender); + } +} +//--------------------------------------------------------------------------- + diff --git a/src/sbbs3/ctrl/WebFormUnit.dfm b/src/sbbs3/ctrl/WebFormUnit.dfm index 231f4945cb..fe6f15444c 100644 --- a/src/sbbs3/ctrl/WebFormUnit.dfm +++ b/src/sbbs3/ctrl/WebFormUnit.dfm @@ -103,6 +103,37 @@ object WebForm: TWebForm Step = 1 TabOrder = 1 end + object ToolButton4: TToolButton + Left = 341 + Top = 0 + Width = 8 + Caption = 'ToolButton4' + ImageIndex = 7 + Style = tbsSeparator + end + object LogLevelText: TStaticText + Left = 349 + Top = 0 + Width = 75 + Height = 22 + Hint = 'Web Server Log Level' + AutoSize = False + BorderStyle = sbsSunken + TabOrder = 2 + end + object LogLevelUpDown: TUpDown + Left = 424 + Top = 0 + Width = 16 + Height = 22 + Hint = 'Log Level Adjustment' + Min = 0 + Max = 7 + Position = 0 + TabOrder = 3 + Wrap = False + OnChangingEx = LogLevelUpDownChangingEx + end end object Log: TRichEdit Left = 0 diff --git a/src/sbbs3/ctrl/WebFormUnit.h b/src/sbbs3/ctrl/WebFormUnit.h index 04931d15a4..bed8e96a20 100644 --- a/src/sbbs3/ctrl/WebFormUnit.h +++ b/src/sbbs3/ctrl/WebFormUnit.h @@ -4,7 +4,7 @@ * @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * * - * Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html * + * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * @@ -57,6 +57,11 @@ __published: // IDE-managed Components TToolButton *ToolButton3; TProgressBar *ProgressBar; TRichEdit *Log; + TToolButton *ToolButton4; + TStaticText *LogLevelText; + TUpDown *LogLevelUpDown; + void __fastcall LogLevelUpDownChangingEx(TObject *Sender, + bool &AllowChange, short NewValue, TUpDownDirection Direction); private: // User declarations public: // User declarations __fastcall TWebForm(TComponent* Owner); -- GitLab