You've already forked lazarus-ccr
tvplanit: New datastore property MediaFolder (TWavDlg looks here for sound files)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4744 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user