KiCad PCB EDA Suite
Loading...
Searching...
No Matches
panel_jobs.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2024 Mark Roszko <[email protected]>
5 * Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include "panel_jobs.h"
22#include <wx/aui/auibook.h>
23#include <jobs/jobset.h>
24#include <jobs/job_registry.h>
25#include <eda_list_dialog.h>
27#include <wx/checkbox.h>
28#include <wx/menu.h>
29#include <bitmaps.h>
30#include <i18n_utility.h>
31#include <jobs_runner.h>
35#include <kicad_manager_frame.h>
36#include <vector>
37
38#include <wx/dirdlg.h>
39#include <wx/filedlg.h>
42
43#include <confirm.h>
44
47
48
50{
51 wxString name;
54 wxString fileWildcard;
55};
56
57
58static std::map<JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO> jobTypeInfos = {
60 { _HKI( "Folder" ), BITMAPS::small_folder, true, "" } },
62 { _HKI( "Archive" ), BITMAPS::zip, false, FILEEXT::ZipFileWildcard() } },
63};
64
65
67{
68public:
69 DIALOG_JOB_OUTPUT( wxWindow* aParent, JOBSET* aJobsFile, JOBSET_OUTPUT* aOutput ) :
70 DIALOG_JOB_OUTPUT_BASE( aParent ), m_jobsFile( aJobsFile ), m_output( aOutput )
71 {
72 SetAffirmativeId( wxID_SAVE );
73
74 // prevent someone from failing to add the type info in the future
75 wxASSERT( jobTypeInfos.contains( m_output->m_type ) );
76
77 SetTitle( wxString::Format( _( "%s Output Options" ), jobTypeInfos[m_output->m_type].name ) );
78
79 if( m_output->m_type != JOBSET_OUTPUT_TYPE::ARCHIVE )
80 {
81 m_textArchiveFormat->Hide();
83 }
84
85 m_buttonOutputPath->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
86 }
87
88
89 virtual void onOutputPathBrowseClicked(wxCommandEvent& event) override
90 {
91 bool isFolder = false;
92 wxString fileWildcard = "";
93 isFolder = jobTypeInfos[m_output->m_type].outputPathIsFolder;
94 fileWildcard = jobTypeInfos[m_output->m_type].fileWildcard;
95
96 if( isFolder )
97 {
98 wxFileName fn;
99 fn.AssignDir( m_textCtrlOutputPath->GetValue() );
100 fn.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS );
101 wxString currPath = fn.GetFullPath();
102
103 wxDirDialog dirDialog( this, _( "Select Templates Directory" ), currPath,
104 wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST );
105
106 if( dirDialog.ShowModal() != wxID_OK )
107 return;
108
109 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
110
111 m_textCtrlOutputPath->SetValue( dirName.GetFullPath() );
112 }
113 else
114 {
115 wxFileDialog dlg( this, _( "Select output path" ), m_textCtrlOutputPath->GetValue(),
116 "test.zip",
117 fileWildcard,
118 wxFD_OVERWRITE_PROMPT | wxFD_SAVE );
119
120 if( dlg.ShowModal() != wxID_OK )
121 {
122 return;
123 }
124
125 wxFileName fname_log( dlg.GetPath() );
126 }
127
128 }
129
131 {
132 wxArrayInt selectedItems;
133 m_listBoxOnly->GetSelections( selectedItems );
134
135 // Update the only job map
136 m_output->m_only.clear();
137 for( int i : selectedItems )
138 {
139 if( m_onlyMap.contains( i ) )
140 {
141 m_output->m_only.emplace_back( m_onlyMap[i] );
142 }
143 }
144
146
147 if( m_output->m_type == JOBSET_OUTPUT_TYPE::ARCHIVE )
148 {
149 JOBS_OUTPUT_ARCHIVE* archive =
151
153 }
154
155
156 return true;
157 }
158
159
160 bool TransferDataToWindow() override
161 {
162 wxArrayString arrayStr;
163 std::vector<int> selectedList;
164
165 std::vector<JOBSET_JOB> jobs = m_jobsFile->GetJobs();
166 int i = 0;
167 for( JOBSET_JOB& job : jobs )
168 {
169 arrayStr.Add( job.m_job->GetDescription() );
170
171 auto it = std::find_if( m_output->m_only.begin(), m_output->m_only.end(),
172 [&]( const wxString& only )
173 {
174 if( only == job.m_id )
175 return true;
176
177 return false;
178 } );
179
180 if( it != m_output->m_only.end() )
181 {
182 selectedList.emplace_back( i );
183 }
184
185 m_onlyMap.emplace( i, job.m_id );
186 i++;
187 }
188
189 m_listBoxOnly->InsertItems( arrayStr, 0 );
190
191 for( int idx : selectedList )
192 {
193 m_listBoxOnly->SetSelection( idx );
194 }
195
196 m_choiceArchiveformat->AppendString( _( "Zip" ) );
197 m_choiceArchiveformat->SetSelection( 0 );
198
199 return true;
200 }
201
202
203private:
206 std::map<int, wxString> m_onlyMap;
207};
208
209
211{
212public:
213 PANEL_JOB_OUTPUT( wxWindow* aParent, PANEL_JOBS* aPanelParent, KICAD_MANAGER_FRAME* aFrame,
214 JOBSET* aFile, JOBSET_OUTPUT* aOutput ) :
215 PANEL_JOB_OUTPUT_BASE( aParent ),
216 m_jobsFile( aFile ),
217 m_output( aOutput ),
218 m_frame( aFrame ),
219 m_panelParent( aPanelParent )
220 {
221 m_buttonOutputRun->SetBitmap( KiBitmapBundle( BITMAPS::sim_run ) );
222 m_buttonOutputOptions->SetBitmap( KiBitmapBundle( BITMAPS::preference ) );
223
224 m_buttonOutputOptions->Connect( wxEVT_MENU,
225 wxCommandEventHandler( PANEL_JOB_OUTPUT::onMenu ), nullptr, this );
226
227 if( jobTypeInfos.contains( aOutput->m_type ) )
228 {
229 JOB_TYPE_INFO& jobTypeInfo = jobTypeInfos[aOutput->m_type];
230 m_textOutputType->SetLabel( wxGetTranslation( jobTypeInfo.name ) );
231 m_bitmapOutputType->SetBitmap( KiBitmapBundle( jobTypeInfo.bitmap ) );
232 }
233 }
234
235
237 {
238 m_buttonOutputOptions->Disconnect(
239 wxEVT_MENU, wxCommandEventHandler( PANEL_JOB_OUTPUT::onMenu ), nullptr, this );
240 }
241
242
243 virtual void OnOutputRunClick( wxCommandEvent& event ) override
244 {
245 CallAfter(
246 [this]()
247 {
250
251 wxFileName fn = project.GetProjectFullName();
252 wxSetWorkingDirectory( fn.GetPath() );
253
254 JOBS_RUNNER jobRunner( &( m_frame->Kiway() ), m_jobsFile );
255
256 WX_PROGRESS_REPORTER* progressReporter =
257 new WX_PROGRESS_REPORTER( m_frame, _( "Running jobs" ), 1 );
258
259 jobRunner.RunJobsForOutput( m_output );
260
261 delete progressReporter;
262 } );
263 }
264
265 virtual void OnOutputOptionsClick( wxCommandEvent& event ) override
266 {
267 wxMenu menu;
268 menu.Append( wxID_EDIT, _( "Edit..." ) );
269 menu.Append( wxID_DELETE, _( "Delete" ) );
270
271 m_buttonOutputOptions->PopupMenu( &menu );
272 }
273
274
275private:
276 void onMenu( wxCommandEvent& aEvent )
277 {
278 switch( aEvent.GetId() )
279 {
280 case wxID_EDIT:
281 {
283
284 dialog.ShowModal();
285 }
286 break;
287
288 case wxID_DELETE:
290 break;
291
292 default:
293 wxFAIL_MSG( wxT( "Unknown ID in context menu event" ) );
294 }
295 }
296
301};
302
303
304PANEL_JOBS::PANEL_JOBS( wxAuiNotebook* aParent, KICAD_MANAGER_FRAME* aFrame,
305 std::unique_ptr<JOBSET> aJobsFile ) :
306 PANEL_JOBS_BASE( aParent ),
307 m_parentBook( aParent ),
308 m_frame( aFrame ),
309 m_jobsFile( std::move( aJobsFile ) )
310{
311 int jobNoColId = m_jobList->AppendColumn( _( "No." ) );
312 int jobDescColId = m_jobList->AppendColumn( _( "Job Description" ) );
313 m_jobList->SetColumnWidth( jobNoColId, wxLIST_AUTOSIZE_USEHEADER );
314 m_jobList->SetColumnWidth( jobDescColId, wxLIST_AUTOSIZE_USEHEADER );
315
316 m_buttonAddJob->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
317 m_buttonUp->SetBitmap( KiBitmapBundle( BITMAPS::small_up ) );
318 m_buttonDown->SetBitmap( KiBitmapBundle( BITMAPS::small_down ) );
319 m_buttonOutputAdd->SetBitmap( KiBitmapBundle( BITMAPS::small_plus ) );
320
321 m_jobList->Connect( wxEVT_MENU, wxCommandEventHandler( PANEL_JOBS::onJobListMenu ),
322 nullptr, this );
323
326
327 m_buttonRunAllOutputs->Enable( !m_jobsFile->GetOutputs().empty() );
328}
329
330
332{
333 m_jobList->Disconnect( wxEVT_MENU, wxCommandEventHandler( PANEL_JOBS::onJobListMenu ),
334 nullptr, this );
335}
336
337
339{
340 auto it = m_outputPanelMap.find( aOutput );
341 if( it != m_outputPanelMap.end() )
342 {
343 PANEL_JOB_OUTPUT* panel = m_outputPanelMap[aOutput];
344 m_outputListSizer->Detach( panel );
345 panel->Destroy();
346
347 m_outputPanelMap.erase( it );
348
349 // ensure the window contents get shifted as needed
350 m_outputList->Layout();
351 Layout();
352 }
353
354 m_jobsFile->RemoveOutput( aOutput );
355
356 m_buttonRunAllOutputs->Enable( !m_jobsFile->GetOutputs().empty() );
357}
358
359
361{
362 m_jobList->DeleteAllItems();
363
364 int num = 1;
365 for( auto& job : m_jobsFile->GetJobs() )
366 {
367 long itemIndex =
368 m_jobList->InsertItem( m_jobList->GetItemCount(), wxString::Format( "%d", num++ ) );
369 m_jobList->SetItem( itemIndex, 1, job.m_job->GetDescription() );
370 }
371
372 updateTitle();
373}
374
375
377{
378 wxString tabName = m_jobsFile->GetFullName();
379 if( m_jobsFile->GetDirty() )
380 {
381 tabName = wxS( "*" ) + tabName;
382 }
383 int pageIdx = m_parentBook->FindPage( this );
384 m_parentBook->SetPageText( pageIdx, tabName );
385}
386
387
389{
390 PANEL_JOB_OUTPUT* outputPanel =
391 new PANEL_JOB_OUTPUT( m_outputList, this, m_frame, m_jobsFile.get(), aOutput );
392 m_outputListSizer->Add( outputPanel, 0, wxEXPAND | wxALL, 5 );
393
394 m_outputPanelMap[aOutput] = outputPanel;
395
396 m_outputList->Layout();
397}
398
399
401{
402 Freeze();
403 m_outputPanelMap.clear();
404
405 for( auto& job : m_jobsFile->GetOutputs() )
406 {
407 addJobOutputPanel( &job );
408 }
409
410 // ensure the window contents get shifted as needed
411 Layout();
412 Thaw();
413}
414
415
417{
418 JOBSET_JOB& job = m_jobsFile->GetJobs()[aItemIndex];
419
421
422 if( iface < KIWAY::KIWAY_FACE_COUNT )
423 {
425
426 m_frame->Kiway().ProcessJobConfigDialog( iface, job.m_job.get(), m_frame );
427 }
428 else
429 {
430 // special jobs
431 if( job.m_job->GetType() == "special_execute" )
432 {
433 JOB_SPECIAL_EXECUTE* specialJob = static_cast<JOB_SPECIAL_EXECUTE*>( job.m_job.get() );
434
435 DIALOG_SPECIAL_EXECUTE dialog( m_frame, specialJob );
436 dialog.ShowModal();
437 }
438 }
439}
440
441
442void PANEL_JOBS::OnJobListDoubleClicked( wxListEvent& aEvent )
443{
444 long item = aEvent.GetIndex();
445
447}
448
449
450void PANEL_JOBS::OnJobListItemRightClick( wxListEvent& event )
451{
452 wxMenu menu;
453 menu.Append( wxID_EDIT, _( "Edit..." ) );
454 menu.Append( wxID_DELETE, _( "Delete" ) );
455
456 m_jobList->PopupMenu( &menu, event.GetPoint() );
457}
458
459
460void PANEL_JOBS::onJobListMenu( wxCommandEvent& aEvent )
461{
462 switch( aEvent.GetId() )
463 {
464 case wxID_EDIT:
465 {
466 long item = m_jobList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
467
468 if( item == -1 )
469 return;
470
472 }
473 break;
474
475 case wxID_DELETE:
476 {
477 long item = m_jobList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
478
479 if( item == -1 )
480 return;
481
482 m_jobsFile->RemoveJob( item );
484 break;
485 }
486
487 default: wxFAIL_MSG( wxT( "Unknown ID in context menu event" ) );
488 }
489}
490
491
492void PANEL_JOBS::OnSaveButtonClick( wxCommandEvent& aEvent )
493{
494 m_jobsFile->SaveToFile();
495 updateTitle();
496}
497
498
499void PANEL_JOBS::OnAddJobClick( wxCommandEvent& aEvent )
500{
501 wxArrayString headers;
502 std::vector<wxArrayString> items;
503
504 headers.Add( _( "Job Types" ) );
505
507
508 for( const std::pair<const wxString, JOB_REGISTRY_ENTRY>& entry : jobMap )
509 {
510 wxArrayString item;
511 item.Add( wxGetTranslation( entry.second.title ) );
512 items.emplace_back( item );
513 }
514
515 EDA_LIST_DIALOG dlg( this, _( "Add New Job" ), headers, items );
516 dlg.SetListLabel( _( "Select job type:" ) );
517
518 if( dlg.ShowModal() == wxID_OK )
519 {
520 wxString selectedString = dlg.GetTextSelection();
521
522 wxString jobKey;
523 if( !selectedString.IsEmpty() )
524 {
525 for( const std::pair<const wxString, JOB_REGISTRY_ENTRY>& entry : jobMap )
526 {
527 if( wxGetTranslation( entry.second.title ) == selectedString )
528 {
529 jobKey = entry.first;
530 break;
531 }
532 }
533 }
534
535 if( !jobKey.IsEmpty() )
536 {
537 JOB* job = JOB_REGISTRY::CreateInstance<JOB>( jobKey );
538 m_jobsFile->AddNewJob( jobKey, job );
539
541 }
542 }
543}
544
545
546void PANEL_JOBS::OnAddOutputClick( wxCommandEvent& aEvent )
547{
548 wxArrayString headers;
549 std::vector<wxArrayString> items;
550
551 headers.Add( _( "Job Types" ) );
552
553 for( const std::pair<const JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO>& jobType : jobTypeInfos )
554 {
555 wxArrayString item;
556 item.Add( wxGetTranslation( jobType.second.name ) );
557 items.emplace_back( item );
558 }
559
560 EDA_LIST_DIALOG dlg( this, _( "Add New Output" ), headers, items );
561 dlg.SetListLabel( _( "Select output type:" ) );
562 dlg.HideFilter();
563
564 if( dlg.ShowModal() == wxID_OK )
565 {
566 wxString selectedString = dlg.GetTextSelection();
567
568 for( const std::pair<const JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO>& jobType : jobTypeInfos )
569 {
570 if( wxGetTranslation( jobType.second.name ) == selectedString )
571 {
572 JOBSET_OUTPUT output = m_jobsFile->AddNewJobOutput( jobType.first, nullptr );
573
574 Freeze();
575 addJobOutputPanel( &output );
576 m_buttonRunAllOutputs->Enable( !m_jobsFile->GetOutputs().empty() );
577 Thaw();
578 }
579 }
580 }
581}
582
583
585{
586 if( m_jobsFile->GetDirty() )
587 {
588 wxFileName fileName = m_jobsFile->GetFullFilename();
589 wxString msg = _( "Save changes to '%s' before closing?" );
590
591 if( !HandleUnsavedChanges( this, wxString::Format( msg, fileName.GetFullName() ),
592 [&]() -> bool
593 {
594 return m_jobsFile->SaveToFile();
595 } ) )
596 {
597 return false;
598 }
599 }
600
601 return true;
602}
603
604
606{
608 KIWAY_PLAYER* frame = m_frame->Kiway().Player( FRAME_PCB_EDITOR, false );
609
610 if( !frame )
611 {
612 frame = m_frame->Kiway().Player( FRAME_PCB_EDITOR, true );
613
614 // frame can be null if Cvpcb cannot be run. No need to show a warning
615 // Kiway() generates the error messages
616 if( !frame )
617 return;
618
619 wxFileName boardfn = project.GetProjectFullName();
620 boardfn.SetExt( FILEEXT::PcbFileExtension );
621
622 frame->OpenProjectFiles( std::vector<wxString>( 1, boardfn.GetFullPath() ) );
623 }
624
625 frame = m_frame->Kiway().Player( FRAME_SCH, false );
626
627 if( !frame )
628 {
629 frame = m_frame->Kiway().Player( FRAME_SCH, true );
630
631 // frame can be null if Cvpcb cannot be run. No need to show a warning
632 // Kiway() generates the error messages
633 if( !frame )
634 return;
635
636 wxFileName schFn = project.GetProjectFullName();
638
639 frame->OpenProjectFiles( std::vector<wxString>( 1, schFn.GetFullPath() ) );
640 }
641}
642
643
644void PANEL_JOBS::OnJobButtonUp( wxCommandEvent& aEvent )
645{
646 long item = m_jobList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
647
648 if( item == -1 )
649 return;
650
651 if( item == 0 )
652 return;
653
654 m_jobsFile->MoveJobUp( item );
655
657
658 m_jobList->SetItemState( item - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
659}
660
661
662void PANEL_JOBS::OnJobButtonDown( wxCommandEvent& aEvent )
663{
664 long item = m_jobList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
665
666 if( item == -1 )
667 return;
668
669 if( item == m_jobList->GetItemCount() - 1 )
670 return;
671
672 m_jobsFile->MoveJobDown( item );
673
675
676 m_jobList->SetItemState( item + 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
677}
678
679void PANEL_JOBS::OnRunAllJobsClick( wxCommandEvent& event )
680{
681 // sanity
682 if( m_jobsFile->GetOutputs().empty() )
683 {
684 DisplayError( this, _( "No outputs defined" ) );
685 return;
686 }
687
688 CallAfter(
689 [this]()
690 {
693
694 wxFileName fn = project.GetProjectFullName();
695 wxSetWorkingDirectory( fn.GetPath() );
696
697 JOBS_RUNNER jobRunner( &( m_frame->Kiway() ), m_jobsFile.get() );
698
699 WX_PROGRESS_REPORTER* progressReporter =
700 new WX_PROGRESS_REPORTER( m_frame, _( "Running jobs" ), 1 );
701
702 jobRunner.RunJobsAllOutputs();
703
704 delete progressReporter;
705 } );
706}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Definition: bitmap.cpp:110
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
@ small_folder
Class DIALOG_JOB_OUTPUT_BASE.
wxStaticText * m_textArchiveFormat
STD_BITMAP_BUTTON * m_buttonOutputPath
wxChoice * m_choiceArchiveformat
wxTextCtrl * m_textCtrlOutputPath
bool TransferDataFromWindow() override
Definition: panel_jobs.cpp:130
JOBSET_OUTPUT * m_output
Definition: panel_jobs.cpp:205
DIALOG_JOB_OUTPUT(wxWindow *aParent, JOBSET *aJobsFile, JOBSET_OUTPUT *aOutput)
Definition: panel_jobs.cpp:69
bool TransferDataToWindow() override
Definition: panel_jobs.cpp:160
std::map< int, wxString > m_onlyMap
Definition: panel_jobs.cpp:206
virtual void onOutputPathBrowseClicked(wxCommandEvent &event) override
Definition: panel_jobs.cpp:89
int ShowModal() override
A dialog which shows:
wxString GetTextSelection(int aColumn=0)
Return the selected text from aColumn in the wxListCtrl in the dialog.
void SetListLabel(const wxString &aLabel)
Definition: jobset.h:70
std::vector< JOBSET_JOB > & GetJobs()
Definition: jobset.h:76
void SetFormat(FORMAT format)
void SetOutputPath(const wxString &aPath)
Definition: jobs_output.h:43
bool RunJobsForOutput(JOBSET_OUTPUT *aOutput, bool aBail=false)
Definition: jobs_runner.cpp:91
bool RunJobsAllOutputs(bool aBail=false)
Definition: jobs_runner.cpp:46
static const REGISTRY_MAP_T & GetRegistry()
Definition: job_registry.h:55
std::unordered_map< wxString, JOB_REGISTRY_ENTRY > REGISTRY_MAP_T
Definition: job_registry.h:37
static KIWAY::FACE_T GetKifaceType(const wxString &aName)
An simple container class that lets us dispatch output jobs to kifaces.
Definition: job.h:79
The main KiCad project manager frame.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:55
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:65
virtual bool OpenProjectFiles(const std::vector< wxString > &aFileList, int aCtl=0)
Open a project or set of files given by aFileList.
Definition: kiway_player.h:113
bool ProcessJobConfigDialog(KIWAY::FACE_T aFace, JOB *aJob, wxWindow *aWindow)
Definition: kiway.cpp:717
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:406
FACE_T
Known KIFACE implementations.
Definition: kiway.h:290
@ KIWAY_FACE_COUNT
Definition: kiway.h:300
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition: kiway.cpp:196
Class PANEL_JOBS_BASE.
wxBitmapButton * m_buttonUp
wxBitmapButton * m_buttonAddJob
wxButton * m_buttonRunAllOutputs
wxBoxSizer * m_outputListSizer
wxBitmapButton * m_buttonOutputAdd
wxListCtrl * m_jobList
wxScrolledWindow * m_outputList
wxBitmapButton * m_buttonDown
virtual void OnAddOutputClick(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:546
virtual void OnJobListItemRightClick(wxListEvent &event) override
Definition: panel_jobs.cpp:450
std::unique_ptr< JOBSET > m_jobsFile
Definition: panel_jobs.h:66
void openJobOptionsForListItem(size_t aItemIndex)
Definition: panel_jobs.cpp:416
std::unordered_map< JOBSET_OUTPUT *, PANEL_JOB_OUTPUT * > m_outputPanelMap
Definition: panel_jobs.h:68
wxAuiNotebook * m_parentBook
Definition: panel_jobs.h:64
PANEL_JOBS(wxAuiNotebook *aParent, KICAD_MANAGER_FRAME *aFrame, std::unique_ptr< JOBSET > aJobsFile)
Definition: panel_jobs.cpp:304
virtual void OnAddJobClick(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:499
void rebuildJobList()
Definition: panel_jobs.cpp:360
void RemoveOutput(JOBSET_OUTPUT *aOutput)
Definition: panel_jobs.cpp:338
void addJobOutputPanel(JOBSET_OUTPUT *aOutput)
Definition: panel_jobs.cpp:388
void updateTitle()
Definition: panel_jobs.cpp:376
void onJobListMenu(wxCommandEvent &aEvent)
Definition: panel_jobs.cpp:460
virtual void OnJobButtonUp(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:644
void buildOutputList()
Definition: panel_jobs.cpp:400
virtual void OnJobButtonDown(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:662
virtual void OnRunAllJobsClick(wxCommandEvent &event) override
Definition: panel_jobs.cpp:679
bool GetCanClose() override
Definition: panel_jobs.cpp:584
void EnsurePcbSchFramesOpen()
Definition: panel_jobs.cpp:605
virtual void OnSaveButtonClick(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:492
KICAD_MANAGER_FRAME * m_frame
Definition: panel_jobs.h:65
virtual void OnJobListDoubleClicked(wxListEvent &aEvent) override
Definition: panel_jobs.cpp:442
Class PANEL_JOB_OUTPUT_BASE.
wxBitmapButton * m_buttonOutputRun
wxStaticBitmap * m_bitmapOutputType
wxBitmapButton * m_buttonOutputOptions
wxStaticText * m_textOutputType
JOBSET_OUTPUT * m_output
Definition: panel_jobs.cpp:298
virtual void OnOutputRunClick(wxCommandEvent &event) override
Definition: panel_jobs.cpp:243
KICAD_MANAGER_FRAME * m_frame
Definition: panel_jobs.cpp:299
void onMenu(wxCommandEvent &aEvent)
Definition: panel_jobs.cpp:276
PANEL_JOBS * m_panelParent
Definition: panel_jobs.cpp:300
JOBSET * m_jobsFile
Definition: panel_jobs.cpp:297
virtual void OnOutputOptionsClick(wxCommandEvent &event) override
Definition: panel_jobs.cpp:265
PANEL_JOB_OUTPUT(wxWindow *aParent, PANEL_JOBS *aPanelParent, KICAD_MANAGER_FRAME *aFrame, JOBSET *aFile, JOBSET_OUTPUT *aOutput)
Definition: panel_jobs.cpp:213
Container for project specific data.
Definition: project.h:64
void SetBitmap(const wxBitmapBundle &aBmp)
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:170
bool HandleUnsavedChanges(wxWindow *aParent, const wxString &aMessage, const std::function< bool()> &aSaveFunction)
Display a dialog with Save, Cancel and Discard Changes buttons.
Definition: confirm.cpp:130
This file is part of the common library.
#define _HKI(x)
#define _(s)
@ FRAME_PCB_EDITOR
Definition: frame_type.h:42
@ FRAME_SCH
Definition: frame_type.h:34
static const std::string KiCadSchematicFileExtension
static wxString ZipFileWildcard()
Some functions to handle hotkeys in KiCad.
PROJECT & Prj()
Definition: kicad.cpp:595
STL namespace.
static std::map< JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO > jobTypeInfos
Definition: panel_jobs.cpp:58
std::shared_ptr< JOB > m_job
Definition: jobset.h:39
wxString m_type
Definition: jobset.h:38
std::vector< wxString > m_only
Definition: jobset.h:64
JOBS_OUTPUT_HANDLER * m_outputHandler
Definition: jobset.h:63
JOBSET_OUTPUT_TYPE m_type
Definition: jobset.h:62
wxString name
Definition: panel_jobs.cpp:51
bool outputPathIsFolder
Definition: panel_jobs.cpp:53
wxString fileWildcard
Definition: panel_jobs.cpp:54
BITMAPS bitmap
Definition: panel_jobs.cpp:52
Definition of file extensions used in Kicad.
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().
Definition: wx_filename.h:39