diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/debian/changelog kicad-201906150104+f550eca~86~ubuntu16.04.1/debian/changelog --- kicad-201906140104+dc56678~86~ubuntu16.04.1/debian/changelog 2019-06-14 01:04:07.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/debian/changelog 2019-06-15 01:04:07.000000000 +0000 @@ -1,8 +1,8 @@ -kicad (201906140104+dc56678~86~ubuntu16.04.1) xenial; urgency=low +kicad (201906150104+f550eca~86~ubuntu16.04.1) xenial; urgency=low * Auto build. - -- js-reynaud Fri, 14 Jun 2019 01:04:07 +0000 + -- js-reynaud Sat, 15 Jun 2019 01:04:07 +0000 kicad (3.9.9-16) unstable; urgency=medium diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/debian/git-build-recipe.manifest kicad-201906150104+f550eca~86~ubuntu16.04.1/debian/git-build-recipe.manifest --- kicad-201906140104+dc56678~86~ubuntu16.04.1/debian/git-build-recipe.manifest 2019-06-14 01:04:07.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/debian/git-build-recipe.manifest 2019-06-15 01:04:07.000000000 +0000 @@ -1,3 +1,3 @@ -# git-build-recipe format 0.4 deb-version 201906140104+dc56678~86 +# git-build-recipe format 0.4 deb-version 201906150104+f550eca~86 lp:~js-reynaud/+git/kicad-daily-pkg git-commit:4ee21123c8822e6340a9c6f0ce4ced4d30acfeb1 -nest kicad lp:kicad kicad git-commit:dc56678289dc4373141cca92d32157449372b82f +nest kicad lp:kicad kicad git-commit:f550ecaf1f6c132b94891a64aa808b6255305027 diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/CMakeLists.txt kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/CMakeLists.txt --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/CMakeLists.txt 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/CMakeLists.txt 2019-06-15 01:04:07.000000000 +0000 @@ -21,7 +21,7 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # -cmake_minimum_required( VERSION 2.8.12 FATAL_ERROR ) +cmake_minimum_required( VERSION 3.0.2 FATAL_ERROR ) # because of http://public.kitware.com/Bug/view.php?id=10395 # See https://gitlab.kitware.com/cmake/cmake/issues/15943 diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/dialogs/panel_hotkeys_editor.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/dialogs/panel_hotkeys_editor.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/dialogs/panel_hotkeys_editor.cpp 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/dialogs/panel_hotkeys_editor.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -105,7 +105,7 @@ const BUTTON_ROW_PANEL::BTN_DEF_LIST l_btn_defs = { { wxID_RESET, - _( "Reset Hotkeys" ), + _( "Undo All Changes" ), _( "Undo all changes made so far in this dialog" ), [this]( wxCommandEvent& ){ m_hotkeyListCtrl->ResetAllHotkeys( false ); @@ -113,7 +113,7 @@ }, { wxID_ANY, - _( "Set to Defaults" ), + _( "Restore All to Defaults" ), _( "Set all hotkeys to the built-in KiCad defaults" ), [this]( wxCommandEvent& ){ m_hotkeyListCtrl->ResetAllHotkeys( true ); @@ -140,7 +140,7 @@ bool PANEL_HOTKEYS_EDITOR::TransferDataToWindow() { - m_hotkeyStore.Init( m_toolManagers ); + m_hotkeyStore.Init( m_toolManagers, m_readOnly ); return m_hotkeyListCtrl->TransferDataToControl(); } @@ -150,6 +150,9 @@ if( !m_hotkeyListCtrl->TransferDataFromControl() ) return false; + if( m_readOnly ) + return true; + // save the hotkeys for( TOOL_MANAGER* toolMgr : m_toolManagers ) WriteHotKeyConfig( toolMgr->GetActions() ); @@ -169,7 +172,7 @@ { wxString ext = DEFAULT_HOTKEY_FILENAME_EXT; wxString mask = wxT( "*." ) + ext; - wxString filename = EDA_FILE_SELECTOR( _( "Read Hotkeys File:" ), m_frame->GetMruPath(), + wxString filename = EDA_FILE_SELECTOR( _( "Import Hotkeys File:" ), m_frame->GetMruPath(), wxEmptyString, ext, mask, this, wxFD_OPEN, true ); if( filename.IsEmpty() ) @@ -184,11 +187,11 @@ { for( HOTKEY& hotkey: section.m_HotKeys ) { - if( importedHotKeys.count( hotkey.m_Parent->GetName() ) ) - hotkey.m_EditKeycode = importedHotKeys[ hotkey.m_Parent->GetName() ]; + if( importedHotKeys.count( hotkey.m_Actions[ 0 ]->GetName() ) ) + hotkey.m_EditKeycode = importedHotKeys[ hotkey.m_Actions[ 0 ]->GetName() ]; } } - + m_hotkeyListCtrl->TransferDataToControl(); } diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/eda_base_frame.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/eda_base_frame.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/eda_base_frame.cpp 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/eda_base_frame.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -318,6 +319,8 @@ void EDA_BASE_FRAME::CommonSettingsChanged() { + GetToolManager()->GetActionManager()->UpdateHotKeys( false ); + if( GetMenuBar() ) { // For icons in menus, icon scaling & hotkeys @@ -530,8 +533,10 @@ } // The Kicad manager frame is not a player so we have to add it by hand - if( IsType( KICAD_MAIN_FRAME_T ) ) - InstallPreferences( &dlg, hotkeysPanel ); + wxWindow* manager = wxFindWindowByName( KICAD_MANAGER_FRAME_NAME ); + + if( manager ) + static_cast( manager )->InstallPreferences( &dlg, hotkeysPanel ); if( dlg.ShowModal() == wxID_OK ) dlg.Kiway().CommonSettingsChanged(); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/hotkeys_basic.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/hotkeys_basic.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/hotkeys_basic.cpp 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/hotkeys_basic.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -96,12 +96,11 @@ { wxT( "Space" ), WXK_SPACE }, - { wxT( "" ), 0 }, + { wxT( "" ), 0 }, - { wxT( "Left Button" ), PSEUDO_WXK_LMB }, - { wxT( "Middle Button" ), PSEUDO_WXK_MMB }, - { wxT( "Right Button" ), PSEUDO_WXK_RMB }, - { wxT( "Mouse Wheel" ), PSEUDO_WXK_WHEEL }, + { wxT( "Click" ), PSEUDO_WXK_CLICK }, + { wxT( "DblClick" ), PSEUDO_WXK_DBLCLICK }, + { wxT( "Wheel" ), PSEUDO_WXK_WHEEL }, // Do not change this line: end of list { wxT( "" ), KEY_NON_FOUND } @@ -360,11 +359,8 @@ // Overlay the current app's hotkey definitions onto the map // for( const auto& ii : aActionMap ) - { - if( ii.second->GetHotKey() ) - hotkeys[ ii.first ] = ii.second->GetHotKey(); - } - + hotkeys[ ii.first ] = ii.second->GetHotKey(); + // Write entire hotkey set // wxFile file( fn.GetFullPath(), wxFile::OpenMode::write ); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/hotkey_store.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/hotkey_store.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/hotkey_store.cpp 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/hotkey_store.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -38,11 +39,16 @@ } }; -static GESTURE_PSEUDO_ACTION g_gesturePseudoActions[] = { - GESTURE_PSEUDO_ACTION( _( "Highlight Net" ), MD_CTRL + PSEUDO_WXK_LMB ), - GESTURE_PSEUDO_ACTION( _( "Clear Net Highlighting" ), MD_CTRL + PSEUDO_WXK_LMB ), - GESTURE_PSEUDO_ACTION( _( "Pan Left/Right" ), MD_CTRL + PSEUDO_WXK_WHEEL ), - GESTURE_PSEUDO_ACTION( _( "Pan Up/Down" ), MD_SHIFT + PSEUDO_WXK_WHEEL ), +static GESTURE_PSEUDO_ACTION* g_gesturePseudoActions[] = { + new GESTURE_PSEUDO_ACTION( _( "Highlight Net" ), MD_CTRL + PSEUDO_WXK_CLICK ), + new GESTURE_PSEUDO_ACTION( _( "Clear Net Highlighting" ), MD_CTRL + PSEUDO_WXK_CLICK ), + new GESTURE_PSEUDO_ACTION( _( "Pan Left/Right" ), MD_CTRL + PSEUDO_WXK_WHEEL ), + new GESTURE_PSEUDO_ACTION( _( "Pan Up/Down" ), MD_SHIFT + PSEUDO_WXK_WHEEL ), + new GESTURE_PSEUDO_ACTION( _( "Finish Drawing" ), PSEUDO_WXK_DBLCLICK ), + new GESTURE_PSEUDO_ACTION( _( "Add to Selection" ), MD_SHIFT + PSEUDO_WXK_CLICK ), + new GESTURE_PSEUDO_ACTION( _( "Remove from Selection" ), MD_CTRL + PSEUDO_WXK_CLICK ), + new GESTURE_PSEUDO_ACTION( _( "Ignore Grid Snaps" ), MD_ALT ), + new GESTURE_PSEUDO_ACTION( _( "Ignore Other Snaps" ), MD_SHIFT ), }; @@ -78,13 +84,13 @@ } -void HOTKEY_STORE::Init( std::vector aToolManagerList ) +void HOTKEY_STORE::Init( std::vector aToolManagerList, bool aIncludeGestures ) { m_toolManagers = std::move( aToolManagerList ); // Collect all action maps into a single master map. This will re-group everything - // and elimate duplicates - std::map masterMap; + // and collect duplicates together + std::map masterMap; for( TOOL_MANAGER* toolMgr : m_toolManagers ) { @@ -93,8 +99,10 @@ // Internal actions probably shouldn't be allowed hotkeys if( entry.second->GetLabel().IsEmpty() ) continue; - - masterMap[ entry.first ] = entry.second; + + HOTKEY& hotkey = masterMap[ entry.first ]; + hotkey.m_Actions.push_back( entry.second ); + hotkey.m_EditKeycode = entry.second->GetHotKey(); } } @@ -103,25 +111,29 @@ for( const auto& entry : masterMap ) { - wxString thisApp = GetAppName( entry.second ); + TOOL_ACTION* entryAction = entry.second.m_Actions[ 0 ]; + wxString entryApp = GetAppName( entryAction ); - if( thisApp != currentApp ) + if( entryApp != currentApp ) { m_hk_sections.emplace_back( HOTKEY_SECTION() ); - currentApp = thisApp; + currentApp = entryApp; currentSection = &m_hk_sections.back(); - currentSection->m_SectionName = GetSectionName( entry.second ); + currentSection->m_SectionName = GetSectionName( entryAction ); } currentSection->m_HotKeys.emplace_back( HOTKEY( entry.second ) ); } - m_hk_sections.emplace_back( HOTKEY_SECTION() ); - currentSection = &m_hk_sections.back(); - currentSection->m_SectionName = _( "Gestures" ); + if( aIncludeGestures ) + { + m_hk_sections.emplace_back( HOTKEY_SECTION() ); + currentSection = &m_hk_sections.back(); + currentSection->m_SectionName = _( "Gestures" ); - for( TOOL_ACTION& gesture : g_gesturePseudoActions ) - currentSection->m_HotKeys.emplace_back( HOTKEY( &gesture ) ); + for( TOOL_ACTION* gesture : g_gesturePseudoActions ) + currentSection->m_HotKeys.emplace_back( HOTKEY( gesture ) ); + } } @@ -133,33 +145,33 @@ void HOTKEY_STORE::SaveAllHotkeys() { - for( HOTKEY_SECTION& section: m_hk_sections ) + for( HOTKEY_SECTION& section : m_hk_sections ) { - for( HOTKEY& hotkey: section.m_HotKeys ) - hotkey.m_Parent->SetHotKey( hotkey.m_EditKeycode ); + for( HOTKEY& hotkey : section.m_HotKeys ) + { + for( TOOL_ACTION* action : hotkey.m_Actions ) + action->SetHotKey( hotkey.m_EditKeycode ); + } } - - if( !m_toolManagers.empty() ) - m_toolManagers[ 0 ]->GetActionManager()->UpdateHotKeys( false ); } void HOTKEY_STORE::ResetAllHotkeysToDefault() { - for( HOTKEY_SECTION& section: m_hk_sections ) + for( HOTKEY_SECTION& section : m_hk_sections ) { - for( HOTKEY& hotkey: section.m_HotKeys ) - hotkey.m_EditKeycode = hotkey.m_Parent->GetDefaultHotKey(); + for( HOTKEY& hotkey : section.m_HotKeys ) + hotkey.m_EditKeycode = hotkey.m_Actions[ 0 ]->GetDefaultHotKey(); } } void HOTKEY_STORE::ResetAllHotkeysToOriginal() { - for( HOTKEY_SECTION& section: m_hk_sections ) + for( HOTKEY_SECTION& section : m_hk_sections ) { - for( HOTKEY& hotkey: section.m_HotKeys ) - hotkey.m_EditKeycode = hotkey.m_Parent->GetHotKey(); + for( HOTKEY& hotkey : section.m_HotKeys ) + hotkey.m_EditKeycode = hotkey.m_Actions[ 0 ]->GetHotKey(); } } @@ -175,7 +187,7 @@ for( HOTKEY& hotkey: section.m_HotKeys ) { - if( hotkey.m_Parent == aAction ) + if( hotkey.m_Actions[ 0 ] == aAction ) continue; if( hotkey.m_EditKeycode == aKey ) diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/tool/action_manager.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/tool/action_manager.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/tool/action_manager.cpp 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/tool/action_manager.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -42,19 +42,13 @@ if( action->m_id == -1 ) action->m_id = MakeActionId( action->m_name ); - RegisterAction( new TOOL_ACTION( *action ) ); + RegisterAction( action ); } } ACTION_MANAGER::~ACTION_MANAGER() { - while( !m_actionNameIndex.empty() ) - { - TOOL_ACTION* action = m_actionNameIndex.begin()->second; - UnregisterAction( action ); - delete action; - } } @@ -71,22 +65,6 @@ } -void ACTION_MANAGER::UnregisterAction( TOOL_ACTION* aAction ) -{ - m_actionNameIndex.erase( aAction->m_name ); - int hotkey = GetHotKey( *aAction ); - - if( hotkey ) - { - std::list& actions = m_actionHotKeys[hotkey]; - auto action = std::find( actions.begin(), actions.end(), aAction ); - - if( action != actions.end() ) - actions.erase( action ); - } -} - - int ACTION_MANAGER::MakeActionId( const std::string& aActionName ) { static int currentActionId = 1; @@ -207,9 +185,9 @@ ReadHotKeyConfig( wxEmptyString, userHotKeyMap ); } - for( const auto& actionName : m_actionNameIndex ) + for( const auto& ii : m_actionNameIndex ) { - TOOL_ACTION* action = actionName.second; + TOOL_ACTION* action = ii.second; int hotkey = 0; if( aFullUpdate ) @@ -218,10 +196,9 @@ hotkey = action->GetHotKey(); if( hotkey > 0 ) - { m_actionHotKeys[hotkey].push_back( action ); - m_hotkeys[action->GetId()] = hotkey; - } + + m_hotkeys[action->GetId()] = hotkey; } } @@ -232,10 +209,10 @@ aAction->m_hotKey = aAction->m_defaultHotKey; if( !aAction->m_legacyName.empty() && aLegacyMap.count( aAction->m_legacyName ) ) - aAction->m_hotKey = aLegacyMap[ aAction->m_legacyName ]; + aAction->SetHotKey( aLegacyMap[ aAction->m_legacyName ] ); if( aHotKeyMap.count( aAction->m_name ) ) - aAction->m_hotKey = aHotKeyMap[ aAction->m_name ]; + aAction->SetHotKey( aHotKeyMap[ aAction->m_name ] ); return aAction->m_hotKey; } diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/tool/tool_manager.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/tool/tool_manager.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/tool/tool_manager.cpp 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/tool/tool_manager.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -260,18 +260,6 @@ } -void TOOL_MANAGER::RegisterAction( TOOL_ACTION* aAction ) -{ - m_actionMgr->RegisterAction( aAction ); -} - - -void TOOL_MANAGER::UnregisterAction( TOOL_ACTION* aAction ) -{ - m_actionMgr->UnregisterAction( aAction ); -} - - bool TOOL_MANAGER::RunAction( const std::string& aActionName, bool aNow, void* aParam ) { TOOL_ACTION* action = m_actionMgr->FindAction( aActionName ); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/widgets/widget_hotkey_list.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/widgets/widget_hotkey_list.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/common/widgets/widget_hotkey_list.cpp 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/common/widgets/widget_hotkey_list.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -44,8 +44,7 @@ ID_EDIT_HOTKEY = 2001, ID_RESET, ID_DEFAULT, - ID_RESET_ALL, - ID_DEFAULT_ALL, + ID_CLEAR }; @@ -159,9 +158,9 @@ int key = aEvent.GetKeyCode(); - for( size_t i = 0; i < sizeof( skipped_keys ) / sizeof( skipped_keys[0] ); ++i ) + for( wxKeyCode skipped_key : skipped_keys ) { - if( key == skipped_keys[i] ) + if( key == skipped_key ) return; } @@ -209,14 +208,9 @@ HK_PROMPT_DIALOG dialog( aParent, wxID_ANY, _( "Set Hotkey" ), aName, aCurrentKey ); if( dialog.ShowModal() == wxID_OK ) - { return dialog.m_event; - } else - { - wxKeyEvent dummy; - return dummy; - } + return wxKeyEvent(); } }; @@ -235,7 +229,6 @@ m_valid = m_normalised_filter_str.size() > 0; } - /** * Method FilterMatches * @@ -249,7 +242,7 @@ return true; // Match in the (translated) filter string - const auto normedInfo = wxGetTranslation( aHotkey.m_Parent->GetLabel() ).Upper(); + const auto normedInfo = wxGetTranslation( aHotkey.m_Actions[ 0 ]->GetLabel() ).Upper(); if( normedInfo.Contains( m_normalised_filter_str ) ) return true; @@ -302,14 +295,14 @@ if( hkdata ) { const auto& changed_hk = hkdata->GetChangedHotkey(); - wxString label = changed_hk.m_Parent->GetLabel(); + wxString label = changed_hk.m_Actions[ 0 ]->GetLabel(); wxString key_text = KeyNameFromKeyCode( changed_hk.m_EditKeycode ); if( label.IsEmpty() ) - label = changed_hk.m_Parent->GetName(); + label = changed_hk.m_Actions[ 0 ]->GetName(); // mark unsaved changes - if( changed_hk.m_EditKeycode != changed_hk.m_Parent->GetHotKey() ) + if( changed_hk.m_EditKeycode != changed_hk.m_Actions[ 0 ]->GetHotKey() ) key_text += " *"; SetItemText( i, 0, label ); @@ -331,7 +324,7 @@ if( exists && aHotkey.m_EditKeycode != aKey ) { - if( ResolveKeyConflicts( aHotkey.m_Parent, aKey ) ) + if( aKey == 0 || ResolveKeyConflicts( aHotkey.m_Actions[ 0 ], aKey ) ) aHotkey.m_EditKeycode = aKey; } } @@ -358,7 +351,7 @@ } -void WIDGET_HOTKEY_LIST::ResetItem( wxTreeListItem aItem ) +void WIDGET_HOTKEY_LIST::ResetItem( wxTreeListItem aItem, int aResetId ) { WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem ); @@ -367,21 +360,13 @@ auto& changed_hk = hkdata->GetChangedHotkey(); - changeHotkey( changed_hk, changed_hk.m_Parent->GetHotKey() ); - UpdateFromClientData(); -} - + if( aResetId == ID_RESET ) + changeHotkey( changed_hk, changed_hk.m_Actions[ 0 ]->GetHotKey() ); + else if( aResetId == ID_CLEAR ) + changeHotkey( changed_hk, 0 ); + else if( aResetId == ID_DEFAULT ) + changeHotkey( changed_hk, changed_hk.m_Actions[ 0 ]->GetDefaultHotKey() ); -void WIDGET_HOTKEY_LIST::ResetItemToDefault( wxTreeListItem aItem ) -{ - WIDGET_HOTKEY_CLIENT_DATA* hkdata = getExpectedHkClientData( aItem ); - - if( !hkdata ) - return; - - auto& changed_hk = hkdata->GetChangedHotkey(); - - changeHotkey( changed_hk, changed_hk.m_Parent->GetDefaultHotKey() ); UpdateFromClientData(); } @@ -406,14 +391,12 @@ { menu.Append( ID_EDIT_HOTKEY, _( "Edit..." ) ); menu.Append( ID_RESET, _( "Undo Changes" ) ); + menu.Append( ID_CLEAR, _( "Clear Assigned Hotkey" ) ); menu.Append( ID_DEFAULT, _( "Restore Default" ) ); menu.Append( wxID_SEPARATOR ); - } - menu.Append( ID_RESET_ALL, _( "Undo All Changes" ) ); - menu.Append( ID_DEFAULT_ALL, _( "Restore All to Default" ) ); - - PopupMenu( &menu ); + PopupMenu( &menu ); + } } @@ -426,19 +409,9 @@ break; case ID_RESET: - ResetItem( m_context_menu_item ); - break; - + case ID_CLEAR: case ID_DEFAULT: - ResetItemToDefault( m_context_menu_item ); - break; - - case ID_RESET_ALL: - ResetAllHotkeys( false ); - break; - - case ID_DEFAULT_ALL: - ResetAllHotkeys( true ); + ResetItem( m_context_menu_item, aEvent.GetId() ); break; default: @@ -456,7 +429,7 @@ if( !conflictingHotKey ) return true; - TOOL_ACTION* conflictingAction = conflictingHotKey->m_Parent; + TOOL_ACTION* conflictingAction = conflictingHotKey->m_Actions[ 0 ]; wxString msg = wxString::Format( _( "\"%s\" is already assigned to \"%s\" in section \"%s\". " "Are you sure you want to change its assignment?" ), KeyNameFromKeyCode( aKey ), @@ -517,13 +490,9 @@ // Should not need to check conflicts, as the state we're about // to set to a should be consistent if( aResetToDefault ) - { m_hk_store.ResetAllHotkeysToDefault(); - } else - { m_hk_store.ResetAllHotkeysToOriginal(); - } UpdateFromClientData(); Thaw(); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/copyright.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/copyright.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/copyright.h 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/copyright.h 2019-06-15 01:04:07.000000000 +0000 @@ -12,8 +12,8 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2018 - * Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019 + * Copyright (C) 2019 KiCad Developers, see AUTHORS.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 diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/eeschema/dialogs/dialog_erc.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/eeschema/dialogs/dialog_erc.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/eeschema/dialogs/dialog_erc.cpp 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/eeschema/dialogs/dialog_erc.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -49,7 +49,8 @@ #include #include #include - +#include +#include #include #include #include @@ -283,6 +284,9 @@ if( sheetList[i] != m_parent->GetCurrentSheet() ) { + m_parent->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); + m_parent->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + m_parent->SetCurrentSheet( sheetList[i] ); m_parent->DisplayCurrentSheet(); sheetList[i].LastScreen()->SetZoom( m_parent->GetScreen()->GetZoom() ); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/eeschema/hierarch.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/eeschema/hierarch.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/eeschema/hierarch.cpp 2019-06-14 01:04:04.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/eeschema/hierarch.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -248,6 +248,9 @@ void HIERARCHY_NAVIG_DLG::onSelectSheetPath( wxTreeEvent& event ) { + m_SchFrameEditor->GetToolManager()->RunAction( ACTIONS::cancelInteractive, true ); + m_SchFrameEditor->GetToolManager()->RunAction( EE_ACTIONS::clearSelection, true ); + wxTreeItemId ItemSel = m_Tree->GetSelection(); m_SchFrameEditor->SetCurrentSheet(( (TreeItemData*) m_Tree->GetItemData( ItemSel ) )->m_SheetPath ); m_SchFrameEditor->DisplayCurrentSheet(); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/eeschema/tools/ee_selection_tool.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/eeschema/tools/ee_selection_tool.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/eeschema/tools/ee_selection_tool.cpp 2019-06-14 01:04:05.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/eeschema/tools/ee_selection_tool.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -486,16 +486,22 @@ collector.m_Threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) ); collector.Collect( start, aFilterList, (wxPoint) aWhere, m_unit, m_convert ); - bool anyCollected = collector.GetCount() != 0; + bool anyCollected = collector.GetCount() > 0; // Post-process collected items for( int i = collector.GetCount() - 1; i >= 0; --i ) { if( !selectable( collector[ i ] ) ) + { collector.Remove( i ); + continue; + } if( aCheckLocked && collector[ i ]->IsLocked() ) + { collector.Remove( i ); + continue; + } // SelectPoint, unlike other selection routines, can select line ends if( collector[ i ]->Type() == SCH_LINE_T ) diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/eeschema/tools/sch_editor_control.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/eeschema/tools/sch_editor_control.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/eeschema/tools/sch_editor_control.cpp 2019-06-14 01:04:05.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/eeschema/tools/sch_editor_control.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -1141,7 +1141,12 @@ if( selection.GetSize() == 1 ) { - g_CurrentSheet->push_back( (SCH_SHEET*) selection.Front() ); + SCH_SHEET* sheet = (SCH_SHEET*) selection.Front(); + + m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + + g_CurrentSheet->push_back( sheet ); m_frame->DisplayCurrentSheet(); } @@ -1153,6 +1158,9 @@ { if( g_CurrentSheet->Last() != g_RootSheet ) { + m_toolMgr->RunAction( ACTIONS::cancelInteractive, true ); + m_toolMgr->RunAction( EE_ACTIONS::clearSelection, true ); + g_CurrentSheet->pop_back(); m_frame->DisplayCurrentSheet(); } diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/eda_base_frame.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/eda_base_frame.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/eda_base_frame.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/eda_base_frame.h 2019-06-15 01:04:07.000000000 +0000 @@ -52,6 +52,9 @@ #define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS +#define KICAD_MANAGER_FRAME_NAME wxT( "KicadFrame" ) + + // Readability helper definitions for creating backup files. #define CREATE_BACKUP_FILE true #define NO_BACKUP_FILE false diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/hotkeys_basic.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/hotkeys_basic.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/hotkeys_basic.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/hotkeys_basic.h 2019-06-15 01:04:07.000000000 +0000 @@ -47,10 +47,9 @@ /* * Keep these out of the ASCII range, and out of the WXK range */ -#define PSEUDO_WXK_LMB 400 -#define PSEUDO_WXK_MMB 401 -#define PSEUDO_WXK_RMB 402 -#define PSEUDO_WXK_WHEEL 403 +#define PSEUDO_WXK_CLICK 400 +#define PSEUDO_WXK_DBLCLICK 401 +#define PSEUDO_WXK_WHEEL 402 /** * Function KeyCodeFromKeyName diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/hotkey_store.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/hotkey_store.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/hotkey_store.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/hotkey_store.h 2019-06-15 01:04:07.000000000 +0000 @@ -32,13 +32,18 @@ struct HOTKEY { - TOOL_ACTION* m_Parent; - int m_EditKeycode; + std::vector m_Actions; + int m_EditKeycode; - HOTKEY( TOOL_ACTION* aParent ) : - m_Parent( aParent ), - m_EditKeycode( aParent->GetHotKey() ) + HOTKEY() : + m_EditKeycode( 0 ) { } + + HOTKEY( TOOL_ACTION* aAction ) : + m_EditKeycode( aAction->GetHotKey() ) + { + m_Actions.push_back( aAction ); + } }; @@ -64,7 +69,7 @@ */ HOTKEY_STORE(); - void Init( std::vector aToolManagerList ); + void Init( std::vector aToolManagerList, bool aIncludeGestures ); static wxString GetAppName( TOOL_ACTION* aAction ); static wxString GetSectionName( TOOL_ACTION* aAction ); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/tool/action_manager.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/tool/action_manager.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/tool/action_manager.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/tool/action_manager.h 2019-06-15 01:04:07.000000000 +0000 @@ -63,13 +63,6 @@ void RegisterAction( TOOL_ACTION* aAction ); /** - * Function UnregisterAction() - * Removes a tool action from the manager and makes it unavailable for further usage. - * @param aAction: action to be removed. - */ - void UnregisterAction( TOOL_ACTION* aAction ); - - /** * Generates an unique ID from for an action with given name. */ static int MakeActionId( const std::string& aActionName ); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/tool/tool_action.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/tool/tool_action.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/tool/tool_action.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/tool/tool_action.h 2019-06-15 01:04:07.000000000 +0000 @@ -173,6 +173,10 @@ TOOL_ACTION_FLAGS m_flags; void* m_param; // Generic parameter +private: + // TOOL_ACTIONS are singletons; don't be copying them around.... + TOOL_ACTION( const TOOL_ACTION& ) = delete; + TOOL_ACTION& operator= ( const TOOL_ACTION& ) = delete; }; #endif diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/tool/tool_manager.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/tool/tool_manager.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/tool/tool_manager.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/tool/tool_manager.h 2019-06-15 01:04:07.000000000 +0000 @@ -95,23 +95,6 @@ bool InvokeTool( const std::string& aToolName ); /** - * Function RegisterAction() - * Registers an action that can be used to control tools (eg. invoke, trigger specific - * behaviours). - * - * @param aAction is the action to be registered. - */ - void RegisterAction( TOOL_ACTION* aAction ); - - /** - * Function UnregisterAction() - * Unregisters an action, so it is no longer active. - * - * @param aAction is the action to be unregistered. - */ - void UnregisterAction( TOOL_ACTION* aAction ); - - /** * Function RunAction() * Runs the specified action. The common format for action names is "application.ToolName.Action". * diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/widgets/widget_hotkey_list.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/widgets/widget_hotkey_list.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/include/widgets/widget_hotkey_list.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/include/widgets/widget_hotkey_list.h 2019-06-15 01:04:07.000000000 +0000 @@ -98,15 +98,9 @@ /** * Method ResetItem - * Reset the item to the original from the dialog was created. + * Reset the item to either the default, the value when the dialog was opened, or none. */ - void ResetItem( wxTreeListItem aItem ); - - /** - * Method ResetItemToDefault - * Reset the item to the default value. - */ - void ResetItemToDefault( wxTreeListItem aItem ); + void ResetItem( wxTreeListItem aItem, int aResetId ); /** * Method OnActivated diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/kicad/kicad_manager_frame.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/kicad/kicad_manager_frame.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/kicad/kicad_manager_frame.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/kicad/kicad_manager_frame.h 2019-06-15 01:04:07.000000000 +0000 @@ -30,9 +30,6 @@ #include #include -#define KICAD_MANAGER_FRAME_NAME wxT( "KicadFrame" ) - -class LAUNCHER_PANEL; class TREEPROJECTFILES; class TREE_PROJECT_FRAME; class ACTION_TOOLBAR; diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/CMakeLists.txt kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/CMakeLists.txt --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/CMakeLists.txt 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/CMakeLists.txt 2019-06-15 01:04:07.000000000 +0000 @@ -17,6 +17,8 @@ dialogs/dialogs_for_printing.cpp dialogs/dialog_new_dataitem_base.cpp dialogs/dialog_new_dataitem.cpp + dialogs/dialog_design_inspector_base.cpp + design_inspector.cpp pl_editor_screen.cpp pl_editor_layout.cpp files.cpp diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/design_inspector.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/design_inspector.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/design_inspector.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/design_inspector.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -0,0 +1,337 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2019 jp.charras at wanadoo.fr + * Copyright (C) 2019 KiCad Developers, see AUTHORS.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 3 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, see . + */ + +/** + * @file design_inspector.cpp + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* XPM + * This bitmap is used to show item types + */ +static const char* root_xpm[] = +{ + "12 12 2 1", + " c None", + "x c #008080", + " xxxx ", + " xxx ", + " xxx ", + " xxx ", + "xxxxxxxxxxx ", + "xxxxxxxxxxxx", + "xxxxxxxxxxx ", + " xxx ", + " xxx ", + " xxx ", + " xxxx ", + " " +}; + +static const char* line_xpm[] = +{ + "12 12 2 1", + " c None", + "x c #008080", + "xx ", + "xx ", + "xx ", + "xx ", + "xx ", + "xx ", + "xx ", + "xx ", + "xx ", + "xx ", + "xxxxxxxxxxxx", + "xxxxxxxxxxxx" +}; + +static const char* rect_xpm[] = +{ + "12 12 2 1", + " c None", + "x c #000080", + "xxxxxxxxxxxx", + "xxxxxxxxxxxx", + "xx xx", + "xx xx", + "xx xx", + "xx xx", + "xx xx", + "xx xx", + "xx xx", + "xx xx", + "xxxxxxxxxxxx", + "xxxxxxxxxxxx" +}; + +static const char* text_xpm[] = +{ + "12 12 2 1", + " c None", + "x c #800000", + " xxxxxxxxxx ", + "xxxxxxxxxxxx", + "xx xx xx", + " xx ", + " xx ", + " xx ", + " xx ", + " xx ", + " xx ", + " xx ", + " xxxx ", + " xxxxxx " +}; + +static const char* poly_xpm[] = +{ + "12 12 2 1", + " c None", + "x c #008000", + " xx ", + " xxxx ", + " xxxxxx ", + " xxxxxxxx ", + " xxxxxxxxxx ", + "xxxxxxxxxxxx", + "xxxxxxxxxxxx", + " xxxxxxxxxx ", + " xxxxxxxx ", + " xxxxxx ", + " xxxx ", + " xx " +}; + +static const char* img_xpm[] = +{ + "12 12 2 1", + " c None", + "x c #800000", + " xx ", + " xxxxxx ", + " xx xx ", + "xx xx", + "xx xx", + " xx xx ", + " xxxxxx ", + " xx ", + " xx ", + " xx ", + " xx ", + " xx " +}; + +// A helper class to draw these bitmaps into a wxGrid cell: +class BitmapGridCellRenderer : public wxGridCellStringRenderer +{ + const char** m_BitmapXPM; +public: + BitmapGridCellRenderer( const char** aBitmapXPM ) + { + m_BitmapXPM = aBitmapXPM; + } + + void Draw( wxGrid& aGrid, wxGridCellAttr& aAttr, + wxDC& aDc, const wxRect& aRect, + int aRow, int aCol, bool aIsSelected) override; +}; + +// Column ids for m_gridListItems +#define COL_BITMAP 0 +#define COL_TYPENAME 1 +#define COL_COUNT 2 +#define COL_COMMENT 3 +#define COL_TEXTSTRING 4 + + +DIALOG_INSPECTOR::DIALOG_INSPECTOR( PL_EDITOR_FRAME* aParent ) : + DIALOG_INSPECTOR_BASE( aParent ) +{ + m_editorFrame = aParent; + ReCreateDesignList(); + + // Now all widgets have the size fixed, call FinishDialogSettings + FinishDialogSettings(); +} + + +DIALOG_INSPECTOR::~DIALOG_INSPECTOR() +{ +} + + + +void DIALOG_INSPECTOR::ReCreateDesignList() +{ + wxWindowUpdateLocker dummy( this ); // Avoid flicker when rebuilding the tree + + if( m_gridListItems->GetNumberRows() > 1 ) + m_gridListItems->DeleteRows( 1, m_gridListItems->GetNumberRows() - 1 ); + + m_itemsList.clear(); + + WS_DATA_MODEL& pglayout = WS_DATA_MODEL::GetTheInstance(); + + wxFileName fn( ((PL_EDITOR_FRAME*) GetParent())->GetCurrFileName() ); + + if( fn.GetName().IsEmpty() ) + SetTitle( "" ); + else + SetTitle( fn.GetName() ); + + // The first item is the entire page + int row = 0; + GetGridList()->SetCellValue( row, COL_TYPENAME, _( "Page" ) ); + GetGridList()->SetCellValue( row, COL_COMMENT, _( "A4" ) ); + GetGridList()->SetCellValue( row, COL_COUNT, "-" ); + GetGridList()->SetCellValue( row, COL_TEXTSTRING, _( "The current page" ) ); + GetGridList()->SetCellRenderer (row, COL_BITMAP, new BitmapGridCellRenderer( root_xpm ) ); + GetGridList()->SetReadOnly( row, COL_BITMAP ); + m_itemsList.push_back( nullptr ); // this item is not a WS_DATA_ITEM, just a pseudo item + + // Now adding all current items + row++; + for( WS_DATA_ITEM* item : pglayout.GetItems() ) + { + const char** img = nullptr; + + switch( item->GetType() ) + { + case WS_DATA_ITEM::WS_SEGMENT: + img = line_xpm; + break; + + case WS_DATA_ITEM::WS_RECT: + img = rect_xpm; + break; + + case WS_DATA_ITEM::WS_TEXT: + img = text_xpm; + break; + + case WS_DATA_ITEM::WS_POLYPOLYGON: + img = poly_xpm; + break; + + case WS_DATA_ITEM::WS_BITMAP: + img = img_xpm; + break; + } + + GetGridList()->AppendRows( 1 ); + GetGridList()->SetCellRenderer (row, COL_BITMAP, new BitmapGridCellRenderer( img ) ); + GetGridList()->SetReadOnly( row, COL_BITMAP ); + GetGridList()->SetCellValue( row, COL_TYPENAME,item->GetClassName() ); + GetGridList()->SetCellValue( row, COL_COUNT, + wxString::Format( "%d", item->m_RepeatCount ) ); + GetGridList()->SetCellValue( row, COL_COMMENT, item->m_Info ); + + if( item->GetType() == WS_DATA_ITEM::WS_TEXT ) + { + WS_DATA_ITEM_TEXT* t_item = static_cast( item ); + GetGridList()->SetCellValue( row, COL_TEXTSTRING, t_item->m_TextBase ); + } + + m_itemsList.push_back( item ); + row++; + } +} + + +// Select the row corresponding to the WS_DATA_ITEM aItem +void DIALOG_INSPECTOR::SelectRow( WS_DATA_ITEM* aItem ) +{ + // m_itemsList[0] is not a true WS_DATA_ITEM + for( unsigned row = 1; row < m_itemsList.size(); ++row ) + { + if( m_itemsList[row] == aItem ) + { + GetGridList()->GoToCell( row, COL_TYPENAME ); + GetGridList()->SelectRow( row ); + break; + } + } +} + +//return the page layout item managed by the cell +WS_DATA_ITEM* DIALOG_INSPECTOR::GetWsDataItem( int aRow ) const +{ + return ( aRow >= 0 && aRow < (int)m_itemsList.size() ) ? m_itemsList[aRow]: nullptr; +} + + +/* return the page layout item managed by the selected cell (or NULL) + */ +WS_DATA_ITEM* DIALOG_INSPECTOR::GetSelectedWsDataItem() const +{ + int idx = GetGridList()->GetGridCursorRow(); + return GetWsDataItem( idx ); +} + + +void DIALOG_INSPECTOR::onCellClicked( wxGridEvent& event ) +{ + int row = event.GetRow(); + GetGridList()->SelectRow( row ); + + WS_DATA_ITEM* item = GetWsDataItem( row ); + + if( !item ) // only WS_DATA_ITEM are returned. + return; + + // Select this item in page layout editor, and update the properties panel: + PL_SELECTION_TOOL* selectionTool = m_editorFrame->GetToolManager()->GetTool(); + selectionTool->ClearSelection(); + EDA_ITEM* draw_item = item->GetDrawItems()[0]; + selectionTool->AddItemToSel( draw_item ); + m_editorFrame->GetCanvas()->Refresh(); + m_editorFrame->GetPropertiesFrame()->CopyPrmsFromItemToPanel( item ); +} + + +void BitmapGridCellRenderer::Draw( wxGrid& aGrid, wxGridCellAttr& aAttr, + wxDC& aDc, const wxRect& aRect, + int aRow, int aCol, bool aIsSelected) +{ + wxGridCellStringRenderer::Draw( aGrid, aAttr, aDc, aRect, aRow, aCol, aIsSelected); + wxBitmap bm( m_BitmapXPM ); + aDc.DrawBitmap( bm,aRect.GetX()+5, aRect.GetY()+2, true); +} + + +void PL_EDITOR_FRAME::ShowDesignInspector() +{ + DIALOG_INSPECTOR dlg( this ); + + dlg.ShowModal(); +} diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/design_inspector.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/design_inspector.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/design_inspector.h 1970-01-01 00:00:00.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/design_inspector.h 2019-06-15 01:04:07.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2019 jp.charras at wanadoo.fr + * Copyright (C) 2019 KiCad Developers, see AUTHORS.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 3 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, see . + */ + + +/** + * @file design_inspector.h + */ + +#ifndef _DESIGN_INSPECTOR_H +#define _DESIGN_INSPECTOR_H + +#include +#include +#include + + +/** + * Class DESIGN_INSPECTOR is the left window showing the list of items + */ + +class DIALOG_INSPECTOR : public DIALOG_INSPECTOR_BASE +{ + friend class PL_EDITOR_FRAME; + +private: + wxGrid* GetGridList() const { return m_gridListItems; } + void onCellClicked( wxGridEvent& event ) override; + + // The list of WS_DATA_ITEM found in page layout + std::vector m_itemsList; + PL_EDITOR_FRAME* m_editorFrame; + +public: + DIALOG_INSPECTOR( PL_EDITOR_FRAME* aParent ); + ~DIALOG_INSPECTOR(); + + void ReCreateDesignList(); + + /** @return the WS_DATA_ITEM item managed by the grid row + */ + WS_DATA_ITEM* GetWsDataItem( int aRow ) const; + + /** @return the page layout item managed by the selected row (or NULL) + */ + WS_DATA_ITEM* GetSelectedWsDataItem() const; + + // Select the tree item corresponding to the WS_DATA_ITEM aItem + void SelectRow( WS_DATA_ITEM* aItem ); +}; + +#endif /* _DESIGN_INSPECTOR_H */ diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -0,0 +1,82 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 1 2018) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_design_inspector_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_INSPECTOR_BASE::DIALOG_INSPECTOR_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* bSizerMain; + bSizerMain = new wxBoxSizer( wxVERTICAL ); + + m_panelList = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizerListMain; + bSizerListMain = new wxBoxSizer( wxVERTICAL ); + + m_gridListItems = new wxGrid( m_panelList, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + + // Grid + m_gridListItems->CreateGrid( 1, 5 ); + m_gridListItems->EnableEditing( true ); + m_gridListItems->EnableGridLines( true ); + m_gridListItems->EnableDragGridSize( false ); + m_gridListItems->SetMargins( 0, 0 ); + + // Columns + m_gridListItems->EnableDragColMove( false ); + m_gridListItems->EnableDragColSize( true ); + m_gridListItems->SetColLabelSize( 30 ); + m_gridListItems->SetColLabelValue( 0, _("Type") ); + m_gridListItems->SetColLabelValue( 1, _("Name") ); + m_gridListItems->SetColLabelValue( 2, _("Count") ); + m_gridListItems->SetColLabelValue( 3, _("Comment") ); + m_gridListItems->SetColLabelValue( 4, _("Text") ); + m_gridListItems->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); + + // Rows + m_gridListItems->EnableDragRowSize( true ); + m_gridListItems->SetRowLabelSize( 40 ); + m_gridListItems->SetRowLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER ); + + // Label Appearance + + // Cell Defaults + m_gridListItems->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); + bSizerListMain->Add( m_gridListItems, 1, wxALL|wxEXPAND, 5 ); + + + m_panelList->SetSizer( bSizerListMain ); + m_panelList->Layout(); + bSizerListMain->Fit( m_panelList ); + bSizerMain->Add( m_panelList, 1, wxEXPAND, 5 ); + + m_sdbSizer = new wxStdDialogButtonSizer(); + m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizer->AddButton( m_sdbSizerCancel ); + m_sdbSizer->Realize(); + + bSizerMain->Add( m_sdbSizer, 0, wxALIGN_RIGHT|wxALL, 5 ); + + + this->SetSizer( bSizerMain ); + this->Layout(); + + this->Centre( wxBOTH ); + + // Connect Events + m_gridListItems->Connect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_INSPECTOR_BASE::onCellClicked ), NULL, this ); +} + +DIALOG_INSPECTOR_BASE::~DIALOG_INSPECTOR_BASE() +{ + // Disconnect Events + m_gridListItems->Disconnect( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEventHandler( DIALOG_INSPECTOR_BASE::onCellClicked ), NULL, this ); + +} diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.fbp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.fbp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.fbp 1970-01-01 00:00:00.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.fbp 2019-06-15 01:04:07.000000000 +0000 @@ -0,0 +1,234 @@ + + + + + ; + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_design_inspector_base + 1000 + none + + 1 + design_inspector + + . + + 1 + 1 + 1 + 1 + UI + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_INSPECTOR_BASE + + 423,293 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h; forward_declare + + + + + + + + bSizerMain + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panelList + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + bSizerListMain + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + 0 + 0 + + + + 1 + + + wxALIGN_LEFT + + wxALIGN_TOP + 0 + 1 + wxALIGN_CENTER + 30 + "Type" "Name" "Count" "Comment" "Text" + wxALIGN_CENTER + 5 + + + 1 + 0 + Dock + 0 + Left + 0 + 1 + 0 + 1 + 1 + 1 + + 1 + + + 1 + 0 + 0 + wxID_ANY + + + + 0 + 0 + + 0 + + + 0 + + 1 + m_gridListItems + 1 + + + protected + 1 + + Resizable + wxALIGN_CENTER + 40 + + wxALIGN_CENTER + + 1 + 1 + + ; ; forward_declare + 0 + + + + + onCellClicked + + + + + + + 5 + wxALIGN_RIGHT|wxALL + 0 + + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + + m_sdbSizer + protected + + + + + + diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.h 1970-01-01 00:00:00.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/dialogs/dialog_design_inspector_base.h 2019-06-15 01:04:07.000000000 +0000 @@ -0,0 +1,51 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Dec 1 2018) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_INSPECTOR_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_INSPECTOR_BASE : public DIALOG_SHIM +{ + private: + + protected: + wxPanel* m_panelList; + wxGrid* m_gridListItems; + wxStdDialogButtonSizer* m_sdbSizer; + wxButton* m_sdbSizerCancel; + + // Virtual event handlers, overide them in your derived class + virtual void onCellClicked( wxGridEvent& event ) { event.Skip(); } + + + public: + + DIALOG_INSPECTOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 423,293 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_INSPECTOR_BASE(); + +}; + diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/menubar.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/menubar.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/menubar.cpp 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/menubar.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -137,6 +137,12 @@ viewMenu->Resolve(); + //-- Inspector menu ------------------------------------------------------- + // + CONDITIONAL_MENU* inspectorMenu = new CONDITIONAL_MENU( false, selTool ); + inspectorMenu->AddItem( PL_ACTIONS::showInspector, SELECTION_CONDITIONS::ShowAlways ); + inspectorMenu->Resolve(); + //-- Place menu ------------------------------------------------------- // CONDITIONAL_MENU* placeMenu = new CONDITIONAL_MENU( false, selTool ); @@ -168,6 +174,7 @@ menuBar->Append( fileMenu, _( "&File" ) ); menuBar->Append( editMenu, _( "&Edit" ) ); menuBar->Append( viewMenu, _( "&View" ) ); + menuBar->Append( inspectorMenu, _( "&Inspect" ) ); menuBar->Append( placeMenu, _( "&Place" ) ); menuBar->Append( preferencesMenu, _( "P&references" ) ); AddStandardHelpMenu( menuBar ); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/pl_editor_frame.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/pl_editor_frame.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/pl_editor_frame.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/pl_editor_frame.h 2019-06-15 01:04:07.000000000 +0000 @@ -70,6 +70,11 @@ PROPERTIES_FRAME* GetPropertiesFrame() { return m_propertiesPagelayout; } + /** + * Show the dialog displaying the list of WS_DATA_ITEM items in the page layout + */ + void ShowDesignInspector(); + bool OpenProjectFiles( const std::vector& aFileSet, int aCtl ) override; /** diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/toolbars_pl_editor.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/toolbars_pl_editor.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/toolbars_pl_editor.cpp 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/toolbars_pl_editor.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -57,6 +57,9 @@ m_mainToolBar->Add( ACTIONS::zoomFitScreen ); m_mainToolBar->Add( ACTIONS::zoomTool, ACTION_TOOLBAR::TOGGLE ); + KiScaledSeparator( m_mainToolBar, this ); + m_mainToolBar->Add( PL_ACTIONS::showInspector ); + // Display mode switch KiScaledSeparator( m_mainToolBar, this ); m_mainToolBar->AddTool( ID_SHOW_REAL_MODE, wxEmptyString, diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_actions.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_actions.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_actions.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_actions.h 2019-06-15 01:04:07.000000000 +0000 @@ -77,6 +77,7 @@ static TOOL_ACTION deleteItemCursor; static TOOL_ACTION refreshPreview; static TOOL_ACTION toggleBackground; + static TOOL_ACTION showInspector; ///> @copydoc COMMON_ACTIONS::TranslateLegacyId() virtual OPT TranslateLegacyId( int aId ) override { return OPT(); } diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_editor_control.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_editor_control.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_editor_control.cpp 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_editor_control.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -44,6 +44,11 @@ _( "Background White" ), _( "Switch between white and black background" ), palette_xpm ); +TOOL_ACTION PL_ACTIONS::showInspector( "plEditor.EditorControl.ShowInspector", + AS_GLOBAL, 0, "", + _( "Show Design Inspector" ), _( "Show the list of items in page layout" ), + spreadsheet_xpm ); + bool PL_EDITOR_CONTROL::Init() { @@ -146,6 +151,13 @@ } +int PL_EDITOR_CONTROL::ShowInspector( const TOOL_EVENT& aEvent ) +{ + m_frame->ShowDesignInspector(); + return 0; +} + + int PL_EDITOR_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) { PL_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); @@ -192,6 +204,7 @@ Go( &PL_EDITOR_CONTROL::Quit, ACTIONS::quit.MakeEvent() ); Go( &PL_EDITOR_CONTROL::ToggleBackgroundColor, PL_ACTIONS::toggleBackground.MakeEvent() ); + Go( &PL_EDITOR_CONTROL::ShowInspector, PL_ACTIONS::showInspector.MakeEvent() ); Go( &PL_EDITOR_CONTROL::UpdateMessagePanel, EVENTS::SelectedEvent ); Go( &PL_EDITOR_CONTROL::UpdateMessagePanel, EVENTS::UnselectedEvent ); diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_editor_control.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_editor_control.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_editor_control.h 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pagelayout_editor/tools/pl_editor_control.h 2019-06-15 01:04:07.000000000 +0000 @@ -61,6 +61,7 @@ int Quit( const TOOL_EVENT& aEvent ); int ToggleBackgroundColor( const TOOL_EVENT& aEvent ); + int ShowInspector( const TOOL_EVENT& aEvent ); /** * Update the message panel *and* the Properties frame, after change diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/CMakeLists.txt kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/CMakeLists.txt --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/CMakeLists.txt 2019-06-14 01:04:06.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/CMakeLists.txt 2019-06-15 01:04:07.000000000 +0000 @@ -773,11 +773,7 @@ add_dependencies( ScriptingModulesPcbnewSoCopy ScriptingWxpythonCopy ) set( PYMOD_EXT "so" ) else() # only linux remains among supported platforms - add_library( pcbnew_python MODULE $ ) - target_link_libraries( pcbnew_python ${PCBNEW_KIFACE_LIBRARIES} ) - set_target_properties( pcbnew_python PROPERTIES OUTPUT_NAME pcbnew PREFIX "_" SUFFIX ".so" ) - install( TARGETS pcbnew_python DESTINATION ${PYTHON_DEST} COMPONENT binary ) - + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.kiface DESTINATION ${PYTHON_DEST} COMPONENT binary RENAME "_pcbnew.so" ) set( PYMOD_EXT "so" ) endif() @@ -792,18 +788,16 @@ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT} ) else() - - - # For phase 1, copy _pcbnew.kiface to the python module. - add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT} - DEPENDS pcbnew_kiface - COMMAND ${CMAKE_COMMAND} -E copy _pcbnew.kiface _pcbnew.${PYMOD_EXT} - COMMENT "Creating python's pcbnew native module _pcbnew.${PYMOD_EXT} for command line use." - ) - add_custom_target( - pcbnew_python_module ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT} - ) + # For phase 1, copy _pcbnew.kiface to the python module. + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT} + DEPENDS pcbnew_kiface + COMMAND ${CMAKE_COMMAND} -E copy _pcbnew.kiface _pcbnew.${PYMOD_EXT} + COMMENT "Creating python's pcbnew native module _pcbnew.${PYMOD_EXT} for command line use." + ) + add_custom_target( + pcbnew_python_module ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/_pcbnew.${PYMOD_EXT} + ) endif() endif() diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/dxf_import_plugin.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/dxf_import_plugin.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/dxf_import_plugin.h 2019-06-14 01:04:07.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/dxf_import_plugin.h 2019-06-15 01:04:07.000000000 +0000 @@ -148,6 +148,7 @@ { wxArrayString list; list.Add( "dxf" ); + list.Add( "DXF" ); return list; } diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/graphics_import_plugin.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/graphics_import_plugin.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/graphics_import_plugin.h 2019-06-14 01:04:07.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/graphics_import_plugin.h 2019-06-15 01:04:07.000000000 +0000 @@ -62,7 +62,7 @@ /** * Return a list of wildcards that contains the file extensions - * handled by this plugin, separated with a coma. + * handled by this plugin, separated with a semi-colon. */ wxString GetWildcards() const { @@ -74,7 +74,7 @@ if( first ) first = false; else - ret += ", "; + ret += ";"; ret += "*." + extension; } diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/svg_import_plugin.h kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/svg_import_plugin.h --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/svg_import_plugin.h 2019-06-14 01:04:07.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/import_gfx/svg_import_plugin.h 2019-06-15 01:04:07.000000000 +0000 @@ -46,6 +46,7 @@ { wxArrayString list; list.Add( "svg" ); + list.Add( "SVG" ); return list; } diff -Nru kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/menubar_footprint_editor.cpp kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/menubar_footprint_editor.cpp --- kicad-201906140104+dc56678~86~ubuntu16.04.1/kicad/pcbnew/menubar_footprint_editor.cpp 2019-06-14 01:04:07.000000000 +0000 +++ kicad-201906150104+f550eca~86~ubuntu16.04.1/kicad/pcbnew/menubar_footprint_editor.cpp 2019-06-15 01:04:07.000000000 +0000 @@ -84,7 +84,7 @@ submenuImport->SetIcon( import_xpm ); submenuImport->Add( PCB_ACTIONS::importFootprint ); - submenuImport->Add( _( "&Impot Graphics..." ), + submenuImport->Add( _( "&Import Graphics..." ), _( "Import 2D Drawing file to Footprint Editor on Drawings layer" ), ID_GEN_IMPORT_GRAPHICS_FILE, import_vector_xpm );