diff --git a/components/tvplanit/source/vpbaseds.pas b/components/tvplanit/source/vpbaseds.pas index ee68adb26..45cc4552c 100644 --- a/components/tvplanit/source/vpbaseds.pas +++ b/components/tvplanit/source/vpbaseds.pas @@ -186,6 +186,10 @@ type TVpCustomDataStore = class(TVpComponent) + private + FMediaFolder : String; + function IsStoredMediaFolder: Boolean; + protected{private} FAutoCreate : Boolean; FAutoConnect : Boolean; @@ -281,6 +285,8 @@ type read FEventTimerEnabled write SetEventTimerEnabled; property PlayEventSounds: Boolean read FPlayEventSounds write FPlayEventSounds; + property MediaFolder: String + read FMediaFolder write FMediaFolder stored IsStoredMediaFolder; {events} property OnAlert: TVpEventEvent read FOnAlert write FOnAlert; @@ -635,6 +641,11 @@ begin end; {=====} +function TVpCustomDatastore.IsStoredMediaFolder: Boolean; +begin + Result := FMediaFolder <> ''; +end; + procedure TVpCustomDataStore.NotifyLinked; var i : Integer; diff --git a/components/tvplanit/source/vpevnteditdlg.pas b/components/tvplanit/source/vpevnteditdlg.pas index 5ad98a571..a9baec3a4 100644 --- a/components/tvplanit/source/vpevnteditdlg.pas +++ b/components/tvplanit/source/vpevnteditdlg.pas @@ -673,8 +673,9 @@ begin Application.CreateForm(TfrmSoundDialog, SoundFinder); try SoundFinder.DingPath := AlarmWavPath; - SoundFinder.Populate; + SoundFinder.MediaFolder := Datastore.MediaFolder; SoundFinder.OnPlaySound := DoPlaySound; + SoundFinder.Populate; SoundFinder.ShowModal; if SoundFinder.ReturnCode = TvpEditorReturnCode(rtCommit) then begin if SoundFinder.CBDefault.Checked then diff --git a/components/tvplanit/source/vpwavdlg.pas b/components/tvplanit/source/vpwavdlg.pas index 9b31f5f04..25dd579ff 100644 --- a/components/tvplanit/source/vpwavdlg.pas +++ b/components/tvplanit/source/vpwavdlg.pas @@ -71,6 +71,7 @@ type procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); private + FMediaFolder: String; FOnPlaySound: TVpPlaySoundEvent; function FindFileItem(AFilename: String): TListItem; public @@ -78,6 +79,7 @@ type ReturnCode : TVpEditorReturnCode; function GetSelectedFileName: String; procedure Populate; + property MediaFolder: String read FMediaFolder write FMediaFolder; property OnPlaySound: TVpPlaySoundEvent read FOnPlaySound write FOnPlaySound; end; @@ -139,13 +141,13 @@ begin Panel4.Caption := RSNothingToSelectFrom; if DingPath = '' then begin CBDefault.Checked := true; - ShellTreeView.Path := ExtractFileDir(ParamStr(0)); + ShellTreeView.Path := FMediaFolder; //ExtractFileDir(ParamStr(0)); end else if FileExists(DingPath) then begin ShellTreeview.Path := ExtractFileDir(DingPath); ShellListview.Selected := FindFileItem(DingPath); end else begin - ShellTreeView.Path := ExtractFileDir(ParamStr(0)); + ShellTreeView.Path := FMediaFolder; //ExtractFileDir(ParamStr(0)); end; CBDefaultClick(nil); end;