| 1 |
#include "virtual_folder_property.h" |
| 2 |
#include "virtual_folder_picker_ctrl.h" |
| 3 |
|
| 4 |
VirtualFolderProperty::VirtualFolderProperty(const wxString& label, const wxString& path, const wxString& tooltip) |
| 5 |
: PropertyBase(tooltip) |
| 6 |
{ |
| 7 |
wxString tip; |
| 8 |
tip << GetTooltip() << _("\n ** Click to select different virtual folder **"); |
| 9 |
|
| 10 |
SetTooltip(tip); |
| 11 |
SetLabel(label); |
| 12 |
SetValue(path); |
| 13 |
} |
| 14 |
|
| 15 |
VirtualFolderProperty::~VirtualFolderProperty() {} |
| 16 |
|
| 17 |
wxString VirtualFolderProperty::GetValue() const { return m_path; } |
| 18 |
|
| 19 |
JSONElement VirtualFolderProperty::Serialize() const |
| 20 |
{ |
| 21 |
JSONElement json = JSONElement::createObject(); |
| 22 |
json.addProperty(wxT("type"), wxT("virtualFolderPicker")); |
| 23 |
DoBaseSerialize(json); |
| 24 |
json.addProperty(wxT("m_path"), m_path); |
| 25 |
return json; |
| 26 |
} |
| 27 |
|
| 28 |
void VirtualFolderProperty::SetValue(const wxString& value) { m_path = value; } |
| 29 |
|
| 30 |
void VirtualFolderProperty::UnSerialize(const JSONElement& json) |
| 31 |
{ |
| 32 |
DoBaseUnSerialize(json); |
| 33 |
m_path = json.namedObject(wxT("m_path")).toString(); |
| 34 |
} |