Changeset 27 for trunk/Forms/UMainForm.pas
- Timestamp:
- Nov 9, 2011, 4:11:56 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UMainForm.pas
r25 r27 18 18 AConnect: TAction; 19 19 AAbout: TAction; 20 ADisconnect: TAction; 20 21 AImportStructure: TAction; 21 22 AInitSystemValues: TAction; … … 55 56 MenuItem20: TMenuItem; 56 57 MenuItem21: TMenuItem; 58 MenuItem22: TMenuItem; 57 59 MenuItem3: TMenuItem; 58 60 MenuItem4: TMenuItem; … … 71 73 procedure AAboutExecute(Sender: TObject); 72 74 procedure AConnectExecute(Sender: TObject); 75 procedure ADisconnectExecute(Sender: TObject); 73 76 procedure AExitExecute(Sender: TObject); 74 77 procedure AImportStructureExecute(Sender: TObject); … … 111 114 TreeState: TTreeState; 112 115 Report: TReport; 116 procedure UpdateInterface; 113 117 procedure LoadTree; 114 118 procedure LoadItemList; … … 130 134 uses 131 135 UItemView, UItemEdit, UItemAdd, ULoginForm, USettingForm, UApplicationInfo, 132 UCore, UImportStructureForm, UAboutForm, ULoginProfileForm ;136 UCore, UImportStructureForm, UAboutForm, ULoginProfileForm, UChronisClientDirect; 133 137 134 138 {$R *.lfm} … … 507 511 end; 508 512 513 procedure TMainForm.UpdateInterface; 514 begin 515 ADisconnect.Enabled := Core.System.Database.Connected; 516 AConnect.Enabled := not Core.System.Database.Connected; 517 AInitSystemValues.Enabled := Core.System.Database.Connected; 518 AImportStructure.Enabled := Core.System.Database.Connected; 519 end; 520 509 521 procedure TMainForm.FormCreate(Sender: TObject); 510 522 begin … … 639 651 Core.System.Database.UserName := Core.LastUserName; 640 652 Core.System.Database.Password := Core.LastPassword; 653 Core.System.Database.Port := Port; 654 if Protocol = cpDirect then Core.Client := TChronisClientDirect.Create; 655 end; 656 try 641 657 Core.System.Database.Connect; 642 end; 643 InitStructure; 644 Core.System.LoadTypes; 645 LoadTree; 646 end; 658 InitStructure; 659 Core.System.LoadTypes; 660 LoadTree; 661 except 662 on E:Exception do ShowMessage(E.Message); 663 end; 664 end; 665 end; 666 667 procedure TMainForm.ADisconnectExecute(Sender: TObject); 668 begin 669 Core.System.Database.Disconnect; 670 TreeView1.Items.Clear; 671 ListView1.Items.Clear; 672 Core.System.Types.Clear; 673 FreeAndNil(Core.Client); 647 674 end; 648 675
Note:
See TracChangeset
for help on using the changeset viewer.