From 45616dc662efa6cadd925741b167fd0f32ded983 Mon Sep 17 00:00:00 2001 From: Scott Hanson Date: Sun, 24 Dec 2023 10:44:51 -0500 Subject: [PATCH] allow manual SD directory selection if drive is missing --- xLights/controllers/HinksPixExportDialog.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/xLights/controllers/HinksPixExportDialog.cpp b/xLights/controllers/HinksPixExportDialog.cpp index 512ca865f0..6d0aa08bb0 100644 --- a/xLights/controllers/HinksPixExportDialog.cpp +++ b/xLights/controllers/HinksPixExportDialog.cpp @@ -451,7 +451,7 @@ void HinksPixExportDialog::OnPopupGrid(wxCommandEvent& event) int max = 59; if (id == ID_MNU_SETALL) { if (col <= static_cast(ScheduleColumn::EndMin) && - col >= static_cast(ScheduleColumn::StartHour)) { + col >= static_cast(ScheduleColumn::StartHour)) { switch (static_cast(col)) { case ScheduleColumn::StartHour: case ScheduleColumn::EndHour: @@ -895,7 +895,7 @@ void HinksPixExportDialog::OnAddRefreshButtonClick(wxCommandEvent& /*event*/) { } void HinksPixExportDialog::OnButton_ExportClick(wxCommandEvent& /*event*/) { - static log4cpp::Category& logger_base = log4cpp::Category::getInstance(std::string("log_base")); + static log4cpp::Category& logger_base = log4cpp::Category::getInstance(std::string("log_base")); if (!m_selectedPlayList.empty()) { StoreToObjectPlayList(m_selectedPlayList); @@ -918,7 +918,6 @@ void HinksPixExportDialog::OnButton_ExportClick(wxCommandEvent& /*event*/) { std::map shortNames; std::vector names; for (auto& playlist : m_playLists) { - bool worked{ true }; for (auto& play : playlist.Items) { if (shortNames.find( play.FSEQ) == shortNames.end()) { wxString const shortName = createUniqueShortName(play.FSEQ, names); @@ -981,13 +980,14 @@ void HinksPixExportDialog::OnButton_ExportClick(wxCommandEvent& /*event*/) { drive = dirname.GetPath(); if (drive.IsEmpty()) { - error = true; - errorMsg = wxString::Format("No USB Drive Set for '%s'", hix->GetName()); - continue; + wxDirDialog dlg(this, "Select SD Directory for " + hix->GetName(), drive, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST); + if (dlg.ShowModal() == wxID_OK) { + drive = dlg.GetPath(); + } } if (!ObtainAccessToURL(drive) || !createTestFile(drive)) { - wxDirDialog dlg(this, "Select SD Directory", drive, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST); + wxDirDialog dlg(this, "Select SD Directory for " + hix->GetName(), drive, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST); if (dlg.ShowModal() == wxID_OK) { drive = dlg.GetPath(); } @@ -1027,7 +1027,7 @@ void HinksPixExportDialog::OnButton_ExportClick(wxCommandEvent& /*event*/) { logger_base.error("HinksPixExportDialog export - loading audio fails - %d : %d : %d", int(loaderState), int(decoderInitState), int(resamplerInitState)); } } - play.AU = auName; + play.AU = auName; } play.HSEQ = shortHseqName; } @@ -1652,7 +1652,7 @@ void HinksPixExportDialog::RedrawPlayList(wxString const& new_playlist, bool sav void HinksPixExportDialog::StoreToObjectSchedule() { CheckSchedules(); - + auto rows = GridSchedule->GetNumberRows(); if (rows == 0) { return;