Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
c3a66c8c
Commit
c3a66c8c
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Added support for mail domains.cfg alias configuration.
Added read/write to registry for log/list and font colors.
parent
b048a343
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/ctrl/MainFormUnit.cpp
+83
-1
83 additions, 1 deletion
src/sbbs3/ctrl/MainFormUnit.cpp
src/sbbs3/ctrl/MainFormUnit.h
+8
-2
8 additions, 2 deletions
src/sbbs3/ctrl/MainFormUnit.h
with
91 additions
and
3 deletions
src/sbbs3/ctrl/MainFormUnit.cpp
+
83
−
1
View file @
c3a66c8c
...
...
@@ -630,6 +630,7 @@ void __fastcall TMainForm::FormCreate(TObject *Sender)
Application
->
MessageBox
(
"Error opening registry key"
,
REG_KEY
,
MB_OK
|
MB_ICONEXCLAMATION
);
Application
->
Terminate
();
return
;
}
if
(
Registry
->
ValueExists
(
"MainFormTop"
))
Top
=
Registry
->
ReadInteger
(
"MainFormTop"
);
...
...
@@ -984,6 +985,59 @@ int __fastcall TMainForm::PageNum(TPageControl* obj)
return
(
PAGE_LOWERLEFT
);
return
(
PAGE_LOWERRIGHT
);
}
void
__fastcall
TMainForm
::
ReadColor
(
TRegistry
*
Registry
,
AnsiString
name
,
TColor
&
color
)
{
if
(
Registry
->
ValueExists
(
name
+
"Color"
))
color
=
StringToColor
(
Registry
->
ReadString
(
name
+
"Color"
));
}
void
__fastcall
TMainForm
::
WriteColor
(
TRegistry
*
Registry
,
AnsiString
name
,
TColor
color
)
{
Registry
->
WriteString
(
name
+
"Color"
,
ColorToString
(
color
));
}
void
__fastcall
TMainForm
::
ReadFont
(
AnsiString
subkey
,
TFont
*
Font
)
{
// Read Registry keys
TRegistry
*
Registry
=
new
TRegistry
;
AnsiString
key
=
REG_KEY
+
subkey
+
"Font"
;
if
(
!
Registry
->
OpenKey
(
key
,
true
))
{
Application
->
MessageBox
(
"Error opening registry key"
,
key
.
c_str
(),
MB_OK
|
MB_ICONEXCLAMATION
);
Application
->
Terminate
();
return
;
}
if
(
Registry
->
ValueExists
(
"Name"
))
Font
->
Name
=
Registry
->
ReadString
(
"Name"
);
if
(
Registry
->
ValueExists
(
"Color"
))
Font
->
Color
=
StringToColor
(
Registry
->
ReadString
(
"Color"
));
if
(
Registry
->
ValueExists
(
"Height"
))
Font
->
Height
=
Registry
->
ReadInteger
(
"Height"
);
if
(
Registry
->
ValueExists
(
"Size"
))
Font
->
Size
=
Registry
->
ReadInteger
(
"Size"
);
Registry
->
CloseKey
();
delete
Registry
;
}
void
__fastcall
TMainForm
::
WriteFont
(
AnsiString
subkey
,
TFont
*
Font
)
{
// Read Registry keys
TRegistry
*
Registry
=
new
TRegistry
;
AnsiString
key
=
REG_KEY
+
subkey
+
"Font"
;
if
(
!
Registry
->
OpenKey
(
key
,
true
))
{
Application
->
MessageBox
(
"Error opening registry key"
,
key
.
c_str
(),
MB_OK
|
MB_ICONEXCLAMATION
);
Application
->
Terminate
();
return
;
}
Registry
->
WriteString
(
"Name"
,
Font
->
Name
);
Registry
->
WriteString
(
"Color"
,
ColorToString
(
Font
->
Color
));
Registry
->
WriteInteger
(
"Height"
,
Font
->
Height
);
Registry
->
WriteInteger
(
"Size"
,
Font
->
Size
);
Registry
->
CloseKey
();
delete
Registry
;
}
void
__fastcall
TMainForm
::
StartupTimerTick
(
TObject
*
Sender
)
{
bool
TelnetFormFloating
=
false
;
...
...
@@ -1011,6 +1065,7 @@ void __fastcall TMainForm::StartupTimerTick(TObject *Sender)
Application
->
MessageBox
(
"Error opening registry key"
,
REG_KEY
,
MB_OK
|
MB_ICONEXCLAMATION
);
Application
->
Terminate
();
return
;
}
TopPanel
->
Height
=
Height
/
3
;
...
...
@@ -1060,6 +1115,19 @@ void __fastcall TMainForm::StartupTimerTick(TObject *Sender)
if
(
Registry
->
ValueExists
(
"FtpFormPage"
))
FtpFormPage
=
Registry
->
ReadInteger
(
"FtpFormPage"
);
ReadColor
(
Registry
,
"TelnetLog"
,
TelnetForm
->
Log
->
Color
);
ReadFont
(
"TelnetLog"
,
TelnetForm
->
Log
->
Font
);
ReadColor
(
Registry
,
"EventsLog"
,
EventsForm
->
Log
->
Color
);
ReadFont
(
"EventsLog"
,
EventsForm
->
Log
->
Font
);
ReadColor
(
Registry
,
"MailLog"
,
MailForm
->
Log
->
Color
);
ReadFont
(
"MailLog"
,
MailForm
->
Log
->
Font
);
ReadColor
(
Registry
,
"FtpLog"
,
FtpForm
->
Log
->
Color
);
ReadFont
(
"FtpLog"
,
FtpForm
->
Log
->
Font
);
ReadColor
(
Registry
,
"NodeList"
,
NodeForm
->
ListBox
->
Color
);
ReadFont
(
"NodeList"
,
NodeForm
->
ListBox
->
Font
);
ReadColor
(
Registry
,
"ClientList"
,
ClientForm
->
ListView
->
Color
);
ReadFont
(
"ClientList"
,
ClientForm
->
ListView
->
Font
);
if
(
Registry
->
ValueExists
(
"TelnetFormTop"
))
TelnetForm
->
Top
=
Registry
->
ReadInteger
(
"TelnetFormTop"
);
if
(
Registry
->
ValueExists
(
"TelnetFormLeft"
))
...
...
@@ -1426,6 +1494,7 @@ void __fastcall TMainForm::SaveSettings(TObject* Sender)
Application
->
MessageBox
(
"Error creating registry key"
,
REG_KEY
,
MB_OK
|
MB_ICONEXCLAMATION
);
Application
->
Terminate
();
return
;
}
Registry
->
WriteInteger
(
"MainFormTop"
,
Top
);
...
...
@@ -1475,7 +1544,7 @@ void __fastcall TMainForm::SaveSettings(TObject* Sender)
,
LowerLeftPageControl
->
Width
);
Registry
->
WriteBool
(
"UndockableForms"
,
UndockableForms
);
Registry
->
WriteBool
(
"TelnetFormFloating"
,
TelnetForm
->
Floating
);
Registry
->
WriteBool
(
"EventsFormFloating"
,
EventsForm
->
Floating
);
Registry
->
WriteBool
(
"NodeFormFloating"
,
NodeForm
->
Floating
);
...
...
@@ -1499,6 +1568,19 @@ void __fastcall TMainForm::SaveSettings(TObject* Sender)
Registry
->
WriteInteger
(
"ClientFormPage"
,
PageNum
((
TPageControl
*
)
ClientForm
->
HostDockSite
));
WriteColor
(
Registry
,
"TelnetLog"
,
TelnetForm
->
Log
->
Color
);
WriteFont
(
"TelnetLog"
,
TelnetForm
->
Log
->
Font
);
WriteColor
(
Registry
,
"EventsLog"
,
EventsForm
->
Log
->
Color
);
WriteFont
(
"EventsLog"
,
EventsForm
->
Log
->
Font
);
WriteColor
(
Registry
,
"MailLog"
,
MailForm
->
Log
->
Color
);
WriteFont
(
"MailLog"
,
MailForm
->
Log
->
Font
);
WriteColor
(
Registry
,
"FtpLog"
,
FtpForm
->
Log
->
Color
);
WriteFont
(
"FtpLog"
,
FtpForm
->
Log
->
Font
);
WriteColor
(
Registry
,
"NodeList"
,
NodeForm
->
ListBox
->
Color
);
WriteFont
(
"NodeList"
,
NodeForm
->
ListBox
->
Font
);
WriteColor
(
Registry
,
"ClientList"
,
ClientForm
->
ListView
->
Color
);
WriteFont
(
"ClientList"
,
ClientForm
->
ListView
->
Font
);
Registry
->
WriteBool
(
"ToolBarVisible"
,
Toolbar
->
Visible
);
Registry
->
WriteBool
(
"StatusBarVisible"
,
StatusBar
->
Visible
);
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/ctrl/MainFormUnit.h
+
8
−
2
View file @
c3a66c8c
...
...
@@ -54,6 +54,7 @@
#include
<ImgList.hpp>
#include
<Buttons.hpp>
#include
<Graphics.hpp>
#include
<vcl\Registry.hpp>
/* TRegistry */
#include
"Trayicon.h"
//---------------------------------------------------------------------------
#define APP_TITLE "Synchronet Control Panel"
...
...
@@ -176,7 +177,7 @@ __published: // IDE-managed Components
TMenuItem
*
BBSEditIPFilterMsg
;
TMenuItem
*
BBSEditHostFilter
;
TMenuItem
*
BBSEditHostFilterMsg
;
TMenuItem
*
AllowedRelayList
1
;
TMenuItem
*
AllowedRelayList
;
TMenuItem
*
SaveSettingsMenuOption
;
TMenuItem
*
N6
;
TMenuItem
*
TelnetEditMenuItem
;
...
...
@@ -232,6 +233,7 @@ __published: // IDE-managed Components
TToolButton
*
ToolButton3
;
TToolButton
*
ReloadConfigButton
;
TMenuItem
*
MailViewSpamLog
;
TMenuItem
*
DomainList
;
void
__fastcall
FileExitMenuItemClick
(
TObject
*
Sender
);
void
__fastcall
ViewToolbarMenuItemClick
(
TObject
*
Sender
);
void
__fastcall
FormClose
(
TObject
*
Sender
,
TCloseAction
&
Action
);
...
...
@@ -319,7 +321,11 @@ public: // User declarations
bool
SpyTerminalKeyboardActive
;
TPageControl
*
__fastcall
PageControl
(
int
num
);
int
__fastcall
PageNum
(
TPageControl
*
obj
);
void
__fastcall
FormMinimize
(
TObject
*
Sender
);
void
__fastcall
FormMinimize
(
TObject
*
Sender
);
void
__fastcall
ReadColor
(
TRegistry
*
,
AnsiString
,
TColor
&
);
void
__fastcall
WriteColor
(
TRegistry
*
,
AnsiString
,
TColor
);
void
__fastcall
ReadFont
(
AnsiString
,
TFont
*
);
void
__fastcall
WriteFont
(
AnsiString
,
TFont
*
);
};
//---------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment