Changeset 738 for cprs/branches/tmg-cprs/CPRS-Chart/Options/fOptions.pas
- Timestamp:
- Apr 19, 2010, 5:24:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/tmg-cprs/CPRS-Chart/Options/fOptions.pas
r735 r738 7 7 Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, 8 8 Buttons, ComCtrls, ExtCtrls, ORCtrls, OrFn, Dialogs, ORDtTmRng, fBAOptionsDiagnoses, 9 uBAGlobals, TntStdCtrls, DKLang, jpeg, inifiles ;9 uBAGlobals, TntStdCtrls, DKLang, jpeg, inifiles, uConst, StrUtils; 10 10 11 11 //kt added 6/29/07 ------------------ … … 139 139 cboTransMethod: TComboBox; 140 140 Label3: TLabel; 141 Edit1: TEdit;141 editDropboxLocation: TEdit; 142 142 Label4: TLabel; 143 143 BitBtn1: TBitBtn; … … 145 145 cbEnableScanning: TCheckBox; 146 146 Label5: TLabel; 147 Edit2: TEdit;147 editScannedLocation: TEdit; 148 148 BitBtn2: TBitBtn; 149 149 Label6: TLabel; … … 188 188 procedure lbSkinsKeyPress(Sender: TObject; var Key: Char); 189 189 procedure btnDisableSkinClick(Sender: TObject); 190 procedure cbSkinAtStartupClick(Sender: TObject); //kt added 6/29/07 190 procedure cbSkinAtStartupClick(Sender: TObject); 191 procedure cboTransMethodChange(Sender: TObject); 192 procedure cbEnableImagesClick(Sender: TObject); 193 procedure editDropboxLocationChange(Sender: TObject); 194 procedure cbEnableScanningClick(Sender: TObject); 195 procedure editScannedLocationChange(Sender: TObject); 196 procedure edtPolFreqChange(Sender: TObject); 197 procedure BitBtn1Click(Sender: TObject); 198 procedure BitBtn2Click(Sender: TObject); //kt added 6/29/07 191 199 private 192 200 { Private declarations } 193 201 FdirtyNotifications: boolean; // used to determine edit changes to Notifications 202 FdirtyImageSettings: boolean; // used to determine edit changes to Image Settings 194 203 FdirtyOrderChecks: boolean; // used to determine edit changes to Order Checks 195 204 FdirtyOtherStuff: boolean; // used to determine edit changes to misc settings … … 201 210 procedure Offset(var topnum: integer; topoffset: integer; var leftnum: integer; leftoffset: integer); 202 211 procedure LoadNotifications; 212 procedure LoadImageSettings; 203 213 procedure LoadOrderChecks; 204 214 procedure ApplyNotifications; 205 215 procedure ApplyOrderChecks; 206 216 procedure ApplyOtherStuff; 217 procedure ApplyImageSettings; 207 218 procedure CheckApply; 208 219 procedure LoadListView(aListView: TListView; aList: TStrings); 209 220 procedure ChangeOnOff(aListView: TListView; aListItem: TListItem); 221 function BrowseDialog(const Title: string; const Flag: integer): string; 210 222 public 211 223 { Public declarations } … … 228 240 ShellAPI, //kt 9/8/08 229 241 uTMGOptions, //kt 2/10/10 242 UploadImages, fImages, //elh 04/15/10 243 ShlObj, //elh 04/15/10 230 244 ORNet, //allows access to RPCBrokerV 231 245 TntForms, TntSystem, TntSysUtils; … … 346 360 LoadNotifications; 347 361 LoadOrderChecks; 362 LoadImageSettings; 363 FdirtyImageSettings := false; 348 364 FdirtyNotifications := false; 349 365 FdirtyOrderChecks := false; … … 469 485 if FdirtyNotifications then 470 486 ApplyNotifications; 487 if FdirtyImageSettings then 488 ApplyImageSettings; 471 489 if FdirtyOrderChecks then 472 490 ApplyOrderChecks; … … 493 511 btnSurrogate.Hint := surrogateinfo; 494 512 LabelSurrogate(surrogateinfo, lblNotificationsSurrogateText); 513 end; 514 515 procedure TfrmOptions.LoadImageSettings; 516 begin 517 cbEnableImages.Checked := uTMGOptions.ReadBool('EnableImages',false); 518 cboTransMethod.ItemIndex := uTMGOptions.ReadInteger('ImageTransferMethod',0); 519 editDropboxLocation.text := uTMGOptions.ReadString('Dropbox directory',''); 520 cbEnableScanning.Checked := uTMGOptions.ReadBool('Scan Enabled',false); 521 editScannedLocation.text := uTMGOptions.ReadString('Pol Directory',''); 522 edtPolFreq.text := IntToStr(uTMGOptions.ReadInteger('Pol Interval (milliseconds)',0)); 523 524 cbEnableScanningClick(self); 525 cboTransMethodChange(self); 495 526 end; 496 527 … … 531 562 end; 532 563 564 procedure TfrmOptions.ApplyImageSettings; 565 begin 566 uTMGOptions.WriteBool('EnableImages',cbEnableImages.Checked); 567 frmFrame.SetATabVisibility(CT_IMAGES, cbEnableImages.Checked, 'Images'); 568 569 uTMGOptions.WriteInteger('ImageTransferMethod',cboTransMethod.itemindex); 570 if cboTransMethod.text = 'Dropbox Transfer' then begin 571 frmImages.UseDropBox := True; 572 end else begin 573 frmImages.UseDropBox := False; 574 end; 575 576 uTMGOptions.WriteString('Dropbox directory',editDropboxLocation.text); 577 frmImages.DropBoxDir := editDropboxLocation.text; 578 579 uTMGOptions.WriteBool('Scan Enabled',cbEnableScanning.Checked); 580 581 uTMGOptions.WriteString('Pol Directory',editScannedLocation.text); 582 UploadForm.FScanDir := editScannedLocation.text; 583 584 uTMGOptions.WriteInteger('Pol Interval (milliseconds)',StrToInt(edtPolFreq.text)); 585 UploadForm.PolInterval := StrToInt(edtPolFreq.text); 586 587 FdirtyImageSettings := false; 588 end; 589 533 590 procedure TfrmOptions.ApplyOrderChecks; 534 591 // save Order Check changes … … 572 629 // determine if Apply button is enabled 573 630 begin 574 btnApply.Enabled := Fdirty OrderChecks or FdirtyNotifications or FdirtyOtherStuff;631 btnApply.Enabled := FdirtyImageSettings or FdirtyOrderChecks or FdirtyNotifications or FdirtyOtherStuff; 575 632 end; 576 633 … … 961 1018 end; 962 1019 1020 procedure TfrmOptions.cboTransMethodChange(Sender: TObject); 1021 begin 1022 if cboTransMethod.text = 'Dropbox Transfer' then begin 1023 editDropboxLocation.enabled := true; 1024 bitbtn1.enabled := true; 1025 end else begin 1026 editDropboxLocation.enabled := false; 1027 bitbtn1.enabled := false; 1028 end; 1029 FdirtyImageSettings := true; 1030 CheckApply; 1031 end; 1032 1033 procedure TfrmOptions.cbEnableImagesClick(Sender: TObject); 1034 begin 1035 FdirtyImageSettings := true; 1036 CheckApply; 1037 end; 1038 1039 procedure TfrmOptions.editDropboxLocationChange(Sender: TObject); 1040 begin 1041 FdirtyImageSettings := true; 1042 CheckApply; 1043 end; 1044 1045 procedure TfrmOptions.cbEnableScanningClick(Sender: TObject); 1046 begin 1047 editScannedLocation.enabled := cbEnableScanning.checked; 1048 bitbtn2.enabled := cbEnableScanning.checked; 1049 edtPolFreq.enabled := cbEnableScanning.checked; 1050 FdirtyImageSettings := true; 1051 CheckApply; 1052 end; 1053 1054 procedure TfrmOptions.editScannedLocationChange(Sender: TObject); 1055 begin 1056 FdirtyImageSettings := true; 1057 CheckApply; 1058 end; 1059 1060 procedure TfrmOptions.edtPolFreqChange(Sender: TObject); 1061 begin 1062 FdirtyImageSettings := true; 1063 CheckApply; 1064 end; 1065 1066 procedure TfrmOptions.BitBtn1Click(Sender: TObject); 1067 var 1068 sFolder: string; 1069 begin 1070 sFolder := BrowseDialog('Choose a Dropbox folder', BIF_RETURNONLYFSDIRS); 1071 if sFolder <> '' then begin 1072 if rightstr(sFolder,1) = '\' then begin 1073 editDropboxLocation.text := sFolder; 1074 end else begin 1075 editDropboxLocation.text := sFolder + '\'; 1076 end; 1077 end; 1078 end; 1079 1080 function TfrmOptions.BrowseDialog(const Title: string; const Flag: integer): string; 1081 var 1082 lpItemID : PItemIDList; 1083 BrowseInfo : TBrowseInfo; 1084 DisplayName : array[0..MAX_PATH] of char; 1085 TempPath : array[0..MAX_PATH] of char; 1086 begin 1087 Result:=''; 1088 FillChar(BrowseInfo, sizeof(TBrowseInfo), #0); 1089 with BrowseInfo do begin 1090 hwndOwner := Application.Handle; 1091 pszDisplayName := @DisplayName; 1092 lpszTitle := PChar(Title); 1093 ulFlags := Flag; 1094 end; 1095 lpItemID := SHBrowseForFolder(BrowseInfo); 1096 if lpItemId <> nil then begin 1097 SHGetPathFromIDList(lpItemID, TempPath); 1098 Result := TempPath; 1099 GlobalFreePtr(lpItemID); 1100 end; 1101 end; 1102 1103 1104 procedure TfrmOptions.BitBtn2Click(Sender: TObject); 1105 var 1106 sFolder: string; 1107 begin 1108 sFolder := BrowseDialog('Choose a Scanned folder', BIF_RETURNONLYFSDIRS); 1109 if sFolder <> '' then begin 1110 if rightstr(sFolder,1) = '\' then begin 1111 editScannedLocation.text := sFolder; 1112 end else begin 1113 editScannedLocation.text := sFolder + '\'; 1114 end; 1115 end; 1116 end; 1117 963 1118 end. 964 1119
Note:
See TracChangeset
for help on using the changeset viewer.