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)
|
TVpCustomDataStore = class(TVpComponent)
|
||||||
|
private
|
||||||
|
FMediaFolder : String;
|
||||||
|
function IsStoredMediaFolder: Boolean;
|
||||||
|
|
||||||
protected{private}
|
protected{private}
|
||||||
FAutoCreate : Boolean;
|
FAutoCreate : Boolean;
|
||||||
FAutoConnect : Boolean;
|
FAutoConnect : Boolean;
|
||||||
@ -281,6 +285,8 @@ type
|
|||||||
read FEventTimerEnabled write SetEventTimerEnabled;
|
read FEventTimerEnabled write SetEventTimerEnabled;
|
||||||
property PlayEventSounds: Boolean
|
property PlayEventSounds: Boolean
|
||||||
read FPlayEventSounds write FPlayEventSounds;
|
read FPlayEventSounds write FPlayEventSounds;
|
||||||
|
property MediaFolder: String
|
||||||
|
read FMediaFolder write FMediaFolder stored IsStoredMediaFolder;
|
||||||
{events}
|
{events}
|
||||||
property OnAlert: TVpEventEvent
|
property OnAlert: TVpEventEvent
|
||||||
read FOnAlert write FOnAlert;
|
read FOnAlert write FOnAlert;
|
||||||
@ -635,6 +641,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
|
function TVpCustomDatastore.IsStoredMediaFolder: Boolean;
|
||||||
|
begin
|
||||||
|
Result := FMediaFolder <> '';
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TVpCustomDataStore.NotifyLinked;
|
procedure TVpCustomDataStore.NotifyLinked;
|
||||||
var
|
var
|
||||||
i : Integer;
|
i : Integer;
|
||||||
|
@ -673,8 +673,9 @@ begin
|
|||||||
Application.CreateForm(TfrmSoundDialog, SoundFinder);
|
Application.CreateForm(TfrmSoundDialog, SoundFinder);
|
||||||
try
|
try
|
||||||
SoundFinder.DingPath := AlarmWavPath;
|
SoundFinder.DingPath := AlarmWavPath;
|
||||||
SoundFinder.Populate;
|
SoundFinder.MediaFolder := Datastore.MediaFolder;
|
||||||
SoundFinder.OnPlaySound := DoPlaySound;
|
SoundFinder.OnPlaySound := DoPlaySound;
|
||||||
|
SoundFinder.Populate;
|
||||||
SoundFinder.ShowModal;
|
SoundFinder.ShowModal;
|
||||||
if SoundFinder.ReturnCode = TvpEditorReturnCode(rtCommit) then begin
|
if SoundFinder.ReturnCode = TvpEditorReturnCode(rtCommit) then begin
|
||||||
if SoundFinder.CBDefault.Checked then
|
if SoundFinder.CBDefault.Checked then
|
||||||
|
@ -71,6 +71,7 @@ type
|
|||||||
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
private
|
private
|
||||||
|
FMediaFolder: String;
|
||||||
FOnPlaySound: TVpPlaySoundEvent;
|
FOnPlaySound: TVpPlaySoundEvent;
|
||||||
function FindFileItem(AFilename: String): TListItem;
|
function FindFileItem(AFilename: String): TListItem;
|
||||||
public
|
public
|
||||||
@ -78,6 +79,7 @@ type
|
|||||||
ReturnCode : TVpEditorReturnCode;
|
ReturnCode : TVpEditorReturnCode;
|
||||||
function GetSelectedFileName: String;
|
function GetSelectedFileName: String;
|
||||||
procedure Populate;
|
procedure Populate;
|
||||||
|
property MediaFolder: String read FMediaFolder write FMediaFolder;
|
||||||
property OnPlaySound: TVpPlaySoundEvent read FOnPlaySound write FOnPlaySound;
|
property OnPlaySound: TVpPlaySoundEvent read FOnPlaySound write FOnPlaySound;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -139,13 +141,13 @@ begin
|
|||||||
Panel4.Caption := RSNothingToSelectFrom;
|
Panel4.Caption := RSNothingToSelectFrom;
|
||||||
if DingPath = '' then begin
|
if DingPath = '' then begin
|
||||||
CBDefault.Checked := true;
|
CBDefault.Checked := true;
|
||||||
ShellTreeView.Path := ExtractFileDir(ParamStr(0));
|
ShellTreeView.Path := FMediaFolder; //ExtractFileDir(ParamStr(0));
|
||||||
end else
|
end else
|
||||||
if FileExists(DingPath) then begin
|
if FileExists(DingPath) then begin
|
||||||
ShellTreeview.Path := ExtractFileDir(DingPath);
|
ShellTreeview.Path := ExtractFileDir(DingPath);
|
||||||
ShellListview.Selected := FindFileItem(DingPath);
|
ShellListview.Selected := FindFileItem(DingPath);
|
||||||
end else begin
|
end else begin
|
||||||
ShellTreeView.Path := ExtractFileDir(ParamStr(0));
|
ShellTreeView.Path := FMediaFolder; //ExtractFileDir(ParamStr(0));
|
||||||
end;
|
end;
|
||||||
CBDefaultClick(nil);
|
CBDefaultClick(nil);
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user