Changeset 738 for cprs/branches/tmg-cprs/CPRS-Chart/Options
- Timestamp:
- Apr 19, 2010, 5:24:20 PM (15 years ago)
- Location:
- cprs/branches/tmg-cprs/CPRS-Chart/Options
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/tmg-cprs/CPRS-Chart/Options/fOptions.dfm
r735 r738 1 1 object frmOptions: TfrmOptions 2 Left = 2833 Top = 1792 Left = 302 3 Top = 223 4 4 Width = 435 5 5 Height = 397 … … 1796 1796 Caption = 'Enable Images Tab' 1797 1797 TabOrder = 0 1798 OnClick = cbEnableImagesClick 1798 1799 end 1799 1800 object cboTransMethod: TComboBox … … 1806 1807 TabOrder = 1 1807 1808 Text = 'Dropbox Transfer' 1809 OnChange = cboTransMethodChange 1808 1810 Items.Strings = ( 1809 1811 'Dropbox Transfer' … … 1811 1813 'Embedded in RPCs') 1812 1814 end 1813 object Edit1: TEdit1815 object editDropboxLocation: TEdit 1814 1816 Left = 16 1815 1817 Top = 120 1816 1818 Width = 201 1817 Height = 2 21819 Height = 21 1818 1820 TabOrder = 2 1821 OnChange = editDropboxLocationChange 1819 1822 end 1820 1823 object BitBtn1: TBitBtn … … 1825 1828 Caption = '...' 1826 1829 TabOrder = 3 1830 OnClick = BitBtn1Click 1827 1831 Glyph.Data = { 1828 1832 F6000000424DF600000000000000760000002800000010000000100000000100 … … 1842 1846 Caption = 'Enable auto-upload of scanned images' 1843 1847 TabOrder = 4 1844 end 1845 object Edit2: TEdit 1848 OnClick = cbEnableScanningClick 1849 end 1850 object editScannedLocation: TEdit 1846 1851 Left = 15 1847 1852 Top = 199 1848 1853 Width = 201 1849 Height = 2 21854 Height = 21 1850 1855 TabOrder = 5 1856 OnChange = editScannedLocationChange 1851 1857 end 1852 1858 object BitBtn2: TBitBtn … … 1857 1863 Caption = '...' 1858 1864 TabOrder = 6 1865 OnClick = BitBtn2Click 1859 1866 Glyph.Data = { 1860 1867 F6000000424DF600000000000000760000002800000010000000100000000100 … … 1874 1881 TabOrder = 7 1875 1882 Text = '60' 1883 OnChange = edtPolFreqChange 1876 1884 end 1877 1885 end … … 2065 2073 00070043617074696F6E000E0063626F5472616E734D6574686F640102000000 2066 2074 5A00000005004974656D73590000000400546578740006004C6162656C330101 2067 0000005B000000070043617074696F6E0005004564697431000006004C616265 2068 6C3401010000005C000000070043617074696F6E00070042697442746E310000 2069 0A00646C675069636B446972000010006362456E61626C655363616E6E696E67 2070 01010000005D000000070043617074696F6E0006004C6162656C350101000000 2071 5E000000070043617074696F6E00050045646974320000070042697442746E32 2072 000006004C6162656C3601010000005F000000070043617074696F6E000A0065 2073 6474506F6C46726571000006004C6162656C3701010000006000000007004361 2074 7074696F6E00} 2075 0000005B000000070043617074696F6E0013006564697444726F70626F784C6F 2076 636174696F6E000006004C6162656C3401010000005C00000007004361707469 2077 6F6E00070042697442746E3100000A00646C675069636B446972000010006362 2078 456E61626C655363616E6E696E6701010000005D000000070043617074696F6E 2079 0006004C6162656C3501010000005E000000070043617074696F6E0013006564 2080 69745363616E6E65644C6F636174696F6E0000070042697442746E3200000600 2081 4C6162656C3601010000005F000000070043617074696F6E000A00656474506F 2082 6C46726571000006004C6162656C37010100000060000000070043617074696F 2083 6E00} 2075 2084 end 2076 2085 object dlgPickDir: TOpenDialog -
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.