Commit 94372b81 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: fix bug 783535. Minor code cleaning.

Pcbnew: fix very minor issue.
parent a367dea4
......@@ -339,22 +339,11 @@ void EDA_BASE_FRAME::AddHelpVersionInfoMenuEntry( wxMenu* aMenu )
{
wxASSERT( aMenu != NULL );
wxMenuItem* item = NULL;
// Copy version string to clipboard for bug report purposes.
item = new wxMenuItem( aMenu, ID_HELP_COPY_VERSION_STRING,
ADD_MENUITEM_WITH_HELP( aMenu, ID_HELP_COPY_VERSION_STRING,
_( "Copy &Version Information" ),
_( "Copy the version string to clipboard to send with bug reports" ) );
// For some reason images are not always added to the OSX menu items. Anyone want
// to clarify as to why this is the case? Putting this information in some formal
// developer notes would be helpful. A good place to put this information would be
// ./documentation/guidelines/UIpolicies.txt.
#if !defined( __WXMAC__ )
item->SetBitmap( copy_button );
#endif
aMenu->Append( item );
_( "Copy the version string to clipboard to send with bug reports" ),
copy_button );
}
......
......@@ -632,41 +632,34 @@ void AddHotkeyConfigMenu( wxMenu* aMenu )
if( aMenu == NULL )
return;
wxMenuItem* item;
wxMenu* HotkeySubmenu = new wxMenu();
/* List existing hotkey menu*/
item = new wxMenuItem( HotkeySubmenu,
ADD_MENUITEM_WITH_HELP( HotkeySubmenu,
ID_PREFERENCES_HOTKEY_SHOW_CURRENT_LIST,
_( "List Current Keys" ),
_( "Displays the current hotkeys list and corresponding commands" ) );
item->SetBitmap( info_xpm );
HotkeySubmenu->Append( item );
_( "Displays the current hotkeys list and corresponding commands" ),
info_xpm );
/* Call hotkeys editor*/
item = new wxMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_SHOW_EDITOR,
_( "Edit Hotkeys" ),
_( "Call the hotkeys editor" ) );
item->SetBitmap( editor_xpm );
HotkeySubmenu->Append( item );
_( "Call the hotkeys editor" ),
editor_xpm );
HotkeySubmenu->AppendSeparator();
/* create hotkey file to export current hotkeys config */
item = new wxMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_EXPORT_CONFIG,
_( "Export Hotkeys Config" ),
_(
"Create a hotkey configuration file to export the current hotkey config" )
);
item->SetBitmap( save_setup_xpm );
HotkeySubmenu->Append( item );
_( "Create a hotkey configuration file to export the current hotkey config" ),
save_setup_xpm );
/* Reload hotkey file */
item = new wxMenuItem( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
ADD_MENUITEM_WITH_HELP( HotkeySubmenu, ID_PREFERENCES_HOTKEY_IMPORT_CONFIG,
_( "Import Hotkeys Config" ),
_( "Load an existing hotkey configuration file" ) );
item->SetBitmap( reload_xpm );
HotkeySubmenu->Append( item );
_( "Load an existing hotkey configuration file" ),
reload_xpm );
/* Append HotkeySubmenu to menu */
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( aMenu, HotkeySubmenu,
......
......@@ -60,7 +60,8 @@ static void abortMoveText( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
if( item->IsNew() )
{
SAFE_DELETE( item );
delete item;
item = NULL;
}
else // Move command on an existing text item, restore the copy of the original.
{
......@@ -77,7 +78,7 @@ static void abortMoveText( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
item->ClearFlags();
}
screen->SetCurItem( NULL );
screen->SetCurItem( item );
}
......
......@@ -115,6 +115,7 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU( ID_LIBEDIT_GEN_PNG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
EVT_MENU( ID_LIBEDIT_GEN_SVG_FILE, LIB_EDIT_FRAME::OnPlotCurrentComponent )
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
EVT_MENU( ID_COLORS_SETUP, LIB_EDIT_FRAME::OnColorConfig )
EVT_MENU( ID_CONFIG_REQ, LIB_EDIT_FRAME::InstallConfigFrame )
......
This diff is collapsed.
This diff is collapsed.
......@@ -144,6 +144,8 @@ void DeleteItemsInList( EDA_DRAW_PANEL* panel, PICKED_ITEMS_LIST& aItemsList )
void SCH_EDIT_FRAME::DeleteItem( SCH_ITEM* aItem )
{
wxCHECK_RET( aItem != NULL, wxT( "Cannot delete invalid item." ) );
if( aItem == NULL )
return;
SCH_SCREEN* screen = GetScreen();
......
......@@ -103,6 +103,7 @@ void SCH_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
}
INSTALL_UNBUFFERED_DC( dc, DrawPanel );
item = screen->GetCurItem(); // Can be modified by previous calls.
switch( id )
{
......
......@@ -101,7 +101,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_TOOL( ID_POPUP_SCH_MOVE_ITEM, SCH_EDIT_FRAME::OnMoveItem )
EVT_MENU( wxID_HELP, EDA_DRAW_FRAME::GetKicadHelp )
EVT_MENU( wxID_ABOUT, EDA_DRAW_FRAME::GetKicadAbout )
EVT_MENU( wxID_ABOUT, EDA_BASE_FRAME::GetKicadAbout )
// Tools and buttons for vertical toolbar.
EVT_TOOL( ID_CANCEL_CURRENT_COMMAND, SCH_EDIT_FRAME::OnCancelCurrentCommand )
......
......@@ -328,7 +328,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& FileName )
GetScreen()->GetFileName(), PcbFileWildcard,
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if( dlg.ShowModal() == wxID_CANCEL )
if( dlg.ShowModal() != wxID_OK )
return false;
GetScreen()->SetFileName( dlg.GetPath() );
......
......@@ -156,7 +156,8 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
frame->GetScreen()->SetFileName( fn.GetFullPath( wxPATH_UNIX ) );
frame->SetTitle( frame->GetScreen()->GetFileName() );
frame->UpdateFileHistory( frame->GetScreen()->GetFileName() );
frame->OnModify(); // Ready to save the new empty board
frame->OnModify(); // Ready to save the new empty board
g_SaveTime = time( NULL ); // Init the time out to save the board
wxString msg;
msg.Printf( _( "File <%s> does not exist.\nThis is normal for a new project" ),
......
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