From d733f1bd5ec113f9c479bce93a6ae45a0ef047a3 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Tue, 19 Jul 2016 17:34:56 +0000 Subject: [PATCH] tvplanit: Hide sound finder btn in event editor if OnPlaySound event handler is not assigned in non-windows systems. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5005 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpevnteditdlg.pas | 9 ++++----- components/tvplanit/source/vpwavdlg.pas | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/tvplanit/source/vpevnteditdlg.pas b/components/tvplanit/source/vpevnteditdlg.pas index 936b00efb..d64440d07 100644 --- a/components/tvplanit/source/vpevnteditdlg.pas +++ b/components/tvplanit/source/vpevnteditdlg.pas @@ -619,12 +619,11 @@ end; procedure TDlgEventEdit.FormShow(Sender: TObject); begin PositionControls; - (* - {$IFDEF LCL} - ScaleDPI(Self, DesigntimeDPI); - {$ENDIF} - *) DescriptionEdit.SetFocus; + {$IFNDEF MSWINDOWS} + if not Assigned(FDatastore.OnPlaySound) then + SoundFinderBtn.Hide; + {$ENDIF} end; {=====} diff --git a/components/tvplanit/source/vpwavdlg.pas b/components/tvplanit/source/vpwavdlg.pas index c283fecdd..5d6935e60 100644 --- a/components/tvplanit/source/vpwavdlg.pas +++ b/components/tvplanit/source/vpwavdlg.pas @@ -166,7 +166,8 @@ begin Label4.Caption := RSNothingToSelectFrom; if DingPath = '' then begin CBDefault.Checked := true; - ShellTreeView.Path := MediaFolder; + if (MediaFolder <> '') and DirectoryExists(MediaFolder) then + ShellTreeView.Path := MediaFolder; end else if FileExists(DingPath) then begin ShellTreeview.Path := ExtractFileDir(DingPath);