979 projectTable = aKiway->
Prj().SchSymbolLibTable();
983 currentLib = symbolEditor->GetCurLib();
986 symbolEditor->FreezeLibraryTree();
988 if( symbolEditor->HasLibModifications() )
990 msg =
_(
"Modifications have been made to one or more symbol libraries.\n" 991 "Changes must be saved or discarded before the symbol library " 992 "table can be modified." );
996 case wxID_YES: symbolEditor->SaveAll();
break;
997 case wxID_NO: symbolEditor->RevertAll();
break;
999 case wxID_CANCEL: symbolEditor->ThawLibraryTree();
return;
1005 dlg.SetKiway( &dlg, aKiway );
1008 projectTable, projectTableFn.GetFullPath() ) );
1010 if( dlg.ShowModal() == wxID_CANCEL )
1013 symbolEditor->ThawLibraryTree();
1018 if( dlg.m_GlobalTableChanged )
1022 globalTable->
Save( globalTablePath );
1026 msg.Printf(
_(
"Error saving global library table:\n\n%s" ), ioe.
What() );
1027 wxMessageBox( msg,
_(
"File Save Error" ), wxOK | wxICON_ERROR );
1031 if( projectTable && dlg.m_ProjectTableChanged )
1035 projectTable->Save( projectTableFn.GetFullPath() );
1039 msg.Printf(
_(
"Error saving project-specific library table:\n\n%s" ), ioe.
What() );
1040 wxMessageBox( msg,
_(
"File Save Error" ), wxOK | wxICON_ERROR );
1045 schEditor->SyncView();
1050 if( !currentLib.empty() && projectTable && !projectTable->HasLibrary( currentLib,
true ) )
1052 symbolEditor->SetCurLib( wxEmptyString );
1053 symbolEditor->emptyScreen();
1056 symbolEditor->SyncLibraries(
true );
1057 symbolEditor->ThawLibraryTree();
1058 symbolEditor->RefreshLibraryTree();
1062 symbolViewer->ReCreateLibList();
static const wxString & GetSymbolLibTableFileName()
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Symbol library viewer main window.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Schematic editor (Eeschema) main window.
virtual const wxString GetProjectPath() const
Return the full path of the project.
virtual const wxString What() const
A composite of Problem() and Where()
Dialog to show and edit symbol library tables.
int UnsavedChangesDialog(wxWindow *parent, wxString aMessage, bool *aApplyToAll)
A specialized version of HandleUnsavedChanges which handles an apply-to-all checkbox.
virtual bool IsNullProject() const
Check if this project is a null project (i.e.
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
static wxString GetGlobalTableFileName()
Fetch the global symbol library table file name.
The symbol library editor main window.