projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '1.0' of /home/carl/git/dvdomatic into 1.0
[dcpomatic.git]
/
src
/
wx
/
dir_picker_ctrl.cc
diff --git
a/src/wx/dir_picker_ctrl.cc
b/src/wx/dir_picker_ctrl.cc
index 05b680288c248baaf0605f88d67eac45e71556d5..47a546a8d8782223a5d519067c95fed7605fa13e 100644
(file)
--- a/
src/wx/dir_picker_ctrl.cc
+++ b/
src/wx/dir_picker_ctrl.cc
@@
-19,6
+19,7
@@
#include <wx/wx.h>
#include <wx/stdpaths.h>
#include <wx/wx.h>
#include <wx/stdpaths.h>
+#include <wx/filepicker.h>
#include <boost/filesystem.hpp>
#include "dir_picker_ctrl.h"
#include "wx_util.h"
#include <boost/filesystem.hpp>
#include "dir_picker_ctrl.h"
#include "wx_util.h"
@@
-39,10
+40,7
@@
DirPickerCtrl::DirPickerCtrl (wxWindow* parent)
SetSizerAndFit (_sizer);
SetSizerAndFit (_sizer);
- _browse->Connect (wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler (DirPickerCtrl::browse_clicked), 0, this);
-
- /* Do this after the fit so that our folder label stays long */
- SetPath (wxStandardPaths::Get().GetDocumentsDir());
+ _browse->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DirPickerCtrl::browse_clicked, this));
}
void
}
void
@@
-53,12
+51,11
@@
DirPickerCtrl::SetPath (wxString p)
if (_path == wxStandardPaths::Get().GetDocumentsDir()) {
_folder->SetLabel (_("My Documents"));
} else {
if (_path == wxStandardPaths::Get().GetDocumentsDir()) {
_folder->SetLabel (_("My Documents"));
} else {
-#if BOOST_FILESYSTEM_VERSION == 3
_folder->SetLabel (std_to_wx (filesystem::path (wx_to_std (_path)).leaf().string()));
_folder->SetLabel (std_to_wx (filesystem::path (wx_to_std (_path)).leaf().string()));
-#else
- _folder->SetLabel (std_to_wx (filesystem::path (wx_to_std (_path)).leaf()));
-#endif
}
}
+
+ wxCommandEvent ev (wxEVT_COMMAND_DIRPICKER_CHANGED, wxID_ANY);
+ GetEventHandler()->ProcessEvent (ev);
}
wxString
}
wxString
@@
-68,10
+65,11
@@
DirPickerCtrl::GetPath () const
}
void
}
void
-DirPickerCtrl::browse_clicked (
wxCommandEvent &
)
+DirPickerCtrl::browse_clicked ()
{
wxDirDialog* d = new wxDirDialog (this);
{
wxDirDialog* d = new wxDirDialog (this);
- d->ShowModal ();
- SetPath (d->GetPath ());
+ if (d->ShowModal () == wxID_OK) {
+ SetPath (d->GetPath ());
+ }
d->Destroy ();
}
d->Destroy ();
}