Skip to content

Commit

Permalink
Remove Backup list from Batch Render
Browse files Browse the repository at this point in the history
  • Loading branch information
cybercop23 authored and dkulp committed Jan 9, 2025
1 parent fccba1c commit 2e26242
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 34 deletions.
45 changes: 21 additions & 24 deletions xLights/BatchRenderDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
#include "xLightsMain.h"

//(*IdInit(BatchRenderDialog)
const long BatchRenderDialog::ID_CHOICE_FILTER = wxNewId();
const long BatchRenderDialog::ID_CHOICE_FOLDER = wxNewId();
const long BatchRenderDialog::ID_STATICTEXT1 = wxNewId();
const long BatchRenderDialog::ID_TEXTCTRL1 = wxNewId();
const long BatchRenderDialog::ID_CHECKBOX1 = wxNewId();
const long BatchRenderDialog::ID_PANEL_HOLDER = wxNewId();
const long BatchRenderDialog::ID_BUTTON1 = wxNewId();
const long BatchRenderDialog::ID_BUTTON2 = wxNewId();
const wxWindowID BatchRenderDialog::ID_CHOICE_FILTER = wxNewId();
const wxWindowID BatchRenderDialog::ID_CHOICE_FOLDER = wxNewId();
const wxWindowID BatchRenderDialog::ID_STATICTEXT1 = wxNewId();
const wxWindowID BatchRenderDialog::ID_TEXTCTRL1 = wxNewId();
const wxWindowID BatchRenderDialog::ID_CHECKBOX1 = wxNewId();
const wxWindowID BatchRenderDialog::ID_PANEL_HOLDER = wxNewId();
const wxWindowID BatchRenderDialog::ID_BUTTON1 = wxNewId();
const wxWindowID BatchRenderDialog::ID_BUTTON2 = wxNewId();
//*)

const long BatchRenderDialog::ID_MNU_SELECTALL = wxNewId();
Expand Down Expand Up @@ -74,8 +74,7 @@ BatchRenderDialog::BatchRenderDialog(wxWindow* parent)
StaticText1 = new wxStaticText(this, wxID_ANY, _("Filter:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
FlexGridSizer2->Add(StaticText1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FilterChoice = new wxChoice(this, ID_CHOICE_FILTER, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE_FILTER"));
FilterChoice->Append(_("Recursive Search"));
FilterChoice->SetSelection( FilterChoice->Append(_("Recursive Search - No Backups")) );
FilterChoice->SetSelection( FilterChoice->Append(_("Recursive Search")) );
FilterChoice->Append(_("Only Show Directory"));
FlexGridSizer2->Add(FilterChoice, 1, wxALL|wxEXPAND, 5);
StaticText2 = new wxStaticText(this, wxID_ANY, _("Folder:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
Expand All @@ -101,15 +100,14 @@ BatchRenderDialog::BatchRenderDialog(wxWindow* parent)
FlexGridSizer3->Add(Button_Cancel, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer1->Add(FlexGridSizer3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
SetSizer(FlexGridSizer1);
FlexGridSizer1->Fit(this);
FlexGridSizer1->SetSizeHints(this);
Center();

Connect(ID_CHOICE_FILTER,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&BatchRenderDialog::OnFilterChoiceSelect);
Connect(ID_CHOICE_FOLDER,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&BatchRenderDialog::OnFolderChoiceSelect);
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&BatchRenderDialog::OnButton_OkClick);
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&BatchRenderDialog::OnButton_CancelClick);
Connect(wxID_ANY,wxEVT_INIT_DIALOG,(wxObjectEventFunction)&BatchRenderDialog::OnInit);
Connect(ID_CHOICE_FILTER, wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction)&BatchRenderDialog::OnFilterChoiceSelect);
Connect(ID_CHOICE_FOLDER, wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction)&BatchRenderDialog::OnFolderChoiceSelect);
Connect(ID_BUTTON1, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&BatchRenderDialog::OnButton_OkClick);
Connect(ID_BUTTON2, wxEVT_COMMAND_BUTTON_CLICKED, (wxObjectEventFunction)&BatchRenderDialog::OnButton_CancelClick);
Connect(wxID_ANY, wxEVT_INIT_DIALOG, (wxObjectEventFunction)&BatchRenderDialog::OnInit);
//*)

CheckListBox_Sequences = new wxTreeListCtrl(this, wxID_ANY,
Expand Down Expand Up @@ -196,6 +194,13 @@ void BatchRenderDialog::GetSeqList(const wxString& folder)
{
wxArrayString files;
GetAllFilesInDir(folder, files, "*.x*", wxDIR_DEFAULT);
for (size_t i = 0; i < files.size(); /* no increment here */) {
if (files[i].StartsWith("Backup/") || files[i].StartsWith("Backup\\") || files[i].Contains("\\Backup\\") || files[i].Contains("/Backup/")) {
files.RemoveAt(i);
} else {
++i; // Only increment if no removal
}
}
files.Sort();
for (size_t x = 0; x < files.size(); x++) {
wxString name = files[x];
Expand Down Expand Up @@ -330,14 +335,6 @@ void BatchRenderDialog::OnFilterChoiceSelect(wxCommandEvent& event)
}
break;
case 1:
FolderChoice->Enable();
if (!name.StartsWith("Backup/") && !name.StartsWith("Backup\\") && !name.Contains("\\Backup\\") && !name.Contains("/Backup/") && isFileInFolder(name)) {
wxTreeListItem item = CheckListBox_Sequences->AppendItem(CheckListBox_Sequences->GetRootItem(), name);
DisplayDateModified(a, item);
DisplayDateRendered(a, item);
}
break;
case 2:
FolderChoice->Disable();
if (!name.Contains("/") && !name.Contains("\\")) {
wxTreeListItem item = CheckListBox_Sequences->AppendItem(CheckListBox_Sequences->GetRootItem(), name);
Expand Down
16 changes: 8 additions & 8 deletions xLights/BatchRenderDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ class BatchRenderDialog: public wxDialog
wxString showDirectory;

//(*Identifiers(BatchRenderDialog)
static const long ID_CHOICE_FILTER;
static const long ID_CHOICE_FOLDER;
static const long ID_STATICTEXT1;
static const long ID_TEXTCTRL1;
static const long ID_CHECKBOX1;
static const long ID_PANEL_HOLDER;
static const long ID_BUTTON1;
static const long ID_BUTTON2;
static const wxWindowID ID_CHOICE_FILTER;
static const wxWindowID ID_CHOICE_FOLDER;
static const wxWindowID ID_STATICTEXT1;
static const wxWindowID ID_TEXTCTRL1;
static const wxWindowID ID_CHECKBOX1;
static const wxWindowID ID_PANEL_HOLDER;
static const wxWindowID ID_BUTTON1;
static const wxWindowID ID_BUTTON2;
//*)

static const long ID_MNU_SELECTALL;
Expand Down
3 changes: 1 addition & 2 deletions xLights/wxsmith/BatchRenderDialog.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
<object class="wxChoice" name="ID_CHOICE_FILTER" variable="FilterChoice" member="yes">
<content>
<item>Recursive Search</item>
<item>Recursive Search - No Backups</item>
<item>Only Show Directory</item>
</content>
<selection>1</selection>
<selection>0</selection>
<handler function="OnFilterChoiceSelect" entry="EVT_CHOICE" />
</object>
<flag>wxALL|wxEXPAND</flag>
Expand Down

0 comments on commit 2e26242

Please sign in to comment.