23#include <wx/aui/auibook.h>
26#include <wx/checkbox.h>
34#include <wx/filedlg.h>
56 SetTitle( wxString::Format(
_(
"%s Destination" ),
81 bool isFolder =
false;
82 wxString fileWildcard =
"";
91 wxString currPath = fn.GetFullPath();
93 wxDirDialog dirDialog(
this,
_(
"Select output directory" ), currPath,
96 if( dirDialog.ShowModal() != wxID_OK )
99 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
107 wxFileDialog dlg(
this,
_(
"Select output path" ), fname.GetPath(), fname.GetFullName(),
109 wxFD_OVERWRITE_PROMPT | wxFD_SAVE );
113 if( dlg.ShowModal() != wxID_OK )
116 wxString
path = dlg.GetPath();
120 wxFileName fn(
path );
122 if( fn.GetExt().IsEmpty() )
125 path = fn.GetFullPath();
136 for(
size_t idx = 0; idx <
m_includeJobs->GetCount(); ++idx )
147 int clickedIndex =
event.GetInt();
149 bool newCheckedState =
m_includeJobs->IsChecked( clickedIndex );
151 wxArrayInt currentSelections;
154 for(
size_t i = 0; i < currentSelections.GetCount(); i++ )
156 m_includeJobs->Check( currentSelections[i], newCheckedState );
167 if( outputPath.IsEmpty() )
173 wxArrayInt selectedItems;
181 for(
int i : selectedItems )
209 wxArrayString arrayStr;
210 std::vector<int> selectedList;
214 arrayStr.Add( wxString::Format( wxT(
"%d. %s" ),
215 (
int) arrayStr.size() + 1,
216 job.GetDescription() ) );
219 [&](
const wxString& only )
221 if( only == job.m_id )
228 selectedList.emplace_back( arrayStr.size() - 1 );
230 m_onlyMap.emplace( arrayStr.size() - 1, job.m_id );
233 if( arrayStr.size() != 0 )
237 if( selectedList.size() )
239 for(
int idx : selectedList )
244 for(
size_t idx = 0; idx <
m_includeJobs->GetCount(); ++idx )
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
wxButton * m_buttonDeselectAll
wxStaticText * m_textArchiveFormat
wxCheckListBox * m_includeJobs
wxChoice * m_choiceArchiveformat
STD_BITMAP_BUTTON * m_buttonOutputPath
wxTextCtrl * m_textCtrlOutputPath
wxTextCtrl * m_textCtrlDescription
DIALOG_DESTINATION_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("%s Destination"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
DIALOG_DESTINATION(wxWindow *aParent, JOBSET *aJobsFile, JOBSET_DESTINATION *aDestination)
std::map< int, wxString > m_onlyMap
bool TransferDataToWindow() override
void onIncludeJobsCheck(wxCommandEvent &event)
bool TransferDataFromWindow() override
virtual void onOutputPathBrowseClicked(wxCommandEvent &event) override
void onDeselectAllClicked(wxCommandEvent &event)
JOBSET_DESTINATION * m_destination
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void SetFormat(FORMAT format)
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
static const std::string ArchiveFileExtension
KICOMMON_API std::map< JOBSET_DESTINATION_T, JOBSET_DESTINATION_T_INFO > JobsetDestinationTypeInfos
Definition of file extensions used in Kicad.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().