diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index f12ceb8ff6..116664aa30 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -316,7 +316,7 @@ bool TOOL_MANAGER::RunAction( const std::string& aActionName, bool aNow, void* a return true; } - wxASSERT_MSG( action != NULL, wxString::Format( _( "Could not find action %s." ), aActionName ) ); + wxASSERT_MSG( action != NULL, wxString::Format( wxT( "Could not find action %s." ), aActionName ) ); return false; } diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index 25ff081b6c..880151ccc0 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -151,7 +151,16 @@ bool TRACKS_CLEANER::CleanupBoard( PCB_EDIT_FRAME *aFrame, modified |= (aMergeSegments && clean_segments()); // Delete dangling tracks - modified |= (aDeleteUnconnected && deleteUnconnectedTracks()); + if( aDeleteUnconnected && deleteUnconnectedTracks() ) + { + modified = true ; + + // Removed tracks can leave aligned segments + // (when a T was formed by tracks and the "vertical" segment + // is removed; + if( aMergeSegments ) + clean_segments(); + } if( modified ) { @@ -161,6 +170,7 @@ bool TRACKS_CLEANER::CleanupBoard( PCB_EDIT_FRAME *aFrame, aFrame->Compile_Ratsnest( NULL, true ); aFrame->OnModify(); } + return modified; } @@ -515,6 +525,7 @@ bool TRACKS_CLEANER::clean_segments() // merge collinear segments: TRACK *nextsegment; + for( TRACK *segment = m_Brd->m_Track; segment; segment = nextsegment ) { nextsegment = segment->Next(); @@ -522,10 +533,12 @@ bool TRACKS_CLEANER::clean_segments() if( segment->Type() == PCB_TRACE_T ) { bool merged_this = merge_collinear_of_track( segment ); - modified |= merged_this; if( merged_this ) // The current segment was modified, retry to merge it again + { nextsegment = segment->Next(); + modified = true; + } } } diff --git a/pcbnew/dialogs/dialog_gen_module_position_file_base.cpp b/pcbnew/dialogs/dialog_gen_module_position_file_base.cpp index 91777ae048..ad4668ee38 100644 --- a/pcbnew/dialogs/dialog_gen_module_position_file_base.cpp +++ b/pcbnew/dialogs/dialog_gen_module_position_file_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -101,20 +101,14 @@ DIALOG_GEN_MODULE_POSITION_BASE::DIALOG_GEN_MODULE_POSITION_BASE( wxWindow* pare this->Centre( wxBOTH ); // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnClose ) ); - this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnInitDialog ) ); m_browseButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); - m_sdbSizerButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnCancelButton ), NULL, this ); m_sdbSizerButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnOKButton ), NULL, this ); } DIALOG_GEN_MODULE_POSITION_BASE::~DIALOG_GEN_MODULE_POSITION_BASE() { // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnClose ) ); - this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnInitDialog ) ); m_browseButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnOutputDirectoryBrowseClicked ), NULL, this ); - m_sdbSizerButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnCancelButton ), NULL, this ); m_sdbSizerButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_GEN_MODULE_POSITION_BASE::OnOKButton ), NULL, this ); } diff --git a/pcbnew/dialogs/dialog_gen_module_position_file_base.fbp b/pcbnew/dialogs/dialog_gen_module_position_file_base.fbp index 33e9efaa77..d5110218b0 100644 --- a/pcbnew/dialogs/dialog_gen_module_position_file_base.fbp +++ b/pcbnew/dialogs/dialog_gen_module_position_file_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 1 0 @@ -59,13 +61,13 @@ - OnClose + - OnInitDialog + @@ -236,7 +238,7 @@ 0 - 0 + 0 350,-1 @@ -714,7 +716,7 @@ 0 - 0 + 0 -1,150 @@ -789,7 +791,7 @@ m_sdbSizerButtons protected - OnCancelButton + diff --git a/pcbnew/dialogs/dialog_gen_module_position_file_base.h b/pcbnew/dialogs/dialog_gen_module_position_file_base.h index 372ef1ab20..5207316ed3 100644 --- a/pcbnew/dialogs/dialog_gen_module_position_file_base.h +++ b/pcbnew/dialogs/dialog_gen_module_position_file_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Jun 5 2014) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,8 @@ #include #include #include +class DIALOG_SHIM; + #include "dialog_shim.h" #include #include @@ -48,10 +50,7 @@ class DIALOG_GEN_MODULE_POSITION_BASE : public DIALOG_SHIM wxButton* m_sdbSizerButtonsCancel; // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnInitDialog( wxInitDialogEvent& event ) { event.Skip(); } virtual void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelButton( wxCommandEvent& event ) { event.Skip(); } virtual void OnOKButton( wxCommandEvent& event ) { event.Skip(); } diff --git a/pcbnew/exporters/gen_modules_placefile.cpp b/pcbnew/exporters/gen_modules_placefile.cpp index f2ed9a44d3..51f2202dbb 100644 --- a/pcbnew/exporters/gen_modules_placefile.cpp +++ b/pcbnew/exporters/gen_modules_placefile.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include /* @@ -70,6 +71,9 @@ * ## End */ +#define PLACEFILE_UNITS_KEY wxT( "PlaceFileUnits" ) +#define PLACEFILE_OPT_KEY wxT( "PlaceFileOpts" ) + class LIST_MOD // An helper class used to build a list of useful footprints. { @@ -93,21 +97,22 @@ public: m_parent( aParent ), m_plotOpts( aParent->GetPlotSettings() ) { + initDialog(); + + GetSizer()->SetSizeHints(this); + Centre(); } private: PCB_EDIT_FRAME* m_parent; PCB_PLOT_PARAMS m_plotOpts; + wxConfigBase* m_config; static int m_unitsOpt; static int m_fileOpt; - void OnInitDialog( wxInitDialogEvent& event ); + void initDialog(); void OnOutputDirectoryBrowseClicked( wxCommandEvent& event ); - void OnCancelButton( wxCommandEvent& event ) - { - EndModal( wxID_CANCEL ); - } void OnOKButton( wxCommandEvent& event ); bool CreateFiles(); @@ -149,16 +154,18 @@ int DIALOG_GEN_MODULE_POSITION::m_fileOpt = 0; const wxString frontSideName = wxT( "top" ); const wxString backSideName = wxT( "bottom" ); -void DIALOG_GEN_MODULE_POSITION::OnInitDialog( wxInitDialogEvent& event ) +void DIALOG_GEN_MODULE_POSITION::initDialog() { + m_config = Kiface().KifaceSettings(); + m_config->Read( PLACEFILE_UNITS_KEY, &m_unitsOpt, 1 ); + m_config->Read( PLACEFILE_OPT_KEY, &m_fileOpt, 0 ); + // Output directory m_outputDirectoryName->SetValue( m_plotOpts.GetOutputDirectory() ); m_radioBoxUnits->SetSelection( m_unitsOpt ); m_radioBoxFilesCount->SetSelection( m_fileOpt ); m_sdbSizerButtonsOK->SetDefault(); - GetSizer()->SetSizeHints(this); - Centre(); } void DIALOG_GEN_MODULE_POSITION::OnOutputDirectoryBrowseClicked( wxCommandEvent& event ) @@ -196,6 +203,9 @@ void DIALOG_GEN_MODULE_POSITION::OnOKButton( wxCommandEvent& event ) m_unitsOpt = m_radioBoxUnits->GetSelection(); m_fileOpt = m_radioBoxFilesCount->GetSelection(); + m_config->Write( PLACEFILE_UNITS_KEY, m_unitsOpt ); + m_config->Write( PLACEFILE_OPT_KEY, m_fileOpt ); + // Set output directory and replace backslashes with forward ones // (Keep unix convention in cfg files) wxString dirStr; diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index bbce5510ad..1f20f2f52c 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -582,12 +582,6 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem ) if( !m_editModules ) { - if( aItem->Type() == PCB_PAD_T && module->GetPadCount() == 1 ) - { - DisplayError( getEditFrame(), _( "Cannot delete the only remaining pad of the module (modules on PCB must have at least one pad)." ) ); - return; - } - getView()->Remove( aItem ); board->Remove( aItem ); }