Annotation of sbbs/src/sbbs3/ctrl/configwizardunit.cpp, revision 1.1.1.2

1.1       root        1: /* Synchronet Control Panel (GUI Borland C++ Builder Project for Win32) */
                      2: 
1.1.1.2 ! root        3: /* $Id: ConfigWizardUnit.cpp,v 1.23 2011/07/14 03:03:48 rswindell Exp $ */
1.1       root        4: 
                      5: /****************************************************************************
                      6:  * @format.tab-size 4          (Plain Text/Source Code File Header)                    *
                      7:  * @format.use-tabs true       (see http://www.synchro.net/ptsc_hdr.html)              *
                      8:  *                                                                                                                                                     *
1.1.1.2 ! root        9:  * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html         *
1.1       root       10:  *                                                                                                                                                     *
                     11:  * This program is free software; you can redistribute it and/or                       *
                     12:  * modify it under the terms of the GNU General Public License                         *
                     13:  * as published by the Free Software Foundation; either version 2                      *
                     14:  * of the License, or (at your option) any later version.                                      *
                     15:  * See the GNU General Public License for more details: gpl.txt or                     *
                     16:  * http://www.fsf.org/copyleft/gpl.html                                                                                *
                     17:  *                                                                                                                                                     *
                     18:  * Anonymous FTP access to the most recent released source is available at     *
                     19:  * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net     *
                     20:  *                                                                                                                                                     *
                     21:  * Anonymous CVS access to the development source and modification history     *
                     22:  * is available at cvs.synchro.net:/cvsroot/sbbs, example:                                     *
                     23:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs login                       *
                     24:  *     (just hit return, no password is necessary)                                                     *
                     25:  * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src                *
                     26:  *                                                                                                                                                     *
                     27:  * For Synchronet coding style and modification guidelines, see                                *
                     28:  * http://www.synchro.net/source.html                                                                          *
                     29:  *                                                                                                                                                     *
                     30:  * You are encouraged to submit any modifications (preferably in Unix diff     *
                     31:  * format) via e-mail to [email protected]                                                                      *
                     32:  *                                                                                                                                                     *
                     33:  * Note: If this box doesn't appear square, then you need to fix your tabs.    *
                     34:  ****************************************************************************/
                     35: //---------------------------------------------------------------------------
                     36: 
                     37: #include "sbbs.h"
                     38: #include <vcl.h>
                     39: #pragma hdrstop
                     40: 
                     41: #include "MainFormUnit.h"
                     42: #include "ConfigWizardUnit.h"
                     43: #include <stdio.h>      // sprintf
                     44: #include <winsock.h>    // addresses and such
                     45: 
                     46: //---------------------------------------------------------------------------
                     47: #pragma package(smart_init)
                     48: #pragma resource "*.dfm"
                     49: 
                     50: #define ILLEGAL_QWKID_CHARS  "*?" ILLEGAL_FILENAME_CHARS
                     51: 
                     52: char ctrl_dir[MAX_PATH+1];
                     53: short tz_val[]= {
                     54:      0
                     55:     ,AST
                     56:     ,EST
                     57:     ,CST
                     58:     ,MST
                     59:     ,PST
                     60:     ,YST
                     61:     ,HST
                     62:     ,BST
                     63:     ,MID
                     64:     ,VAN
                     65:     ,EDM
                     66:     ,WIN
                     67:     ,BOG
                     68:     ,CAR
                     69:     ,RIO
                     70:     ,FER
                     71:     ,AZO
                     72:     ,LON
                     73:     ,BER
                     74:     ,ATH
                     75:     ,MOS
                     76:     ,DUB
                     77:     ,KAB
                     78:     ,KAR
                     79:     ,BOM
                     80:     ,KAT
                     81:     ,DHA
                     82:     ,BAN
                     83:     ,HON
                     84:     ,TOK
                     85:     ,SYD
                     86:     ,NOU
                     87:     ,WEL
                     88: };
                     89: 
                     90: char* tz_str[]={
                     91:      "Universal (UTC/GMT)"
                     92:     ,"U.S. - Atlantic"
                     93:     ,"U.S. - Eastern"
                     94:     ,"U.S. - Central"
                     95:     ,"U.S. - Mountain"
                     96:     ,"U.S. - Pacific"
                     97:     ,"U.S. - Yukon"
                     98:     ,"U.S. - Hawaii/Alaska"
                     99:     ,"U.S. - Bering"
                    100:     ,"Midway"
                    101:     ,"Vancouver"
                    102:     ,"Edmonton"
                    103:     ,"Winnipeg"
                    104:     ,"Bogota"
                    105:     ,"Caracas"
                    106:     ,"Rio de Janeiro"
                    107:     ,"Fernando de Noronha"
                    108:     ,"Azores"
                    109:     ,"London"
                    110:     ,"Berlin"
                    111:     ,"Athens"
                    112:     ,"Moscow"
                    113:     ,"Dubai"
                    114:     ,"Kabul"
                    115:     ,"Karachi"
                    116:     ,"Bombay"
                    117:     ,"Kathmandu"
                    118:     ,"Dhaka"
                    119:     ,"Bangkok"
                    120:     ,"Hong Kong"
                    121:     ,"Tokyo"
                    122:     ,"Sydney"
                    123:     ,"Noumea"
                    124:     ,"Wellington"
                    125: };
                    126: 
                    127: //---------------------------------------------------------------------------
                    128: __fastcall TConfigWizard::TConfigWizard(TComponent* Owner)
                    129:     : TForm(Owner)
                    130: {
                    131: }
                    132: //---------------------------------------------------------------------------
                    133: void __fastcall TConfigWizard::FormShow(TObject *Sender)
                    134: {
                    135:     char str[512];
                    136:     int i;
                    137:     int status;
                    138: 
                    139:        Application->BringToFront();
                    140: 
                    141:     memset(&scfg,0,sizeof(scfg));
                    142:     SAFECOPY(scfg.ctrl_dir,MainForm->global.ctrl_dir);
                    143:     scfg.size=sizeof(scfg);
                    144:     char error[256];
                    145:        SAFECOPY(error,UNKNOWN_LOAD_ERROR);
                    146:     if(!load_cfg(&scfg,NULL,FALSE,error)) {
1.1.1.2 ! root      147:         Application->MessageBox(error,"ERROR Loading Configuration"
1.1       root      148:                ,MB_OK|MB_ICONEXCLAMATION);
                    149:         Close();
                    150:         return;
                    151:     }
                    152: 
                    153:     if(scfg.new_install) {
                    154:         TIME_ZONE_INFORMATION tz;
                    155:            memset(&tz,0,sizeof(tz));
                    156:        DWORD tzRet=GetTimeZoneInformation(&tz);
                    157: 
                    158:         /* Convert to SMB tz format */
                    159:         scfg.sys_timezone=0;
                    160:                if(tz.Bias>0) {
                    161:                switch(tz.Bias|US_ZONE) {
                    162:                                case AST:
                    163:                                case EST:
                    164:                                case CST:
                    165:                                case MST:
                    166:                                case PST:
                    167:                                case YST:
                    168:                                case HST:
                    169:                                case BST:
                    170:                        scfg.sys_timezone=tz.Bias|US_ZONE;
                    171:                                if(tzRet==TIME_ZONE_ID_DAYLIGHT)
                    172:                                        scfg.sys_timezone|=DAYLIGHT;
                    173:                     break;
                    174:                 default:
                    175:                                        scfg.sys_timezone=tz.Bias|WESTERN_ZONE;
1.1.1.2 ! root      176:                                if(tzRet==TIME_ZONE_ID_DAYLIGHT)
        !           177:                                        scfg.sys_timezone|=DAYLIGHT;
        !           178:                     break;
        !           179:             }
        !           180:                } else if(tz.Bias<0) {
        !           181:             switch(tzRet) {
        !           182:                 case TIME_ZONE_ID_DAYLIGHT:
        !           183:                     tz.Bias += tz.DaylightBias;
        !           184:                     break;
        !           185:                 case TIME_ZONE_ID_STANDARD:
        !           186:                     tz.Bias += tz.StandardBias;
1.1       root      187:                     break;
                    188:             }
                    189:                        scfg.sys_timezone=(-tz.Bias)|EASTERN_ZONE;
1.1.1.2 ! root      190:         }
1.1       root      191: #if 0
                    192:         /* Get DNS Server Address */
                    193:         str_list_t dns_list = getNameServerList();
                    194:         if(dns_list!=NULL) {
                    195:             SAFECOPY(MainForm->mail_startup.dns_server,dns_list[0]);
                    196:             freeNameServerList(dns_list);
                    197:         }
                    198: #endif        
                    199:     } else {
                    200:         SystemNameEdit->Text=AnsiString(scfg.sys_name);
                    201:         SystemLocationEdit->Text=AnsiString(scfg.sys_location);
                    202:         SysopNameEdit->Text=AnsiString(scfg.sys_op);
                    203:         SystemPasswordEdit->Text=AnsiString(scfg.sys_pass);
                    204:         InternetAddressComboBox->Text=AnsiString(scfg.sys_inetaddr);
                    205:         QWKIDEdit->Text=AnsiString(scfg.sys_id);
                    206:         QNetTaglineEdit->Text=AnsiString(scfg.qnet_tagline);
                    207:         AllNodesTelnetCheckBox->Checked
                    208:             =(scfg.sys_nodes==MainForm->bbs_startup.last_node);
                    209:     }
                    210: 
                    211:     NewUsersCheckBox->Checked=!(scfg.sys_misc&SM_CLOSED);
                    212:     FeedbackCheckBox->Checked=scfg.node_valuser;
                    213:     AliasesCheckBox->Checked=scfg.uq&UQ_ALIASES;
                    214:     NewUsersCheckBoxClick(Sender);
                    215: 
                    216:     if(scfg.sys_misc&SM_USRVDELM)
                    217:         DeletedEmailYesButton->Checked=true;
                    218:     else if(scfg.sys_misc&SM_SYSVDELM)
                    219:         DeletedEmailSysopButton->Checked=true;
                    220:     else
                    221:         DeletedEmailNoButton->Checked=true;
                    222: 
                    223: //    DNSAddressEdit->Text=MainForm->mail_startup.dns_server;
                    224:     MaxMailUpDown->Position=MainForm->mail_startup.max_clients;
                    225:     MaxFtpUpDown->Position=MainForm->ftp_startup.max_clients;
                    226:     MaxWebUpDown->Position=MainForm->web_startup.max_clients;
                    227:     NodesUpDown->Position=scfg.sys_nodes;
                    228: 
                    229:     for(i=0;i<sizeof(tz_str)/sizeof(tz_str[0]);i++) {
                    230:         char str[128];
                    231:         if(tz_val[i] && !(tz_val[i]&US_ZONE))
                    232:             sprintf(str,"%c%u:%02u %s"
                    233:                 ,tz_val[i]&WESTERN_ZONE ? '-':'+'
                    234:                 ,(tz_val[i]&0xfff)/60
                    235:                 ,(tz_val[i]&0xfff)%60
                    236:                 ,tz_str[i]
                    237:                 );
                    238:         else
                    239:             strcpy(str,tz_str[i]);
                    240:         TimeZoneComboBox->Items->Add(str);
                    241:     }
                    242:        sprintf(str,"Other (%s)",smb_zonestr(scfg.sys_timezone,NULL));
                    243:     TimeZoneComboBox->Items->Add(str);
                    244: 
                    245:     for(i=0;i<sizeof(tz_val)/sizeof(tz_val[0]);i++)
                    246:         if((scfg.sys_timezone&((short)~DAYLIGHT))==tz_val[i])
                    247:             break;
                    248:     TimeZoneComboBox->ItemIndex=i;
                    249:     DaylightCheckBox->Enabled=scfg.sys_timezone&US_ZONE;
                    250:     DaylightCheckBox->Checked=scfg.sys_timezone&DAYLIGHT;
                    251:     if(scfg.sys_misc&SM_MILITARY)
                    252:         Time24hrRadioButton->Checked=true;
                    253:     else
                    254:         Time12hrRadioButton->Checked=true;
                    255:     if(scfg.sys_misc&SM_EURODATE)
                    256:         DateEuRadioButton->Checked=true;
                    257:     else
                    258:         DateUsRadioButton->Checked=true;
                    259: 
                    260:     WizNotebook->PageIndex=0;
                    261:     ProgressBar->Max=WizNotebook->Pages->Count-1;
                    262:     IllegalCharsLabel->Caption="Illegal characters: '"
                    263:         ILLEGAL_QWKID_CHARS "'";
                    264: 
                    265:        NextButton->Enabled=true;
                    266: }
                    267: //---------------------------------------------------------------------------
                    268: void __fastcall TConfigWizard::NextButtonClick(TObject *Sender)
                    269: {
                    270:     if(ProgressBar->Position==ProgressBar->Max) /* Finished */
                    271:     {
                    272:         // Write Registry keys
                    273:         if(AllNodesTelnetCheckBox->Checked)
                    274:             MainForm->bbs_startup.last_node=NodesUpDown->Position;
                    275:         MainForm->ftp_startup.max_clients=MaxFtpUpDown->Position;
                    276:         MainForm->mail_startup.max_clients=MaxMailUpDown->Position;
                    277:         MainForm->web_startup.max_clients=MaxWebUpDown->Position;
                    278: //        strcpy(MainForm->mail_startup.dns_server,DNSAddressEdit->Text.c_str());
                    279: 
                    280:         MainForm->SaveIniSettings(Sender);
                    281: 
                    282:         // Write CNF files
                    283:         strcpy(scfg.sys_name,SystemNameEdit->Text.c_str());
                    284:         strcpy(scfg.sys_id,QWKIDEdit->Text.c_str());
                    285:         strcpy(scfg.sys_location,SystemLocationEdit->Text.c_str());
                    286:         strcpy(scfg.sys_op,SysopNameEdit->Text.c_str());
                    287:         strcpy(scfg.sys_pass,SystemPasswordEdit->Text.c_str());
                    288:         strcpy(scfg.sys_inetaddr,InternetAddressComboBox->Text.c_str());
                    289:         strcpy(scfg.qnet_tagline,QNetTaglineEdit->Text.c_str());
                    290:         scfg.sys_nodes=NodesUpDown->Position;
                    291:         if(TimeZoneComboBox->ItemIndex>=0
                    292:                && TimeZoneComboBox->ItemIndex<=sizeof(tz_val)/sizeof(tz_val[0]))
                    293:             scfg.sys_timezone=tz_val[TimeZoneComboBox->ItemIndex];
                    294:         if(DaylightCheckBox->Checked)
                    295:             scfg.sys_timezone|=DAYLIGHT;
                    296:         if(Time24hrRadioButton->Checked)
                    297:             scfg.sys_misc|=SM_MILITARY;
                    298:         else
                    299:             scfg.sys_misc&=~SM_MILITARY;
                    300:         if(DateEuRadioButton->Checked)
                    301:             scfg.sys_misc|=SM_EURODATE;
                    302:         else
                    303:             scfg.sys_misc&=~SM_EURODATE;
                    304:         if(NewUsersCheckBox->Checked)
                    305:             scfg.sys_misc&=~SM_CLOSED;
                    306:         else
                    307:             scfg.sys_misc|=SM_CLOSED;
                    308:         if(AliasesCheckBox->Checked)
                    309:             scfg.uq|=UQ_ALIASES;
                    310:         else
                    311:             scfg.uq&=~UQ_ALIASES;
                    312:         scfg.node_valuser=FeedbackCheckBox->Checked;
                    313: 
                    314:         if(DeletedEmailYesButton->Checked)
                    315:             scfg.sys_misc|=(SM_USRVDELM|SM_SYSVDELM);
                    316:         else if(DeletedEmailNoButton->Checked)
                    317:             scfg.sys_misc&=~(SM_USRVDELM|SM_SYSVDELM);
                    318:         else {
                    319:             scfg.sys_misc|=SM_SYSVDELM;
                    320:             scfg.sys_misc&=~SM_USRVDELM;
                    321:         }
                    322: 
                    323:         scfg.new_install=FALSE;
                    324:         if(!save_cfg(&scfg,0)) {
                    325:                Application->MessageBox("Error saving configuration"
                    326:                ,"ERROR",MB_OK|MB_ICONEXCLAMATION);
                    327:         } else
                    328:                refresh_cfg(&scfg);
                    329: 
                    330:         Close();
                    331:         return;
                    332:     }
                    333:     WizNotebook->PageIndex++;
                    334:     ProgressBar->Position=WizNotebook->PageIndex;
                    335:     if(ProgressBar->Position==ProgressBar->Max) /* Last page */
                    336:         NextButton->Caption="&Finish";
                    337: }
                    338: //---------------------------------------------------------------------------
                    339: void __fastcall TConfigWizard::BackButtonClick(TObject *Sender)
                    340: {
                    341:     WizNotebook->PageIndex--;
                    342:     ProgressBar->Position=WizNotebook->PageIndex;
                    343:     NextButton->Caption="&Next >";
                    344: }
                    345: //---------------------------------------------------------------------------
                    346: void __fastcall TConfigWizard::CancelButtonClick(TObject *Sender)
                    347: {
                    348:     Close();
                    349: }
                    350: //---------------------------------------------------------------------------
                    351: void __fastcall TConfigWizard::LogoImageClick(TObject *Sender)
                    352: {
                    353:     LogoImage->Visible=false;
                    354:     ProgressBar->Visible=false;
                    355: }
                    356: //---------------------------------------------------------------------------
                    357: void __fastcall TConfigWizard::TitleLabelClick(TObject *Sender)
                    358: {
                    359:     LogoImage->Visible=true;
                    360:     ProgressBar->Visible=true;
                    361: }
                    362: //---------------------------------------------------------------------------
                    363: void __fastcall TConfigWizard::WizNotebookPageChanged(TObject *Sender)
                    364: {
                    365:     TFont* current;
                    366: 
                    367:     switch(WizNotebook->PageIndex) {
                    368:         case 0:
                    369:             current=IntroductionLabel->Font;
                    370:             NextButton->Enabled=true;
                    371:             break;
                    372:         case 1:
                    373:             current=IdentificationLabel->Font;
                    374: //            ActiveControl=SystemNameEdit;
                    375:             if(!SysopNameEdit->Text.Length()) {
                    376:                 char username[41];
                    377:                 DWORD len=sizeof(username)-1;
                    378:                 GetUserName(username,&len);
                    379:                 SysopNameEdit->Text=AnsiString(username);
                    380:             }
                    381:             if(!SystemNameEdit->Text.Length()) {
                    382:                 char bbsname[41];
                    383:                 DWORD len=sizeof(bbsname)-1;
                    384:                 GetComputerName(bbsname,&len);
                    385:                 SystemNameEdit->Text=AnsiString(bbsname);
                    386:             }
                    387:             VerifyIdentification(Sender);
                    388:             break;
                    389:         case 2:
                    390:             current=TimeLabel->Font;
                    391:             NextButton->Enabled=true;
                    392:             break;
                    393:         case 3:
                    394:             current=InternetLabel->Font;
                    395:             if(!InternetAddressComboBox->Items->Count) {
                    396:                 WSADATA WSAData;
                    397:                 WSAStartup(MAKEWORD(1,1), &WSAData); /* req'd for gethostname */
                    398:                 if(scfg.sys_inetaddr[0])
                    399:                     InternetAddressComboBox->Items->Add(scfg.sys_inetaddr);
                    400:                 char hostname[128];
                    401:                 gethostname(hostname,sizeof(hostname)-1);
                    402:                 if(hostname[0]) {
                    403:                     InternetAddressComboBox->Items->Add(hostname);
                    404:                     HOSTENT* host=gethostbyname(hostname);
                    405:                     SOCKADDR_IN addr;
                    406:                     for(int i=0;host && host->h_addr_list[i];i++) {
                    407:                         addr.sin_addr.s_addr
                    408:                             =*((DWORD*)host->h_addr_list[i]);
                    409:                         InternetAddressComboBox->Items->Add(inet_ntoa(addr.sin_addr));
                    410:                     }
                    411:                 }
                    412:                 WSACleanup();
                    413:                 InternetAddressComboBox->ItemIndex=0;
                    414:             }
                    415:             VerifyInternetAddresses(Sender);
                    416:             break;
                    417:         case 4:
                    418:             current=QWKLabel->Font;
                    419:             if(!QWKIDEdit->Text.Length()) {
                    420:                 char bbsname[41];
                    421:                 char qwkid[9];
                    422:                 int len=0;
                    423:                 strcpy(bbsname,SystemNameEdit->Text.UpperCase().c_str());
                    424:                 for(char*p=bbsname;*p && len<8;p++) {
                    425:                     if(strchr(ILLEGAL_QWKID_CHARS,*p))
                    426:                         continue;
                    427:                     if(!len && isdigit(*p))
                    428:                         continue;
                    429:                     if(*p<=' ')
                    430:                         continue;
                    431:                     qwkid[len++]=*p;
                    432:                 }
                    433:                 qwkid[len]=0;
                    434:                 QWKIDEdit->Text=AnsiString(qwkid);
                    435:             }
                    436:             if(!QNetTaglineEdit->Text.Length()) {
                    437:                 QNetTaglineEdit->Text = SystemNameEdit->Text +
                    438:                     " - " + InternetAddressComboBox->Text;
                    439:             }
                    440:             VerifyQWK(Sender);
                    441:             break;
                    442:         case 5:
                    443:             current=MaximumsLabel->Font;
                    444:             NextButton->Enabled=true;
                    445:             break;
                    446:         case 6:
                    447:             current=OptionsLabel->Font;
                    448:             NextButton->Enabled=true;
                    449:             break;
                    450:         case 7:
                    451:             current=VerifyLabel->Font;
                    452:             VerifyPassword(Sender);
                    453:             if(!NextButton->Enabled)
                    454:                 ActiveControl=SysPassVerifyEdit;
                    455:             break;
                    456:         case 8:
                    457:             current=CompleteLabel->Font;
                    458:             break;
                    459:         default:
                    460:             return;
                    461:     }
                    462: 
                    463:     /* default to inactive */
                    464:     IntroductionLabel->Font->Color=clGray;
                    465:     IdentificationLabel->Font->Color=clGray;
                    466:     QWKLabel->Font->Color=clGray;
                    467:     TimeLabel->Font->Color=clGray;
                    468:     InternetLabel->Font->Color=clGray;
                    469:     MaximumsLabel->Font->Color=clGray;
                    470:     OptionsLabel->Font->Color=clGray;
                    471:     VerifyLabel->Font->Color=clGray;
                    472:     CompleteLabel->Font->Color=clGray;
                    473: 
                    474:     /* active */
                    475:     current->Color=clYellow;
                    476: 
                    477:     BackButton->Enabled=WizNotebook->PageIndex;
                    478: }
                    479: //---------------------------------------------------------------------------
                    480: void __fastcall TConfigWizard::VerifyIdentification(TObject *Sender)
                    481: {
                    482:     NextButton->Enabled=(SystemNameEdit->Text.Length()
                    483:         && SystemLocationEdit->Text.Length()
                    484:         && SysopNameEdit->Text.Length()
                    485:         && SystemPasswordEdit->Text.Length()
                    486:     );
                    487: }
                    488: //---------------------------------------------------------------------------
                    489: void __fastcall TConfigWizard::VerifyPassword(TObject *Sender)
                    490: {
                    491:     NextButton->Enabled=(SystemPasswordEdit->Text==SysPassVerifyEdit->Text);
                    492: }
                    493: //---------------------------------------------------------------------------
                    494: void __fastcall TConfigWizard::VerifyQWK(TObject *Sender)
                    495: {
                    496:     char    qwk_id[9];
                    497: 
                    498:     SAFECOPY(qwk_id,QWKIDEdit->Text.c_str());
                    499:     NextButton->Enabled=(
                    500:         strlen(qwk_id)>=2
                    501:         && isalpha(qwk_id[0])
                    502:         && strcspn(qwk_id,ILLEGAL_QWKID_CHARS)==strlen(qwk_id)
                    503:         && QNetTaglineEdit->Text.Length());
                    504: }
                    505: //---------------------------------------------------------------------------
                    506: void __fastcall TConfigWizard::QNetTaglineEditKeyPress(TObject *Sender,
                    507:       char &Key)
                    508: {
                    509:     if(Key==1)  /* Ctrl-A */
                    510:         QNetTaglineEdit->SetSelTextBuf("\1");
                    511: }
                    512: //---------------------------------------------------------------------------
                    513: 
                    514: void __fastcall TConfigWizard::VerifyInternetAddresses(TObject *Sender)
                    515: {
                    516:     NextButton->Enabled=(InternetAddressComboBox->Text.Length()
                    517: //        && DNSAddressEdit->Text.Length()
                    518:         );
                    519: }
                    520: //---------------------------------------------------------------------------
                    521: void __fastcall TConfigWizard::TimeZoneComboBoxChange(TObject *Sender)
                    522: {
                    523:     if(TimeZoneComboBox->ItemIndex>=0
                    524:        && TimeZoneComboBox->ItemIndex<=sizeof(tz_val)/sizeof(tz_val[0]))
                    525:         DaylightCheckBox->Enabled=tz_val[TimeZoneComboBox->ItemIndex]&US_ZONE;
                    526:     else
                    527:            DaylightCheckBox->Enabled=false;
                    528:     if(!DaylightCheckBox->Enabled)
                    529:         DaylightCheckBox->Checked=false;
                    530: }
                    531: //---------------------------------------------------------------------------
                    532: 
                    533: void __fastcall TConfigWizard::NewUsersCheckBoxClick(TObject *Sender)
                    534: {
                    535:     AliasesCheckBox->Enabled=NewUsersCheckBox->Checked;
                    536:     FeedbackCheckBox->Enabled=NewUsersCheckBox->Checked;
                    537: }
                    538: //---------------------------------------------------------------------------
                    539: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.