Editor: Show full path name in sound delegate display string

directional-lights
Sven Eberhardt 2016-10-16 01:15:38 -04:00
parent 38cf275de7
commit cd9d6f5c6f
2 changed files with 8 additions and 0 deletions

View File

@ -1832,6 +1832,13 @@ C4PropertyDelegateSound::C4PropertyDelegateSound(const C4PropertyDelegateFactory
}
}
QString C4PropertyDelegateSound::GetDisplayString(const C4Value &v, class C4Object *obj, bool short_names) const
{
// Always show full sound name
C4String *val_string = v.getStr();
return val_string ? QString(val_string->GetCStr()) : QString(v.GetDataString().getData());
}
bool C4PropertyDelegateSound::IsPasteValid(const C4Value &val) const
{
// Must be nil or a string

View File

@ -446,6 +446,7 @@ class C4PropertyDelegateSound : public C4PropertyDelegateEnum
{
public:
C4PropertyDelegateSound(const C4PropertyDelegateFactory *factory, C4PropList *props);
QString GetDisplayString(const C4Value &v, class C4Object *obj, bool short_names) const override;
bool IsPasteValid(const C4Value &val) const override;
protected:
C4StyledItemDelegateWithButton::ButtonType GetOptionComboBoxButtonType() const override { return C4StyledItemDelegateWithButton::BT_PlaySound; }