projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup: rename some methods in FilePickerCtrl and use boost::filesystem::path more.
[dcpomatic.git]
/
src
/
wx
/
file_picker_ctrl.cc
diff --git
a/src/wx/file_picker_ctrl.cc
b/src/wx/file_picker_ctrl.cc
index 4bb6518efc2fe33a91ac26812a701a5fba9bd55e..07424e74cd82182cc9670c411eea98dbb7a6a0f8 100644
(file)
--- a/
src/wx/file_picker_ctrl.cc
+++ b/
src/wx/file_picker_ctrl.cc
@@
-55,13
+55,14
@@
FilePickerCtrl::FilePickerCtrl (wxWindow* parent, wxString prompt, wxString wild
_file->Bind (wxEVT_BUTTON, boost::bind (&FilePickerCtrl::browse_clicked, this));
}
_file->Bind (wxEVT_BUTTON, boost::bind (&FilePickerCtrl::browse_clicked, this));
}
+
void
void
-FilePickerCtrl::
SetPath (wxString p
)
+FilePickerCtrl::
set_path(boost::filesystem::path path
)
{
{
- _path = p;
+ _path = p
ath
;
- if (!_path.
IsEmpty
()) {
- _file->SetLabel(std_to_wx(
filesystem::path(wx_to_std(_path))
.filename().string()));
+ if (!_path.
empty
()) {
+ _file->SetLabel(std_to_wx(
_path
.filename().string()));
} else {
_file->SetLabel (_("(None)"));
}
} else {
_file->SetLabel (_("(None)"));
}
@@
-70,12
+71,14
@@
FilePickerCtrl::SetPath (wxString p)
GetEventHandler()->ProcessEvent (ev);
}
GetEventHandler()->ProcessEvent (ev);
}
-wxString
-FilePickerCtrl::GetPath () const
+
+boost::filesystem::path
+FilePickerCtrl::path() const
{
return _path;
}
{
return _path;
}
+
void
FilePickerCtrl::browse_clicked ()
{
void
FilePickerCtrl::browse_clicked ()
{
@@
-84,14
+87,14
@@
FilePickerCtrl::browse_clicked ()
style |= wxFD_OVERWRITE_PROMPT;
}
wxFileDialog dialog(this, _prompt, wxEmptyString, wxEmptyString, _wildcard, style);
style |= wxFD_OVERWRITE_PROMPT;
}
wxFileDialog dialog(this, _prompt, wxEmptyString, wxEmptyString, _wildcard, style);
- dialog.SetPath(
_path
);
+ dialog.SetPath(
std_to_wx(_path.string())
);
if (dialog.ShowModal() == wxID_OK) {
if (dialog.ShowModal() == wxID_OK) {
-
SetPath(dialog.GetPath(
));
+
set_path(boost::filesystem::path(wx_to_std(dialog.GetPath())
));
}
}
void
}
}
void
-FilePickerCtrl::
SetWildcard
(wxString w)
+FilePickerCtrl::
set_wildcard
(wxString w)
{
_wildcard = w;
}
{
_wildcard = w;
}