From 62c5a706d53755f91612e062db9c3c54deebf7e8 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 31 Mar 2018 10:46:52 +0200 Subject: [PATCH] DIALOG_GRAPHIC_ITEM_PROPERTIES: fix a not very understandable error message (especially when Dwgs.User layer is disabled). Rename the method PCB_LAYER_BOX_SELECTOR::SetLayerSet to the better name SetNotAllowedLayerSet --- pcbnew/dialogs/dialog_edit_footprint_text.cpp | 2 +- pcbnew/dialogs/dialog_graphic_item_properties.cpp | 10 ++++++---- .../dialog_graphic_item_properties_for_fp_editor.cpp | 2 +- pcbnew/dialogs/dialog_pcb_text_properties.cpp | 2 +- pcbnew/dialogs/dialog_track_via_properties.cpp | 6 +++--- pcbnew/dimension.cpp | 2 +- pcbnew/import_dxf/dialog_dxf_import.cpp | 2 +- pcbnew/pcb_layer_box_selector.h | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/pcbnew/dialogs/dialog_edit_footprint_text.cpp b/pcbnew/dialogs/dialog_edit_footprint_text.cpp index 1c99bf7d2c..e7fa974ffc 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_text.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_text.cpp @@ -195,7 +195,7 @@ bool DIALOG_EDIT_FPTEXT::TransferDataToWindow() m_LayerSelectionCtrl->ShowNonActivatedLayers( true ); m_LayerSelectionCtrl->SetLayersHotkeys( false ); - m_LayerSelectionCtrl->SetLayerSet( forbiddenLayers ); + m_LayerSelectionCtrl->SetNotAllowedLayerSet( forbiddenLayers ); m_LayerSelectionCtrl->SetBoardFrame( m_boardEditor ); m_LayerSelectionCtrl->Resync(); diff --git a/pcbnew/dialogs/dialog_graphic_item_properties.cpp b/pcbnew/dialogs/dialog_graphic_item_properties.cpp index aa30d5aecc..a543a75533 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties.cpp @@ -204,15 +204,17 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow() // Configure the layers list selector m_LayerSelectionCtrl->SetLayersHotkeys( false ); - m_LayerSelectionCtrl->SetLayerSet( LSET::AllCuMask() ); + m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::AllCuMask() ); m_LayerSelectionCtrl->SetBoardFrame( m_parent ); m_LayerSelectionCtrl->Resync(); if( m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ) < 0 ) { - wxMessageBox( _( "This item was on an unknown layer.\n" - "It has been moved to the drawings layer. Please fix it." ) ); - m_LayerSelectionCtrl->SetLayerSelection( Dwgs_User ); + wxMessageBox( _( "This item was on a not allowed or non existing layer.\n" + "It has been moved to the first allowed layer.\n\n" + "Please fix it." ) ); + //m_LayerSelectionCtrl->SetLayerSelection( Dwgs_User ); + m_LayerSelectionCtrl->SetSelection( 0 ); } return DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataToWindow(); diff --git a/pcbnew/dialogs/dialog_graphic_item_properties_for_fp_editor.cpp b/pcbnew/dialogs/dialog_graphic_item_properties_for_fp_editor.cpp index 19ce9d8755..4c13248b0e 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties_for_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties_for_fp_editor.cpp @@ -199,7 +199,7 @@ bool DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::TransferDataToWindow() // Configure the layers list selector m_LayerSelectionCtrl->SetLayersHotkeys( false ); - m_LayerSelectionCtrl->SetLayerSet( LSET::InternalCuMask().set( Edge_Cuts ) ); + m_LayerSelectionCtrl->SetNotAllowedLayerSet( LSET::InternalCuMask().set( Edge_Cuts ) ); m_LayerSelectionCtrl->SetBoardFrame( m_parent ); m_LayerSelectionCtrl->Resync(); diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.cpp b/pcbnew/dialogs/dialog_pcb_text_properties.cpp index d4ea081021..e1b021ab74 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties.cpp @@ -185,7 +185,7 @@ bool DIALOG_PCB_TEXT_PROPERTIES::TransferDataToWindow() m_LayerSelectionCtrl->SetLayersHotkeys( false ); // A text has no sense on edge cut layer - m_LayerSelectionCtrl->SetLayerSet( Edge_Cuts ); + m_LayerSelectionCtrl->SetNotAllowedLayerSet( Edge_Cuts ); m_LayerSelectionCtrl->SetBoardFrame( m_Parent ); m_LayerSelectionCtrl->Resync(); m_LayerSelectionCtrl->SetLayerSelection( m_SelectedPCBText->GetLayer() ); diff --git a/pcbnew/dialogs/dialog_track_via_properties.cpp b/pcbnew/dialogs/dialog_track_via_properties.cpp index d1b8a13cfb..6bb032c339 100644 --- a/pcbnew/dialogs/dialog_track_via_properties.cpp +++ b/pcbnew/dialogs/dialog_track_via_properties.cpp @@ -248,11 +248,11 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen m_ViaStartLayer->SetLayersHotkeys( false ); - m_ViaStartLayer->SetLayerSet( LSET::AllNonCuMask() ); + m_ViaStartLayer->SetNotAllowedLayerSet( LSET::AllNonCuMask() ); m_ViaStartLayer->SetBoardFrame( aParent ); m_ViaStartLayer->Resync(); m_ViaEndLayer->SetLayersHotkeys( false ); - m_ViaEndLayer->SetLayerSet( LSET::AllNonCuMask() ); + m_ViaEndLayer->SetNotAllowedLayerSet( LSET::AllNonCuMask() ); m_ViaEndLayer->SetBoardFrame( aParent ); m_ViaEndLayer->Resync(); @@ -291,7 +291,7 @@ DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParen } m_TrackLayerCtrl->SetLayersHotkeys( false ); - m_TrackLayerCtrl->SetLayerSet( LSET::AllNonCuMask() ); + m_TrackLayerCtrl->SetNotAllowedLayerSet( LSET::AllNonCuMask() ); m_TrackLayerCtrl->SetBoardFrame( aParent ); m_TrackLayerCtrl->Resync(); diff --git a/pcbnew/dimension.cpp b/pcbnew/dimension.cpp index 617f75f904..2178bf74ee 100644 --- a/pcbnew/dimension.cpp +++ b/pcbnew/dimension.cpp @@ -141,7 +141,7 @@ DIALOG_DIMENSION_EDITOR::DIALOG_DIMENSION_EDITOR( PCB_EDIT_FRAME* aParent, m_SelLayerBox->ShowNonActivatedLayers( true ); m_SelLayerBox->SetLayersHotkeys( false ); - m_SelLayerBox->SetLayerSet( LSET::AllCuMask().set( Edge_Cuts ) ); + m_SelLayerBox->SetNotAllowedLayerSet( LSET::AllCuMask().set( Edge_Cuts ) ); m_SelLayerBox->SetBoardFrame( m_parent ); m_SelLayerBox->Resync(); diff --git a/pcbnew/import_dxf/dialog_dxf_import.cpp b/pcbnew/import_dxf/dialog_dxf_import.cpp index 5683bddc9a..3fb210c2cb 100644 --- a/pcbnew/import_dxf/dialog_dxf_import.cpp +++ b/pcbnew/import_dxf/dialog_dxf_import.cpp @@ -93,7 +93,7 @@ DIALOG_DXF_IMPORT::DIALOG_DXF_IMPORT( PCB_BASE_FRAME* aParent, bool aImportAsFoo // Configure the layers list selector m_SelLayerBox->SetLayersHotkeys( false ); // Do not display hotkeys - m_SelLayerBox->SetLayerSet( LSET::AllCuMask() ); // Do not use copper layers + m_SelLayerBox->SetNotAllowedLayerSet( LSET::AllCuMask() ); // Do not use copper layers m_SelLayerBox->SetBoardFrame( m_parent ); m_SelLayerBox->Resync(); diff --git a/pcbnew/pcb_layer_box_selector.h b/pcbnew/pcb_layer_box_selector.h index 1fb84bfcb9..68a4ea0094 100644 --- a/pcbnew/pcb_layer_box_selector.h +++ b/pcbnew/pcb_layer_box_selector.h @@ -72,7 +72,7 @@ public: // SetLayerSet allows disableing some layers, which are not // shown in list - void SetLayerSet( LSET aMask ) { m_layerMaskDisable = aMask; } + void SetNotAllowedLayerSet( LSET aMask ) { m_layerMaskDisable = aMask; } // Reload the Layers names and bitmaps // Virtual function