From 1cbcc8dc254841887ef15aab5aa43783c72a18d5 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 3 Apr 2014 09:40:55 +0200 Subject: [PATCH 01/11] All: add 2 hotkeys to simulate a mouse left click (key return) and left dclick (key end) --- common/dialogs/dialog_hotkeys_editor.cpp | 7 +++--- common/hotkey_grid_table.cpp | 23 +++++++++++++++++ common/hotkeys_basic.cpp | 2 ++ eeschema/hotkeys.cpp | 28 +++++++++++++++++++++ eeschema/hotkeys.h | 5 +++- eeschema/menubar.cpp | 4 ++- pagelayout_editor/hotkeys.cpp | 32 +++++++++++++++++++++--- pagelayout_editor/hotkeys.h | 5 +++- pagelayout_editor/onrightclick.cpp | 4 ++- pcbnew/hotkeys.cpp | 16 +++++++++--- pcbnew/hotkeys.h | 3 ++- pcbnew/hotkeys_board_editor.cpp | 19 +++++++------- pcbnew/hotkeys_module_editor.cpp | 9 +++++++ pcbnew/onrightclick.cpp | 2 +- 14 files changed, 133 insertions(+), 26 deletions(-) diff --git a/common/dialogs/dialog_hotkeys_editor.cpp b/common/dialogs/dialog_hotkeys_editor.cpp index bb3b85f523..1c249b7f3c 100644 --- a/common/dialogs/dialog_hotkeys_editor.cpp +++ b/common/dialogs/dialog_hotkeys_editor.cpp @@ -175,7 +175,7 @@ void HOTKEYS_EDITOR_DIALOG::OnClickOnCell( wxGridEvent& event ) /** OnRightClickOnCell * If a cell is selected, display a list of keys for selection * The list is restricted to keys that cannot be entered: - * tab, home ... because these keys have special functions in dialogs + * tab, home, return ... because these keys have special functions in dialogs */ void HOTKEYS_EDITOR_DIALOG::OnRightClickOnCell( wxGridEvent& event ) { @@ -186,8 +186,8 @@ void HOTKEYS_EDITOR_DIALOG::OnRightClickOnCell( wxGridEvent& event ) return; // Do not translate these key names. They are internally used. - //ee hotkeys_basic.cpp - #define C_COUNT 8 + // See hotkeys_basic.cpp + #define C_COUNT 9 wxString choices[C_COUNT] = { wxT("End") @@ -198,6 +198,7 @@ void HOTKEYS_EDITOR_DIALOG::OnRightClickOnCell( wxGridEvent& event ) wxT("Space"), wxT("Ctrl+Space"), wxT("Alt+Space"), + wxT("Return") }; wxString keyname = wxGetSingleChoice( _( "Special keys only. For others keys, use keyboard" ), diff --git a/common/hotkey_grid_table.cpp b/common/hotkey_grid_table.cpp index ecb75182aa..c1f82545f3 100644 --- a/common/hotkey_grid_table.cpp +++ b/common/hotkey_grid_table.cpp @@ -1,3 +1,26 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 1992-2014 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 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 /* diff --git a/common/hotkeys_basic.cpp b/common/hotkeys_basic.cpp index 968bcb47ca..5724fe94cd 100644 --- a/common/hotkeys_basic.cpp +++ b/common/hotkeys_basic.cpp @@ -133,6 +133,8 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] = { wxT( "Left" ), WXK_LEFT }, { wxT( "Right" ), WXK_RIGHT }, + { wxT( "Return" ), WXK_RETURN }, + { wxT( "Space" ), WXK_SPACE }, // Do not change this line: end of list diff --git a/eeschema/hotkeys.cpp b/eeschema/hotkeys.cpp index f6c83a9afa..b3ec06d534 100644 --- a/eeschema/hotkeys.cpp +++ b/eeschema/hotkeys.cpp @@ -128,6 +128,10 @@ static EDA_HOTKEY HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_SHIFT + GR_KB_CTRL + 'Z' (int) wxID_REDO ); #endif +// mouse click command: +static EDA_HOTKEY HkMouseLeftClick( wxT( "Mouse Left Click" ), HK_LEFT_CLICK, WXK_RETURN, 0 ); +static EDA_HOTKEY HkMouseLeftDClick( wxT( "Mouse Left DClick" ), HK_LEFT_DCLICK, WXK_END, 0 ); + // Schematic editor static EDA_HOTKEY HkBeginWire( wxT( "Begin Wire" ), HK_BEGIN_WIRE, 'W', ID_WIRE_BUTT ); static EDA_HOTKEY HkBeginBus( wxT( "Begin Bus" ), HK_BEGIN_BUS, 'B', ID_BUS_BUTT ); @@ -191,6 +195,8 @@ static EDA_HOTKEY HkDelete( wxT( "Delete Item" ), HK_DELETE, WXK_DELETE ); static EDA_HOTKEY HkFindItem( wxT( "Find Item" ), HK_FIND_ITEM, 'F' + GR_KB_CTRL, ID_FIND_ITEMS ); static EDA_HOTKEY HkFindNextItem( wxT( "Find Next Item" ), HK_FIND_NEXT_ITEM, WXK_F5, wxEVT_COMMAND_FIND ); +static EDA_HOTKEY HkFindReplace( wxT( "Find and Replace" ), HK_FIND_REPLACE, + 'F' + GR_KB_CTRL + GR_KB_ALT, wxID_REPLACE ); static EDA_HOTKEY HkFindNextDrcMarker( wxT( "Find Next DRC Marker" ), HK_FIND_NEXT_DRC_MARKER, WXK_F5 + GR_KB_SHIFT, EVT_COMMAND_FIND_DRC_MARKER ); @@ -220,6 +226,8 @@ EDA_HOTKEY* s_Common_Hotkey_List[] = &HkDrag, &HkUndo, &HkRedo, + &HkMouseLeftClick, + &HkMouseLeftDClick, NULL }; @@ -231,6 +239,7 @@ EDA_HOTKEY* s_Schematic_Hotkey_List[] = &HkFindItem, &HkFindNextItem, &HkFindNextDrcMarker, + &HkFindReplace, &HkInsert, &HkMove2Drag, &HkSaveBlock, @@ -361,6 +370,15 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, GetScreen()->m_O_Curseur = GetCrossHairPosition(); break; + case HK_LEFT_CLICK: + OnLeftClick( aDC, aPosition ); + break; + + case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events + OnLeftClick( aDC, aPosition ); + OnLeftDClick( aDC, aPosition ); + break; + case HK_ZOOM_IN: case HK_ZOOM_OUT: case HK_ZOOM_REDRAW: @@ -395,6 +413,7 @@ void SCH_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, case HK_UNDO: case HK_REDO: case HK_FIND_ITEM: + case HK_FIND_REPLACE: if( notBusy ) { cmd.SetId( hotKey->m_IdMenuEvent ); @@ -558,6 +577,15 @@ void LIB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPosition, GetScreen()->m_O_Curseur = GetCrossHairPosition(); break; + case HK_LEFT_CLICK: + OnLeftClick( aDC, aPosition ); + break; + + case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events + OnLeftClick( aDC, aPosition ); + OnLeftDClick( aDC, aPosition ); + break; + case HK_ZOOM_IN: case HK_ZOOM_OUT: case HK_ZOOM_REDRAW: diff --git a/eeschema/hotkeys.h b/eeschema/hotkeys.h index b434634181..a68a07dd7b 100644 --- a/eeschema/hotkeys.h +++ b/eeschema/hotkeys.h @@ -13,6 +13,7 @@ enum hotkey_id_commnand { HK_FIND_NEXT_ITEM = HK_COMMON_END, HK_FIND_NEXT_DRC_MARKER, HK_FIND_ITEM, + HK_FIND_REPLACE, HK_DELETE, HK_REPEAT_LAST, HK_LIBEDIT_MOVE_GRAPHIC_ITEM, @@ -48,7 +49,9 @@ enum hotkey_id_commnand { HK_ADD_NOCONN_FLAG, HK_SAVE_LIB, HK_SAVE_SCH, - HK_LOAD_SCH + HK_LOAD_SCH, + HK_LEFT_CLICK, + HK_LEFT_DCLICK }; // List of hotkey descriptors for Eeschema diff --git a/eeschema/menubar.cpp b/eeschema/menubar.cpp index 58ed11c90d..086473b394 100644 --- a/eeschema/menubar.cpp +++ b/eeschema/menubar.cpp @@ -213,7 +213,9 @@ void SCH_EDIT_FRAME::ReCreateMenuBar() AddMenuItem( editMenu, ID_FIND_ITEMS, text, HELP_FIND, KiBitmap( find_xpm ) ); // Find/Replace - AddMenuItem( editMenu, wxID_REPLACE, _( "Find and Re&place\tCtrl+Shift+F" ), HELP_REPLACE, + text = AddHotkeyName( _( "Find and Re&place" ), s_Schematic_Hokeys_Descr, + HK_FIND_REPLACE ); + AddMenuItem( editMenu, wxID_REPLACE, text, HELP_REPLACE, KiBitmap( find_replace_xpm ) ); // Import footprint association from the CvPcb cmp file: diff --git a/pagelayout_editor/hotkeys.cpp b/pagelayout_editor/hotkeys.cpp index 77ea54bccd..49a9d0e395 100644 --- a/pagelayout_editor/hotkeys.cpp +++ b/pagelayout_editor/hotkeys.cpp @@ -55,8 +55,12 @@ * and see this list for some ascii keys (space ...) */ -/* local variables */ -/* Hotkey list: */ +// Hotkey list: + +// mouse click command: +static EDA_HOTKEY HkMouseLeftClick( wxT( "Mouse Left Click" ), HK_LEFT_CLICK, WXK_RETURN, 0 ); +static EDA_HOTKEY HkMouseLeftDClick( wxT( "Mouse Left DClick" ), HK_LEFT_DCLICK, WXK_END, 0 ); + static EDA_HOTKEY HkResetLocalCoord( wxT( "Reset Local Coordinates" ), HK_RESET_LOCAL_COORD, ' ' ); static EDA_HOTKEY HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO, WXK_HOME, ID_ZOOM_PAGE ); @@ -67,6 +71,7 @@ static EDA_HOTKEY HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2, ID_POPUP static EDA_HOTKEY HkZoomIn( wxT( "Zoom In" ), HK_ZOOM_IN, WXK_F1, ID_POPUP_ZOOM_IN ); static EDA_HOTKEY HkHelp( wxT( "Help (this window)" ), HK_HELP, '?' ); static EDA_HOTKEY HkMoveItem( wxT( "Move Item" ), HK_MOVE_ITEM, 'M', ID_POPUP_ITEM_MOVE ); +static EDA_HOTKEY HkPlaceItem( wxT( "Place Item" ), HK_PLACE_ITEM, 'P', ID_POPUP_ITEM_PLACE ); static EDA_HOTKEY HkMoveStartPoint( wxT( "Move Start Point" ), HK_MOVE_START_POINT, 'S', ID_POPUP_ITEM_MOVE_START_POINT ); static EDA_HOTKEY HkMoveEndPoint( wxT( "Move End Point" ), HK_MOVE_END_POINT, 'E', @@ -85,13 +90,17 @@ EDA_HOTKEY* s_Common_Hotkey_List[] = &HkZoomIn, &HkZoomOut, &HkZoomRedraw, &HkZoomCenter, &HkZoomAuto, &HkResetLocalCoord, &HkUndo, &HkRedo, + &HkMouseLeftClick, + &HkMouseLeftDClick, NULL }; EDA_HOTKEY* s_PlEditor_Hotkey_List[] = { &HkMoveItem, &HkMoveStartPoint, - &HkMoveEndPoint, &HkDeleteItem, + &HkMoveEndPoint, + &HkPlaceItem, + &HkDeleteItem, NULL }; @@ -142,6 +151,15 @@ void PL_EDITOR_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, case HK_NOT_FOUND: return; + case HK_LEFT_CLICK: + OnLeftClick( aDC, aPosition ); + break; + + case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events + OnLeftClick( aDC, aPosition ); + OnLeftDClick( aDC, aPosition ); + break; + case HK_HELP: // Display Current hotkey list DisplayHotkeyList( this, s_PlEditor_Hokeys_Descr ); break; @@ -208,6 +226,14 @@ void PL_EDITOR_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, GetEventHandler()->ProcessEvent( cmd ); break; + case HK_PLACE_ITEM: + if( busy ) + { + cmd.SetId( HK_Descr->m_IdMenuEvent ); + GetEventHandler()->ProcessEvent( cmd ); + } + break; + default: wxMessageBox( wxT("Unknown hotkey") ); return; diff --git a/pagelayout_editor/hotkeys.h b/pagelayout_editor/hotkeys.h index 37a310116b..f06d129d26 100644 --- a/pagelayout_editor/hotkeys.h +++ b/pagelayout_editor/hotkeys.h @@ -39,7 +39,10 @@ enum hotkey_id_commnand { HK_MOVE_ITEM, HK_MOVE_START_POINT, HK_MOVE_END_POINT, - HK_DELETE_ITEM + HK_PLACE_ITEM, + HK_DELETE_ITEM, + HK_LEFT_CLICK, + HK_LEFT_DCLICK }; // List of hotkey descriptors for PlEditor. diff --git a/pagelayout_editor/onrightclick.cpp b/pagelayout_editor/onrightclick.cpp index 50c2ccf475..fffe735b70 100644 --- a/pagelayout_editor/onrightclick.cpp +++ b/pagelayout_editor/onrightclick.cpp @@ -108,7 +108,9 @@ bool PL_EDITOR_FRAME::OnRightClick( const wxPoint& aPosition, wxMenu* aPopMenu ) } else // An item is currently in edit { - AddMenuItem( aPopMenu, ID_POPUP_ITEM_PLACE, _( "Place" ), + msg = AddHotkeyName( _( "Place Item" ), s_PlEditor_Hokeys_Descr, + HK_PLACE_ITEM ); + AddMenuItem( aPopMenu, ID_POPUP_ITEM_PLACE, msg, KiBitmap( move_xpm ) ); AddMenuItem( aPopMenu, ID_POPUP_ITEM_PLACE_CANCEL, _( "Cancel" ), KiBitmap( cancel_xpm ) ); diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 173b09fffd..6e63856363 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -29,8 +29,14 @@ * and see this list for some ascii keys (space ...) */ -/* local variables */ -/* Hotkey list: */ +// Hotkey list: + +// mouse click command: +static EDA_HOTKEY HkMouseLeftClick( wxT( "Mouse Left Click" ), + HK_LEFT_CLICK, WXK_RETURN, 0 ); +static EDA_HOTKEY HkMouseLeftDClick( wxT( "Mouse Left DClick" ), + HK_LEFT_DCLICK, WXK_END, 0 ); + static EDA_HOTKEY HkSwitch2CopperLayer( wxT( "Switch to Copper layer" ), HK_SWITCH_LAYER_TO_COPPER, WXK_PAGEDOWN ); static EDA_HOTKEY HkSwitch2ComponentLayer( wxT( "Switch to Component layer" ), @@ -70,7 +76,6 @@ static EDA_HOTKEY HkSelLayerAndAddBlindBuriedVia( wxT( "Sel Layer and Add Blind/ static EDA_HOTKEY HkSwitchTrackPosture( wxT( "Switch Track Posture" ), HK_SWITCH_TRACK_POSTURE, '/' ); static EDA_HOTKEY HkDragTrackKeepSlope( wxT( "Drag track keep slope" ), HK_DRAG_TRACK_KEEP_SLOPE, 'D' ); static EDA_HOTKEY HkPlaceItem( wxT( "Place Item" ), HK_PLACE_ITEM, 'P' ); -static EDA_HOTKEY HkEndTrack( wxT( "End Track" ), HK_END_TRACK, WXK_END ); static EDA_HOTKEY HkEditBoardItem( wxT( "Edit Item" ), HK_EDIT_ITEM, 'E' ); static EDA_HOTKEY HkFlipItem( wxT( "Flip Item" ), HK_FLIP_ITEM, 'F' ); static EDA_HOTKEY HkRotateItem( wxT( "Rotate Item" ), HK_ROTATE_ITEM, 'R' ); @@ -211,6 +216,8 @@ EDA_HOTKEY* common_Hotkey_List[] = &HkZoomRedraw, &HkZoomCenter, &HkZoomAuto, &HkSwitchUnits, &HkResetLocalCoord, &HkSetGridOrigin, &HkResetGridOrigin, &HkUndo, &HkRedo, + &HkMouseLeftClick, + &HkMouseLeftDClick, NULL }; @@ -225,7 +232,8 @@ EDA_HOTKEY* board_edit_Hotkey_List[] = &HkSwitchTrackPosture, &HkDragTrackKeepSlope, &HkPlaceItem, &HkCopyItem, - &HkEndTrack, &HkMoveItem, &HkFlipItem, + &HkMoveItem, + &HkFlipItem, &HkRotateItem, &HkDragFootprint, &HkGetAndMoveFootprint, &HkLock_Unlock_Footprint, &HkSavefile, &HkSavefileAs, &HkLoadfile, &HkFindItem, &HkEditBoardItem, diff --git a/pcbnew/hotkeys.h b/pcbnew/hotkeys.h index 6424e713da..c213c13daf 100644 --- a/pcbnew/hotkeys.h +++ b/pcbnew/hotkeys.h @@ -28,7 +28,6 @@ enum hotkey_id_commnand { HK_ADD_MICROVIA, HK_SWITCH_TRACK_POSTURE, HK_DRAG_TRACK_KEEP_SLOPE, - HK_END_TRACK, HK_SAVE_BOARD, HK_SAVE_BOARD_AS, HK_LOAD_BOARD, @@ -90,6 +89,8 @@ enum hotkey_id_commnand { HK_CANVAS_DEFAULT, HK_CANVAS_OPENGL, HK_CANVAS_CAIRO, + HK_LEFT_CLICK, + HK_LEFT_DCLICK }; // Full list of hotkey descriptors for board editor and footprint editor diff --git a/pcbnew/hotkeys_board_editor.cpp b/pcbnew/hotkeys_board_editor.cpp index b42f2ddb04..d48f77a2eb 100644 --- a/pcbnew/hotkeys_board_editor.cpp +++ b/pcbnew/hotkeys_board_editor.cpp @@ -161,6 +161,15 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit return; break; + case HK_LEFT_CLICK: + OnLeftClick( aDC, aPosition ); + break; + + case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events + OnLeftClick( aDC, aPosition ); + OnLeftDClick( aDC, aPosition ); + break; + case HK_RECORD_MACROS_0: case HK_RECORD_MACROS_1: case HK_RECORD_MACROS_2: @@ -428,16 +437,6 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit break; - case HK_END_TRACK: - if( itemCurrentlyEdited && GetCurItem()->IsTrack() && GetCurItem()->IsNew() ) - { - // A new track is in progress: call to End_Route() - m_canvas->MoveCursorToCrossHair(); - End_Route( (TRACK*) GetCurItem(), aDC ); - } - - break; - case HK_GET_AND_MOVE_FOOTPRINT: if( !itemCurrentlyEdited ) evt_type = ID_POPUP_PCB_GET_AND_MOVE_MODULE_REQUEST; diff --git a/pcbnew/hotkeys_module_editor.cpp b/pcbnew/hotkeys_module_editor.cpp index 08be819c83..dcaed9df75 100644 --- a/pcbnew/hotkeys_module_editor.cpp +++ b/pcbnew/hotkeys_module_editor.cpp @@ -58,6 +58,15 @@ void FOOTPRINT_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotKey, const wxPoint& aPos GetScreen()->m_O_Curseur = GetCrossHairPosition(); break; + case HK_LEFT_CLICK: + OnLeftClick( aDC, aPosition ); + break; + + case HK_LEFT_DCLICK: // Simulate a double left click: generate 2 events + OnLeftClick( aDC, aPosition ); + OnLeftDClick( aDC, aPosition ); + break; + case HK_SET_GRID_ORIGIN: SetGridOrigin( GetCrossHairPosition() ); m_canvas->Refresh(); diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 75d704a889..c66adc4c64 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -520,7 +520,7 @@ void PCB_EDIT_FRAME::createPopupMenuForTracks( TRACK* Track, wxMenu* PopMenu ) { if( flags & IS_NEW ) { - msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hokeys_Descr, HK_END_TRACK ); + msg = AddHotkeyName( _( "End Track" ), g_Board_Editor_Hokeys_Descr, HK_LEFT_DCLICK ); AddMenuItem( PopMenu, ID_POPUP_PCB_END_TRACK, msg, KiBitmap( checked_ok_xpm ) ); } From 0304286c2cac83ab162abbe9a02ff5851f9b8be9 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 3 Apr 2014 06:54:08 -0400 Subject: [PATCH 02/11] Fix Clang build error when OpenMP is not found. --- pcbnew/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 5c1583d711..afbdb0e323 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -536,8 +536,12 @@ if( USE_KIWAY_DLLS ) OUTPUT_NAME pcbnew PREFIX ${KIFACE_PREFIX} SUFFIX ${KIFACE_SUFFIX} - COMPILE_FLAGS ${OpenMP_CXX_FLAGS} ) + if( ${OPENMP_FOUND} ) + set_target_properties( pcbnew_kiface PROPERTIES + COMPILE_FLAGS ${OpenMP_CXX_FLAGS} + ) + endif() target_link_libraries( pcbnew_kiface 3d-viewer pcbcommon From c1804da8a2e8ca229e138156c096296ab3d30c53 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 3 Apr 2014 13:55:02 +0200 Subject: [PATCH 03/11] Cmakefiles: do not create map file on Windows, because creating map file generates hundred of useless wranings. In PATCH_COMMAND, use patch instead of bzr patch if patch or patch.exe is found (mandatory to use msys2 because bzr patch does not work when using msys2) --- CMakeModules/download_boost.cmake | 24 +++++++++++++++++------- CMakeModules/download_openssl.cmake | 12 ++++++++++-- cvpcb/CMakeLists.txt | 9 +++++++-- eeschema/CMakeLists.txt | 8 +++++++- gerbview/CMakeLists.txt | 8 +++++++- pagelayout_editor/CMakeLists.txt | 8 +++++++- pcbnew/CMakeLists.txt | 10 +++++++++- 7 files changed, 64 insertions(+), 15 deletions(-) diff --git a/CMakeModules/download_boost.cmake b/CMakeModules/download_boost.cmake index e929a2aae5..601738413c 100644 --- a/CMakeModules/download_boost.cmake +++ b/CMakeModules/download_boost.cmake @@ -101,6 +101,16 @@ else() endif() +find_program(patch_bin NAMES patch patch.exe) + +if( "${patch_bin}" STREQUAL "patch_bin-NOTFOUND" ) + set( PATCH_STR_CMD ${PATCH_STR_CMD} ) +else() + set( PATCH_STR_CMD ${patch_bin} -p0 -i ) +endif() + + + if( MINGW AND NOT CMAKE_HOST_UNIX ) # building for MINGW on windows not UNIX if( MSYS ) # The Boost system does not build properly on MSYS using bootstrap.sh. Running @@ -197,25 +207,25 @@ ExternalProject_Add( boost # bzr revert is insufficient to remove "added" files: COMMAND bzr clean-tree -q --force - COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch" - COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch" + COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_minkowski.patch" + COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_cstdint.patch" - COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266 + COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86.patch" #https://svn.boost.org/trac/boost/ticket/8266 # tell bzr about "added" files by last patch: COMMAND bzr add libs/context/src/asm/jump_i386_x86_64_sysv_macho_gas.S COMMAND bzr add libs/context/src/asm/make_i386_x86_64_sysv_macho_gas.S - COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266 - COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273 + COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_x86_build.patch" #https://svn.boost.org/trac/boost/ticket/8266 + COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_macosx_older_openssl.patch" #https://svn.boost.org/trac/boost/ticket/9273 - COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262 + COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/boost_mingw.patch" #https://svn.boost.org/trac/boost/ticket/7262 # tell bzr about "added" files by last patch: COMMAND bzr add libs/context/src/asm/make_i386_ms_pe_gas.S COMMAND bzr add libs/context/src/asm/jump_i386_ms_pe_gas.S COMMAND bzr add libs/context/src/asm/make_x86_64_ms_pe_gas.S COMMAND bzr add libs/context/src/asm/jump_x86_64_ms_pe_gas.S - COMMAND bzr patch -p0 "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266 + COMMAND ${PATCH_STR_CMD} "${PROJECT_SOURCE_DIR}/patches/patch_macosx_context_ppc_v2.patch" #https://svn.boost.org/trac/boost/ticket/8266 COMMAND bzr add libs/context/build/Jamfile.v2 COMMAND bzr add libs/context/build/architecture.jam COMMAND bzr add libs/context/src/asm/jump_combined_sysv_macho_gas.S diff --git a/CMakeModules/download_openssl.cmake b/CMakeModules/download_openssl.cmake index b810cfb63e..6ab8fc70d7 100644 --- a/CMakeModules/download_openssl.cmake +++ b/CMakeModules/download_openssl.cmake @@ -42,6 +42,14 @@ if( CMAKE_TOOLCHAIN_FILE ) set( TOOLCHAIN "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" ) endif() +FIND_PROGRAM (patch_bin NAMES patch.exe patch) + +if( "${patch_bin}" STREQUAL "patch_bin-NOTFOUND" ) + set( PATCH_STR_CMD bzr patch -p0 ) +else() + set( PATCH_STR_CMD ${patch_bin} -p0 -i ) +endif() + ExternalProject_Add( openssl DOWNLOAD_DIR ${DOWNLOAD_DIR} @@ -58,13 +66,13 @@ ExternalProject_Add( # PATCH_COMMAND patch -p0 < ${PROJECT_SOURCE_DIR}/patches/openssl-1.0.1e.patch # This one requires the bzr commit below, since bzr patch only knows a working tree. - + # Revert the branch to pristine before applying patch sets as bzr patch # fails when applying a patch to the branch twice and doesn't have a switch # to ignore previously applied patches PATCH_COMMAND bzr revert # PATCH_COMMAND continuation (any *_COMMAND here can be continued with COMMAND): - COMMAND bzr patch -p0 ${PROJECT_SOURCE_DIR}/patches/openssl-1.0.1e.patch + COMMAND ${PATCH_STR_CMD} ${PROJECT_SOURCE_DIR}/patches/openssl-1.0.1e.patch CONFIGURE_COMMAND ${CMAKE_COMMAND} diff --git a/cvpcb/CMakeLists.txt b/cvpcb/CMakeLists.txt index 47a5c3c111..2e89204780 100644 --- a/cvpcb/CMakeLists.txt +++ b/cvpcb/CMakeLists.txt @@ -1,5 +1,10 @@ - -set( MAKE_LINK_MAPS true ) +# the map generation creates on Windows/gcc a lot of useless warnings +# so disable it on windows +if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) + set( MAKE_LINK_MAPS false ) +else() + set( MAKE_LINK_MAPS true ) +endif() add_definitions( -DCVPCB ) diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index bd04eebb7d..87b71aa5f5 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -1,4 +1,10 @@ -set( MAKE_LINK_MAPS true ) +# the map generation creates on Windows/gcc a lot of useless warnings +# so disable it on windows +if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) + set( MAKE_LINK_MAPS false ) +else() + set( MAKE_LINK_MAPS true ) +endif() add_definitions( -DEESCHEMA ) diff --git a/gerbview/CMakeLists.txt b/gerbview/CMakeLists.txt index 685c826a1d..df67987d6f 100644 --- a/gerbview/CMakeLists.txt +++ b/gerbview/CMakeLists.txt @@ -1,4 +1,10 @@ -set( MAKE_LINK_MAPS true ) +# the map generation creates on Windows/gcc a lot of useless warnings +# so disable it on windows +if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) + set( MAKE_LINK_MAPS false ) +else() + set( MAKE_LINK_MAPS true ) +endif() add_definitions(-DGERBVIEW) diff --git a/pagelayout_editor/CMakeLists.txt b/pagelayout_editor/CMakeLists.txt index 95ce1af27f..308bd94949 100644 --- a/pagelayout_editor/CMakeLists.txt +++ b/pagelayout_editor/CMakeLists.txt @@ -1,4 +1,10 @@ -set( MAKE_LINK_MAPS true ) +# the map generation creates on Windows/gcc a lot of useless warnings +# so disable it on windows +if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) + set( MAKE_LINK_MAPS false ) +else() + set( MAKE_LINK_MAPS true ) +endif() add_definitions(-DPL_EDITOR) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index afbdb0e323..d16eb9f04f 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -1,4 +1,10 @@ -set( MAKE_LINK_MAPS true ) +# the map generation creates on Windows/gcc a lot of useless warnings +# so disable it on windows +if( WIN32 AND NOT CMAKE_CROSSCOMPILING ) + set( MAKE_LINK_MAPS false ) +else() + set( MAKE_LINK_MAPS true ) +endif() add_definitions( -DPCBNEW ) add_subdirectory(router) @@ -530,6 +536,7 @@ if( USE_KIWAY_DLLS ) ${PCBNEW_SCRIPTING_SRCS} # ${PCBNEW_RESOURCES} ) + set_target_properties( pcbnew_kiface PROPERTIES # Decorate OUTPUT_NAME with PREFIX and SUFFIX, creating something like # _pcbnew.so, _pcbnew.dll, or _pcbnew.kiface @@ -542,6 +549,7 @@ if( USE_KIWAY_DLLS ) COMPILE_FLAGS ${OpenMP_CXX_FLAGS} ) endif() + target_link_libraries( pcbnew_kiface 3d-viewer pcbcommon From b1e4eeb2b54c0761eeae7293749ea04f1acbf04e Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Fri, 4 Apr 2014 09:57:26 -0500 Subject: [PATCH 04/11] Rework FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer(), fix up comments and warnings. --- common/single_top.cpp | 27 +++++++++++++++------------ eeschema/files-io.cpp | 9 +++++++-- pcbnew/modview_frame.cpp | 29 +++++++++++++++++++++++++---- pcbnew/modview_frame.h | 10 +++++++--- 4 files changed, 54 insertions(+), 21 deletions(-) diff --git a/common/single_top.cpp b/common/single_top.cpp index ce9fe38202..efb530e261 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -164,7 +164,7 @@ static const wxString dso_full_path( const wxString& aAbsoluteArgv0 ) // in them. They are basically spin-offs from what was once a top process module. // That may not make linux package maintainers happy, but that is not my job. // Get over it. KiCad is not a trivial suite, and multiple platforms come - // into play, not merely linux. For starters they will use extension ".kicad", + // into play, not merely linux. For starters they will use extension ".kiface", // but later in time morph to ".so". They are not purely libraries, else they // would begin with "lib" in basename. Like I said, get over it, we're serving // too many masters here: python, windows, linux, OSX, multiple versions of wx... @@ -338,7 +338,8 @@ bool PGM_SINGLE_TOP::OnPgmInit( wxApp* aWxApp ) // KIFACE::CreateWindow() is a virtual so we don't need to link to it. // Remember its in the *.kiface DSO. #if 0 - // this pulls in EDA_DRAW_FRAME type info, which we don't want in single_top + // this pulls in EDA_DRAW_FRAME type info, which we don't want in + // the single_top link image. KIWAY_PLAYER* frame = dynamic_cast( kiface->CreateWindow( NULL, TOP_FRAME, &kiway, KFCTL_STANDALONE ) ); #else @@ -375,9 +376,9 @@ bool PGM_SINGLE_TOP::OnPgmInit( wxApp* aWxApp ) if( argc == 2 ) { #if defined(PGM_DATA_FILE_EXT) - // PGM_DATA_FILE_EXT is different for each compile, it may come - // from CMake on the compiler command line, often does not. - // This facillity is mostly useful only for those program modules + // PGM_DATA_FILE_EXT, if present, may be different for each compile, + // it may come from CMake on the compiler command line, but often does not. + // This facillity is mostly useful for those program modules // supporting a single argv[1]. if( !argv1.GetExt() ) argv1.SetExt( wxT( PGM_DATA_FILE_EXT ) ); @@ -413,11 +414,13 @@ bool PGM_SINGLE_TOP::OnPgmInit( wxApp* aWxApp ) } else { - /* The lean single_top program launcher has no access program settings, - else it would not be lean. That kind of functionality is in the - KIFACE now, but it cannot assume that it is the only KIFACE in memory. - So this looks like a dead concept here, or an expensive one in terms - of code size. + /* + + The lean single_top program launcher has no access to program + settings, for if it did, it would not be lean. That kind of + functionality is in the KIFACE now, but it cannot assume that it is + the only KIFACE in memory. So this looks like a dead concept here, + or an expensive one in terms of code size. wxString dir; @@ -455,8 +458,8 @@ void PGM_SINGLE_TOP::MacOpenFile( const wxString& aFileName ) if( filename.FileExists() ) { #if 0 - // this pulls in EDA_DRAW_FRAME type info, which we don't want in single_top - // link image. + // this pulls in EDA_DRAW_FRAME type info, which we don't want in + // the single_top link image. KIWAY_PLAYER* frame = dynamic_cast( App().GetTopWindow() ); #else KIWAY_PLAYER* frame = (KIWAY_PLAYER*) App().GetTopWindow(); diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index a94761d038..3832ce3ca6 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -248,7 +248,6 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in SCH_SCREEN* screen; wxString fullFileName( aFileSet[0] ); wxString msg; - bool libCacheExist = false; SCH_SCREENS screenList; for( screen = screenList.GetFirst(); screen != NULL; screen = screenList.GetNext() ) @@ -384,9 +383,12 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in } // load the project. - libCacheExist = LoadCacheLibrary( g_RootSheet->GetScreen()->GetFileName() ); + bool libCacheExist = LoadCacheLibrary( g_RootSheet->GetScreen()->GetFileName() ); + g_RootSheet->SetScreen( NULL ); + bool diag = g_RootSheet->Load( this ); + SetScreen( m_CurrentSheet->LastScreen() ); UpdateFileHistory( g_RootSheet->GetScreen()->GetFileName() ); @@ -397,6 +399,9 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in SetSheetNumberAndCount(); m_canvas->Refresh( true ); + (void) libCacheExist; + (void) diag; + // return diag; return true; // do not close Eeschema if the file if not found: // we may have to create a new schematic file. diff --git a/pcbnew/modview_frame.cpp b/pcbnew/modview_frame.cpp index 8375336b75..96313fde13 100644 --- a/pcbnew/modview_frame.cpp +++ b/pcbnew/modview_frame.cpp @@ -271,10 +271,31 @@ const wxChar* FOOTPRINT_VIEWER_FRAME::GetFootprintViewerFrameName() } -FOOTPRINT_VIEWER_FRAME* FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer( const wxWindow* aParent ) +FOOTPRINT_VIEWER_FRAME* FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer( const KIWAY_PLAYER* aParent ) { - // top_of_project! - wxASSERT( dynamic_cast( aParent ) ); + wxASSERT( aParent ); + + // We search only within the current project, and do so by limiting + // the search scope to a wxWindow hierarchy subset. Find the top most + // KIWAY_PLAYER which is part of this PROJECT by matching its KIWAY* to the + // most immediate parent's. + + // NOTE: an open FOOTPRINT_VIEWER_FRAME may have either the PCB_EDIT_FRAME + // or the FOOTPRINT_EDIT_FRAME. + + KIWAY* kiway = &aParent->Kiway(); + wxWindow* frame; + + while( (frame = aParent->GetParent()) != NULL ) + { + // will go NULL when we reach a non-KIWAY_PLAYER + KIWAY_PLAYER* kwp = dynamic_cast( frame ); + + if( kwp && &kwp->Kiway() == kiway ) + aParent = kwp; + else + break; + } return (FOOTPRINT_VIEWER_FRAME*) wxWindow::FindWindowByName( GetFootprintViewerFrameName(), aParent ); @@ -424,7 +445,7 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& event ) { GetBoard()->Add( loadFootprint( id ) ); } - catch( IO_ERROR ioe ) + catch( const IO_ERROR& ioe ) { wxString msg; msg.Printf( _( "Could not load footprint \"%s\" from library \"%s\".\n\n" diff --git a/pcbnew/modview_frame.h b/pcbnew/modview_frame.h index b28242a811..dab4432f3b 100644 --- a/pcbnew/modview_frame.h +++ b/pcbnew/modview_frame.h @@ -74,10 +74,14 @@ public: /** * Function GetActiveFootprintViewer (static) - * @return a reference to the current opened Footprint viewer - * or NULL if no Footprint viewer currently opened + * + * @param aParent the KIWAY_PLAYER which is the parent of the calling wxWindow. + * This is used to traverse the window hierarchy upwards to the topmost + * KIWAY_PLAYER which is still part of the same project. + * + * @return Any currently opened Footprint viewer or NULL if none. */ - static FOOTPRINT_VIEWER_FRAME* GetActiveFootprintViewer( const wxWindow* aParent ); + static FOOTPRINT_VIEWER_FRAME* GetActiveFootprintViewer( const KIWAY_PLAYER* aParent ); wxString& GetSelectedFootprint( void ) const { return m_selectedFootprintName; } const wxString GetSelectedLibraryFullName(); From 030cee7ddfcf8147af518ef4f5d206a3480a94f4 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 4 Apr 2014 20:28:35 +0200 Subject: [PATCH 05/11] Footprint Editor: minor cosmetic enhancement (which could avoid a report like bug #1302255) --- bitmaps_png/CMakeLists.txt | 1 + bitmaps_png/cpp_26/copy_library.cpp | 119 +++++++ bitmaps_png/sources/copy_library.svg | 501 +++++++++++++++++++++++++++ include/bitmaps.h | 1 + pcbnew/moduleframe.cpp | 4 +- 5 files changed, 625 insertions(+), 1 deletion(-) create mode 100644 bitmaps_png/cpp_26/copy_library.cpp create mode 100644 bitmaps_png/sources/copy_library.svg diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index 944a5450fb..c8a79d784f 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -176,6 +176,7 @@ set( BMAPS_MID copyblock copycomponent copy_button + copy_library copper_layers_setup cursor_shape cursor diff --git a/bitmaps_png/cpp_26/copy_library.cpp b/bitmaps_png/cpp_26/copy_library.cpp new file mode 100644 index 0000000000..2b0da851cd --- /dev/null +++ b/bitmaps_png/cpp_26/copy_library.cpp @@ -0,0 +1,119 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x06, 0x5f, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0x96, 0x79, 0x4c, 0x54, + 0x57, 0x14, 0xc6, 0x5f, 0x97, 0xa4, 0x8d, 0xd1, 0xf4, 0x0f, 0xd3, 0x58, 0x40, 0x23, 0x51, 0xb0, + 0x35, 0x30, 0x52, 0x53, 0xa0, 0x2a, 0x1a, 0x96, 0xaa, 0x65, 0x51, 0x89, 0x16, 0x6d, 0xad, 0xb5, + 0xd1, 0xba, 0x44, 0x45, 0xc4, 0xa5, 0x8a, 0x11, 0x11, 0x17, 0x6a, 0x1c, 0xd4, 0x26, 0xa2, 0xb6, + 0x01, 0xea, 0xda, 0x5a, 0xc5, 0x28, 0x08, 0x8c, 0x02, 0x65, 0x86, 0x19, 0x18, 0x66, 0x80, 0x61, + 0x19, 0x04, 0x59, 0x67, 0x5f, 0x90, 0x81, 0x41, 0x20, 0x08, 0xb3, 0xbd, 0x37, 0xef, 0xf4, 0xdc, + 0x67, 0xb5, 0xd8, 0x46, 0xaa, 0x4d, 0xd3, 0x97, 0x9c, 0x64, 0x66, 0x72, 0xef, 0xfd,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 0xb1, 0xe2, 0xfb, 0xae, 0x9e, + 0x03, 0x91, 0x52, 0x91, 0xcd, 0xa3, 0xa3, 0xa8, 0xa8, 0x08, 0x12, 0x12, 0x12, 0x20, 0x36, 0x36, + 0x16, 0x56, 0xad, 0x5a, 0x05, 0x69, 0xc7, 0xd3, 0xe0, 0x87, 0x92, 0xf3, 0x70, 0xb8, 0x2a, 0x05, + 0x2e, 0x35, 0x5f, 0x60, 0x1b, 0x94, 0x0d, 0x8c, 0x4a, 0xa3, 0xa2, 0x97, 0xdc, 0x8e, 0x76, 0x13, + 0x33, 0x34, 0x35, 0x37, 0x31, 0x97, 0x5b, 0x2e, 0x3a, 0xbf, 0xcc, 0xfd, 0x7c, 0x24, 0x26, 0x2d, + 0xd2, 0x30, 0x2b, 0x7c, 0x56, 0xad, 0x8f, 0x8f, 0xcf, 0x3d, 0x8c, 0xd3, 0xe3, 0xc7, 0x8f, 0x8f, + 0x7a, 0x21, 0x68, 0x74, 0x90, 0xe1, 0xcc, 0xca, 0xca, 0x82, 0x3d, 0x7b, 0xf6, 0x00, 0x96, 0x01, + 0xd6, 0x1e, 0xfe, 0x8a, 0x49, 0x96, 0xed, 0x77, 0x58, 0x86, 0xbb, 0xe9, 0x25, 0xb9, 0xd1, 0x6e, + 0xfd, 0x90, 0xde, 0xb5, 0x36, 0x6f, 0xcd, 0x88, 0xff, 0x9a, 0x99, 0x6d, 0x78, 0x81, 0x7e, 0x43, + 0x51, 0xd4, 0x94, 0xbf, 0xbd, 0x26, 0x5e, 0x06, 0x34, 0x3a, 0x88, 0x59, 0xd0, 0xae, 0x83, 0xde, + 0x1f, 0x79, 0x97, 0x2d, 0xfc, 0x31, 0x62, 0x20, 0xe4, 0x5a, 0x30, 0xfb, 0xf1, 0x77, 0x41, 0x96, + 0xf7, 0xfc, 0xdf, 0xdd, 0x44, 0x8d, 0xf1, 0xfa, 0xff, 0x57, 0x20, 0x34, 0x4b, 0x5f, 0x50, 0x50, + 0xd0, 0x87, 0xe3, 0xa6, 0x8c, 0xf3, 0x7a, 0x27, 0x6a, 0xc2, 0xee, 0xb1, 0x00, 0xff, 0x09, 0xe8, + 0x55, 0xfe, 0x2d, 0xfd, 0xaf, 0x20, 0x35, 0xb1, 0xf6, 0xd6, 0xad, 0x5b, 0x39, 0x8b, 0xff, 0x53, + 0x6c, 0xde, 0xbc, 0x19, 0x62, 0x62, 0x62, 0x1e, 0xe1, 0x5d, 0x18, 0xf0, 0x4a, 0x20, 0xbc, 0xeb, + 0x36, 0xe2, 0xe4, 0x76, 0xe3, 0x80, 0x3e, 0x7c, 0xd9, 0xc0, 0xf5, 0xb2, 0xb0, 0xb0, 0xb0, 0xb7, + 0x5f, 0x05, 0xf4, 0x3b, 0xd6, 0xb8, 0x5a, 0x39, 0x98, 0x47, 0x6d, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE copy_library_xpm[1] = {{ png, sizeof( png ), "copy_library_xpm" }}; + +//EOF diff --git a/bitmaps_png/sources/copy_library.svg b/bitmaps_png/sources/copy_library.svg new file mode 100644 index 0000000000..662adeb695 --- /dev/null +++ b/bitmaps_png/sources/copy_library.svg @@ -0,0 +1,501 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/include/bitmaps.h b/include/bitmaps.h index ae049aa719..280942ebc9 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -103,6 +103,7 @@ EXTERN_BITMAP( copper_layers_setup_xpm ) EXTERN_BITMAP( copyblock_xpm ) EXTERN_BITMAP( copycomponent_xpm ) EXTERN_BITMAP( copy_button_xpm ) +EXTERN_BITMAP( copy_library_xpm ) EXTERN_BITMAP( create_cmp_file_xpm ) EXTERN_BITMAP( cursor_shape_xpm ) EXTERN_BITMAP( cursor_xpm ) diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index bdbaf7d971..4d11d4c7d1 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -410,7 +410,9 @@ void FOOTPRINT_EDIT_FRAME::OnUpdateVerticalToolbar( wxUpdateUIEvent& aEvent ) void FOOTPRINT_EDIT_FRAME::OnUpdateLibSelected( wxUpdateUIEvent& aEvent ) { - aEvent.Enable( getLibPath() != wxEmptyString ); + bool enable = getLibPath() != wxEmptyString; + aEvent.Enable( enable ); + GetMenuBar()->Enable( ID_MODEDIT_SAVE_LIBRARY_AS, enable ); } From 34dc6da5ad2541343c579b88b90337aa5cae3171 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 4 Apr 2014 20:35:07 +0200 Subject: [PATCH 06/11] Pcbnew: commit forgotten change. --- pcbnew/menubar_modedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcbnew/menubar_modedit.cpp b/pcbnew/menubar_modedit.cpp index 12854c7ea5..ffbe9a681f 100644 --- a/pcbnew/menubar_modedit.cpp +++ b/pcbnew/menubar_modedit.cpp @@ -104,7 +104,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() AddMenuItem( fileMenu, ID_MODEDIT_SAVE_LIBRARY_AS, _( "Save Current Library As..." ), _( "Save entire current library under a new name." ), - wxNullBitmap ); + KiBitmap( copy_library_xpm ) ); // Save module text = AddHotkeyName( _( "&Save Module in Active Library" ), From 4c780e7074086698ab1d5b7e108df10784f5ad90 Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Fri, 4 Apr 2014 13:43:12 -0500 Subject: [PATCH 07/11] remove a warning message --- pcbnew/class_board_connected_item.cpp | 15 +++------------ pcbnew/modview_frame.cpp | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pcbnew/class_board_connected_item.cpp b/pcbnew/class_board_connected_item.cpp index 73bdced99a..0248131d35 100644 --- a/pcbnew/class_board_connected_item.cpp +++ b/pcbnew/class_board_connected_item.cpp @@ -109,9 +109,7 @@ int BOARD_CONNECTED_ITEM::GetClearance( BOARD_CONNECTED_ITEM* aItem ) const } else { -#ifdef DEBUG - wxLogWarning(wxT("BOARD_CONNECTED_ITEM::GetClearance():NULL netclass,type %d"), Type() ); -#endif + DBG(printf( "%s: NULL netclass,type %d", __func__, Type() );) } return 0; @@ -129,9 +127,7 @@ NETCLASS* BOARD_CONNECTED_ITEM::GetNetClass() const if( board == NULL ) // Should not occur { -#ifdef DEBUG - wxLogWarning( wxT("BOARD_CONNECTED_ITEM::GetNetClass():NULL board,type %d"), Type() ); -#endif + DBG(printf( "%s: NULL board,type %d", __func__, Type() );) return NULL; } @@ -142,12 +138,7 @@ NETCLASS* BOARD_CONNECTED_ITEM::GetNetClass() const { netclass = net->GetNetClass(); -#ifdef DEBUG - if( netclass == NULL ) - { - wxLogWarning( wxT("BOARD_CONNECTED_ITEM::GetNetClass():NULL netclass,type %d"), Type() ); - } -#endif + //DBG( if(!netclass) printf( "%s: NULL netclass,type %d", __func__, Type() );) } if( netclass ) diff --git a/pcbnew/modview_frame.cpp b/pcbnew/modview_frame.cpp index 96313fde13..b79a2c4d3c 100644 --- a/pcbnew/modview_frame.cpp +++ b/pcbnew/modview_frame.cpp @@ -281,7 +281,7 @@ FOOTPRINT_VIEWER_FRAME* FOOTPRINT_VIEWER_FRAME::GetActiveFootprintViewer( const // most immediate parent's. // NOTE: an open FOOTPRINT_VIEWER_FRAME may have either the PCB_EDIT_FRAME - // or the FOOTPRINT_EDIT_FRAME. + // or the FOOTPRINT_EDIT_FRAME as parent. KIWAY* kiway = &aParent->Kiway(); wxWindow* frame; From ff4887b46c7131b2a2c20126cd060914909969ed Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Sun, 6 Apr 2014 13:50:59 -0500 Subject: [PATCH 08/11] kicad-install.sh uses https protocol. --- scripts/kicad-install-no_launchpad_account.sh | 327 ------------------ scripts/kicad-install.sh | 18 +- 2 files changed, 12 insertions(+), 333 deletions(-) delete mode 100644 scripts/kicad-install-no_launchpad_account.sh mode change 100755 => 100644 scripts/kicad-install.sh diff --git a/scripts/kicad-install-no_launchpad_account.sh b/scripts/kicad-install-no_launchpad_account.sh deleted file mode 100644 index 3a0d2d0078..0000000000 --- a/scripts/kicad-install-no_launchpad_account.sh +++ /dev/null @@ -1,327 +0,0 @@ -#!/bin/bash -e -# Install KiCad from source onto either: -# -> a Ubuntu/Debian/Mint or -# -> a Red Hat -# compatible linux system. -# -# The "install_prerequisites" step is the only "distro dependent" one. That step could be modified -# for other linux distros. -# -# There are 3 package groups in a KiCad install: -# 1) Compiled source code in the form of executable programs. -# 2) User manuals and other documentation typically as *.pdf files. -# 3) a) Schematic parts, b) layout footprints, and c) 3D models for footprints. -# -# To achieve 1) source is checked out from its repo and compiled by this script then executables -# are installed using CMake. -# To achieve 2) documentation is checked out from its repo and installed using CMake. -# TO achieve 3a) and 3c) they are checked out from their repos and installed using CMake. -# To achieve 3b) a global fp-lib-table is put into your home directory which points to -# http://github.com/KiCad. No actual footprints are installed locally, internet access is used -# during program operation to fetch footprints from github as if it was a remote drive in the cloud. -# If you want to install those same KiCad footprints locally, you may run a separate script -# named library-repos-install.sh found in this same directory. That script requires that "git" be on -# your system whereas this script does not. The footprints require some means to download them and -# bzr-git seems not up to the task. wget or curl would also work. - - -# Since bash is invoked with -e by the first line of this script, all the steps in this script -# must succeed otherwise bash will abort at the first non-zero error code. Therefore any script -# functions must be crafted to anticipate numerous conditions, such that no command fails unless it -# is a serious situation. - - -# Set where the 3 source trees will go, use a full path -WORKING_TREES=~/kicad_sources - -# CMake Options -OPTS="$OPTS -DCMAKE_BUILD_TYPE=Release" -OPTS="$OPTS -DBUILD_GITHUB_PLUGIN=ON" - -# Python scripting, uncomment to enable -#OPTS="$OPTS -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_MODULES=ON -DKICAD_SCRIPTING_WXPYTHON=ON" - -#a connection to https://code.launchpad.net does not request a launchpad account -#but, obviously, you cannot commit anything -REPOS=https://code.launchpad.net -LEGACY_LIB_REPO=$REPOS/~dickelbeck/kicad/library-read-only -SRCS_REPO=$REPOS/~kicad-product-committers/kicad/product -DOCS_REPO=$REPOS/~kicad-developers/kicad/doc - - -usage() -{ - echo "" - echo " usage:" - echo "" - echo "./kicad-install.sh " - echo " where is one of:" - echo " --install-or-update (does full installation or update.)" - echo " --remove-sources (removes source trees for another attempt.)" - echo " --uninstall-libraries (removes KiCad supplied libraries.)" - echo " --uninstall-kicad (uninstalls all of KiCad but leaves source trees.)" - echo "" - echo "example:" - echo ' $ ./kicad-install.sh --install-or-update' -} - - -install_prerequisites() -{ - # Find a package manager, PM - PM=$( command -v yum || command -v apt-get ) - - # assume all these Debian, Mint, Ubuntu systems have same prerequisites - if [ "$(expr match "$PM" '.*\(apt-get\)')" == "apt-get" ]; then - #echo "debian compatible system" - sudo apt-get install \ - bzr \ - bzrtools \ - build-essential \ - cmake \ - cmake-curses-gui \ - debhelper \ - doxygen \ - grep \ - libbz2-dev \ - libcairo2-dev \ - libglew-dev \ - libssl-dev \ - libwxgtk2.8-dev \ - python-wxgtk2.8 - - # assume all yum systems have same prerequisites - elif [ "$(expr match "$PM" '.*\(yum\)')" == "yum" ]; then - #echo "red hat compatible system" - # Note: if you find this list not to be accurate, please submit a patch: - sudo yum groupinstall "Development Tools" - sudo yum install \ - bzr \ - bzrtools \ - bzip2-libs \ - bzip2-devel \ - cmake \ - cmake-gui \ - doxygen \ - cairo-devel \ - glew-devel \ - grep \ - openssl-devel \ - wxGTK-devel \ - wxPython - else - echo - echo "Incompatible System. Neither 'yum' nor 'apt-get' found. Not possible to continue." - echo - exit 1 - fi - - # ensure bzr name and email are set. No message since bzr prints an excellent diagnostic. - bzr whoami || exit 2 -} - - -rm_build_dir() -{ - local dir="$1" - - echo "removing directory $dir" - - if [ -e "$dir/install_manifest.txt" ]; then - # this file is often created as root, so remove as root - sudo rm "$dir/install_manifest.txt" 2> /dev/null - fi - - if [ -d "$dir" ]; then - rm -rf "$dir" - fi -} - - -cmake_uninstall() -{ - # assume caller set the CWD, and is only telling us about it in $1 - local dir="$1" - - cwd=`pwd` - if [ "$cwd" != "$dir" ]; then - echo "missing dir $dir" - elif [ ! -e install_manifest.txt ]; then - echo - echo "Missing file $dir/install_manifest.txt." - else - echo "uninstalling from $dir" - sudo make uninstall - sudo rm install_manifest.txt - fi -} - - -# Function set_env_var -# sets an environment variable globally. -set_env_var() -{ - local var=$1 - local val=$2 - - if [ -d /etc/profile.d ]; then - if [ ! -e /etc/profile.d/kicad.sh ] || ! grep "$var" /etc/profile.d/kicad.sh >> /dev/null; then - echo - echo "Adding environment variable $var to file /etc/profile.d/kicad.sh" - echo "Please logout and back in after this script completes for environment" - echo "variable to get set into environment." - sudo sh -c "echo export $var=$val >> /etc/profile.d/kicad.sh" - fi - - elif [ -e /etc/environment ]; then - if ! grep "$var" /etc/environment >> /dev/null; then - echo - echo "Adding environment variable $var to file /etc/environment" - echo "Please reboot after this script completes for environment variable to get set into environment." - sudo sh -c "echo $var=$val >> /etc/environment" - fi - fi -} - - -install_or_update() -{ - echo "step 1) installing pre-requisites" - install_prerequisites - - - echo "step 2) make $WORKING_TREES if it does not exist" - if [ ! -d "$WORKING_TREES" ]; then - sudo mkdir -p "$WORKING_TREES" - echo " mark $WORKING_TREES as owned by me" - sudo chown -R `whoami` "$WORKING_TREES" - fi - cd $WORKING_TREES - - - echo "step 3) checking out the source code from launchpad repo..." - if [ ! -d "$WORKING_TREES/kicad.bzr" ]; then - bzr checkout $SRCS_REPO kicad.bzr - echo " source repo to local working tree." - else - cd kicad.bzr - bzr up - echo " local source working tree updated." - cd ../ - fi - - if [ ! -d "$WORKING_TREES/kicad-lib.bzr" ]; then - bzr checkout $LEGACY_LIB_REPO kicad-lib.bzr - echo ' kicad-lib checked out.' - else - cd kicad-lib.bzr - bzr up - echo ' kicad-lib repo updated.' - cd ../ - fi - - echo "step 5) checking out the documentation from launchpad repo..." - if [ ! -d "$WORKING_TREES/kicad-doc.bzr" ]; then - bzr checkout $DOCS_REPO kicad-doc.bzr - echo " docs checked out." - else - cd kicad-doc.bzr - bzr up - echo " docs working tree updated." - cd ../ - fi - - - echo "step 6) compiling source code..." - cd kicad.bzr - if [ ! -d "build" ]; then - mkdir build && cd build - cmake $OPTS ../ - else - cd build - # Although a "make clean" is sometimes needed, more often than not it slows down the update - # more than it is worth. Do it manually if you need to in this directory. - # make clean - fi - make -j4 - echo " kicad compiled." - - - echo "step 7) installing KiCad program files..." - sudo make install - echo " kicad program files installed." - - - echo "step 8) installing libraries..." - cd ../../kicad-lib.bzr - rm_build_dir build - mkdir build && cd build - cmake ../ - sudo make install - echo " kicad-lib.bzr installed." - - - echo "step 9) as non-root, install user configuration files..." - # install ~/fp-lib-table - make install_github_fp-lib-table - echo " kicad user-configuration files installed." - - - echo "step 10) installing documentation..." - cd ../../kicad-doc.bzr - rm_build_dir build - mkdir build && cd build - cmake ../ - sudo make install - echo " kicad-doc.bzr installed." - - echo "step 11) check for environment variables..." - if [ -z "${KIGITHUB}" ]; then - set_env_var KIGITHUB https://github.com/KiCad - fi - - echo - echo 'All KiCad "--install-or-update" steps completed, you are up to date.' - echo -} - - -if [ $# -eq 1 -a "$1" == "--remove-sources" ]; then - echo "deleting $WORKING_TREES" - rm_build_dir "$WORKING_TREES/kicad.bzr/build" - rm_build_dir "$WORKING_TREES/kicad-lib.bzr/build" - rm_build_dir "$WORKING_TREES/kicad-doc.bzr/build" - rm -rf "$WORKING_TREES" - exit -fi - - -if [ $# -eq 1 -a "$1" == "--install-or-update" ]; then - install_or_update - exit -fi - - -if [ $# -eq 1 -a "$1" == "--uninstall-libraries" ]; then - cd "$WORKING_TREES/kicad-lib.bzr/build" - cmake_uninstall "$WORKING_TREES/kicad-lib.bzr/build" - exit -fi - - -if [ $# -eq 1 -a "$1" == "--uninstall-kicad" ]; then - cd "$WORKING_TREES/kicad.bzr/build" - cmake_uninstall "$WORKING_TREES/kicad.bzr/build" - - cd "$WORKING_TREES/kicad-lib.bzr/build" - cmake_uninstall "$WORKING_TREES/kicad-lib.bzr/build" - - # this may fail since "uninstall" support is a recent feature of this repo: - cd "$WORKING_TREES/kicad-doc.bzr/build" - cmake_uninstall "$WORKING_TREES/kicad-doc.bzr/build" - - exit -fi - - -usage diff --git a/scripts/kicad-install.sh b/scripts/kicad-install.sh old mode 100755 new mode 100644 index 6dab247203..015d757a31 --- a/scripts/kicad-install.sh +++ b/scripts/kicad-install.sh @@ -35,13 +35,19 @@ WORKING_TREES=~/kicad_sources # CMake Options -OPTS="$OPTS -DCMAKE_BUILD_TYPE=Release" -OPTS="$OPTS -DBUILD_GITHUB_PLUGIN=ON" +#OPTS="$OPTS -DBUILD_GITHUB_PLUGIN=OFF" # Python scripting, uncomment to enable #OPTS="$OPTS -DKICAD_SCRIPTING=ON -DKICAD_SCRIPTING_MODULES=ON -DKICAD_SCRIPTING_WXPYTHON=ON" -LIB_REPO=~dickelbeck/kicad/library-read-only +# Use https under bazaar to retrieve repos because this does not require a +# launchpad.net account. Whereas lp: requires a launchpad account. +# https results in read only access. +REPOS=https://code.launchpad.net + +LEGACY_LIB_REPO=$REPOS/~dickelbeck/kicad/library-read-only +SRCS_REPO=$REPOS/~kicad-product-committers/kicad/product +DOCS_REPO=$REPOS/~kicad-developers/kicad/doc usage() @@ -196,7 +202,7 @@ install_or_update() echo "step 3) checking out the source code from launchpad repo..." if [ ! -d "$WORKING_TREES/kicad.bzr" ]; then - bzr checkout lp:kicad kicad.bzr + bzr checkout $SRCS_REPO kicad.bzr echo " source repo to local working tree." else cd kicad.bzr @@ -206,7 +212,7 @@ install_or_update() fi if [ ! -d "$WORKING_TREES/kicad-lib.bzr" ]; then - bzr checkout "lp:$LIB_REPO" kicad-lib.bzr + bzr checkout $LEGACY_LIB_REPO kicad-lib.bzr echo ' kicad-lib checked out.' else cd kicad-lib.bzr @@ -217,7 +223,7 @@ install_or_update() echo "step 5) checking out the documentation from launchpad repo..." if [ ! -d "$WORKING_TREES/kicad-doc.bzr" ]; then - bzr checkout lp:~kicad-developers/kicad/doc kicad-doc.bzr + bzr checkout $DOCS_REPO kicad-doc.bzr echo " docs checked out." else cd kicad-doc.bzr From cd4feed7de401e4c66c0d474ea7af9991259d506 Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Sun, 6 Apr 2014 14:12:37 -0500 Subject: [PATCH 09/11] use proper schematic parts library --- scripts/kicad-install.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/kicad-install.sh b/scripts/kicad-install.sh index 015d757a31..8bd792fe87 100644 --- a/scripts/kicad-install.sh +++ b/scripts/kicad-install.sh @@ -45,7 +45,14 @@ WORKING_TREES=~/kicad_sources # https results in read only access. REPOS=https://code.launchpad.net -LEGACY_LIB_REPO=$REPOS/~dickelbeck/kicad/library-read-only +# This is no longer maintained, is old +#LEGACY_LIB_REPO=$REPOS/~dickelbeck/kicad/library-read-only + +# This branch is a bzr/launchpad import of the Git repository +# at https://github.com/KiCad/kicad-library.git. +# It has schematic parts and 3D models in it. +LIBS_REPO=$REPOS/~kicad-product-committers/kicad/library + SRCS_REPO=$REPOS/~kicad-product-committers/kicad/product DOCS_REPO=$REPOS/~kicad-developers/kicad/doc @@ -211,8 +218,9 @@ install_or_update() cd ../ fi + echo "step 4) checking out the schematic parts and 3D library repo." if [ ! -d "$WORKING_TREES/kicad-lib.bzr" ]; then - bzr checkout $LEGACY_LIB_REPO kicad-lib.bzr + bzr checkout $LIBS_REPO kicad-lib.bzr echo ' kicad-lib checked out.' else cd kicad-lib.bzr From 31d231ed363c3396992f6cbd7288e3da9e31ecf6 Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Sun, 6 Apr 2014 14:21:10 -0500 Subject: [PATCH 10/11] make kicad-install.sh executable --- scripts/kicad-install.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/kicad-install.sh diff --git a/scripts/kicad-install.sh b/scripts/kicad-install.sh old mode 100644 new mode 100755 From f599033a1a3a1728f44ba0e2d3086fd02021a225 Mon Sep 17 00:00:00 2001 From: Dick Hollenbeck Date: Mon, 7 Apr 2014 07:28:44 -0500 Subject: [PATCH 11/11] Enhance scripts/library-repos-install.sh to create library-repos-install.bat and add that. --- scripts/library-repos-install.bat | 89 +++++++++++++++++++++++++++++++ scripts/library-repos-install.sh | 36 +++++++++++-- 2 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 scripts/library-repos-install.bat diff --git a/scripts/library-repos-install.bat b/scripts/library-repos-install.bat new file mode 100644 index 0000000000..09027b5aab --- /dev/null +++ b/scripts/library-repos-install.bat @@ -0,0 +1,89 @@ +REM This file was created using /scripts/library-repos-install.sh on linux. +REM Run it from a directory you desire as the base for all libraries. +git clone https://github.com/KiCad/kicad-library +git clone https://github.com/KiCad/Displays_7-Segment.pretty +git clone https://github.com/KiCad/Air_Coils_SML_NEOSID.pretty +git clone https://github.com/KiCad/Sockets_BNC.pretty +git clone https://github.com/KiCad/Buzzers_Beepers.pretty +git clone https://github.com/KiCad/Capacitors_Elko_ThroughHole.pretty +git clone https://github.com/KiCad/Capacitors.pretty +git clone https://github.com/KiCad/Capacitors_SMD.pretty +git clone https://github.com/KiCad/Capacitors_ThroughHole.pretty +git clone https://github.com/KiCad/Choke_Axial_ThroughHole.pretty +git clone https://github.com/KiCad/Choke_Radial_ThroughHole.pretty +git clone https://github.com/KiCad/Choke_SMD.pretty +git clone https://github.com/KiCad/Choke_Toroid_ThroughHole.pretty +git clone https://github.com/KiCad/Choke_Common-Mode_Wurth.pretty +git clone https://github.com/KiCad/Connect.pretty +git clone https://github.com/KiCad/Connectors_Serial_MOLEX.pretty +git clone https://github.com/KiCad/Converters_DCDC_ACDC.pretty +git clone https://github.com/KiCad/Crystals.pretty +git clone https://github.com/KiCad/Crystals_Oscillators_SMD.pretty +git clone https://github.com/KiCad/Diodes_SMD.pretty +git clone https://github.com/KiCad/Diodes_ThroughHole.pretty +git clone https://github.com/KiCad/Discret.pretty +git clone https://github.com/KiCad/Display.pretty +git clone https://github.com/KiCad/Divers.pretty +git clone https://github.com/KiCad/EuroBoard_Outline.pretty +git clone https://github.com/KiCad/Fiducials.pretty +git clone https://github.com/KiCad/Filters_HF_Coils_NEOSID.pretty +git clone https://github.com/KiCad/Footprint_Symbols.pretty +git clone https://github.com/KiCad/Fuse_Holders_and_Fuses.pretty +git clone https://github.com/KiCad/Heatsinks.pretty +git clone https://github.com/KiCad/Housings_ROHM.pretty +git clone https://github.com/KiCad/Housings_SIP9.pretty +git clone https://github.com/KiCad/Housings_SOT-23_SOT-143_TSOT-6.pretty +git clone https://github.com/KiCad/Housings_SOT-89.pretty +git clone https://github.com/KiCad/Housings_SOT.pretty +git clone https://github.com/KiCad/Housings_TO-50.pretty +git clone https://github.com/KiCad/Housings_TO-78.pretty +git clone https://github.com/KiCad/Housings_TO-92.pretty +git clone https://github.com/KiCad/Inductors.pretty +git clone https://github.com/KiCad/Inductors_NEOSID.pretty +git clone https://github.com/KiCad/IR-DirectFETs.pretty +git clone https://github.com/KiCad/Iut.pretty +git clone https://github.com/KiCad/Labels.pretty +git clone https://github.com/KiCad/LEDs.pretty +git clone https://github.com/KiCad/Hall-Effect_Transducers_LEM.pretty +git clone https://github.com/KiCad/Measurement_Points.pretty +git clone https://github.com/KiCad/Measurement_Scales.pretty +git clone https://github.com/KiCad/Mechanical_Sockets.pretty +git clone https://github.com/KiCad/Mounting_Holes.pretty +git clone https://github.com/KiCad/Muonde.pretty +git clone https://github.com/KiCad/NF-Transformers_ETAL.pretty +git clone https://github.com/KiCad/Oddities.pretty +git clone https://github.com/KiCad/Transistors_OldSowjetAera.pretty +git clone https://github.com/KiCad/Opto-Devices.pretty +git clone https://github.com/KiCad/Oscillator-Modules.pretty +git clone https://github.com/KiCad/Oscillators.pretty +git clone https://github.com/KiCad/Pentawatts.pretty +git clone https://github.com/KiCad/PFF_PSF_PSS_Leadforms.pretty +git clone https://github.com/KiCad/Pin_Arrays.pretty +git clone https://github.com/KiCad/Potentiometers.pretty +git clone https://github.com/KiCad/Power_Integrations.pretty +git clone https://github.com/KiCad/Printtrafo_CHK.pretty +git clone https://github.com/KiCad/Relays_ThroughHole.pretty +git clone https://github.com/KiCad/Resistors_SMD.pretty +git clone https://github.com/KiCad/Resistors_ThroughHole.pretty +git clone https://github.com/KiCad/Resistors_Universal.pretty +git clone https://github.com/KiCad/QFP.pretty +git clone https://github.com/KiCad/SMD_Packages.pretty +git clone https://github.com/KiCad/Sockets_DIP.pretty +git clone https://github.com/KiCad/Sockets_Mini-Universal.pretty +git clone https://github.com/KiCad/Sockets.pretty +git clone https://github.com/KiCad/Sockets_MOLEX_KK-System.pretty +git clone https://github.com/KiCad/Sockets_PGA.pretty +git clone https://github.com/KiCad/Sockets_WAGO734.pretty +git clone https://github.com/KiCad/SOIC_Packages.pretty +git clone https://github.com/KiCad/SSOP_Packages.pretty +git clone https://github.com/KiCad/Capacitors_Tantalum_SMD.pretty +git clone https://github.com/KiCad/Terminal_Blocks.pretty +git clone https://github.com/KiCad/Transformers_SMPS_ThroughHole.pretty +git clone https://github.com/KiCad/Transistors_SMD.pretty +git clone https://github.com/KiCad/Transistors_TO-220.pretty +git clone https://github.com/KiCad/Transistors_TO-247.pretty +git clone https://github.com/KiCad/Valves.pretty +git clone https://github.com/KiCad/Wire_Connections_Bridges.pretty +git clone https://github.com/KiCad/Wire_Pads.pretty +git clone https://github.com/KiCad/Pin_Headers.pretty +git clone https://github.com/KiCad/Socket_Strips.pretty diff --git a/scripts/library-repos-install.sh b/scripts/library-repos-install.sh index 11c642a28a..b34b570343 100755 --- a/scripts/library-repos-install.sh +++ b/scripts/library-repos-install.sh @@ -34,12 +34,15 @@ usage() echo "" echo "./library-sources-install.sh " echo " where is one of:" + echo " --install-prerequisites (install command tools needed here, run once first.)" echo " --install-or-update (from github, the library sources.)" echo " --remove-all-libraries (remove all *.pretty from $WORKING_TREES/library-repos/. )" - echo " --install-prerequisites (install command tools needed here, run once first.)" echo " --remove-orphaned-libraries (remove local libraries which have been deleted or renamed at github.)" + echo " --list-libraries (show the full list of github libraries.)" + echo " --create-bat-file (cat a windows batch file, redirect to capture to disk.)" echo "" - echo "example:" + echo "examples (with --install-prerequisites once first):" + echo ' $ ./library-sources-install.sh --install-prerequisites' echo ' $ ./library-sources-install.sh --install-or-update' } @@ -134,7 +137,7 @@ checkout_or_update_libraries() if [ ! -e "$WORKING_TREES/library-repos/$repo" ]; then - # Be _sure_ and preserve the directory name, we want extension .pretty not .pretty.git. + # Preserve the directory extension as ".pretty". # That way those repos can serve as pretty libraries directly if need be. echo "installing $WORKING_TREES/library-repos/$repo" @@ -217,5 +220,32 @@ if [ $# -eq 1 -a "$1" == "--install-prerequisites" ]; then exit fi +if [ $# -eq 1 -a "$1" == "--list-libraries" ]; then + + # use github API to get repos into PRETTY_REPOS var + detect_pretty_repos + + # add the "schematic parts & 3D model" kicad-library to total + for repo in kicad-library $PRETTY_REPOS; do + echo "$repo" + done + exit +fi + +# may re-direct this output to a disk file for Windows *.BAT file creation. +if [ $# -eq 1 -a "$1" == "--create-bat-file" ]; then + + # use github API to get repos into PRETTY_REPOS var + detect_pretty_repos + + echo "REM This file was created using /scripts/library-repos-install.sh on linux." + echo "REM Run it from a directory you desire as the base for all libraries." + + # add the "schematic parts & 3D model" kicad-library to total + for repo in kicad-library $PRETTY_REPOS; do + echo "git clone https://github.com/KiCad/$repo" + done + exit +fi usage