X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_playlist.cc;h=bac47d6dbae3ee02067c1e69b7f6375f98fd2ffc;hb=424ffe2828a76e8b0f2dc43d7391f6e2cf153468;hp=a81c0b730ef68873e22586e539a307d26223f14e;hpb=1d08c7b46a8d8ef99e4fbd14225dcdf9f6cb4667;p=dcpomatic.git diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc index a81c0b730..bac47d6db 100644 --- a/src/tools/dcpomatic_playlist.cc +++ b/src/tools/dcpomatic_playlist.cc @@ -21,6 +21,7 @@ #include "../wx/wx_util.h" #include "../wx/wx_signal_manager.h" #include "../wx/content_view.h" +#include "../wx/dcpomatic_button.h" #include "../lib/util.h" #include "../lib/config.h" #include "../lib/cross.h" @@ -125,12 +126,12 @@ public: main_sizer->Add (_list, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP); wxBoxSizer* button_sizer = new wxBoxSizer (wxVERTICAL); - _up = new wxButton (overall_panel, wxID_ANY, _("Up")); - _down = new wxButton (overall_panel, wxID_ANY, _("Down")); - _add = new wxButton (overall_panel, wxID_ANY, _("Add")); - _remove = new wxButton (overall_panel, wxID_ANY, _("Remove")); - _save = new wxButton (overall_panel, wxID_ANY, _("Save playlist")); - _load = new wxButton (overall_panel, wxID_ANY, _("Load playlist")); + _up = new Button (overall_panel, _("Up")); + _down = new Button (overall_panel, _("Down")); + _add = new Button (overall_panel, _("Add")); + _remove = new Button (overall_panel, _("Remove")); + _save = new Button (overall_panel, _("Save playlist")); + _load = new Button (overall_panel, _("Load playlist")); button_sizer->Add (_up, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP); button_sizer->Add (_down, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP); button_sizer->Add (_add, 0, wxEXPAND | wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP); @@ -279,7 +280,9 @@ private: void save_clicked () { - wxFileDialog* d = new wxFileDialog (this, _("Select playlist file"), wxEmptyString, wxEmptyString, wxT("XML files (*.xml)|*.xml"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); + Config* c = Config::instance (); + wxString default_dir = c->player_playlist_directory() ? std_to_wx(c->player_playlist_directory()->string()) : wxString(wxEmptyString); + wxFileDialog* d = new wxFileDialog (this, _("Select playlist file"), default_dir, wxEmptyString, wxT("XML files (*.xml)|*.xml"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (d->ShowModal() == wxID_OK) { _playlist.write (wx_to_std(d->GetPath())); } @@ -287,7 +290,9 @@ private: void load_clicked () { - wxFileDialog* d = new wxFileDialog (this, _("Select playlist file"), wxEmptyString, wxEmptyString, wxT("XML files (*.xml)|*.xml")); + Config* c = Config::instance (); + wxString default_dir = c->player_playlist_directory() ? std_to_wx(c->player_playlist_directory()->string()) : wxString(wxEmptyString); + wxFileDialog* d = new wxFileDialog (this, _("Select playlist file"), default_dir, wxEmptyString, wxT("XML files (*.xml)|*.xml")); if (d->ShowModal() == wxID_OK) { _list->DeleteAllItems (); if (!_playlist.read (wx_to_std(d->GetPath()), _content_dialog)) {