Commit 26c320db authored by Chris Pavlina's avatar Chris Pavlina Committed by Wayne Stambaugh

Add schematic component library change rescue feature (fixes lp:1435338).

* Add code to test if any of the components in the schematic cache have been changed
  in the component libraries.
* Prompt user to accept or reject components when changes are found.
* If the user chooses to use the components in the cache, create a new library with the old
  components and add it to the beginning of the component library list so the schematic will
  not be changed.
* Create dialogs to handle user feedback and status.
parent ad9ec412
......@@ -93,12 +93,19 @@ const wxString PROJECT::GetProjectFullName() const
return m_project_name.GetFullPath();
}
const wxString PROJECT::GetProjectPath() const
{
return m_project_name.GetPathWithSep();
}
const wxString PROJECT::GetProjectName() const
{
return m_project_name.GetName();
}
const wxString PROJECT::FootprintLibTblName() const
{
wxFileName fn = GetProjectFullName();
......
......@@ -63,6 +63,10 @@ set( EESCHEMA_DLGS
dialogs/dialog_plot_schematic.cpp
dialogs/dialog_print_using_printer_base.cpp
dialogs/dialog_print_using_printer.cpp
dialogs/dialog_rescue_each.cpp
dialogs/dialog_rescue_each_base.cpp
dialogs/dialog_rescue_summary.cpp
dialogs/dialog_rescue_summary_base.cpp
dialogs/dialog_sch_edit_sheet_pin.cpp
dialogs/dialog_sch_edit_sheet_pin_base.cpp
dialogs/dialog_sch_sheet_props.cpp
......@@ -111,6 +115,7 @@ set( EESCHEMA_SRCS
libedit_undo_redo.cpp
lib_arc.cpp
lib_bezier.cpp
lib_cache_rescue.cpp
lib_circle.cpp
lib_collectors.cpp
lib_draw_item.cpp
......
......@@ -628,6 +628,65 @@ LIB_PIN* LIB_PART::GetPin( const wxString& aNumber, int aUnit, int aConvert )
}
bool LIB_PART::PinsConflictWith( LIB_PART& aOtherPart, bool aTestNums, bool aTestNames,
bool aTestType, bool aTestOrientation, bool aTestLength )
{
LIB_PINS thisPinList;
GetPins( thisPinList, /* aUnit */ 0, /* aConvert */ 0 );
BOOST_FOREACH( LIB_PIN* eachThisPin, thisPinList )
{
wxASSERT( eachThisPin );
LIB_PINS otherPinList;
aOtherPart.GetPins( otherPinList, /* aUnit */ 0, /* aConvert */ 0 );
bool foundMatch = false;
BOOST_FOREACH( LIB_PIN* eachOtherPin, otherPinList )
{
wxASSERT( eachOtherPin );
// Same position?
if( eachThisPin->GetPosition() != eachOtherPin->GetPosition() )
continue;
// Same number?
wxString eachThisPinNumber, eachOtherPinNumber;
eachThisPin->PinStringNum( eachThisPinNumber );
eachOtherPin->PinStringNum( eachOtherPinNumber );
if( aTestNums && ( eachThisPinNumber != eachOtherPinNumber ))
continue;
// Same name?
if( aTestNames && ( eachThisPin->GetName() != eachOtherPin->GetName() ))
continue;
// Same electrical type?
if( aTestType && ( eachThisPin->GetType() != eachOtherPin->GetType() ))
continue;
// Same orientation?
if( aTestOrientation && ( eachThisPin->GetOrientation() != eachOtherPin->GetOrientation() ))
continue;
// Same length?
if( aTestLength && ( eachThisPin->GetLength() != eachOtherPin->GetLength() ))
continue;
foundMatch = true;
}
if( !foundMatch )
{
// This means there was not an identical (according to the arguments)
// pin at the same position in the other component.
return true;
}
}
// The loop never gave up, so no conflicts were found.
return false;
}
bool LIB_PART::Save( OUTPUTFORMATTER& aFormatter )
{
LIB_FIELD& value = GetValueField();
......
......@@ -522,6 +522,22 @@ public:
*/
LIB_PIN* GetPin( const wxString& aNumber, int aUnit = 0, int aConvert = 0 );
/**
* Function PinsConflictWith
* returns true if this part's pins do not match another part's pins. This
* is used to detect whether the project cache is out of sync with the
* system libs.
*
* @param aOtherPart - The other library part to test
* @param aTestNums - Whether two pins at the same point must have the same number.
* @param aTestNames - Whether two pins at the same point must have the same name.
* @param aTestType - Whether two pins at the same point must have the same electrical type.
* @param aTestOrientation - Whether two pins at the same point must have the same orientation.
* @param aTestLength - Whether two pins at the same point must have the same length.
*/
bool PinsConflictWith( LIB_PART& aOtherPart, bool aTestNums, bool aTestNames,
bool aTestType, bool aTestOrientation, bool aTestLength );
/**
* Move the part \a aOffset.
*
......
......@@ -38,6 +38,7 @@
#include <richio.h>
#include <config_params.h>
#include <wildcards_and_files_ext.h>
#include <lib_cache_rescue.h>
//#include <richio.h>
#include <general.h>
......@@ -924,7 +925,7 @@ wxArrayString PART_LIBS::GetLibraryNames( bool aSorted )
}
LIB_PART* PART_LIBS::FindLibPart( const wxString& aName, const wxString& aLibraryName )
LIB_PART* PART_LIBS::FindLibPart( const wxString& aPartName, const wxString& aLibraryName )
{
LIB_PART* part = NULL;
......@@ -933,7 +934,7 @@ LIB_PART* PART_LIBS::FindLibPart( const wxString& aName, const wxString& aLibrar
if( !aLibraryName.IsEmpty() && lib.GetName() != aLibraryName )
continue;
part = lib.FindPart( aName );
part = lib.FindPart( aPartName );
if( part )
break;
......@@ -943,7 +944,7 @@ LIB_PART* PART_LIBS::FindLibPart( const wxString& aName, const wxString& aLibrar
}
LIB_ALIAS* PART_LIBS::FindLibraryEntry( const wxString& aName, const wxString& aLibraryName )
LIB_ALIAS* PART_LIBS::FindLibraryEntry( const wxString& aEntryName, const wxString& aLibraryName )
{
LIB_ALIAS* entry = NULL;
......@@ -952,7 +953,7 @@ LIB_ALIAS* PART_LIBS::FindLibraryEntry( const wxString& aName, const wxString& a
if( !!aLibraryName && lib.GetName() != aLibraryName )
continue;
entry = lib.FindEntry( aName );
entry = lib.FindEntry( aEntryName );
if( entry )
break;
......@@ -961,6 +962,17 @@ LIB_ALIAS* PART_LIBS::FindLibraryEntry( const wxString& aName, const wxString& a
return entry;
}
void PART_LIBS::FindLibraryEntries( const wxString& aEntryName, std::vector<LIB_ALIAS*>& aEntries )
{
BOOST_FOREACH( PART_LIB& lib, *this )
{
LIB_ALIAS* entry = lib.FindEntry( aEntryName );
if( entry )
aEntries.push_back( entry );
}
}
/* searches all libraries in the list for an entry, using a case insensitive comparison.
* Used to find an entry, when the normal (case sensitive) search fails.
*/
......@@ -1162,12 +1174,15 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR, boost::ba
// add the special cache library.
wxString cache_name = CacheName( aProject->GetProjectFullName() );
PART_LIB* cache_lib;
if( !!cache_name )
{
try
{
if( PART_LIB* lib = AddLibrary( cache_name ) )
lib->SetCache();
cache_lib = AddLibrary( cache_name );
if( cache_lib )
cache_lib->SetCache();
}
catch( const IO_ERROR& ioe )
{
......
......@@ -301,6 +301,15 @@ public:
LIB_ALIAS* FindLibraryEntry( const wxString& aEntryName,
const wxString& aLibraryName = wxEmptyString );
/**
* Function FindLibraryEntries
* searches all libraries in the list for an entry, returns all matches.
*
* @param aEntryName - Name of entry to search for (case sensitive).
* @param aEntries - a std::vector to store entries
*/
void FindLibraryEntries( const wxString& aEntryName, std::vector<LIB_ALIAS*>& aEntries );
/**
* Function FindLibraryNearEntries
* Searches all libraries in the list for an entry, using a case insensitive comparison.
......
......@@ -44,7 +44,7 @@
<property name="minimum_size"></property>
<property name="name">DIALOG_ANNOTATE_BASE</property>
<property name="pos"></property>
<property name="size">432,550</property>
<property name="size">-1,-1</property>
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
<property name="title">Annotate Schematic</property>
......
......@@ -33,6 +33,7 @@
#include <gestfich.h>
#include <schframe.h>
#include <invoke_sch_dialog.h>
#include <kiface_i.h>
#include <general.h>
#include <netlist.h>
......@@ -54,6 +55,7 @@ public:
wxString* aCallersProjectSpecificLibPaths, wxArrayString* aCallersLibNames );
private:
wxConfigBase* m_config;
wxString* m_callers_project_specific_lib_paths;
wxArrayString* m_callers_lib_names;
......@@ -124,6 +126,12 @@ DIALOG_EESCHEMA_CONFIG::DIALOG_EESCHEMA_CONFIG( wxWindow* aParent,
if( libpaths->GetCount() > 1 )
m_DefaultLibraryPathslistBox->Select( 1 );
// Load setting for cache rescue
m_config = Kiface().KifaceSettings();
bool rescueNeverShow = false;
m_config->Read( wxT("RescueNeverShow"), &rescueNeverShow, false );
m_cbRescue->SetValue( !rescueNeverShow );
wxString msg = wxString::Format( _(
"Project '%s'" ),
GetChars( Prj().GetProjectFullName() )
......@@ -241,6 +249,8 @@ void DIALOG_EESCHEMA_CONFIG::OnOkClick( wxCommandEvent& event )
*m_callers_lib_names = list;
}
m_config->Write( wxT("RescueNeverShow"), ! m_cbRescue->GetValue() );
EndModal( wxID_OK );
}
......
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 5 2013)
// C++ code generated with wxFormBuilder (version Mar 13 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -120,6 +120,9 @@ DIALOG_EESCHEMA_CONFIG_FBP::DIALOG_EESCHEMA_CONFIG_FBP( wxWindow* parent, wxWind
m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bMainSizer->Add( m_staticline3, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_cbRescue = new wxCheckBox( this, wxID_ANY, _("Check for cache/library conflicts at schematic load"), wxDefaultPosition, wxDefaultSize, 0 );
bMainSizer->Add( m_cbRescue, 0, wxALL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
......
This source diff could not be displayed because it is too large. You can view the blob instead.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Nov 5 2013)
// C++ code generated with wxFormBuilder (version Mar 13 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
......@@ -24,6 +24,7 @@ class DIALOG_SHIM;
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/checkbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
......@@ -60,6 +61,7 @@ class DIALOG_EESCHEMA_CONFIG_FBP : public DIALOG_SHIM
wxStaticText* m_staticTextPathlist;
wxListBox* m_DefaultLibraryPathslistBox;
wxStaticLine* m_staticline3;
wxCheckBox* m_cbRescue;
// Virtual event handlers, overide them in your derived class
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
......
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Chris Pavlina <pavlina.chris@gmail.com>
* Copyright (C) 2015 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <schframe.h>
#include <sch_component.h>
#include <invoke_sch_dialog.h>
#include <dialog_rescue_each_base.h>
#include <kiface_i.h>
#include <class_library.h>
#include <class_libentry.h>
#include <set>
#include <vector>
#include <boost/foreach.hpp>
#include <lib_cache_rescue.h>
class DIALOG_RESCUE_EACH: public DIALOG_RESCUE_EACH_BASE
{
public:
/**
* Constructor
* This dialog asks the user which rescuable, cached parts he wants to rescue.
* Any rejects will be pruned from aCandidates.
* @param aCaller - the SCH_EDIT_FRAME calling this
* @param aCandidates - the list of RESCUE_CANDIDATES
* @param aComponents - a vector of all the components in the schematic
* @param aAskShowAgain - if true, a "Never Show Again" button will be included
*/
DIALOG_RESCUE_EACH( SCH_EDIT_FRAME* aParent, std::vector<RESCUE_CANDIDATE>& aCandidates,
std::vector<SCH_COMPONENT*>& aComponents, bool aAskShowAgain );
~DIALOG_RESCUE_EACH();
private:
SCH_EDIT_FRAME* m_Parent;
wxConfigBase* m_Config;
std::vector<RESCUE_CANDIDATE>* m_Candidates;
std::vector<SCH_COMPONENT*>* m_Components;
bool m_AskShowAgain;
bool m_insideUpdateEvent;
bool TransferDataToWindow();
bool TransferDataFromWindow();
void PopulateConflictList();
void PopulateInstanceList();
void OnConflictSelect( wxDataViewEvent& event );
void OnNeverShowClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void OnHandleCachePreviewRepaint( wxPaintEvent& aRepaintEvent );
void OnHandleLibraryPreviewRepaint( wxPaintEvent& aRepaintEvent );
void OnDialogResize( wxSizeEvent& aSizeEvent );
void renderPreview( LIB_PART* aComponent, int aUnit, wxPanel* panel );
};
DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( SCH_EDIT_FRAME* aParent, std::vector<RESCUE_CANDIDATE>& aCandidates,
std::vector<SCH_COMPONENT*>& aComponents, bool aAskShowAgain )
: DIALOG_RESCUE_EACH_BASE( aParent ),
m_Parent( aParent ),
m_Candidates( &aCandidates ),
m_Components( &aComponents ),
m_AskShowAgain( aAskShowAgain ),
m_insideUpdateEvent( false )
{
}
DIALOG_RESCUE_EACH::~DIALOG_RESCUE_EACH()
{
}
bool DIALOG_RESCUE_EACH::TransferDataToWindow()
{
if( !wxDialog::TransferDataToWindow() )
return false;
m_Config = Kiface().KifaceSettings();
m_ListOfConflicts->AppendToggleColumn( wxT("Rescue") );
m_ListOfConflicts->AppendTextColumn( wxT("Symbol Name") );
m_ListOfInstances->AppendTextColumn( wxT("Reference") );
m_ListOfInstances->AppendTextColumn( wxT("Value") );
PopulateConflictList();
PopulateInstanceList();
if( !m_AskShowAgain )
m_btnNeverShowAgain->Hide();
GetSizer()->Layout();
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
Centre();
return true;
}
void DIALOG_RESCUE_EACH::PopulateConflictList()
{
wxVector<wxVariant> data;
BOOST_FOREACH( RESCUE_CANDIDATE& each_candidate, *m_Candidates )
{
data.clear();
data.push_back( wxVariant( true ) );
data.push_back( each_candidate.requested_name );
m_ListOfConflicts->AppendItem( data );
}
}
void DIALOG_RESCUE_EACH::PopulateInstanceList()
{
m_ListOfInstances->DeleteAllItems();
int row = m_ListOfConflicts->GetSelectedRow();
if( row == wxNOT_FOUND )
row = 0;
RESCUE_CANDIDATE& selected_part = (*m_Candidates)[row];
wxVector<wxVariant> data;
BOOST_FOREACH( SCH_COMPONENT* each_component, *m_Components )
{
if( each_component->GetPartName() != selected_part.requested_name )
continue;
SCH_FIELD* valueField = each_component->GetField( 1 );
data.clear();
data.push_back( each_component->GetRef( & m_Parent->GetCurrentSheet() ) );
data.push_back( valueField ? valueField->GetText() : wxT("") );
m_ListOfInstances->AppendItem( data );
}
}
void DIALOG_RESCUE_EACH::OnHandleCachePreviewRepaint( wxPaintEvent& aRepaintEvent )
{
int row = m_ListOfConflicts->GetSelectedRow();
if( row == wxNOT_FOUND )
row = 0;
RESCUE_CANDIDATE& selected_part = (*m_Candidates)[row];
renderPreview( selected_part.cache_candidate, 0, m_componentViewOld );
}
void DIALOG_RESCUE_EACH::OnHandleLibraryPreviewRepaint( wxPaintEvent& aRepaintEvent )
{
int row = m_ListOfConflicts->GetSelectedRow();
if( row == wxNOT_FOUND )
row = 0;
RESCUE_CANDIDATE& selected_part = (*m_Candidates)[row];
renderPreview( selected_part.lib_candidate, 0, m_componentViewNew );
}
void DIALOG_RESCUE_EACH::OnDialogResize( wxSizeEvent& aSizeEvent )
{
// Placeholer - I was previously doing some extra reflow here.
DIALOG_RESCUE_EACH_BASE::OnDialogResize( aSizeEvent );
}
// Render the preview in our m_componentView. If this gets more complicated, we should
// probably have a derived class from wxPanel; but this keeps things local.
void DIALOG_RESCUE_EACH::renderPreview( LIB_PART* aComponent, int aUnit, wxPanel* aPanel )
{
wxPaintDC dc( aPanel );
EDA_COLOR_T bgcolor = m_Parent->GetDrawBgColor();
dc.SetBackground( bgcolor == BLACK ? *wxBLACK_BRUSH : *wxWHITE_BRUSH );
dc.Clear();
if( aComponent == NULL )
return;
if( aUnit <= 0 )
aUnit = 1;
const wxSize dc_size = dc.GetSize();
dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );
// Find joint bounding box for everything we are about to draw.
EDA_RECT bBox = aComponent->GetBoundingBox( aUnit, /* deMorganConvert */ 0 );
const double xscale = (double) dc_size.x / bBox.GetWidth();
const double yscale = (double) dc_size.y / bBox.GetHeight();
const double scale = std::min( xscale, yscale ) * 0.85;
dc.SetUserScale( scale, scale );
wxPoint offset = bBox.Centre();
NEGATE( offset.x );
NEGATE( offset.y );
// Avoid rendering when either dimension is zero
int width, height;
dc.GetSize( &width, &height );
if( !width || !height )
return;
aComponent->Draw( NULL, &dc, offset, aUnit, /* deMorganConvert */ 0, GR_COPY,
UNSPECIFIED_COLOR, DefaultTransform, true, true, false );
}
void DIALOG_RESCUE_EACH::OnConflictSelect( wxDataViewEvent& aEvent )
{
// wxformbuilder connects this event to the _dialog_, not the data view.
// Make sure the correct item triggered it, otherwise we trigger recursively
// and get a stack overflow.
if( aEvent.GetEventObject() != m_ListOfConflicts ) return;
PopulateInstanceList();
int row = m_ListOfConflicts->GetSelectedRow();
if( row == wxNOT_FOUND )
row = 0;
RESCUE_CANDIDATE& selected_part = (*m_Candidates)[row];
renderPreview( selected_part.cache_candidate, 0, m_componentViewOld );
renderPreview( selected_part.lib_candidate, 0, m_componentViewNew );
}
bool DIALOG_RESCUE_EACH::TransferDataFromWindow()
{
if( !wxDialog::TransferDataFromWindow() )
return false;
std::vector<RESCUE_CANDIDATE>::iterator it = m_Candidates->begin();
for( size_t index = 0; it != m_Candidates->end(); ++index )
{
wxVariant val;
m_ListOfConflicts->GetValue( val, index, 0 );
bool rescue_part = val.GetBool();
if( !rescue_part )
m_Candidates->erase( it );
else
++it;
}
return true;
}
void DIALOG_RESCUE_EACH::OnNeverShowClick( wxCommandEvent& aEvent )
{
wxMessageDialog dlg( m_Parent, wxT( "Stop showing this tool? No changes will be made.\n\n"
"This setting can be changed from the Component Libraries settings, and the "
"tool can be activated manually from the Tools menu." ),
wxT( "Rescue Components" ), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
int resp = dlg.ShowModal ();
if( resp == wxID_YES )
{
m_Config->Write( wxT("RescueNeverShow"), true );
m_Candidates->clear();
Close();
}
}
void DIALOG_RESCUE_EACH::OnCancelClick( wxCommandEvent& aEvent )
{
m_Candidates->clear();
DIALOG_RESCUE_EACH_BASE::OnCancelClick( aEvent );
}
int InvokeDialogRescueEach( SCH_EDIT_FRAME* aCaller, std::vector<RESCUE_CANDIDATE>& aCandidates,
std::vector<SCH_COMPONENT*>& aComponents, bool aAskShowAgain )
{
DIALOG_RESCUE_EACH dlg( aCaller, aCandidates, aComponents, aAskShowAgain );
return dlg.ShowModal();
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 13 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_rescue_each_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxSize( 450,100 ), wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
m_lblInfo = new wxStaticText( this, wxID_ANY, _("This project uses symbols that no longer match the symbols in the system libraries. Using this tool, you can rescue these cached symbols into a new library.\n\nChoose \"Rescue\" for any parts you would like to save from this project's cache, or press Cancel to allow the symbols to be updated to the new versions."), wxDefaultPosition, wxDefaultSize, 0 );
m_lblInfo->Wrap( 500 );
bSizerMain->Add( m_lblInfo, 0, wxALL|wxEXPAND, 5 );
m_staticText5 = new wxStaticText( this, wxID_ANY, _("Symbols with cache/library conflicts:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
m_staticText5->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bSizerMain->Add( m_staticText5, 0, wxALL, 5 );
m_ListOfConflicts = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizerMain->Add( m_ListOfConflicts, 2, wxALL|wxEXPAND, 5 );
m_staticText4 = new wxStaticText( this, wxID_ANY, _("Instances of this symbol:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 );
m_staticText4->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bSizerMain->Add( m_staticText4, 0, wxALL, 5 );
m_ListOfInstances = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizerMain->Add( m_ListOfInstances, 1, wxALL|wxEXPAND, 5 );
wxBoxSizer* bSizerView;
bSizerView = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxVERTICAL );
m_staticText2 = new wxStaticText( this, wxID_ANY, _("Cached Part:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText2->Wrap( -1 );
m_staticText2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bSizer6->Add( m_staticText2, 0, wxALL, 5 );
m_componentViewOld = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER );
m_componentViewOld->SetMinSize( wxSize( 150,150 ) );
bSizer6->Add( m_componentViewOld, 1, wxEXPAND | wxALL, 5 );
bSizerView->Add( bSizer6, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer7;
bSizer7 = new wxBoxSizer( wxVERTICAL );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Library Part:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
m_staticText3->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bSizer7->Add( m_staticText3, 0, wxALL, 5 );
m_componentViewNew = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER );
m_componentViewNew->SetMinSize( wxSize( 150,150 ) );
bSizer7->Add( m_componentViewNew, 1, wxEXPAND | wxALL, 5 );
bSizerView->Add( bSizer7, 1, wxEXPAND, 5 );
bSizerMain->Add( bSizerView, 2, wxEXPAND, 5 );
wxBoxSizer* bSizer5;
bSizer5 = new wxBoxSizer( wxHORIZONTAL );
m_btnNeverShowAgain = new wxButton( this, wxID_ANY, _("Never Show Again"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer5->Add( m_btnNeverShowAgain, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
bSizer5->Add( 0, 0, 1, wxEXPAND, 5 );
m_stdButtons = new wxStdDialogButtonSizer();
m_stdButtonsOK = new wxButton( this, wxID_OK );
m_stdButtons->AddButton( m_stdButtonsOK );
m_stdButtonsCancel = new wxButton( this, wxID_CANCEL );
m_stdButtons->AddButton( m_stdButtonsCancel );
m_stdButtons->Realize();
bSizer5->Add( m_stdButtons, 0, wxALL|wxEXPAND, 5 );
bSizerMain->Add( bSizer5, 0, wxEXPAND, 5 );
this->SetSizer( bSizerMain );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
this->Connect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_RESCUE_EACH_BASE::OnDialogResize ) );
this->Connect( wxID_ANY, wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_RESCUE_EACH_BASE::OnConflictSelect ) );
m_componentViewOld->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_RESCUE_EACH_BASE::OnHandleCachePreviewRepaint ), NULL, this );
m_componentViewNew->Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_RESCUE_EACH_BASE::OnHandleLibraryPreviewRepaint ), NULL, this );
m_btnNeverShowAgain->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_RESCUE_EACH_BASE::OnNeverShowClick ), NULL, this );
m_stdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_RESCUE_EACH_BASE::OnCancelClick ), NULL, this );
}
DIALOG_RESCUE_EACH_BASE::~DIALOG_RESCUE_EACH_BASE()
{
// Disconnect Events
this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( DIALOG_RESCUE_EACH_BASE::OnDialogResize ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEventHandler( DIALOG_RESCUE_EACH_BASE::OnConflictSelect ) );
m_componentViewOld->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_RESCUE_EACH_BASE::OnHandleCachePreviewRepaint ), NULL, this );
m_componentViewNew->Disconnect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_RESCUE_EACH_BASE::OnHandleLibraryPreviewRepaint ), NULL, this );
m_btnNeverShowAgain->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_RESCUE_EACH_BASE::OnNeverShowClick ), NULL, this );
m_stdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_RESCUE_EACH_BASE::OnCancelClick ), NULL, this );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 13 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_RESCUE_EACH_BASE_H__
#define __DIALOG_RESCUE_EACH_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/dataview.h>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_RESCUE_EACH_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_RESCUE_EACH_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticText* m_lblInfo;
wxStaticText* m_staticText5;
wxDataViewListCtrl* m_ListOfConflicts;
wxStaticText* m_staticText4;
wxDataViewListCtrl* m_ListOfInstances;
wxStaticText* m_staticText2;
wxPanel* m_componentViewOld;
wxStaticText* m_staticText3;
wxPanel* m_componentViewNew;
wxButton* m_btnNeverShowAgain;
wxStdDialogButtonSizer* m_stdButtons;
wxButton* m_stdButtonsOK;
wxButton* m_stdButtonsCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnDialogResize( wxSizeEvent& event ) { event.Skip(); }
virtual void OnConflictSelect( wxDataViewEvent& event ) { event.Skip(); }
virtual void OnHandleCachePreviewRepaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnHandleLibraryPreviewRepaint( wxPaintEvent& event ) { event.Skip(); }
virtual void OnNeverShowClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 529,593 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_RESCUE_EACH_BASE();
};
#endif //__DIALOG_RESCUE_EACH_BASE_H__
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Chris Pavlina <pavlina.chris@gmail.com>
* Copyright (C) 2015 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <schframe.h>
#include <invoke_sch_dialog.h>
#include <dialog_rescue_summary_base.h>
#include <kiface_i.h>
#include <lib_cache_rescue.h>
#include <sch_component.h>
#include <vector>
#include <boost/foreach.hpp>
class DIALOG_RESCUE_SUMMARY: public DIALOG_RESCUE_SUMMARY_BASE
{
public:
DIALOG_RESCUE_SUMMARY( SCH_EDIT_FRAME* aParent, std::vector<RESCUE_LOG>& aRescueLog );
private:
SCH_EDIT_FRAME* m_Parent;
wxConfigBase* m_Config;
std::vector<RESCUE_LOG>* m_RescueLog;
bool TransferDataToWindow();
void OnOkClick( wxCommandEvent& event );
};
DIALOG_RESCUE_SUMMARY::DIALOG_RESCUE_SUMMARY( SCH_EDIT_FRAME* aParent, std::vector<RESCUE_LOG>& aRescueLog )
: DIALOG_RESCUE_SUMMARY_BASE( aParent ), m_Parent( aParent), m_RescueLog( &aRescueLog )
{ }
bool DIALOG_RESCUE_SUMMARY::TransferDataToWindow()
{
if( !wxDialog::TransferDataToWindow() )
return false;
m_Config = Kiface().KifaceSettings();
m_ListOfChanges->AppendTextColumn( wxT( "Reference" ) );
m_ListOfChanges->AppendTextColumn( wxT( "Old Symbol" ), wxDATAVIEW_CELL_INERT, /*width*/ 100);
m_ListOfChanges->AppendTextColumn( wxT( "New Symbol" ), wxDATAVIEW_CELL_INERT, /*width*/ 100);
wxVector<wxVariant> data;
BOOST_FOREACH( RESCUE_LOG& each_log_item, *m_RescueLog )
{
data.clear();
data.push_back( each_log_item.component->GetRef( & m_Parent->GetCurrentSheet() ) );
data.push_back( each_log_item.old_name );
data.push_back( each_log_item.new_name );
m_ListOfChanges->AppendItem( data );
}
GetSizer()->Layout();
GetSizer()->Fit( this );
GetSizer()->SetSizeHints( this );
Centre();
return true;
}
int InvokeDialogRescueSummary( SCH_EDIT_FRAME* aCaller, std::vector<RESCUE_LOG>& aRescueLog )
{
DIALOG_RESCUE_SUMMARY dlg( aCaller, aRescueLog );
return dlg.ShowModal();
}
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 13 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_rescue_summary_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_RESCUE_SUMMARY_BASE::DIALOG_RESCUE_SUMMARY_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bmainSizer;
bmainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bupperSizer;
bupperSizer = new wxBoxSizer( wxVERTICAL );
m_staticText5 = new wxStaticText( this, wxID_ANY, _("The symbols of the following components were changed:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
bupperSizer->Add( m_staticText5, 0, wxALL, 5 );
m_ListOfChanges = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bupperSizer->Add( m_ListOfChanges, 1, wxALL|wxEXPAND, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1->Realize();
bupperSizer->Add( m_sdbSizer1, 0, wxEXPAND, 5 );
bmainSizer->Add( bupperSizer, 1, wxALL|wxEXPAND, 6 );
this->SetSizer( bmainSizer );
this->Layout();
}
DIALOG_RESCUE_SUMMARY_BASE::~DIALOG_RESCUE_SUMMARY_BASE()
{
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 13 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_RESCUE_SUMMARY_BASE_H__
#define __DIALOG_RESCUE_SUMMARY_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h"
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/dataview.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_RESCUE_SUMMARY_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_RESCUE_SUMMARY_BASE : public DIALOG_SHIM
{
private:
protected:
wxStaticText* m_staticText5;
wxDataViewListCtrl* m_ListOfChanges;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
public:
DIALOG_RESCUE_SUMMARY_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Summary of Library Rescue"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 536,385 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_RESCUE_SUMMARY_BASE();
};
#endif //__DIALOG_RESCUE_SUMMARY_BASE_H__
......@@ -61,6 +61,9 @@ enum id_eeschema_frm
ID_UPDATE_ONE_SHEET = ID_END_LIST,
ID_SAVE_ONE_SHEET_UNDER_NEW_NAME,
/* Schematic editor main menubar IDs. */
ID_RESCUE_CACHED,
/* Schematic editor horizontal toolbar IDs */
ID_HIERARCHY,
ID_TO_LIBVIEW,
......
......@@ -34,6 +34,7 @@
#include <gestfich.h>
#include <schframe.h>
#include <pgm_base.h>
#include <kiface_i.h>
#include <eeschema_id.h>
#include <class_library.h>
......@@ -42,6 +43,7 @@
#include <sch_sheet_path.h>
#include <sch_component.h>
#include <wildcards_and_files_ext.h>
#include <lib_cache_rescue.h>
bool SCH_EDIT_FRAME::SaveEEFile( SCH_SCREEN* aScreen, bool aSaveUnderNewName, bool aCreateBackupFile )
......@@ -303,6 +305,20 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
GetScreen()->ClrModify();
UpdateFileHistory( fullFileName );
// Check to see whether some old, cached library parts need to be rescued
// Only do this if RescueNeverShow was not set.
wxConfigBase *config = Kiface().KifaceSettings();
bool rescueNeverShow = false;
config->Read( wxT("RescueNeverShow"), &rescueNeverShow, false );
if( !rescueNeverShow )
{
if( RescueCacheConflicts( false ) )
{
GetScreen()->CheckComponentsToPartsLinks();
GetScreen()->TestDanglingEnds();
}
}
}
GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );
......
......@@ -40,14 +40,40 @@
#ifndef INVOKE_SCH_DIALOG_H_
#define INVOKE_SCH_DIALOG_H_
#include <set>
#include <vector>
class wxFrame;
class wxDialog;
class LIB_PART;
class PART_LIBS;
class SCH_COMPONENT;
class RESCUE_CANDIDATE;
class RESCUE_LOG;
// Often this is not used in the prototypes, since wxFrame is good enough and would
// represent maximum information hiding.
class SCH_EDIT_FRAME;
/**
* Function InvokeDialogRescueSummary
* This dialog displays a summary of component rescues.
* @param aCaller - the SCH_EDIT_FRAME calling this
* @param aRescueLog - a list of RESCUE_LOG items to show
*/
int InvokeDialogRescueSummary( SCH_EDIT_FRAME* aCaller, std::vector<RESCUE_LOG>& aRescueLog );
/**
* Function InvokeDialogRescueEach
* This dialog asks the user which rescuable, cached parts he wants to rescue.
* Any rejects will be pruned from aCandidates.
* @param aCaller - the SCH_EDIT_FRAME calling this
* @param aCandidates - the list of RESCUE_CANDIDATES
* @param aComponents - a vector of all the components in the schematic
* @param aAskShowAgain - if true, a "Never Show Again" button will be included
*/
int InvokeDialogRescueEach( SCH_EDIT_FRAME* aCaller, std::vector<RESCUE_CANDIDATE>& aCandidates,
std::vector<SCH_COMPONENT*>& aComponents, bool aAskShowAgain );
/// Create and show DIALOG_ANNOTATE and return whatever
/// DIALOG_ANNOTATE::ShowModal() returns.
......
This diff is collapsed.
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Chris Pavlina <pavlina.chris@gmail.com>
* Copyright (C) 2015 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _LIB_CACHE_RESCUE_H_
#define _LIB_CACHE_RESCUE_H_
/* This code handles the case where an old schematic has parts that have
* changed in the system libraries, such that their pins no longer line up.
* The function of note is a member of SCH_EDIT_FRAME, defined thus:
*
* bool SCH_EDIT_FRAME::RescueCacheConflicts( bool aSilentIfNone );
*
* When this is called, a list of component names referring to conflicting
* symbols is compiled. If this list is empty, then the function displays
* a notification and returns (if aSilentIfNone is true, the notification is
* silenced).
*
* The user is then prompted to select which parts he would like to rescue.
* Any remaining after he's through are rescued: they are renamed to avoid
* further conflicts, and then they are copied into a new library. The
* schematic components are updated to link to these new names, the library
* is saved, and the library is added to the project at the top of the
* search path.
*/
#include <vector>
#include <wx/string.h>
class LIB_PART;
class SCH_COMPONENT;
class RESCUE_CANDIDATE
{
public:
wxString requested_name;
LIB_PART* cache_candidate;
LIB_PART* lib_candidate;
};
class RESCUE_LOG
{
public:
SCH_COMPONENT* component;
wxString old_name;
wxString new_name;
};
#endif // _LIB_CACHE_RESCUE_H_
......@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 20011 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2011 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......
......@@ -436,6 +436,12 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
_( "Library &Browser" ), HELP_RUN_LIB_VIEWER,
KiBitmap( library_browse_xpm ) );
AddMenuItem( toolsMenu,
ID_RESCUE_CACHED,
_( "&Rescue Cached Components" ),
_( "Find old components in the project cache and rescue them to a new library" ),
KiBitmap( copycomponent_xpm ) );
toolsMenu->AppendSeparator();
AddMenuItem( toolsMenu,
......
......@@ -227,6 +227,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_TOOL( ID_RUN_LIBRARY, SCH_EDIT_FRAME::OnOpenLibraryEditor )
EVT_TOOL( ID_POPUP_SCH_CALL_LIBEDIT_AND_LOAD_CMP, SCH_EDIT_FRAME::OnOpenLibraryEditor )
EVT_TOOL( ID_TO_LIBVIEW, SCH_EDIT_FRAME::OnOpenLibraryViewer )
EVT_TOOL( ID_RESCUE_CACHED, SCH_EDIT_FRAME::OnRescueCached )
EVT_TOOL( ID_RUN_PCB, SCH_EDIT_FRAME::OnOpenPcbnew )
EVT_TOOL( ID_RUN_PCB_MODULE_EDITOR, SCH_EDIT_FRAME::OnOpenPcbModuleEditor )
......@@ -1058,6 +1059,10 @@ void SCH_EDIT_FRAME::OnOpenLibraryEditor( wxCommandEvent& event )
}
}
void SCH_EDIT_FRAME::OnRescueCached( wxCommandEvent& event )
{
RescueCacheConflicts( true );
}
void SCH_EDIT_FRAME::OnExit( wxCommandEvent& event )
{
......
......@@ -808,6 +808,7 @@ private:
void OnOpenPcbModuleEditor( wxCommandEvent& event );
void OnOpenCvpcb( wxCommandEvent& event );
void OnOpenLibraryEditor( wxCommandEvent& event );
void OnRescueCached( wxCommandEvent& event );
void OnPreferencesOptions( wxCommandEvent& event );
void OnCancelCurrentCommand( wxCommandEvent& aEvent );
......@@ -1259,6 +1260,20 @@ public:
*/
bool CreateArchiveLibrary( const wxString& aFileName );
/**
* Function RescueCacheConflicts
* exports components from the '-cache' library that conflict with parts
* in the project libraries to a new library, renaming them to add a suffix
* of the root document's name to avoid conflicts.
*
* @param aRunningOnDemand - indicates whether the tool has been called up by the user
* (as opposed to being run automatically). If true, an information dialog is
* displayed if there are no components to rescue. If false, the tool is silent
* if there are no components to rescue, and a "Never Show Again" button is
* displayed.
*/
bool RescueCacheConflicts( bool aRunningOnDemand );
/**
* Function PrintPage
* plots or prints the current sheet to the clipboard.
......
......@@ -93,6 +93,13 @@ public:
*/
VTBL_ENTRY const wxString GetProjectPath() const;
/**
* Function GetProjectName
* returns the short name of the project. This is the file name without
* extension or path.
*/
VTBL_ENTRY const wxString GetProjectName() const;
/**
* Function FootprintLibTblName
* returns the path and filename of this project's fp-lib-table,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment