Eeschema component library rescue changes.
* Show rescued component names in rescue dialog. * Remove summary dialog. * Don't create empty rescue library.
This commit is contained in:
parent
4f3337f5ed
commit
c7b8f790a7
|
@ -65,8 +65,6 @@ set( EESCHEMA_DLGS
|
|||
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
|
||||
|
|
|
@ -87,6 +87,20 @@ DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH( SCH_EDIT_FRAME* aParent, std::vector<RES
|
|||
{
|
||||
m_Config = Kiface().KifaceSettings();
|
||||
m_stdButtonsOK->SetDefault();
|
||||
|
||||
// Set the info message, customized to include the proper suffix.
|
||||
wxString info_message;
|
||||
info_message.Printf(
|
||||
_( "This project uses symbols that no longer match the ones in the system libraries.\n"
|
||||
"Using this tool, you can rescue these cached symbols into a new library.\n"
|
||||
"\n"
|
||||
"Choose \"Rescue\" for any parts you would like to save from this project's cache,\n"
|
||||
"or press \"Cancel\" to allow the symbols to be updated to the new versions.\n"
|
||||
"\n"
|
||||
"All rescued components will be renamed with a new suffix of \"-RESCUE-%s\"\n"
|
||||
"to avoid naming conflicts." ),
|
||||
Prj().GetProjectName() );
|
||||
m_lblInfo->SetLabel( info_message );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// C++ code generated with wxFormBuilder (version Mar 13 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -16,7 +16,7 @@ DIALOG_RESCUE_EACH_BASE::DIALOG_RESCUE_EACH_BASE( wxWindow* parent, wxWindowID i
|
|||
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.\nUsing 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 = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_lblInfo->Wrap( 500 );
|
||||
bSizerMain->Add( m_lblInfo, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">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.

Choose "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.</property>
|
||||
<property name="label"></property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// C++ code generated with wxFormBuilder (version Mar 13 2015)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
|
|
@ -1,88 +0,0 @@
|
|||
/*
|
||||
* 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 )
|
||||
{
|
||||
m_Config = Kiface().KifaceSettings();
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_RESCUE_SUMMARY::TransferDataToWindow()
|
||||
{
|
||||
if( !wxDialog::TransferDataToWindow() )
|
||||
return false;
|
||||
|
||||
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();
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// 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, wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
m_ListOfChanges = new wxDataViewListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_ListOfChanges->SetMinSize( wxSize( -1,200 ) );
|
||||
|
||||
bupperSizer->Add( m_ListOfChanges, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
bupperSizer->Add( m_sdbSizer, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bmainSizer->Add( bupperSizer, 1, wxALL|wxEXPAND, 6 );
|
||||
|
||||
|
||||
this->SetSizer( bmainSizer );
|
||||
this->Layout();
|
||||
}
|
||||
|
||||
DIALOG_RESCUE_SUMMARY_BASE::~DIALOG_RESCUE_SUMMARY_BASE()
|
||||
{
|
||||
}
|
|
@ -1,287 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<wxFormBuilder_Project>
|
||||
<FileVersion major="1" minor="13" />
|
||||
<object class="Project" expanded="1">
|
||||
<property name="class_decoration"></property>
|
||||
<property name="code_generation">C++</property>
|
||||
<property name="disconnect_events">1</property>
|
||||
<property name="disconnect_mode">source_name</property>
|
||||
<property name="disconnect_php_events">0</property>
|
||||
<property name="disconnect_python_events">0</property>
|
||||
<property name="embedded_files_path">res</property>
|
||||
<property name="encoding">UTF-8</property>
|
||||
<property name="event_generation">connect</property>
|
||||
<property name="file">dialog_rescue_summary_base</property>
|
||||
<property name="first_id">1000</property>
|
||||
<property name="help_provider">none</property>
|
||||
<property name="internationalize">1</property>
|
||||
<property name="name">dialog_rescue_summary_base</property>
|
||||
<property name="namespace"></property>
|
||||
<property name="path">.</property>
|
||||
<property name="precompiled_header"></property>
|
||||
<property name="relative_path">1</property>
|
||||
<property name="skip_lua_events">1</property>
|
||||
<property name="skip_php_events">1</property>
|
||||
<property name="skip_python_events">1</property>
|
||||
<property name="ui_table">UI</property>
|
||||
<property name="use_enum">0</property>
|
||||
<property name="use_microsoft_bom">0</property>
|
||||
<object class="Dialog" expanded="1">
|
||||
<property name="aui_managed">0</property>
|
||||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
|
||||
<property name="bg"></property>
|
||||
<property name="center"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="event_handler">impl_virtual</property>
|
||||
<property name="extra_style"></property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">DIALOG_RESCUE_SUMMARY_BASE</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size">536,385</property>
|
||||
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||
<property name="title">Summary of Library Rescue</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnActivate"></event>
|
||||
<event name="OnActivateApp"></event>
|
||||
<event name="OnAuiFindManager"></event>
|
||||
<event name="OnAuiPaneButton"></event>
|
||||
<event name="OnAuiPaneClose"></event>
|
||||
<event name="OnAuiPaneMaximize"></event>
|
||||
<event name="OnAuiPaneRestore"></event>
|
||||
<event name="OnAuiRender"></event>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnClose"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnHibernate"></event>
|
||||
<event name="OnIconize"></event>
|
||||
<event name="OnIdle"></event>
|
||||
<event name="OnInitDialog"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bmainSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">6</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxBoxSizer" expanded="1">
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">bupperSizer</property>
|
||||
<property name="orient">wxVERTICAL</property>
|
||||
<property name="permission">none</property>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStaticText" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></property>
|
||||
<property name="best_size"></property>
|
||||
<property name="bg"></property>
|
||||
<property name="caption"></property>
|
||||
<property name="caption_visible">1</property>
|
||||
<property name="center_pane">0</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">The symbols of the following components were changed:</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_staticText5</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<property name="wrap">-1</property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxALL|wxEXPAND</property>
|
||||
<property name="proportion">1</property>
|
||||
<object class="wxDataViewListCtrl" expanded="1">
|
||||
<property name="bg"></property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="font"></property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="minimum_size">-1,200</property>
|
||||
<property name="name">m_ListOfChanges</property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pos"></property>
|
||||
<property name="size"></property>
|
||||
<property name="style"></property>
|
||||
<property name="subclass"></property>
|
||||
<property name="tooltip"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnDataViewListCtrlColumnHeaderClick"></event>
|
||||
<event name="OnDataViewListCtrlColumnHeaderRightClick"></event>
|
||||
<event name="OnDataViewListCtrlColumnReordered"></event>
|
||||
<event name="OnDataViewListCtrlColumnSorted"></event>
|
||||
<event name="OnDataViewListCtrlItemActivated"></event>
|
||||
<event name="OnDataViewListCtrlItemBeginDrag"></event>
|
||||
<event name="OnDataViewListCtrlItemCollapsed"></event>
|
||||
<event name="OnDataViewListCtrlItemCollapsing"></event>
|
||||
<event name="OnDataViewListCtrlItemContextMenu"></event>
|
||||
<event name="OnDataViewListCtrlItemDrop"></event>
|
||||
<event name="OnDataViewListCtrlItemDropPossible"></event>
|
||||
<event name="OnDataViewListCtrlItemEditingDone"></event>
|
||||
<event name="OnDataViewListCtrlItemEditingStarted"></event>
|
||||
<event name="OnDataViewListCtrlItemExpanded"></event>
|
||||
<event name="OnDataViewListCtrlItemExpanding"></event>
|
||||
<event name="OnDataViewListCtrlItemStartEditing"></event>
|
||||
<event name="OnDataViewListCtrlItemValueChanged"></event>
|
||||
<event name="OnDataViewListCtrlSelectionChanged"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||
<property name="Apply">0</property>
|
||||
<property name="Cancel">0</property>
|
||||
<property name="ContextHelp">0</property>
|
||||
<property name="Help">0</property>
|
||||
<property name="No">0</property>
|
||||
<property name="OK">1</property>
|
||||
<property name="Save">0</property>
|
||||
<property name="Yes">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="name">m_sdbSizer</property>
|
||||
<property name="permission">protected</property>
|
||||
<event name="OnApplyButtonClick"></event>
|
||||
<event name="OnCancelButtonClick"></event>
|
||||
<event name="OnContextHelpButtonClick"></event>
|
||||
<event name="OnHelpButtonClick"></event>
|
||||
<event name="OnNoButtonClick"></event>
|
||||
<event name="OnOKButtonClick"></event>
|
||||
<event name="OnSaveButtonClick"></event>
|
||||
<event name="OnYesButtonClick"></event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</wxFormBuilder_Project>
|
|
@ -1,51 +0,0 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// 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_sdbSizer;
|
||||
wxButton* m_sdbSizerOK;
|
||||
|
||||
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__
|
|
@ -55,14 +55,6 @@ class RESCUE_LOG;
|
|||
// 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.
|
||||
|
|
|
@ -338,6 +338,16 @@ bool SCH_EDIT_FRAME::RescueCacheConflicts( bool aRunningOnDemand )
|
|||
wxFileName library_fn;
|
||||
std::auto_ptr<PART_LIB> rescue_lib( create_rescue_library( library_fn ) );
|
||||
rescue_components( candidates, rescue_lib.get(), part_name_suffix );
|
||||
|
||||
// If no components were rescued, let the user know what's going on. He might
|
||||
// have clicked cancel by mistake, and should have some indication of that.
|
||||
if( candidates.empty() )
|
||||
{
|
||||
wxMessageDialog dlg( this, _( "No cached symbols were rescued." ) );
|
||||
dlg.ShowModal();
|
||||
return true;
|
||||
}
|
||||
|
||||
if( !save_library( library_fn.GetFullPath(), rescue_lib.get(), this ) )
|
||||
{
|
||||
// Save failed. Do not update the components.
|
||||
|
@ -348,36 +358,27 @@ bool SCH_EDIT_FRAME::RescueCacheConflicts( bool aRunningOnDemand )
|
|||
std::vector<RESCUE_LOG> rescue_log;
|
||||
update_components( components, candidates, part_name_suffix, rescue_log );
|
||||
|
||||
if( rescue_log.empty() )
|
||||
wxASSERT( !rescue_log.empty() );
|
||||
|
||||
// Try inserting the library into the project
|
||||
if( insert_library( prj, rescue_lib.get(), 0 ) )
|
||||
{
|
||||
wxMessageDialog dlg( this, _( "No cached symbols were rescued." ) );
|
||||
dlg.ShowModal();
|
||||
// Clean up wire ends
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
GetScreen()->SchematicCleanUp( NULL, &dc );
|
||||
m_canvas->Refresh( true );
|
||||
OnModify();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try inserting the library into the project
|
||||
if( insert_library( prj, rescue_lib.get(), 0 ) )
|
||||
// Unsuccessful! Restore all the components
|
||||
BOOST_FOREACH( RESCUE_LOG& rescue_log_item, rescue_log )
|
||||
{
|
||||
InvokeDialogRescueSummary( this, rescue_log );
|
||||
|
||||
// Clean up wire ends
|
||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||
GetScreen()->SchematicCleanUp( NULL, &dc );
|
||||
m_canvas->Refresh( true );
|
||||
OnModify();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unsuccessful! Restore all the components
|
||||
BOOST_FOREACH( RESCUE_LOG& rescue_log_item, rescue_log )
|
||||
{
|
||||
rescue_log_item.component->SetPartName( rescue_log_item.old_name );
|
||||
}
|
||||
wxMessageDialog dlg( this, _( "An error occurred while attempting to rescue components. No changes have been made." ) );
|
||||
return false;
|
||||
rescue_log_item.component->SetPartName( rescue_log_item.old_name );
|
||||
}
|
||||
wxMessageDialog dlg( this, _( "An error occurred while attempting to rescue components. No changes have been made." ) );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue