Merge branch 'master' into content-rework-take5
[dcpomatic.git] / src / wx / dir_picker_ctrl.cc
index 4cd7c3d155e5586f091d538df9f1d4ca5596a26e..ec7854764e048c435819e129467c33a051f0a28f 100644 (file)
@@ -19,6 +19,7 @@
 
 #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"
@@ -40,9 +41,6 @@ DirPickerCtrl::DirPickerCtrl (wxWindow* parent)
        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());
 }
 
 void
@@ -55,6 +53,9 @@ DirPickerCtrl::SetPath (wxString p)
        } else {
                _folder->SetLabel (std_to_wx (filesystem::path (wx_to_std (_path)).leaf().string()));
        }
+
+       wxCommandEvent ev (wxEVT_COMMAND_DIRPICKER_CHANGED, wxID_ANY);
+       GetEventHandler()->ProcessEvent (ev);
 }
 
 wxString