Keep Board Setup in front when called from DRC dialog.

This commit is contained in:
Jeff Young 2025-09-11 15:46:45 +01:00
parent 9b006c4f3b
commit 18b56539a6
5 changed files with 10 additions and 9 deletions

View File

@ -55,8 +55,8 @@
#define RESOLVE_PAGE( T, pageIndex ) static_cast<T*>( m_treebook->ResolvePage( pageIndex ) ) #define RESOLVE_PAGE( T, pageIndex ) static_cast<T*>( m_treebook->ResolvePage( pageIndex ) )
DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) : DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame, wxWindow* aParent ) :
PAGED_DIALOG( aFrame, _( "Board Setup" ), false, false, PAGED_DIALOG( aParent ? aParent : aFrame, _( "Board Setup" ), false, false,
_( "Import Settings from Another Board..." ), wxSize( 980, 600 ) ), _( "Import Settings from Another Board..." ), wxSize( 980, 600 ) ),
m_frame( aFrame ), m_frame( aFrame ),
m_layers( nullptr ), m_layers( nullptr ),

View File

@ -42,7 +42,7 @@ class PANEL_TEXT_VARIABLES;
class DIALOG_BOARD_SETUP : public PAGED_DIALOG class DIALOG_BOARD_SETUP : public PAGED_DIALOG
{ {
public: public:
DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ); DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame, wxWindow* aWindow = nullptr );
~DIALOG_BOARD_SETUP(); ~DIALOG_BOARD_SETUP();
protected: protected:

View File

@ -303,7 +303,7 @@ void DIALOG_DRC::OnMenu( wxCommandEvent& event )
void DIALOG_DRC::OnErrorLinkClicked( wxHtmlLinkEvent& event ) void DIALOG_DRC::OnErrorLinkClicked( wxHtmlLinkEvent& event )
{ {
m_frame->ShowBoardSetupDialog( _( "Custom Rules" ) ); m_frame->ShowBoardSetupDialog( _( "Custom Rules" ), this );
} }
@ -993,7 +993,7 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent )
} }
case ID_EDIT_SEVERITIES: case ID_EDIT_SEVERITIES:
m_frame->ShowBoardSetupDialog( _( "Violation Severity" ) ); m_frame->ShowBoardSetupDialog( _( "Violation Severity" ), this );
break; break;
} }
@ -1035,7 +1035,7 @@ void DIALOG_DRC::OnIgnoredItemRClick( wxListEvent& event )
void DIALOG_DRC::OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) void DIALOG_DRC::OnEditViolationSeverities( wxHyperlinkEvent& aEvent )
{ {
m_frame->ShowBoardSetupDialog( _( "Violation Severity" ) ); m_frame->ShowBoardSetupDialog( _( "Violation Severity" ), this );
} }

View File

@ -109,6 +109,7 @@
#include <widgets/pcb_net_inspector_panel.h> #include <widgets/pcb_net_inspector_panel.h>
#include <widgets/wx_aui_utils.h> #include <widgets/wx_aui_utils.h>
#include <kiplatform/app.h> #include <kiplatform/app.h>
#include <kiplatform/ui.h>
#include <core/profile.h> #include <core/profile.h>
#include <math/box2_minmax.h> #include <math/box2_minmax.h>
#include <view/wx_view_controls.h> #include <view/wx_view_controls.h>
@ -1466,7 +1467,7 @@ void PCB_EDIT_FRAME::ActivateGalCanvas()
} }
void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage ) void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage, wxWindow* aParent )
{ {
static std::mutex dialogMutex; // Local static mutex static std::mutex dialogMutex; // Local static mutex
@ -1486,7 +1487,7 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage )
// Make sure everything's up-to-date // Make sure everything's up-to-date
GetBoard()->BuildListOfNets(); GetBoard()->BuildListOfNets();
DIALOG_BOARD_SETUP dlg( this ); DIALOG_BOARD_SETUP dlg( this, aParent );
if( !aInitialPage.IsEmpty() ) if( !aInitialPage.IsEmpty() )
dlg.SetInitialPage( aInitialPage, wxEmptyString ); dlg.SetInitialPage( aInitialPage, wxEmptyString );

View File

@ -301,7 +301,7 @@ public:
///< @copydoc EDA_DRAW_FRAME::UseGalCanvas() ///< @copydoc EDA_DRAW_FRAME::UseGalCanvas()
void ActivateGalCanvas() override; void ActivateGalCanvas() override;
void ShowBoardSetupDialog( const wxString& aInitialPage = wxEmptyString ); void ShowBoardSetupDialog( const wxString& aInitialPage = wxEmptyString, wxWindow* aParent = nullptr );
void PrepareLayerIndicator( bool aForceRebuild = false ); void PrepareLayerIndicator( bool aForceRebuild = false );