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
b16b95aa
Commit
b16b95aa
authored
21 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Automatically converts Windows timezone to SMB format on new install.
Supports non-standard timezones (as configured in SCFG).
parent
c2a12674
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/ctrl/ConfigWizardUnit.cpp
+35
-10
35 additions, 10 deletions
src/sbbs3/ctrl/ConfigWizardUnit.cpp
with
35 additions
and
10 deletions
src/sbbs3/ctrl/ConfigWizardUnit.cpp
+
35
−
10
View file @
b16b95aa
...
...
@@ -153,10 +153,32 @@ void __fastcall TConfigWizard::FormShow(TObject *Sender)
if
(
scfg
.
new_install
)
{
TIME_ZONE_INFORMATION
tz
;
memset
(
&
tz
,
0
,
sizeof
(
tz
));
GetTimeZoneInformation
(
&
tz
);
/* How to convert to SMB tz format? */
memset
(
&
tz
,
0
,
sizeof
(
tz
));
DWORD
tzRet
=
GetTimeZoneInformation
(
&
tz
);
/* Convert to SMB tz format */
scfg
.
sys_timezone
=
0
;
if
(
tz
.
Bias
>
0
)
{
switch
(
tz
.
Bias
|
US_ZONE
)
{
case
AST
:
case
EST
:
case
CST
:
case
MST
:
case
PST
:
case
YST
:
case
HST
:
case
BST
:
scfg
.
sys_timezone
=
tz
.
Bias
|
US_ZONE
;
if
(
tzRet
==
TIME_ZONE_ID_DAYLIGHT
)
scfg
.
sys_timezone
|=
DAYLIGHT
;
break
;
default:
scfg
.
sys_timezone
=
tz
.
Bias
|
WESTERN_ZONE
;
break
;
}
}
else
if
(
tz
.
Bias
<
0
)
scfg
.
sys_timezone
=
(
-
tz
.
Bias
)
|
EASTERN_ZONE
;
/* Get DNS Server Address */
#if 0 /* Old way */
sprintf(str,"%s /c ipconfig /all > %sipconfig.txt"
...
...
@@ -249,14 +271,13 @@ void __fastcall TConfigWizard::FormShow(TObject *Sender)
strcpy
(
str
,
tz_str
[
i
]);
TimeZoneComboBox
->
Items
->
Add
(
str
);
}
sprintf
(
str
,
"Other (%s)"
,
zonestr
(
scfg
.
sys_timezone
));
TimeZoneComboBox
->
Items
->
Add
(
str
);
for
(
i
=
0
;
i
<
sizeof
(
tz_val
)
/
sizeof
(
tz_val
[
0
]);
i
++
)
if
((
scfg
.
sys_timezone
&
((
short
)
~
DAYLIGHT
))
==
tz_val
[
i
])
break
;
if
(
i
<
sizeof
(
tz_val
)
/
sizeof
(
tz_val
[
0
]))
TimeZoneComboBox
->
ItemIndex
=
i
;
else
TimeZoneComboBox
->
ItemIndex
=
0
;
TimeZoneComboBox
->
ItemIndex
=
i
;
DaylightCheckBox
->
Enabled
=
scfg
.
sys_timezone
&
US_ZONE
;
DaylightCheckBox
->
Checked
=
scfg
.
sys_timezone
&
DAYLIGHT
;
if
(
scfg
.
sys_misc
&
SM_MILITARY
)
...
...
@@ -298,7 +319,8 @@ void __fastcall TConfigWizard::NextButtonClick(TObject *Sender)
strcpy
(
scfg
.
sys_inetaddr
,
InternetAddressComboBox
->
Text
.
c_str
());
strcpy
(
scfg
.
qnet_tagline
,
QNetTaglineEdit
->
Text
.
c_str
());
scfg
.
sys_nodes
=
NodesUpDown
->
Position
;
if
(
TimeZoneComboBox
->
ItemIndex
>=
0
)
if
(
TimeZoneComboBox
->
ItemIndex
>=
0
&&
TimeZoneComboBox
->
ItemIndex
<=
sizeof
(
tz_val
)
/
sizeof
(
tz_val
[
0
]))
scfg
.
sys_timezone
=
tz_val
[
TimeZoneComboBox
->
ItemIndex
];
if
(
DaylightCheckBox
->
Checked
)
scfg
.
sys_timezone
|=
DAYLIGHT
;
...
...
@@ -528,8 +550,11 @@ void __fastcall TConfigWizard::VerifyInternetAddresses(TObject *Sender)
//---------------------------------------------------------------------------
void
__fastcall
TConfigWizard
::
TimeZoneComboBoxChange
(
TObject
*
Sender
)
{
if
(
TimeZoneComboBox
->
ItemIndex
>=
0
)
if
(
TimeZoneComboBox
->
ItemIndex
>=
0
&&
TimeZoneComboBox
->
ItemIndex
<=
sizeof
(
tz_val
)
/
sizeof
(
tz_val
[
0
]))
DaylightCheckBox
->
Enabled
=
tz_val
[
TimeZoneComboBox
->
ItemIndex
]
&
US_ZONE
;
else
DaylightCheckBox
->
Enabled
=
false
;
if
(
!
DaylightCheckBox
->
Enabled
)
DaylightCheckBox
->
Checked
=
false
;
}
...
...
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