KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kicad_manager_frame.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) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2013 CERN (www.cern.ch)
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#include "kicad_id.h"
23#include "pcm.h"
24#include "pgm_kicad.h"
25#include "project_tree.h"
26#include "project_tree_pane.h"
29#include "local_history_pane.h"
31
32#include <advanced_config.h>
34#include <bitmaps.h>
35#include <build_version.h>
36#include <confirm.h>
40#include <local_history.h>
42#include <wx/msgdlg.h>
43#include <eda_base_frame.h>
44#include <executable_names.h>
45#include <file_history.h>
46#include <local_history.h>
47#include <policy_keys.h>
48#include <gestfich.h>
49#include <kiplatform/app.h>
51#include <kiplatform/ui.h>
52#include <kiplatform/policy.h>
53#include <build_version.h>
54#include <kiway.h>
55#include <kiway_mail.h>
56#include <launch_ext.h>
57#include <lockfile.h>
59#include <reporter.h>
61#include <sch_file_versions.h>
64#include <tool/action_manager.h>
65#include <tool/action_toolbar.h>
66#include <tool/common_control.h>
68#include <tool/tool_manager.h>
74#include <widgets/kistatusbar.h>
75#include <widgets/ui_common.h>
76#include <wx/ffile.h>
77#include <wx/filedlg.h>
78#include <wx/dnd.h>
79#include <wx/process.h>
80#include <algorithm>
81#include <atomic>
82#include <update_manager.h>
83#include <jobs/jobset.h>
85
86#include <../pcbnew/pcb_io/kicad_sexpr/pcb_io_kicad_sexpr.h> // for SEXPR_BOARD_FILE_VERSION def
87
88
89#ifdef __WXMAC__
90#include <MacTypes.h>
91#include <ApplicationServices/ApplicationServices.h>
92#endif
93
94#include "kicad_manager_frame.h"
96
98
99
100#define EDITORS_CAPTION _( "Editors" )
101#define PROJECT_FILES_CAPTION _( "Project Files" )
102
103#define ID_INIT_WATCHED_PATHS 52913
104
105#define SEP() wxFileName::GetPathSeparator()
106
107
108// Menubar and toolbar event table
109BEGIN_EVENT_TABLE( KICAD_MANAGER_FRAME, EDA_BASE_FRAME )
110 // Window events
113
114 // Menu events
131 KICAD_MANAGER_FRAME::OnCompareProjectBranches )
132
133 // Range menu events
135 EVT_MENU( ID_FILE_LIST_CLEAR, KICAD_MANAGER_FRAME::OnClearFileHistory )
136
137 // Special functions
138 EVT_MENU( ID_INIT_WATCHED_PATHS, KICAD_MANAGER_FRAME::OnChangeWatchedPaths )
139
140 // Drop files event
141 EVT_DROP_FILES( KICAD_MANAGER_FRAME::OnDropFiles )
142
143END_EVENT_TABLE()
144
145// See below the purpose of this include
146#include <wx/xml/xml.h>
147
148KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title, const wxPoint& pos,
149 const wxSize& size ) :
152 m_openSavedWindows( false ),
153 m_restoredFromHistory( false ),
154 m_active_project( false ),
155 m_showHistoryPanel( false ),
156 m_showGitCommitPanel( true ),
157 m_projectTreePane( nullptr ),
158 m_historyPane( nullptr ),
159 m_gitCommitPane( nullptr ),
160 m_launcher( nullptr ),
161 m_lastToolbarIconSize( 0 ),
162 m_pcmButton( nullptr ),
163 m_pcmUpdateCount( 0 )
164{
165 const int defaultLeftWinWidth = FromDIP( 250 );
166
167 m_leftWinWidth = defaultLeftWinWidth; // Default value
168 m_aboutTitle = "KiCad";
169
170 // JPC: A very ugly hack to fix an issue on Linux: if the wxbase315u_xml_gcc_custom.so is
171 // used **only** in PCM, it is not found in some cases at run time.
172 // So just use it in the main module to avoid a not found issue
173 // wxbase315u_xml_gcc_custom shared object when launching Kicad
174 wxXmlDocument dummy;
175
176 // Create the status line (bottom of the frame). Left half is for project name; right half
177 // is for Reporter (currently used by archiver/unarchiver and PCM).
178 // Note: this is a KISTATUSBAR status bar. Therefore the specified number of fields
179 // is the extra number of fields, not the full field count.
180 // We need here 2 fields: the extra fiels to display the project name, and another field
181 // to display a info (specific to Windows) using the FIELD_OFFSET_BGJOB_TEXT id offset (=1)
182 // So the extra field count is 1
183 CreateStatusBar( 2 );
186 Pgm().RegisterLibraryLoadStatusBar( (KISTATUSBAR*) GetStatusBar() );
187 GetStatusBar()->SetFont( KIUI::GetStatusFont( this ) );
188
189 // Give an icon
190 wxIcon icon;
191 wxIconBundle icon_bundle;
192
193 if( IsNightlyVersion())
194 {
195 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad_nightly, 48 ) );
196 icon_bundle.AddIcon( icon );
197 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad_nightly, 128 ) );
198 icon_bundle.AddIcon( icon );
199 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad_nightly, 256 ) );
200 icon_bundle.AddIcon( icon );
201 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad_nightly_32 ) );
202 icon_bundle.AddIcon( icon );
203 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad_nightly_16 ) );
204 icon_bundle.AddIcon( icon );
205 }
206 else
207 {
208 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad, 48 ) );
209 icon_bundle.AddIcon( icon );
210 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad, 128 ) );
211 icon_bundle.AddIcon( icon );
212 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad, 256 ) );
213 icon_bundle.AddIcon( icon );
214 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad_32 ) );
215 icon_bundle.AddIcon( icon );
216 icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_kicad_16 ) );
217 icon_bundle.AddIcon( icon );
218 }
219
220 SetIcons( icon_bundle );
221
222 // Load the settings
223 LoadSettings( config() );
224
225 // Left window: is the box which display tree project
226 m_projectTreePane = new PROJECT_TREE_PANE( this );
227
228 setupTools();
229 setupUIConditions();
230
231 m_toolbarSettings = GetToolbarSettings<KICAD_MANAGER_TOOLBAR_SETTINGS>( "kicad-toolbars" );
232 configureToolbars();
233 RecreateToolbars();
234 ReCreateMenuBar();
235
236 m_auimgr.SetManagedWindow( this );
237 m_auimgr.SetFlags( wxAUI_MGR_LIVE_RESIZE );
238
239 m_auimgr.AddPane( m_tbLeft, EDA_PANE().VToolbar().Name( "TopMainToolbar" ).Left().Layer( 2 ) );
240
241 // There is no wxAUIPaneInfo::SetSize(), but a trick is to use MinSize() to set the required pane width,
242 // and after give a reasonable MinSize value.
243 m_auimgr.AddPane( m_projectTreePane,
244 EDA_PANE().Palette().Name( "ProjectTree" ).Left().Layer( 1 )
245 .Caption( PROJECT_FILES_CAPTION ).PaneBorder( false )
246 .MinSize( m_leftWinWidth, -1 ).Floatable( false ).Movable( false ) );
247
248 m_historyPane = new LOCAL_HISTORY_PANE( this );
249 m_auimgr.AddPane( m_historyPane,
250 EDA_PANE().Palette().Name( "LocalHistory" ).Left().Layer( 1 ).Position( 1 )
251 .Caption( _( "Local History" ) ).PaneBorder( false )
252 .Floatable( false ).Movable( false ).CloseButton( true ).Hide() );
253
254 if( m_showHistoryPanel )
255 m_auimgr.GetPane( m_historyPane ).Show();
256
257 m_gitCommitPane = new GIT_COMMIT_PANE( this );
258 m_auimgr.AddPane( m_gitCommitPane, EDA_PANE()
259 .Palette()
260 .Name( GitCommitPaneName() )
261 .Left()
262 .Layer( 1 )
263 .Position( 2 )
264 .Caption( _( "Version Control" ) )
265 .MinSize( wxSize( m_gitCommitPane->GetMinDockWidth(), -1 ) )
266 .PaneBorder( false )
267 .Floatable( false )
268 .Movable( false )
269 .CloseButton( true )
270 .Hide() );
271
272 if( m_showGitCommitPanel )
273 m_auimgr.GetPane( m_gitCommitPane ).Show();
274
275 // Refresh the changed-file list when the user returns to the project manager, since
276 // edits are made in the separate editor windows.
277 Bind( wxEVT_ACTIVATE,
278 [this]( wxActivateEvent& aEvent )
279 {
280 aEvent.Skip();
281
282 // Reading the status walks the repository, so only do it for a pane the user can
283 // actually see. Showing the pane refreshes it, so the gate cannot leave it stale.
284 if( aEvent.GetActive() && GitCommitPaneShown() )
285 m_gitCommitPane->RefreshFileList();
286 } );
287
288 wxSize client_size = GetClientSize();
289 m_notebook = new wxAuiNotebook( this, wxID_ANY, wxPoint( client_size.x, client_size.y ),
290 FromDIP( wxSize( 700, 590 ) ),
291 wxAUI_NB_TOP | wxAUI_NB_CLOSE_ON_ALL_TABS | wxAUI_NB_TAB_MOVE
292 | wxAUI_NB_SCROLL_BUTTONS | wxNO_BORDER );
293
294 m_notebook->SetArtProvider( new WX_AUI_TAB_ART() );
295
296 m_notebook->Bind( wxEVT_AUINOTEBOOK_PAGE_CLOSE, &KICAD_MANAGER_FRAME::onNotebookPageCloseRequest, this );
297 m_notebook->Bind( wxEVT_AUINOTEBOOK_PAGE_CLOSED, &KICAD_MANAGER_FRAME::onNotebookPageCountChanged, this );
298 m_launcher = new PANEL_KICAD_LAUNCHER( m_notebook );
299
300 m_notebook->Freeze();
301 m_launcher->SetClosable( false );
302 m_notebook->AddPage( m_launcher, EDITORS_CAPTION, false );
303 m_notebook->SetTabCtrlHeight( 0 );
304 m_notebook->Thaw();
305
306 m_auimgr.AddPane( m_notebook, EDA_PANE().Canvas().Name( "Editors" ).Center().Caption( EDITORS_CAPTION )
307 .PaneBorder( false ).MinSize( m_notebook->GetBestSize() ) );
308
309 m_auimgr.Update();
310
311 // Now the actual m_projectTreePane size is set, give it a reasonable min width
312 m_auimgr.GetPane( m_projectTreePane ).MinSize( defaultLeftWinWidth, FromDIP( 80 ) );
313
314
315 wxSizer* mainSizer = GetSizer();
316
317 // Only fit the initial window size the first time KiCad is run.
318 if( mainSizer && config()->m_Window.state.size_x == 0 && config()->m_Window.state.size_y == 0 )
319 {
320 Layout();
321 mainSizer->Fit( this );
322 Center();
323 }
324
325 if( ADVANCED_CFG::GetCfg().m_HideVersionFromTitle )
326 SetTitle( wxT( "KiCad" ) );
327 else
328 SetTitle( wxString( "KiCad " ) + GetMajorMinorVersion() );
329
330 // Do not let the messages window have initial focus
331 m_projectTreePane->SetFocus();
332
333 // Init for dropping files
336
337 // Gerber files
338 // Note that all gerber files are aliased as GerberFileExtension
342
343 DragAcceptFiles( true );
344}
345
346
348{
350 Unbind( wxEVT_CHAR_HOOK, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
351
352 m_notebook->Unbind( wxEVT_AUINOTEBOOK_PAGE_CLOSE, &KICAD_MANAGER_FRAME::onNotebookPageCloseRequest, this );
353 m_notebook->Unbind( wxEVT_AUINOTEBOOK_PAGE_CLOSED, &KICAD_MANAGER_FRAME::onNotebookPageCountChanged, this );
354
357 Pgm().UnregisterLibraryLoadStatusBar( (KISTATUSBAR*) GetStatusBar() );
358
359 // Shutdown all running tools
360 if( m_toolManager )
361 m_toolManager->ShutdownAllTools();
362
363 if( m_pcm )
364 m_pcm->StopBackgroundUpdate();
365
366 // Stop update manager before tearing down the AUI framework. The update
367 // task runs on the thread pool and may call CallAfter on this frame, so it
368 // must complete before we uninitialize AUI or destroy child windows.
369 m_updateManager.reset();
370
371 delete m_actions;
372 delete m_toolManager;
373 delete m_toolDispatcher;
374
375 m_auimgr.UnInit();
376}
377
379{
380 if( m_notebook->GetPageCount() == 1 )
381 m_notebook->SetTabCtrlHeight( 0 );
382 else
383 m_notebook->SetTabCtrlHeight( -1 );
384}
385
386
388{
390}
391
392
394{
395 wxAuiNotebook* notebook = (wxAuiNotebook*) evt.GetEventObject();
396 wxWindow* page = notebook->GetPage( evt.GetSelection() );
397
398 if( PANEL_NOTEBOOK_BASE* panel = dynamic_cast<PANEL_NOTEBOOK_BASE*>( page ) )
399 {
400 if( panel->GetClosable() )
401 {
402 if( !panel->GetCanClose() )
403 evt.Veto();
404
405 CallAfter(
406 [this]()
407 {
409 } );
410 }
411 else
412 {
413 evt.Veto();
414 }
415 }
416}
417
418
419wxStatusBar* KICAD_MANAGER_FRAME::OnCreateStatusBar( int number, long style, wxWindowID id,
420 const wxString& name )
421{
422 KISTATUSBAR* sb = new KISTATUSBAR( number, this, id,
426
427 size_t sbFieldCnt = static_cast<size_t>( sb->GetFieldsCount() );
428 std::vector<int> sbFieldSizes( sbFieldCnt );
429
430 for( size_t i = 0; i < sbFieldCnt; i++ )
431 sbFieldSizes[i] = sb->GetStatusWidth( static_cast<int>( i ) );
432
433 // Field 0 (the project path) is the only stretchable field so it uses all the leftover width
434 // before ellipsizing. Field 1 gets a fixed width sized to its watcher text; longer content
435 // (archive progress) is ellipsized rather than allowed to steal the path's width.
436 if( sbFieldCnt > 0 )
437 sbFieldSizes[0] = -1;
438
439 if( sbFieldCnt > 1 )
440 {
441 int margin = KIUI::GetTextSize( wxT( "XX" ), sb ).x;
442 int watcherWidth = std::max( KIUI::GetTextSize( _( "Local path: monitoring folder changes" ), sb ).x,
443 KIUI::GetTextSize( _( "Network path: not monitoring folder changes" ), sb ).x );
444
445 sbFieldSizes[1] = watcherWidth + margin;
446 }
447
448 sb->SetStatusWidths( sbFieldCnt, sbFieldSizes.data() );
449
450 return sb;
451}
452
453
455{
456 // creates the PLUGIN_CONTENT_MANAGER, if not exists
457 if( m_pcm )
458 return;
459
460 m_pcm = std::make_shared<PLUGIN_CONTENT_MANAGER>(
461 [this]( int aUpdateCount )
462 {
463 if( Pgm().m_Quitting )
464 return;
465
466 m_pcmUpdateCount = aUpdateCount;
467
468 if( aUpdateCount > 0 )
469 {
471 wxS( "pcm" ),
472 _( "PCM Updates Available" ),
473 wxString::Format( _( "%d package update(s) available" ), aUpdateCount ),
474 wxT( "" ) );
475 }
476 else
477 {
478 Pgm().GetNotificationsManager().Remove( wxS( "pcm" ) );
479 }
480
481 CallAfter(
482 [this]()
483 {
485 } );
486 });
487
488 m_pcm->SetRepositoryList( kicadSettings()->m_PcmRepositories );
489}
490
491
493{
494 // Create the manager
496 m_toolManager->SetEnvironment( nullptr, nullptr, nullptr, config(), this );
498
500
501 // Attach the events to the tool dispatcher
503 Bind( wxEVT_CHAR_HOOK, &TOOL_DISPATCHER::DispatchWxEvent, m_toolDispatcher );
504
505 // Register tools
506 m_toolManager->RegisterTool( new COMMON_CONTROL );
507 m_toolManager->RegisterTool( new KICAD_MANAGER_CONTROL );
508 m_toolManager->InitTools();
509}
510
511
513{
515
516 ACTION_MANAGER* manager = m_toolManager->GetActionManager();
517
518 wxASSERT( manager );
519
520 auto activeProject =
521 [this] ( const SELECTION& )
522 {
523 return m_active_project;
524 };
525
526#define ENABLE( x ) ACTION_CONDITIONS().Enable( x )
527
528 ACTION_CONDITIONS activeProjectCond;
529 activeProjectCond.Enable( activeProject );
530
531 manager->SetConditions( ACTIONS::saveAs, activeProjectCond );
532 manager->SetConditions( ACTIONS::exportForOlderVersion, activeProjectCond );
533 manager->SetConditions( KICAD_MANAGER_ACTIONS::closeProject, activeProjectCond );
534 manager->SetConditions( KICAD_MANAGER_ACTIONS::archiveProject, activeProjectCond );
535 manager->SetConditions( KICAD_MANAGER_ACTIONS::newJobsetFile, activeProjectCond );
536 manager->SetConditions( KICAD_MANAGER_ACTIONS::openJobsetFile, activeProjectCond );
537
538 auto historyCond =
539 [this]( const SELECTION& )
540 {
541 return HistoryPanelShown();
542 };
543
545
546 auto gitCommitPaneCond = [this]( const SELECTION& )
547 {
548 return GitCommitPaneShown();
549 };
550
551 manager->SetConditions( ACTIONS::showGitCommitPane, ACTION_CONDITIONS().Check( gitCommitPaneCond ) );
552
553 // These are just here for text boxes, search boxes, etc. in places such as the standard
554 // file dialogs.
558
559#undef ENABLE
560}
561
562
564{
565 return m_projectTreePane;
566}
567
568
570{
572 wxASSERT( ret );
573 return ret;
574}
575
576
578{
579 KICAD_SETTINGS* ret = dynamic_cast<KICAD_SETTINGS*>( config() );
580 wxASSERT( ret );
581 return ret;
582}
583
584
586{
587 CallAfter(
588 [&]()
589 {
591 {
592 if( KIFACE* kiface = Kiway().KiFACE( face ) )
593 kiface->PreloadLibraries( &Kiway() );
594 }
595
597 } );
598}
599
600
602{
603 return GetProjectFileName();
604}
605
606
608{
610 : wxString( wxEmptyString );
611}
612
613
615{
616 wxFileName fn( GetProjectFileName() );
617
619 return fn.GetFullPath();
620}
621
622
624{
625 wxFileName fn( GetProjectFileName() );
626
628 return fn.GetFullPath();
629}
630
631
633{
634 wxFileName fn( GetProjectFileName() );
635
636 fn.SetExt( FILEEXT::PcbFileExtension );
637 return fn.GetFullPath();
638}
639
640
642{
643 wxFileName fn( GetProjectFileName() );
644
646 return fn.GetFullPath();
647}
648
649
651{
652 m_projectTreePane->ReCreateTreePrj();
653}
654
655
660
661
663{
664 return PgmTop().GetHelpFileName();
665}
666
667
668void KICAD_MANAGER_FRAME::OnSize( wxSizeEvent& event )
669{
670 if( m_auimgr.GetManagedWindow() )
671 m_auimgr.Update();
672
673 event.Skip();
674}
675
676
678{
679 // All fileNames are now in m_AcceptedFiles vector.
680 // Check if contains a project file name and load project.
681 // If not, open files in dedicated app.
682 for( const wxFileName& fileName : m_AcceptedFiles )
683 {
684 wxString ext = fileName.GetExt();
685
687 {
688 wxString fn = fileName.GetFullPath();
689 m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( fileName.GetExt() ), &fn );
690
691 return;
692 }
693 }
694
695 // Then stock gerber files in gerberFiles and run action for other files.
696 wxString gerberFiles;
697
698 // Gerbview editor should be able to open Gerber and drill files
699 for( const wxFileName& fileName : m_AcceptedFiles )
700 {
701 wxString ext = fileName.GetExt();
702
706 {
707 gerberFiles += wxT( '\"' );
708 gerberFiles += fileName.GetFullPath() + wxT( '\"' );
709 gerberFiles = gerberFiles.Pad( 1 );
710 }
711 else
712 {
713 wxString fn = fileName.GetFullPath();
714 m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( fileName.GetExt() ), &fn );
715 }
716 }
717
718 // Execute Gerbviewer
719 if( !gerberFiles.IsEmpty() )
720 {
721 wxString fullEditorName = FindKicadFile( GERBVIEW_EXE );
722
723 if( wxFileExists( fullEditorName ) )
724 {
725 wxString command = fullEditorName + " " + gerberFiles;
726 m_toolManager->RunAction<wxString*>( *m_acceptedExts.at( FILEEXT::GerberFileExtension ), &command );
727 }
728 }
729}
730
731
732bool KICAD_MANAGER_FRAME::canCloseWindow( wxCloseEvent& aEvent )
733{
734 // Shutdown blocks must be determined and vetoed as early as possible, before any jobset prompt
736 {
737 for( size_t i = 0; i < m_notebook->GetPageCount(); i++ )
738 {
739 PANEL_JOBSET* jobset = dynamic_cast<PANEL_JOBSET*>( m_notebook->GetPage( i ) );
740
741 if( jobset && jobset->GetJobsFile()->GetDirty() )
742 {
743 KIPLATFORM::APP::SetShutdownBlockReason( this, _( "Jobset changes are unsaved" ) );
744 return false;
745 }
746 }
747
748 // Drop the reason a cancelled logoff left behind once its jobset has been saved
750 }
751
752 KICAD_SETTINGS* settings = kicadSettings();
754
755 for( size_t i = 0; i < m_notebook->GetPageCount(); i++ )
756 {
757 wxWindow* page = m_notebook->GetPage( i );
758
759 if( PANEL_NOTEBOOK_BASE* panel = dynamic_cast<PANEL_NOTEBOOK_BASE*>( page ) )
760 {
761 if( !panel->GetCanClose() )
762 return false;
763 }
764 }
765
766 // CloseProject will recursively ask all the open editors if they need to save changes.
767 // If any of them cancel then we need to cancel closing the KICAD_MANAGER_FRAME.
768 if( CloseProject( true ) )
769 {
770 // Don't propagate event to frames which have already been closed
771 aEvent.StopPropagation();
772
773 return true;
774 }
775 else
776 {
777 if( aEvent.CanVeto() )
778 aEvent.Veto();
779
780 return false;
781 }
782}
783
784
786{
787#ifdef _WINDOWS_
788 // For some obscure reason, on Windows, when killing Kicad from the Windows task manager
789 // if a editor frame (schematic, library, board editor or fp editor) is open and has
790 // some edition to save, OnCloseWindow is run twice *at the same time*, creating race
791 // conditions between OnCloseWindow() code.
792 // Therefore I added (JPC) a ugly hack to discard the second call (unwanted) during
793 // execution of the first call (only one call is right).
794 // Note also if there is no change made in editors, this behavior does not happen.
795 static std::atomic<unsigned int> lock_close_event( 0 );
796
797 if( ++lock_close_event > 1 ) // Skip extra calls
798 {
799 return;
800 }
801#endif
802
803 m_projectTreePane->Show( false );
804 Pgm().m_Quitting = true;
805
806 Destroy();
807
808#ifdef _WINDOWS_
809 lock_close_event = 0; // Reenable event management
810#endif
811}
812
813
815{
817
818 if( !aIsExplicitUserSave && !cfg.ShouldAutoSave() )
819 return;
820
821 cfg.m_OpenJobSets.clear();
822
823 for( size_t i = 0; i < m_notebook->GetPageCount(); i++ )
824 {
825 if( PANEL_JOBSET* jobset = dynamic_cast<PANEL_JOBSET*>( m_notebook->GetPage( i ) ) )
826 {
827 wxFileName jobsetFn( jobset->GetFilePath() );
828 jobsetFn.MakeRelativeTo( Prj().GetProjectPath() );
829 cfg.m_OpenJobSets.emplace_back( jobsetFn.GetFullPath() );
830 }
831 }
832
833 cfg.SaveToFile( Prj().GetProjectPath() );
834}
835
836
837void KICAD_MANAGER_FRAME::OnExit( wxCommandEvent& event )
838{
839 Close( true );
840}
841
842
844{
845 if( !Kiway().PlayersClose( false ) )
846 return false;
847
848 // Abort any in-progress background load, since the threads depend on the project not changing
850 {
851 if( KIFACE* kiface = Kiway().KiFACE( face ) )
852 kiface->CancelPreload();
853 }
854
855 // Save the project file for the currently loaded project.
856 if( m_active_project )
857 {
859
860 if( Prj().GetLocalSettings().ShouldAutoSave() && Prj().GetProjectFile().ShouldAutoSave() )
861 {
863
864 if( aSave )
865 mgr.SaveProject();
866 }
867
868 // Ensure the Last_Save tag is at HEAD before closing. This handles the case where
869 // autosave commits were made after the last explicit save - without this, the next
870 // project load would offer to restore the autosave state, which is incorrect after
871 // a clean close.
872 wxString projPath = Prj().GetProjectPath();
873
874 // Wait for any in-flight autosave so the HEAD check below isn't racing it.
876
877 if( Pgm().GetCommonSettings()->AutosaveUsesLocalHistory()
878 && !projPath.IsEmpty() && Kiway().LocalHistory().HistoryExists( projPath ) )
879 {
880 if( Kiway().LocalHistory().HeadNewerThanLastSave( projPath ) )
881 {
882 // Tag unconditionally: even on no-op snapshots Last_Save must anchor at HEAD.
883 Kiway().LocalHistory().CommitFullProjectSnapshot( projPath, wxS( "Close" ) );
884 Kiway().LocalHistory().TagSave( projPath, wxS( "project" ) );
885 }
886 }
887
888 // The editors clean up autosaves for sheets actually dirtied in their session.
889 // Anything still on disk here was deferred by the user in the recovery dialog
890 // and must survive so the dialog can offer it again on the next open.
891
892 m_active_project = false;
893 // Enforce local history size limit (if enabled) once all pending saves/backups are done.
894 if( Pgm().GetCommonSettings()
895 && Pgm().GetCommonSettings()->AutosaveUsesLocalHistory() )
896 {
897 unsigned long long int limit = Pgm().GetCommonSettings()->m_Backup.limit_total_size;
898
899 if( limit > 0 && Kiway().LocalHistory().IsCompacting() )
900 {
901 Kiway().LocalHistory().EnforceSizeLimitInBackground( Prj().GetProjectPath(), (size_t) limit );
902 }
903 else if( limit > 0 )
904 {
905 WX_PROGRESS_REPORTER reporter( this, _( "Local History" ), 3, PR_NO_ABORT );
906 Kiway().LocalHistory().EnforceSizeLimit( Prj().GetProjectPath(), (size_t) limit, &reporter );
907 }
908 }
909
910 // Unregister the project saver before unloading the project to prevent
911 // dangling references
913
914 // Must run before the unload below, which releases the git session without waiting.
915 m_projectTreePane->WaitForGitOperations();
916
917 mgr.UnloadProject( &Prj() );
918 }
919
920 SetStatusText( "" );
921
922 // Traverse pages in reverse order so deleting them doesn't mess up our iterator.
923 for( int i = (int) m_notebook->GetPageCount() - 1; i >= 0; i-- )
924 {
925 wxWindow* page = m_notebook->GetPage( i );
926
927 if( PANEL_NOTEBOOK_BASE* panel = dynamic_cast<PANEL_NOTEBOOK_BASE*>( page ) )
928 {
929 if( panel->GetProjectTied() )
930 m_notebook->DeletePage( i );
931 }
932 }
933
934 m_projectTreePane->EmptyTreePrj();
936
937 return true;
938}
939
940
941void KICAD_MANAGER_FRAME::OpenJobsFile( const wxFileName& aFileName, bool aCreate, bool aResaveProjectPreferences )
942{
943 for( size_t i = 0; i < m_notebook->GetPageCount(); i++ )
944 {
945 if( PANEL_JOBSET* panel = dynamic_cast<PANEL_JOBSET*>( m_notebook->GetPage( i ) ) )
946 {
947 if( aFileName.GetFullPath() == panel->GetFilePath() )
948 {
949 m_notebook->SetSelection( i );
950 return;
951 }
952 }
953 }
954
955 try
956 {
957 std::unique_ptr<JOBSET> jobsFile = std::make_unique<JOBSET>( aFileName.GetFullPath().ToStdString() );
958
959 jobsFile->LoadFromFile();
960
961 if( aCreate && !aFileName.FileExists() )
962 {
963 JOBSET_DESTINATION* dest = jobsFile->AddNewDestination( JOBSET_DESTINATION_T::FOLDER );
964 dest->m_outputHandler->SetOutputPath( aFileName.GetName() );
965 jobsFile->SaveToFile( wxEmptyString, true );
966 }
967
968 PANEL_JOBSET* jobPanel = new PANEL_JOBSET( m_notebook, this, std::move( jobsFile ) );
969 jobPanel->SetProjectTied( true );
970 jobPanel->SetClosable( true );
971 m_notebook->AddPage( jobPanel, aFileName.GetFullName(), true );
973
974 if( aResaveProjectPreferences )
976 }
977 catch( ... )
978 {
979 DisplayErrorMessage( this, _( "Error opening jobs file" ) );
980 }
981}
982
983
984bool KICAD_MANAGER_FRAME::LoadProject( const wxFileName& aProjectFileName )
985{
986 // The project file should be valid by the time we get here or something has gone wrong.
987 if( !aProjectFileName.Exists() )
988 return false;
989
990 wxString fullPath = aProjectFileName.GetFullPath();
991
992 // Inspect only; SETTINGS_MANAGER::LoadProject() takes the real lock
993 LOCKFILE lockFile = LOCKFILE::Inspect( fullPath );
994
995 bool lockOverrideGranted = false;
996
997 if( !lockFile.Valid() )
998 {
999 wxString msg;
1000 msg.Printf( _( "Project '%s' is already open by '%s' at '%s'." ),
1001 fullPath,
1002 lockFile.GetUsername(),
1003 lockFile.GetHostname() );
1004
1005 if( !AskOverrideLock( this, msg ) )
1006 return false; // User clicked Cancel - abort project loading entirely
1007
1008 lockOverrideGranted = true;
1009 }
1010
1011 // Any open KIFACE's must be closed if they are not part of the new project.
1012 // (We never want a KIWAY_PLAYER open on a KIWAY that isn't in the same project.)
1013 // User is prompted here to close those KIWAY_PLAYERs:
1014 if( !CloseProject( true ) )
1015 return false;
1016
1017 m_active_project = true;
1018
1019 // NB: when loading a legacy project SETTINGS_MANAGER::LoadProject() will convert it to
1020 // current extension. Be very careful with aProjectFileName vs. Prj().GetProjectPath()
1021 // from here on out.
1022
1023 // The load overrides the lock in place. Releasing it here and taking it again there would
1024 // delete and recreate the lock file, which fails on Windows while another handle is open.
1025 Pgm().GetSettingsManager().LoadProject( fullPath, true, lockOverrideGranted );
1026
1027 // Propagate lock override decision to the loaded project
1028 if( lockOverrideGranted )
1029 Prj().SetLockOverrideGranted( true );
1030
1031 LoadWindowState( aProjectFileName.GetFullName() );
1032
1033 if( aProjectFileName.IsDirWritable() )
1034 SetMruPath( Prj().GetProjectPath() );
1035
1036 if( Pgm().GetCommonSettings()->AutosaveUsesLocalHistory()
1037 && Kiway().LocalHistory().HeadNewerThanLastSave( Prj().GetProjectPath() ) )
1038 {
1039 wxString head = Kiway().LocalHistory().GetHeadHash( Prj().GetProjectPath() );
1040
1041 KICAD_MESSAGE_DIALOG dlg( this, _( "KiCad found unsaved changes from your last session that are newer than "
1042 "the saved project files." ),
1043 _( "Recover Unsaved Changes" ), wxYES_NO | wxICON_QUESTION );
1044
1045 dlg.SetExtendedMessage( _( "This can happen if your previous session ended unexpectedly.\n\n"
1046 "Choose 'Restore' to recover those changes, or 'Discard' to keep the "
1047 "currently saved files." ) );
1048
1049 dlg.SetYesNoLabels( _( "Restore" ), _( "Discard" ) );
1050
1051 if( dlg.ShowModal() == wxID_YES )
1052 {
1053 // The dialog above is the confirmation, skip RestoreCommit's own prompt.
1054 if( Kiway().LocalHistory().RestoreCommit( Prj().GetProjectPath(), head, this, false ) )
1056 }
1057 else
1058 {
1059 // User declined; commit on-disk state and tag unconditionally so Last_Save anchors
1060 // at HEAD even if no new commit was needed.
1061 Kiway().LocalHistory().CommitFullProjectSnapshot( Prj().GetProjectPath(), wxS( "Declined restore" ) );
1062 Kiway().LocalHistory().TagSave( Prj().GetProjectPath(), wxS( "project" ) );
1063 }
1064 }
1065
1066 // Save history & window state to disk now. Don't wait around for a crash.
1067 KICAD_SETTINGS* settings = kicadSettings();
1068 SaveSettings( settings );
1069 settings->SaveToFile( Pgm().GetSettingsManager().GetPathForSettingsFile( settings ) );
1070
1071 m_projectTreePane->ReCreateTreePrj();
1072 m_historyPane->RefreshHistory( Prj().GetProjectPath() );
1073
1074 if( GitCommitPaneShown() )
1075 m_gitCommitPane->RefreshFileList();
1076
1077 for( const wxString& jobset : Prj().GetLocalSettings().m_OpenJobSets )
1078 {
1079 wxFileName jobsetFn( jobset );
1080 jobsetFn.MakeAbsolute( Prj().GetProjectPath() );
1081
1082 if( jobsetFn.Exists() )
1083 OpenJobsFile( jobsetFn.GetFullPath(), false, false );
1084 }
1085
1086 // Always start with the apps page
1087 m_notebook->SetSelection( 0 );
1088
1089 // Rebuild the list of watched paths.
1090 // however this is possible only when the main loop event handler is running,
1091 // so we use it to run the rebuild function.
1092 wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED, ID_INIT_WATCHED_PATHS );
1093
1094 wxPostEvent( this, cmd );
1095
1096 PrintPrjInfo();
1097
1098 KIPLATFORM::APP::RegisterApplicationRestart( aProjectFileName.GetFullPath() );
1099 m_openSavedWindows = true;
1100
1101 KIPLATFORM::ENV::AddToRecentDocs( aProjectFileName.GetFullPath() );
1102
1103 // Now that we have a new project, trigger a library preload, which will load in any
1104 // project-specific symbol and footprint libraries into the manager
1106 return true;
1107}
1108
1109
1110void KICAD_MANAGER_FRAME::CreateNewProject( const wxFileName& aProjectFileName, bool aCreateStubFiles )
1111{
1112 wxCHECK_RET( aProjectFileName.DirExists() && aProjectFileName.IsDirWritable(),
1113 "Project folder must exist and be writable to create a new project." );
1114
1115 // If the project is legacy, convert it
1116 if( !aProjectFileName.FileExists() )
1117 {
1118 wxFileName legacyPro( aProjectFileName );
1119 legacyPro.SetExt( FILEEXT::LegacyProjectFileExtension );
1120
1121 if( legacyPro.FileExists() )
1122 {
1123 GetSettingsManager()->LoadProject( legacyPro.GetFullPath() );
1125
1126 wxRemoveFile( legacyPro.GetFullPath() );
1127 }
1128 else
1129 {
1130 // Copy template project file from template folder.
1131 wxString srcFileName = sys_search().FindValidPath( "kicad.kicad_pro" );
1132
1133 wxFileName destFileName( aProjectFileName );
1134 destFileName.SetExt( FILEEXT::ProjectFileExtension );
1135
1136 // Create a minimal project file if the template project file could not be copied
1137 if( !wxFileName::FileExists( srcFileName )
1138 || !wxCopyFile( srcFileName, destFileName.GetFullPath() ) )
1139 {
1140 wxFFile file( destFileName.GetFullPath(), "wb" );
1141
1142 if( file.IsOpened() )
1143 file.Write( wxT( "{\n}\n") );
1144
1145 // wxFFile dtor will close the file
1146 }
1147 }
1148 }
1149
1150 // Create a "stub" for a schematic root sheet and a board if requested.
1151 // It will avoid messages from the schematic editor or the board editor to create a new file
1152 // And forces the user to create main files under the right name for the project manager
1153 if( aCreateStubFiles )
1154 {
1155 wxFileName fn( aProjectFileName.GetFullPath() );
1157
1158 // If a <project>.kicad_sch file does not exist, create a "stub" file ( minimal schematic
1159 // file ).
1160 if( !fn.FileExists() )
1161 {
1162 wxFFile file( fn.GetFullPath(), "wb" );
1163
1164 if( file.IsOpened() )
1165 {
1166 file.Write( wxString::Format( "(kicad_sch\n"
1167 "\t(version %d)\n"
1168 "\t(generator \"eeschema\")\n"
1169 "\t(generator_version \"%s\")\n"
1170 "\t(uuid %s)\n"
1171 "\t(paper \"A4\")\n"
1172 "\t(lib_symbols)\n"
1173 "\t(sheet_instances\n"
1174 "\t\t(path \"/\"\n"
1175 "\t\t\t(page \"1\")\n"
1176 "\t\t)\n"
1177 "\t)\n"
1178 "\t(embedded_fonts no)\n"
1179 ")",
1182 KIID().AsString() ) );
1183 }
1184
1185 // wxFFile dtor will close the file
1186 }
1187
1188 // If a <project>.kicad_pcb or <project>.brd file does not exist,
1189 // create a .kicad_pcb "stub" file
1190 fn.SetExt( FILEEXT::KiCadPcbFileExtension );
1191 wxFileName leg_fn( fn );
1192 leg_fn.SetExt( FILEEXT::LegacyPcbFileExtension );
1193
1194 if( !fn.FileExists() && !leg_fn.FileExists() )
1195 {
1196 wxFFile file( fn.GetFullPath(), "wb" );
1197
1198 if( file.IsOpened() )
1199 {
1200 // Create a small dummy file as a stub for pcbnew:
1201 file.Write( wxString::Format( "(kicad_pcb (version %d) (generator \"pcbnew\") (generator_version \"%s\")\n)",
1203 }
1204
1205 // wxFFile dtor will close the file
1206 }
1207 }
1208
1209 // Save history & window state to disk now. Don't wait around for a crash.
1210 KICAD_SETTINGS* settings = kicadSettings();
1211 SaveSettings( settings );
1212 settings->SaveToFile( Pgm().GetSettingsManager().GetPathForSettingsFile( settings ) );
1213
1214 m_openSavedWindows = true;
1215}
1216
1217
1219{
1220 std::shared_ptr<KIGIT_COMMON> gitCommon = Prj().GetGitCommon();
1221 git_repository* repo = gitCommon->GetRepo();
1222
1223 if( !repo )
1224 {
1225 wxMessageBox( _( "Compare Project Branches requires a project that is "
1226 "tracked by git." ),
1227 _( "Compare Branches" ),
1228 wxOK | wxICON_INFORMATION, this );
1229 return;
1230 }
1231
1232 std::vector<wxString> refs;
1233
1234 // libgit2 is not safe for concurrent use of one repository, so read the refs under the git
1235 // action lock. If a background operation holds it, fall back to HEAD.
1236 if( std::unique_lock<std::mutex> lock = gitCommon->TryLockAction(); lock.owns_lock() )
1237 refs = KIGIT::CompareBranchRefs( repo );
1238
1239 if( refs.empty() )
1240 refs.push_back( wxS( "HEAD" ) );
1241
1242 DIALOG_GIT_MR_REVIEW dlg( this, gitCommon.get(), refs );
1243 dlg.ShowModal();
1244}
1245
1246
1248{
1249 // show all files in file dialog (in Kicad all files are editable texts):
1250 wxString wildcard = FILEEXT::AllFilesWildcard();
1251
1252 wxString default_dir = Prj().GetProjectPath();
1253
1254 wxFileDialog dlg( this, _( "Edit File in Text Editor" ), default_dir, wxEmptyString, wildcard,
1255 wxFD_OPEN );
1256
1258
1259 if( dlg.ShowModal() == wxID_CANCEL )
1260 return;
1261
1262 wxString filename = dlg.GetPath();
1263
1264 if( !dlg.GetPath().IsEmpty() && !Pgm().GetTextEditor().IsEmpty() )
1265 m_toolManager->RunAction<wxString*>( KICAD_MANAGER_ACTIONS::openTextEditor, &filename );
1266}
1267
1268
1269void KICAD_MANAGER_FRAME::OnEditAdvancedCfg( wxCommandEvent& WXUNUSED( event ) )
1270{
1271 DIALOG_EDIT_CFG dlg( this );
1272 dlg.ShowModal();
1273}
1274
1275
1277{
1278 m_projectTreePane->ReCreateTreePrj();
1279}
1280
1281
1283{
1284 // call my base class
1286
1287 // tooltips in toolbars
1289 m_launcher->CreateLaunchers();
1290
1291 // update captions
1292 int pageId = m_notebook->FindPage( m_launcher );
1293
1294 if( pageId != wxNOT_FOUND )
1295 m_notebook->SetPageText( pageId, EDITORS_CAPTION );
1296
1297 m_auimgr.GetPane( m_projectTreePane ).Caption( PROJECT_FILES_CAPTION );
1298 m_auimgr.Update();
1299
1300 m_projectTreePane->FileWatcherReset();
1301
1302 PrintPrjInfo();
1303}
1304
1305
1307{
1309
1310 if( m_pcm && ( aFlags & ENVVARS_CHANGED ) )
1311 m_pcm->ReadEnvVar();
1312
1313 COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
1314
1315 if( m_lastToolbarIconSize == 0
1317 {
1320 }
1321
1322 m_projectTreePane->ReCreateTreePrj();
1323
1324 // The tree rebuild above does not reach the panel.
1325 if( m_gitCommitPane )
1326 {
1327 m_gitCommitPane->RefreshFileList();
1328 m_gitCommitPane->ReloadAdvancedWindow();
1329 }
1330}
1331
1332
1334{
1335 wxString file = GetProjectFileName();
1336
1337 // empty file string means no project loaded
1338 if( !Prj().IsNullProject() &&
1339 Prj().GetProjectLock() == nullptr )
1340 {
1341 LOCKFILE lockFile( file );
1342
1343 if( !lockFile.Valid() )
1344 {
1345 wxString msg;
1346 msg.Printf( _( "Project '%s' is already open by '%s' at '%s'." ),
1347 file,
1348 lockFile.GetUsername(),
1349 lockFile.GetHostname() );
1350
1351 if( AskOverrideLock( this, msg ) )
1352 {
1353 lockFile.OverrideLock();
1354 }
1355 }
1356
1357 Prj().SetReadOnly( !lockFile.Valid() || Prj().GetProjectFile().IsReadOnly() );
1358 Prj().SetProjectLock( new LOCKFILE( std::move( lockFile ) ) );
1359 }
1360
1361 wxString title;
1362
1363 if( !file.IsEmpty() )
1364 {
1365 wxFileName fn( file );
1366
1367 title = fn.GetName();
1368
1369 if( Prj().IsReadOnly() )
1370 title += wxS( " " ) + _( "[Read Only]" );
1371 }
1372 else
1373 {
1374 title = _( "[no project loaded]" );
1375 }
1376
1377 if( ADVANCED_CFG::GetCfg().m_HideVersionFromTitle )
1378 title += wxT( " \u2014 " ) + wxString( wxS( "KiCad" ) );
1379 else
1380 title += wxT( " \u2014 " ) + wxString( wxS( "KiCad " ) ) + GetMajorMinorVersion();
1381
1382 SetTitle( title );
1383
1384 // Register project file saver. Ensures project file participates in
1385 // autosave history commits without affecting dirty state.
1387}
1388
1389
1391{
1393
1394 auto settings = dynamic_cast<KICAD_SETTINGS*>( aCfg );
1395
1396 wxCHECK( settings, /*void*/ );
1397
1398 m_leftWinWidth = settings->m_LeftWinWidth;
1399 m_showHistoryPanel = settings->m_ShowHistoryPanel;
1400 m_showGitCommitPanel = settings->m_ShowGitCommitPanel;
1401}
1402
1403
1405{
1407
1408 KICAD_SETTINGS* settings = dynamic_cast<KICAD_SETTINGS*>( aCfg );
1409
1410 wxCHECK( settings, /*void*/ );
1411
1412 settings->m_LeftWinWidth = m_projectTreePane->GetSize().x;
1413 settings->m_ShowHistoryPanel = m_historyPane && m_auimgr.GetPane( m_historyPane ).IsShown();
1415
1416 if( !m_isClosing )
1418}
1419
1420
1422{
1423 wxString status = wxString::Format( _( "Project: %s" ), Prj().GetProjectFullName() );
1424 SetStatusText( status, 0 );
1425}
1426
1427
1432
1433
1434void KICAD_MANAGER_FRAME::OnIdle( wxIdleEvent& aEvent )
1435{
1441 if( !m_openSavedWindows )
1442 return;
1443
1444 m_openSavedWindows = false;
1445
1446 if( Pgm().GetCommonSettings()->m_Session.remember_open_files )
1447 {
1448 int previousOpenCount = std::count_if( Prj().GetLocalSettings().m_files.begin(),
1449 Prj().GetLocalSettings().m_files.end(),
1450 [&]( const PROJECT_FILE_STATE& f )
1451 {
1452 return !f.fileName.EndsWith( FILEEXT::ProjectFileExtension ) && f.open;
1453 } );
1454
1455 if( previousOpenCount > 0 )
1456 {
1457 APP_PROGRESS_DIALOG progressReporter( _( "Restoring session" ), wxEmptyString, previousOpenCount, this );
1458
1459 // We don't currently support opening more than one view per file
1460 std::set<wxString> openedFiles;
1461
1462 int i = 0;
1463
1464 for( const PROJECT_FILE_STATE& file : Prj().GetLocalSettings().m_files )
1465 {
1466 if( file.open && !openedFiles.count( file.fileName ) )
1467 {
1468 progressReporter.Update( i++, wxString::Format( _( "Restoring '%s'" ), file.fileName ) );
1469
1470 openedFiles.insert( file.fileName );
1471 wxFileName fn( file.fileName );
1472
1473 if( fn.GetExt() == FILEEXT::LegacySchematicFileExtension
1474 || fn.GetExt() == FILEEXT::KiCadSchematicFileExtension )
1475 {
1477 }
1478 else if( fn.GetExt() == FILEEXT::LegacyPcbFileExtension
1479 || fn.GetExt() == FILEEXT::KiCadPcbFileExtension )
1480 {
1482 }
1483 }
1484
1485 wxYield();
1486 }
1487 }
1488 }
1489
1490 // clear file states regardless if we opened windows or not due to setting
1492
1493 // After restore from history, mark open editors as dirty so user is prompted to save
1495 {
1496 m_restoredFromHistory = false;
1497
1498 // Mark schematic editor as dirty if open
1499 if( KIWAY_PLAYER* schFrame = Kiway().Player( FRAME_SCH, false ) )
1500 schFrame->OnModify();
1501
1502 // Mark PCB editor as dirty if open
1503 if( KIWAY_PLAYER* pcbFrame = Kiway().Player( FRAME_PCB_EDITOR, false ) )
1504 pcbFrame->OnModify();
1505 }
1506
1507 KICAD_SETTINGS* settings = kicadSettings();
1508
1510 && settings->m_PcmUpdateCheck )
1511 {
1512 if( !m_pcm )
1513 CreatePCM();
1514
1515 m_pcm->RunBackgroundUpdate();
1516 }
1517
1518#ifdef KICAD_UPDATE_CHECK
1519 if( !m_updateManager && settings->m_KiCadUpdateCheck )
1520 {
1521 m_updateManager = std::make_unique<UPDATE_MANAGER>();
1522 m_updateManager->CheckForUpdate( this );
1523 }
1524#endif
1525
1526 // This little diddy is needed to get the window put into the Mac dock icon's context menu.
1527 Raise();
1528}
1529
1530
1532{
1533 m_pcmButton = aButton;
1534
1536}
1537
1538
1540{
1541 if( m_pcmButton )
1542 {
1543 if( m_pcmUpdateCount > 0 )
1544 {
1545 m_pcmButton->SetShowBadge( true );
1546 m_pcmButton->SetBadgeText( wxString::Format( "%d", m_pcmUpdateCount ) );
1547 }
1548 else
1549 {
1550 m_pcmButton->SetShowBadge( false );
1551 }
1552
1553 m_pcmButton->Refresh();
1554 }
1555}
1556
1557
1559{
1560 // No idea why, but the same mechanism used in EDA_DRAW_FRAME doesn't work here
1561 // the only thing that seems to work is to blow it all up and start from scratch.
1562 m_auimgr.DetachPane( m_tbLeft );
1563 delete m_tbLeft;
1564 m_tbLeft = nullptr;
1566 m_auimgr.AddPane( m_tbLeft, EDA_PANE().HToolbar().Name( "TopMainToolbar" ).Left().Layer( 2 ) );
1567
1568 m_auimgr.Update();
1569}
1570
1571
1573{
1574 wxAuiPaneInfo& pane = m_auimgr.GetPane( m_historyPane );
1575 bool show = !pane.IsShown();
1576 pane.Show( show );
1577
1578 if( show )
1579 m_historyPane->RefreshHistory( Prj().GetProjectPath() );
1580
1581 m_auimgr.Update();
1582}
1583
1584
1586{
1587 // Editors take the project settings from memory, which still hold what the restore replaced
1588 Prj().GetProjectFile().LoadFromFile( Prj().GetProjectPath() );
1589 Prj().GetLocalSettings().LoadFromFile( Prj().GetProjectPath() );
1590}
1591
1592
1594{
1595 if( !Kiway().PlayersClose( true ) )
1596 return;
1597
1598 if( Kiway().LocalHistory().RestoreCommit( Prj().GetProjectPath(), aHash, this ) )
1599 {
1600 m_restoredFromHistory = true; // Mark editors dirty when they reopen
1602 }
1603
1604 m_projectTreePane->ReCreateTreePrj();
1605 m_openSavedWindows = true;
1606 m_historyPane->RefreshHistory( Prj().GetProjectPath() );
1607}
1608
1609
1611{
1612 return m_historyPane && m_auimgr.GetPane( m_historyPane ).IsShown();
1613}
1614
1615
1617{
1618 wxAuiPaneInfo& pane = m_auimgr.GetPane( m_gitCommitPane );
1619 bool show = !pane.IsShown();
1620
1621 pane.Show( show );
1622
1623 if( show )
1624 m_gitCommitPane->RefreshFileList();
1625
1626 m_auimgr.Update();
1627}
1628
1629
1631{
1632 return m_gitCommitPane && m_auimgr.GetPane( m_gitCommitPane ).IsShown();
1633}
1634
1635
1637{
1638 if( m_gitCommitPane )
1639 {
1640 // A hidden pane is not refreshed on project load, so it may still hold the previous session
1641 m_gitCommitPane->RefreshFileList();
1642 m_gitCommitPane->ShowHistory();
1643 }
1644}
const char * name
constexpr EDA_IU_SCALE unityScale
Definition base_units.h:131
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition bitmap.cpp:100
@ icon_kicad_nightly
@ icon_kicad_nightly_32
@ icon_kicad_nightly_16
wxString GetMajorMinorVersion()
Get only the major and minor version in a string major.minor.
bool IsNightlyVersion()
Check if the build is meant to be nightly.
static TOOL_ACTION paste
Definition actions.h:77
static TOOL_ACTION saveAs
Definition actions.h:55
static TOOL_ACTION exportForOlderVersion
Definition actions.h:60
static TOOL_ACTION copy
Definition actions.h:75
static TOOL_ACTION showGitCommitPane
Definition actions.h:264
static TOOL_ACTION cut
Definition actions.h:74
Manage TOOL_ACTION objects.
void SetConditions(const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
Set the conditions the UI elements for activating a specific tool action should use for determining t...
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
wxProgressDialog with the option to also update the application progress on the taskbar
virtual bool Update(int aValue, const wxString &aNewMsg=wxEmptyString, bool *aSkip=nullptr) override
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
void UnregisterStatusBar(KISTATUSBAR *aStatusBar)
Removes status bar from handling.
void RegisterStatusBar(KISTATUSBAR *aStatusBar)
Add a status bar for handling.
A bitmap button widget that behaves like an AUI toolbar item's button when it is drawn.
Handle actions that are shared between different applications.
APPEARANCE m_Appearance
AUTO_BACKUP m_Backup
Git PR-style branch comparison dialog (Phase 10).
int ShowModal() override
The base frame for deriving all KiCad main window classes.
void LoadWindowState(const wxString &aFileName)
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
virtual void setupUIConditions()
Setup the UI conditions for the various actions and their controls in this frame.
std::vector< wxFileName > m_AcceptedFiles
SETTINGS_MANAGER * GetSettingsManager() const
bool isBlockableSessionEnd() const
Return true when the session is ending on a platform that shows a shutdown block reason.
wxAuiManager m_auimgr
virtual void RecreateToolbars()
virtual void LoadSettings(APP_SETTINGS_BASE *aCfg)
Load common frame parameters from a configuration file.
ACTION_TOOLBAR * m_tbLeft
std::map< const wxString, TOOL_ACTION * > m_acceptedExts
Associate file extensions with action to execute.
virtual void SaveSettings(APP_SETTINGS_BASE *aCfg)
Save common frame parameters to a configuration data file.
void SetMruPath(const wxString &aPath)
bool m_isClosing
Set by the close window event handler after frames are asked if they can close.
Specialization of the wxAuiPaneInfo class for KiCad panels.
Docked panel for committing: the branch to commit to, a summary and description, the commit options,...
void SetOutputPath(const wxString &aPath)
Definition jobs_output.h:56
virtual bool LoadFromFile(const wxString &aDirectory="")
Loads the backing file from disk and then calls Load()
virtual bool SaveToFile(const wxString &aDirectory="", bool aForce=false)
Calls Store() and then writes the contents of the JSON document to a file.
static TOOL_ACTION viewDroppedGerbers
static TOOL_ACTION loadProject
static TOOL_ACTION showLocalHistory
static TOOL_ACTION editSchematic
static TOOL_ACTION openTextEditor
static TOOL_ACTION archiveProject
static TOOL_ACTION closeProject
static TOOL_ACTION openJobsetFile
static TOOL_ACTION newJobsetFile
Handle actions in the kicad manager frame.
The main KiCad project manager frame.
std::shared_ptr< PLUGIN_CONTENT_MANAGER > m_pcm
void SetPcmButton(BITMAP_BUTTON *aButton)
void CreateNewProject(const wxFileName &aProjectFileName, bool aCreateStubFiles=true)
Creates a new project by setting up and initial project, schematic, and board files.
void reloadProjectSettings()
Reread the project and local settings files after a history restore rewrote them.
const SEARCH_STACK & sys_search() override
Return a SEARCH_STACK pertaining to entire program.
void OnImportEasyEdaProFiles(wxCommandEvent &event)
Open dialog to import EasyEDA Pro schematic and board files.
void ProjectChanged() override
Notification event that the project has changed.
void ShowChangedLanguage() override
Redraw the menus and what not in current language.
const wxString SchLegacyFileName()
wxWindow * GetToolCanvas() const override
Canvas access.
void OnImportEasyEdaFiles(wxCommandEvent &event)
Open dialog to import EasyEDA Std schematic and board files.
void OnImportPadsProjectFiles(wxCommandEvent &event)
Open dialog to import PADS Logic schematic and PCB files.
void OnImportEasyPcFiles(wxCommandEvent &event)
Open dialog to import an Easy-PC / DesignSpark PCB project, schematic or board.
void OnImportAltiumProjectFiles(wxCommandEvent &event)
Open dialog to import Altium project files.
const wxString GetProjectFileName() const
KICAD_SETTINGS * kicadSettings() const
void OnImportEagleFiles(wxCommandEvent &event)
Open dialog to import Eagle schematic and board files.
wxStatusBar * OnCreateStatusBar(int number, long style, wxWindowID id, const wxString &name) override
Create the status line (like a wxStatusBar).
void OnExit(wxCommandEvent &event)
void OpenJobsFile(const wxFileName &aFileName, bool aCreate=false, bool aResaveProjectPreferences=true)
bool canCloseWindow(wxCloseEvent &aCloseEvent) override
void OnSize(wxSizeEvent &event) override
GIT_COMMIT_PANE * m_gitCommitPane
virtual void setupUIConditions() override
Setup the UI conditions for the various actions and their controls in this frame.
PROJECT_TREE_PANE * m_projectTreePane
void OnImportGedaFiles(wxCommandEvent &event)
Open dialog to import gEDA/gaf schematic and PCB files.
void RestoreCommitFromHistory(const wxString &aHash)
void DoWithAcceptedFiles() override
Execute action on accepted dropped file.
void OnOpenFileInTextEditor(wxCommandEvent &event)
APP_SETTINGS_BASE * config() const override
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
void OnImportOrcadFiles(wxCommandEvent &event)
Open dialog to import an OrCAD schematic file.
const wxString PcbLegacyFileName()
void OnEditAdvancedCfg(wxCommandEvent &event)
void OnImportPcadProjectFiles(wxCommandEvent &event)
KICAD_MANAGER_FRAME(wxWindow *parent, const wxString &title, const wxPoint &pos, const wxSize &size)
bool CloseProject(bool aSave)
Closes the project, and saves it if aSave is true;.
wxString GetCurrentFileName() const override
Get the full filename + path of the currently opened file in the frame.
void ShowGitHistory()
Open the advanced Git window on its History page, run through the docked panel.
void onNotebookPageCloseRequest(wxAuiNotebookEvent &evt)
void CommonSettingsChanged(int aFlags) override
Notification event that some of the common (suite-wide) settings have changed.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void OnIdle(wxIdleEvent &event)
void PrintPrjInfo()
Prints the current working directory name and the project name on the text panel.
void OnImportDipTraceFiles(wxCommandEvent &event)
Open dialog to import DipTrace schematic and board files.
void SaveOpenJobSetsToLocalSettings(bool aIsExplicitUserSave=false)
bool LoadProject(const wxFileName &aProjectFileName)
Loads a new project.
bool m_restoredFromHistory
Set after restore to mark editors dirty.
void onNotebookPageCountChanged(wxAuiNotebookEvent &evt)
LOCAL_HISTORY_PANE * m_historyPane
void OnImportCadstarArchiveFiles(wxCommandEvent &event)
Open dialog to import CADSTAR Schematic and PCB Archive files.
void OnImportTarget3001Files(wxCommandEvent &event)
void OnCompareProjectBranches(wxCommandEvent &event)
Open DIALOG_GIT_MR_REVIEW so the user can pick two refs and review the changed-file list between them...
void SaveSettings(APP_SETTINGS_BASE *aCfg) override
Save common frame parameters to a configuration data file.
BITMAP_BUTTON * m_pcmButton
PANEL_KICAD_LAUNCHER * m_launcher
void HideTabsIfNeeded()
Hides the tabs for Editor notebook if there is only 1 page.
wxString help_name() override
std::unique_ptr< UPDATE_MANAGER > m_updateManager
std::vector< wxString > m_OpenProjects
Definition kiid.h:46
KISTATUSBAR is a wxStatusBar suitable for Kicad manager.
Definition kistatusbar.h:50
virtual void SetStatusWidths(int aSize, const int *aWidths) override
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
FACE_T
Known KIFACE implementations.
Definition kiway.h:354
@ FACE_SCH
eeschema DSO
Definition kiway.h:355
@ FACE_PCB
pcbnew DSO
Definition kiway.h:356
LOCAL_HISTORY & LocalHistory()
Return the LOCAL_HISTORY associated with this KIWAY.
Definition kiway.h:460
void EnforceSizeLimitInBackground(const wxString &aProjectPath, size_t aMaxBytes)
Run EnforceSizeLimit without a reporter on a background thread, after any running compaction.
bool EnforceSizeLimit(const wxString &aProjectPath, size_t aMaxBytes, PROGRESS_REPORTER *aReporter=nullptr)
Enforce total size limit by rebuilding trimmed history keeping newest commits whose cumulative unique...
bool TagSave(const wxString &aProjectPath, const wxString &aFileType)
Tag a manual save in the local history repository.
wxString GetHeadHash(const wxString &aProjectPath)
Return the current head commit hash.
void RegisterProjectSaver(PROJECT *aProject)
Register aProject's own files (project, rules and library tables) for history snapshots.
void WaitForPendingSave()
Block until any pending background save completes.
bool CommitFullProjectSnapshot(const wxString &aProjectPath, const wxString &aTitle)
Commit a snapshot of the entire project directory (excluding the .history directory and ignored trans...
void UnregisterSaver(const void *aSaverObject)
Unregister a previously registered saver callback.
Advisory lock over a file, taken by writing a sibling lock file and holding an exclusive lock on it f...
Definition lockfile.h:54
bool OverrideLock(bool aRemoveOnRelease=true)
Force the lock, overwriting the data that existed already.
Definition lockfile.h:188
bool Valid() const
Definition lockfile.h:224
wxString GetUsername()
Definition lockfile.h:214
wxString GetHostname()
Definition lockfile.h:220
static LOCKFILE Inspect(const wxString &aFilename)
Look at a lock without taking it: nothing is created, nothing is claimed and nothing is removed on re...
Definition lockfile.h:113
void RegisterStatusBar(KISTATUSBAR *aStatusBar)
Add a status bar for handling.
void CreateOrUpdate(const wxString &aKey, const wxString &aTitle, const wxString &aDescription, const wxString &aHref=wxEmptyString)
Create a notification with the given parameters or updates an existing one with the same key.
void Remove(const wxString &aKey)
Remove a notification by key.
void UnregisterStatusBar(KISTATUSBAR *aStatusBar)
Remove status bar from handling.
static REPORTER & GetInstance()
Definition reporter.cpp:207
void SetClosable(bool aYes)
void SetProjectTied(bool aYes)
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition pgm_base.cpp:600
void PreloadDesignBlockLibraries(KIWAY *aKiway)
Starts a background job to preload the global and project design block libraries.
Definition pgm_base.cpp:946
virtual BACKGROUND_JOBS_MONITOR & GetBackgroundJobMonitor() const
Definition pgm_base.h:130
void UnregisterLibraryLoadStatusBar(KISTATUSBAR *aStatusBar)
Unregister a status bar from receiving library load warning messages.
bool m_Quitting
Definition pgm_base.h:425
void RegisterLibraryLoadStatusBar(KISTATUSBAR *aStatusBar)
Register a status bar to receive library load warning messages.
virtual NOTIFICATIONS_MANAGER & GetNotificationsManager() const
Definition pgm_base.h:135
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition pgm_base.h:124
wxString GetHelpFileName()
Definition pgm_kicad.h:58
SEARCH_STACK & SysSearch()
Definition pgm_kicad.h:56
APP_SETTINGS_BASE * PgmSettings()
Definition pgm_kicad.h:54
bool LoadFromFile(const wxString &aDirectory="") override
Loads the backing file from disk and then calls Load()
The project local settings are things that are attached to a particular project, but also might be pa...
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
Calls Store() and then writes the contents of the JSON document to a file.
std::vector< wxString > m_OpenJobSets
Window to display the tree files.
void SetProjectLock(LOCKFILE *aLockFile)
Definition project.cpp:555
virtual void SetReadOnly(bool aReadOnly=true)
Definition project.h:161
virtual std::shared_ptr< KIGIT_COMMON > GetGitCommon() const
This project's Git session, created empty on first use.
Definition project.cpp:85
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
Definition project.cpp:271
virtual const wxString GetProjectPath() const
Return the full path of the project.
Definition project.cpp:277
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
Definition project.h:207
virtual PROJECT_FILE & GetProjectFile() const
Definition project.h:201
virtual void SetLockOverrideGranted(bool aGranted=true)
Definition project.h:165
Look for files in a number of paths.
static bool ShowNever(const SELECTION &aSelection)
Always returns false.
bool SaveProject(const wxString &aFullPath=wxEmptyString, PROJECT *aProject=nullptr)
Save a loaded project.
bool IsProjectOpen() const
Helper for checking if we have a project open.
bool UnloadProject(PROJECT *aProject, bool aSave=true)
Save, unload and unregister the given PROJECT.
std::vector< wxString > GetOpenProjects() const
bool TriggerBackupIfNeeded(REPORTER &aReporter) const
Call BackupProject() if a new backup is needed according to the current backup policy.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true, bool aOverrideLock=false)
Load a project or sets up a new project with a specified path.
TOOL_MANAGER * m_toolManager
TOOL_DISPATCHER * m_toolDispatcher
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
ACTIONS * m_actions
virtual void DispatchWxEvent(wxEvent &aEvent)
Process wxEvents (mostly UI events), translate them to TOOL_EVENTs, and make tools handle those.
Master controller class:
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
bool AskOverrideLock(wxWindow *aParent, const wxString &aMessage)
Display a dialog indicating the file is already open, with an option to reset the lock.
Definition confirm.cpp:38
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:217
This file is part of the common library.
#define KICAD_MESSAGE_DIALOG
Definition confirm.h:48
#define ENABLE(x)
#define _(s)
Base window classes and related definitions.
#define KICAD_DEFAULT_DRAWFRAME_STYLE
#define KICAD_MANAGER_FRAME_NAME
EVT_MENU_RANGE(ID_GERBVIEW_DRILL_FILE1, ID_GERBVIEW_DRILL_FILEMAX, GERBVIEW_FRAME::OnDrlFileHistory) EVT_MENU_RANGE(ID_GERBVIEW_ZIP_FILE1
KiCad executable names.
const wxString GERBVIEW_EXE
@ FRAME_PCB_EDITOR
Definition frame_type.h:38
@ FRAME_SCH
Definition frame_type.h:30
@ KICAD_MAIN_FRAME_T
Definition frame_type.h:67
wxString FindKicadFile(const wxString &shortname)
Search the executable file shortname in KiCad binary path and return full file name if found or short...
Definition gestfich.cpp:72
static const std::string LegacySchematicFileExtension
static const std::string GerberJobFileExtension
static const std::string GerberFileExtension
static const std::string ProjectFileExtension
static const std::string LegacyPcbFileExtension
static const std::string LegacyProjectFileExtension
static const std::string KiCadSchematicFileExtension
static const std::string DrillFileExtension
static const std::string KiCadPcbFileExtension
static wxString AllFilesWildcard()
static bool IsGerberFileExtension(const wxString &ext)
@ ID_FILE_LIST_CLEAR
Definition id.h:58
@ ID_FILEMAX
Definition id.h:56
@ ID_FILE1
Definition id.h:55
PGM_KICAD & PgmTop()
Definition kicad.cpp:96
@ ID_IMPORT_EASYPC_PROJECT
Definition kicad_id.h:44
@ ID_EDIT_ADVANCED_CFG
Definition kicad_id.h:34
@ ID_IMPORT_DIPTRACE_PROJECT
Definition kicad_id.h:43
@ ID_IMPORT_EAGLE_PROJECT
Definition kicad_id.h:36
@ ID_IMPORT_EASYEDAPRO_PROJECT
Definition kicad_id.h:38
@ ID_IMPORT_PADS_PROJECT
Definition kicad_id.h:40
@ ID_IMPORT_GEDA_PROJECT
Definition kicad_id.h:42
@ ID_IMPORT_PCAD_PROJECT
Definition kicad_id.h:41
@ ID_IMPORT_CADSTAR_ARCHIVE_PROJECT
Definition kicad_id.h:35
@ ID_EDIT_LOCAL_FILE_IN_TEXT_EDITOR
Definition kicad_id.h:33
@ ID_IMPORT_ORCAD_PROJECT
Definition kicad_id.h:46
@ ID_IMPORT_EASYEDA_PROJECT
Definition kicad_id.h:37
@ ID_IMPORT_ALTIUM_PROJECT
Definition kicad_id.h:39
@ ID_COMPARE_PROJECT_BRANCHES
Definition kicad_id.h:47
@ ID_IMPORT_TARGET3001_PROJECT
Definition kicad_id.h:45
EVT_MENU(ID_COMPARE_PROJECT_BRANCHES, KICAD_MANAGER_FRAME::OnCompareProjectBranches) KICAD_MANAGER_FRAME
#define EDITORS_CAPTION
#define ID_INIT_WATCHED_PATHS
#define PROJECT_FILES_CAPTION
std::vector< wxString > CompareBranchRefs(git_repository *aRepo)
Refs to offer when comparing branches, base first and head second.
void SetShutdownBlockReason(wxWindow *aWindow, const wxString &aReason)
Sets the block reason why the window/application is preventing OS shutdown.
Definition unix/app.cpp:108
void RemoveShutdownBlockReason(wxWindow *aWindow)
Removes any shutdown block reason set.
Definition unix/app.cpp:103
bool RegisterApplicationRestart(const wxString &aCommandLine)
Registers the application for restart with the OS with the given command line string to pass as args.
Definition unix/app.cpp:83
void AddToRecentDocs(const wxString &aPath)
PBOOL GetPolicyBool(const wxString &aKey)
void AllowNetworkFileSystems(wxDialog *aDialog)
Configure a file dialog to show network and virtual file systems.
Definition wxgtk/ui.cpp:741
KICOMMON_API wxFont GetStatusFont(wxWindow *aWindow)
KICOMMON_API wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...
Definition ui_common.cpp:80
#define SEXPR_BOARD_FILE_VERSION
Current s-expression file format version. 2 was the last legacy format version.
PGM_BASE & Pgm()
The global program "get" accessor.
#define POLICY_KEY_PCM
Definition policy_keys.h:27
#define SEXPR_SCHEMATIC_FILE_VERSION
Schematic file version.
T * GetToolbarSettings(const wxString &aFilename)
KIWAY Kiway(KFCTL_STANDALONE)
std::vector< FAB_LAYER_COLOR > dummy
Functors that can be used to figure out how the action controls should be displayed in the UI and if ...
ACTION_CONDITIONS & Enable(const SELECTION_CONDITION &aCondition)
unsigned long long limit_total_size
Maximum total size of backups (bytes), 0 for unlimited.
std::shared_ptr< JOBS_OUTPUT_HANDLER > m_outputHandler
Definition jobset.h:137
Implement a participant in the KIWAY alchemy.
Definition kiway.h:153
IFACE KIFACE_BASE kiface("pcb_test_frame", KIWAY::FACE_PCB)
IbisParser parser & reporter
#define ENVVARS_CHANGED
Functions to provide common constants and other functions to assist in making a consistent UI.
Definition of file extensions used in Kicad.
#define PR_NO_ABORT