Index: cprs/branches/tmg-cprs/CPRS-Chart/Options/fOptions.pas
===================================================================
--- cprs/branches/tmg-cprs/CPRS-Chart/Options/fOptions.pas	(revision 738)
+++ cprs/branches/tmg-cprs/CPRS-Chart/Options/fOptions.pas	(revision 801)
@@ -140,14 +140,14 @@
     Label3: TLabel;
     editDropboxLocation: TEdit;
-    Label4: TLabel;
-    BitBtn1: TBitBtn;
+    lblDropBox: TLabel;
+    btnBrowseDropBox: TBitBtn;
     dlgPickDir: TOpenDialog;
     cbEnableScanning: TCheckBox;
-    Label5: TLabel;
+    lblPollingInterval: TLabel;
     editScannedLocation: TEdit;
-    BitBtn2: TBitBtn;
-    Label6: TLabel;
+    btnBrowseScannedImages: TBitBtn;
+    lblScannedImagesFolder: TLabel;
     edtPolFreq: TEdit;
-    Label7: TLabel;
+    lblSeconds: TLabel;
     procedure FormCreate(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
@@ -195,6 +195,6 @@
     procedure editScannedLocationChange(Sender: TObject);
     procedure edtPolFreqChange(Sender: TObject);
-    procedure BitBtn1Click(Sender: TObject);
-    procedure BitBtn2Click(Sender: TObject);  //kt added 6/29/07
+    procedure btnBrowseDropBoxClick(Sender: TObject);
+    procedure btnBrowseScannedImagesClick(Sender: TObject);  //kt added 6/29/07
   private
     { Private declarations }
@@ -357,9 +357,14 @@
   // initialize form
   var i : integer;  //kt added 6/29/07
-  begin
+      j : TImgTransferMethod;
+  begin
+    //kt start mod
+    cboTransMethod.Items.Clear;
+    for j := itmDropbox to itmRPC do cboTransMethod.Items.Add(IMAGE_TRANSFER_METHODS[j]);
+    //kt end mod
     LoadNotifications;
     LoadOrderChecks;
-    LoadImageSettings;
-    FdirtyImageSettings := false;
+    LoadImageSettings; //kt
+    FdirtyImageSettings := false; //kt
     FdirtyNotifications := false;
     FdirtyOrderChecks := false;
@@ -515,11 +520,10 @@
   procedure TfrmOptions.LoadImageSettings;
   begin
-     cbEnableImages.Checked := uTMGOptions.ReadBool('EnableImages',false);
-     cboTransMethod.ItemIndex :=  uTMGOptions.ReadInteger('ImageTransferMethod',0);
+     cbEnableImages.Checked := uTMGOptions.ReadBool('EnableImages',true);
+     cboTransMethod.ItemIndex :=  uTMGOptions.ReadInteger('ImageTransferMethod',2);
      editDropboxLocation.text := uTMGOptions.ReadString('Dropbox directory','');
      cbEnableScanning.Checked := uTMGOptions.ReadBool('Scan Enabled',false);
      editScannedLocation.text := uTMGOptions.ReadString('Pol Directory','');
      edtPolFreq.text := IntToStr(uTMGOptions.ReadInteger('Pol Interval (milliseconds)',0));
-
      cbEnableScanningClick(self);
      cboTransMethodChange(self);
@@ -568,4 +572,6 @@
 
      uTMGOptions.WriteInteger('ImageTransferMethod',cboTransMethod.itemindex);
+     frmImages.TransferMethod := TImgTransferMethod(cboTransMethod.itemindex);
+     {
      if cboTransMethod.text = 'Dropbox Transfer' then begin
         frmImages.UseDropBox := True;
@@ -573,5 +579,5 @@
         frmImages.UseDropBox := False;
      end;
-
+     }
      uTMGOptions.WriteString('Dropbox directory',editDropboxLocation.text);
      frmImages.DropBoxDir := editDropboxLocation.text;
@@ -1018,101 +1024,109 @@
   end;
 
-procedure TfrmOptions.cboTransMethodChange(Sender: TObject);
-begin
-    if cboTransMethod.text = 'Dropbox Transfer' then begin
-       editDropboxLocation.enabled := true;
-       bitbtn1.enabled := true;
-    end else begin
-       editDropboxLocation.enabled := false;
-       bitbtn1.enabled := false;
-    end;
+  procedure TfrmOptions.cboTransMethodChange(Sender: TObject);
+  var Show : boolean;
+  begin
+    if cboTransMethod.Text = IMAGE_TRANSFER_METHODS[itmDirect] then begin
+      MessageDlg('Sorry.  Direct file access not yet supported.',mtInformation,[mbOK],0);
+      cboTransMethod.ItemIndex := -1;
+    end;
+    if cboTransMethod.ItemIndex < 0 then begin
+      cboTransMethod.ItemIndex := ord(itmRPC);
+      cboTransMethod.Text := IMAGE_TRANSFER_METHODS[itmRPC];
+    end;
+    Show := (cboTransMethod.ItemIndex = ord(itmDropbox));
+    editDropboxLocation.Visible := Show;
+    btnBrowseDropBox.Visible := Show;
+    lblDropBox.Visible := Show;
     FdirtyImageSettings := true;
     CheckApply;
-end;
-
-procedure TfrmOptions.cbEnableImagesClick(Sender: TObject);
-begin
-   FdirtyImageSettings := true;
-   CheckApply;
-end;
-
-procedure TfrmOptions.editDropboxLocationChange(Sender: TObject);
-begin
-   FdirtyImageSettings := true;
-   CheckApply;
-end;
-
-procedure TfrmOptions.cbEnableScanningClick(Sender: TObject);
-begin
-   editScannedLocation.enabled := cbEnableScanning.checked;
-   bitbtn2.enabled := cbEnableScanning.checked;
-   edtPolFreq.enabled := cbEnableScanning.checked;
-   FdirtyImageSettings := true;
-   CheckApply;
-end;
-
-procedure TfrmOptions.editScannedLocationChange(Sender: TObject);
-begin
-   FdirtyImageSettings := true;
-   CheckApply;
-end;
-
-procedure TfrmOptions.edtPolFreqChange(Sender: TObject);
-begin
-   FdirtyImageSettings := true;
-   CheckApply;
-end;
-
-procedure TfrmOptions.BitBtn1Click(Sender: TObject);
-var
-   sFolder: string;
-begin
-  sFolder := BrowseDialog('Choose a Dropbox folder', BIF_RETURNONLYFSDIRS);
-  if sFolder <> '' then begin
-    if rightstr(sFolder,1) = '\' then begin
-       editDropboxLocation.text := sFolder;
-    end else begin
-       editDropboxLocation.text := sFolder + '\';
-    end;
-  end;
-end;
-
-function TfrmOptions.BrowseDialog(const Title: string; const Flag: integer): string;
-var
-  lpItemID : PItemIDList;
-  BrowseInfo : TBrowseInfo;
-  DisplayName : array[0..MAX_PATH] of char;
-  TempPath : array[0..MAX_PATH] of char;
-begin
-  Result:='';
-  FillChar(BrowseInfo, sizeof(TBrowseInfo), #0);
-  with BrowseInfo do begin
-    hwndOwner := Application.Handle;
-    pszDisplayName := @DisplayName;
-    lpszTitle := PChar(Title);
-    ulFlags := Flag;
-  end;
-  lpItemID := SHBrowseForFolder(BrowseInfo);
-  if lpItemId <> nil then begin
-    SHGetPathFromIDList(lpItemID, TempPath);
-    Result := TempPath;
-    GlobalFreePtr(lpItemID);
-  end;
-end;
-
-
-procedure TfrmOptions.BitBtn2Click(Sender: TObject);
-var
-   sFolder: string;
-begin
-  sFolder := BrowseDialog('Choose a Scanned folder', BIF_RETURNONLYFSDIRS);
-  if sFolder <> '' then begin
-    if rightstr(sFolder,1) = '\' then begin
-       editScannedLocation.text := sFolder;
-    end else begin
-       editScannedLocation.text := sFolder + '\';
-    end;
-  end;
-end;
+  end;
+
+  procedure TfrmOptions.cbEnableImagesClick(Sender: TObject);
+  begin
+    FdirtyImageSettings := true;
+    CheckApply;
+  end;
+
+  procedure TfrmOptions.editDropboxLocationChange(Sender: TObject);
+  begin
+    FdirtyImageSettings := true;
+    CheckApply;
+  end;
+
+  procedure TfrmOptions.cbEnableScanningClick(Sender: TObject);
+  begin
+    editScannedLocation.Visible := cbEnableScanning.checked;
+    btnBrowseScannedImages.Visible := cbEnableScanning.checked;
+    edtPolFreq.Visible := cbEnableScanning.checked;
+    lblScannedImagesFolder.Visible := cbEnableScanning.checked;
+    lblPollingInterval.Visible := cbEnableScanning.checked;
+    lblSeconds.Visible := cbEnableScanning.checked;
+    FdirtyImageSettings := true;
+    CheckApply;
+  end;
+
+  procedure TfrmOptions.editScannedLocationChange(Sender: TObject);
+  begin
+     FdirtyImageSettings := true;
+     CheckApply;
+  end;
+
+  procedure TfrmOptions.edtPolFreqChange(Sender: TObject);
+  begin
+     FdirtyImageSettings := true;
+     CheckApply;
+  end;
+
+  procedure TfrmOptions.btnBrowseDropBoxClick(Sender: TObject);
+  var
+     sFolder: string;
+  begin
+    sFolder := BrowseDialog('Choose a Dropbox folder', BIF_RETURNONLYFSDIRS);
+    if sFolder <> '' then begin
+      if rightstr(sFolder,1) = '\' then begin
+         editDropboxLocation.text := sFolder;
+      end else begin
+         editDropboxLocation.text := sFolder + '\';
+      end;
+    end;
+  end;
+
+  function TfrmOptions.BrowseDialog(const Title: string; const Flag: integer): string;
+  var
+    lpItemID : PItemIDList;
+    BrowseInfo : TBrowseInfo;
+    DisplayName : array[0..MAX_PATH] of char;
+    TempPath : array[0..MAX_PATH] of char;
+  begin
+    Result:='';
+    FillChar(BrowseInfo, sizeof(TBrowseInfo), #0);
+    with BrowseInfo do begin
+      hwndOwner := Application.Handle;
+      pszDisplayName := @DisplayName;
+      lpszTitle := PChar(Title);
+      ulFlags := Flag;
+    end;
+    lpItemID := SHBrowseForFolder(BrowseInfo);
+    if lpItemId <> nil then begin
+      SHGetPathFromIDList(lpItemID, TempPath);
+      Result := TempPath;
+      GlobalFreePtr(lpItemID);
+    end;
+  end;
+
+  procedure TfrmOptions.btnBrowseScannedImagesClick(Sender: TObject);
+  var
+     sFolder: string;
+  begin
+    sFolder := BrowseDialog('Choose a Scanned folder', BIF_RETURNONLYFSDIRS);
+    if sFolder <> '' then begin
+      if rightstr(sFolder,1) = '\' then begin
+         editScannedLocation.text := sFolder;
+      end else begin
+         editScannedLocation.text := sFolder + '\';
+      end;
+    end;
+  end;
 
 end.
