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
328
330{
331 m_jobList->Disconnect( wxEVT_MENU, wxCommandEventHandler( PANEL_JOBS::onJobListMenu ),
332 nullptr, this );
333}
334
335
337{
338 auto it = m_outputPanelMap.find( aOutput );
339 if( it != m_outputPanelMap.end() )
340 {
341 PANEL_JOB_OUTPUT* panel = m_outputPanelMap[aOutput];
342 m_outputListSizer->Detach( panel );
343 panel->Destroy();
344
345 m_outputPanelMap.erase( it );
346
347 // ensure the window contents get shifted as needed
348 m_outputList->Layout();
349 Layout();
350 }
351
352 m_jobsFile->RemoveOutput( aOutput );
353}
354
355
357{
358 m_jobList->DeleteAllItems();
359
360 int num = 1;
361 for( auto& job : m_jobsFile->GetJobs() )
362 {
363 long itemIndex =
364 m_jobList->InsertItem( m_jobList->GetItemCount(), wxString::Format( "%d", num++ ) );
365 m_jobList->SetItem( itemIndex, 1, job.m_job->GetDescription() );
366 }
367
368 updateTitle();
369}
370
371
373{
374 wxString tabName = m_jobsFile->GetFullName();
375 if( m_jobsFile->GetDirty() )
376 {
377 tabName = wxS( "*" ) + tabName;
378 }
379 int pageIdx = m_parentBook->FindPage( this );
380 m_parentBook->SetPageText( pageIdx, tabName );
381}
382
383
385{
386 PANEL_JOB_OUTPUT* outputPanel =
387 new PANEL_JOB_OUTPUT( m_outputList, this, m_frame, m_jobsFile.get(), aOutput );
388 m_outputListSizer->Add( outputPanel, 0, wxEXPAND | wxALL, 5 );
389
390 m_outputPanelMap[aOutput] = outputPanel;
391
392 m_outputList->Layout();
393}
394
395
397{
398 Freeze();
399 m_outputPanelMap.clear();
400
401 for( auto& job : m_jobsFile->GetOutputs() )
402 {
403 addJobOutputPanel( &job );
404 }
405
406 // ensure the window contents get shifted as needed
407 Layout();
408 Thaw();
409}
410
411
413{
414 JOBSET_JOB& job = m_jobsFile->GetJobs()[aItemIndex];
415
417
418 if( iface < KIWAY::KIWAY_FACE_COUNT )
419 {
421
423 }
424 else
425 {
426 // special jobs
427 if( job.m_job->GetType() == "special_execute" )
428 {
429 JOB_SPECIAL_EXECUTE* specialJob = static_cast<JOB_SPECIAL_EXECUTE*>( job.m_job );
430
431 DIALOG_SPECIAL_EXECUTE dialog( m_frame, specialJob );
432 dialog.ShowModal();
433 }
434 }
435}
436
437
438void PANEL_JOBS::OnJobListDoubleClicked( wxListEvent& aEvent )
439{
440 long item = aEvent.GetIndex();
441
443}
444
445
446void PANEL_JOBS::OnJobListItemRightClick( wxListEvent& event )
447{
448 wxMenu menu;
449 menu.Append( wxID_EDIT, _( "Edit..." ) );
450 menu.Append( wxID_DELETE, _( "Delete" ) );
451
452 m_jobList->PopupMenu( &menu, event.GetPoint() );
453}
454
455
456void PANEL_JOBS::onJobListMenu( wxCommandEvent& aEvent )
457{
458 switch( aEvent.GetId() )
459 {
460 case wxID_EDIT:
461 {
462 long item = m_jobList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
463
464 if( item == -1 )
465 return;
466
468 }
469 break;
470
471 case wxID_DELETE:
472 {
473 long item = m_jobList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
474
475 if( item == -1 )
476 return;
477
478 m_jobsFile->RemoveJob( item );
480 break;
481 }
482
483 default: wxFAIL_MSG( wxT( "Unknown ID in context menu event" ) );
484 }
485}
486
487
488void PANEL_JOBS::OnSaveButtonClick( wxCommandEvent& aEvent )
489{
490 m_jobsFile->SaveToFile();
491 updateTitle();
492}
493
494
495void PANEL_JOBS::OnAddJobClick( wxCommandEvent& aEvent )
496{
497 wxArrayString headers;
498 std::vector<wxArrayString> items;
499
500 headers.Add( _( "Job Types" ) );
501
503
504 for( const std::pair<const wxString, JOB_REGISTRY_ENTRY>& entry : jobMap )
505 {
506 wxArrayString item;
507 item.Add( wxGetTranslation( entry.second.title ) );
508 items.emplace_back( item );
509 }
510
511 EDA_LIST_DIALOG dlg( this, _( "Add New Job" ), headers, items );
512 dlg.SetListLabel( _( "Select job type:" ) );
513
514 if( dlg.ShowModal() == wxID_OK )
515 {
516 wxString selectedString = dlg.GetTextSelection();
517
518 wxString jobKey;
519 if( !selectedString.IsEmpty() )
520 {
521 for( const std::pair<const wxString, JOB_REGISTRY_ENTRY>& entry : jobMap )
522 {
523 if( wxGetTranslation( entry.second.title ) == selectedString )
524 {
525 jobKey = entry.first;
526 break;
527 }
528 }
529 }
530
531 if( !jobKey.IsEmpty() )
532 {
533 JOB* job = JOB_REGISTRY::CreateInstance<JOB>( jobKey );
534 m_jobsFile->AddNewJob( jobKey, job );
535
537 }
538 }
539}
540
541
542void PANEL_JOBS::OnAddOutputClick( wxCommandEvent& aEvent )
543{
544 wxArrayString headers;
545 std::vector<wxArrayString> items;
546
547 headers.Add( _( "Job Types" ) );
548
549 for( const std::pair<const JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO>& jobType : jobTypeInfos )
550 {
551 wxArrayString item;
552 item.Add( wxGetTranslation( jobType.second.name ) );
553 items.emplace_back( item );
554 }
555
556 EDA_LIST_DIALOG dlg( this, _( "Add New Output" ), headers, items );
557 dlg.SetListLabel( _( "Select output type:" ) );
558 dlg.HideFilter();
559
560 if( dlg.ShowModal() == wxID_OK )
561 {
562 wxString selectedString = dlg.GetTextSelection();
563
564 for( const std::pair<const JOBSET_OUTPUT_TYPE, JOB_TYPE_INFO>& jobType : jobTypeInfos )
565 {
566 if( wxGetTranslation( jobType.second.name ) == selectedString )
567 {
568 JOBSET_OUTPUT output = m_jobsFile->AddNewJobOutput( jobType.first, nullptr );
569
570 Freeze();
571 addJobOutputPanel( &output );
572 Thaw();
573 }
574 }
575 }
576}
577
578
580{
581 if( m_jobsFile->GetDirty() )
582 {
583 wxFileName fileName = m_jobsFile->GetFullFilename();
584 wxString msg = _( "Save changes to '%s' before closing?" );
585
586 if( !HandleUnsavedChanges( this, wxString::Format( msg, fileName.GetFullName() ),
587 [&]() -> bool
588 {
589 return m_jobsFile->SaveToFile();
590 } ) )
591 {
592 return false;
593 }
594 }
595
596 return true;
597}
598
599
601{
603 KIWAY_PLAYER* frame = m_frame->Kiway().Player( FRAME_PCB_EDITOR, false );
604
605 if( !frame )
606 {
607 frame = m_frame->Kiway().Player( FRAME_PCB_EDITOR, true );
608
609 // frame can be null if Cvpcb cannot be run. No need to show a warning
610 // Kiway() generates the error messages
611 if( !frame )
612 return;
613
614 wxFileName boardfn = project.GetProjectFullName();
615 boardfn.SetExt( FILEEXT::PcbFileExtension );
616
617 frame->OpenProjectFiles( std::vector<wxString>( 1, boardfn.GetFullPath() ) );
618 }
619
620 frame = m_frame->Kiway().Player( FRAME_SCH, false );
621
622 if( !frame )
623 {
624 frame = m_frame->Kiway().Player( FRAME_SCH, true );
625
626 // frame can be null if Cvpcb cannot be run. No need to show a warning
627 // Kiway() generates the error messages
628 if( !frame )
629 return;
630
631 wxFileName schFn = project.GetProjectFullName();
633
634 frame->OpenProjectFiles( std::vector<wxString>( 1, schFn.GetFullPath() ) );
635 }
636}
637
638
639void PANEL_JOBS::OnJobButtonUp( wxCommandEvent& aEvent )
640{
641 long item = m_jobList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
642
643 if( item == -1 )
644 return;
645
646 if( item == 0 )
647 return;
648
649 m_jobsFile->MoveJobUp( item );
650
652
653 m_jobList->SetItemState( item - 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
654}
655
656
657void PANEL_JOBS::OnJobButtonDown( wxCommandEvent& aEvent )
658{
659 long item = m_jobList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
660
661 if( item == -1 )
662 return;
663
664 if( item == m_jobList->GetItemCount() - 1 )
665 return;
666
667 m_jobsFile->MoveJobDown( item );
668
670
671 m_jobList->SetItemState( item + 1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
672}
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
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:69
std::vector< JOBSET_JOB > & GetJobs()
Definition: jobset.h:75
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
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
const std::string & GetType() const
Definition: job.h:85
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
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:542
virtual void OnJobListItemRightClick(wxListEvent &event) override
Definition: panel_jobs.cpp:446
std::unique_ptr< JOBSET > m_jobsFile
Definition: panel_jobs.h:65
void openJobOptionsForListItem(size_t aItemIndex)
Definition: panel_jobs.cpp:412
std::unordered_map< JOBSET_OUTPUT *, PANEL_JOB_OUTPUT * > m_outputPanelMap
Definition: panel_jobs.h:67
wxAuiNotebook * m_parentBook
Definition: panel_jobs.h:63
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:495
void rebuildJobList()
Definition: panel_jobs.cpp:356
void RemoveOutput(JOBSET_OUTPUT *aOutput)
Definition: panel_jobs.cpp:336
void addJobOutputPanel(JOBSET_OUTPUT *aOutput)
Definition: panel_jobs.cpp:384
void updateTitle()
Definition: panel_jobs.cpp:372
void onJobListMenu(wxCommandEvent &aEvent)
Definition: panel_jobs.cpp:456
virtual void OnJobButtonUp(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:639
void buildOutputList()
Definition: panel_jobs.cpp:396
virtual void OnJobButtonDown(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:657
bool GetCanClose() override
Definition: panel_jobs.cpp:579
void EnsurePcbSchFramesOpen()
Definition: panel_jobs.cpp:600
virtual void OnSaveButtonClick(wxCommandEvent &aEvent) override
Definition: panel_jobs.cpp:488
KICAD_MANAGER_FRAME * m_frame
Definition: panel_jobs.h:64
virtual void OnJobListDoubleClicked(wxListEvent &aEvent) override
Definition: panel_jobs.cpp:438
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...
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
JOB * m_job
Definition: jobset.h:38
wxString m_type
Definition: jobset.h:37
std::vector< wxString > m_only
Definition: jobset.h:63
JOBS_OUTPUT_HANDLER * m_outputHandler
Definition: jobset.h:62
JOBSET_OUTPUT_TYPE m_type
Definition: jobset.h:61
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