From de4e688b8339b750623ad8d753b844fca4affa00 Mon Sep 17 00:00:00 2001 From: Blair Bonnett Date: Sun, 7 Dec 2014 14:10:12 -0500 Subject: [PATCH 1/4] Imporve hot key name description. (fixes lp:1066193) --- pcbnew/hotkeys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 8f903b7d48..73e08d4e88 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -109,7 +109,7 @@ static EDA_HOTKEY HkFlipItem( wxT( "Flip Item" ), HK_FLIP_ITEM, 'F' ); static EDA_HOTKEY HkRotateItem( wxT( "Rotate Item" ), HK_ROTATE_ITEM, 'R' ); static EDA_HOTKEY HkMoveItem( wxT( "Move Item" ), HK_MOVE_ITEM, 'M' ); static EDA_HOTKEY HkCopyItem( wxT( "Copy Item" ), HK_COPY_ITEM, 'C' ); -static EDA_HOTKEY HkDragFootprint( wxT( "Drag Footprint" ), HK_DRAG_ITEM, 'G' ); +static EDA_HOTKEY HkDragFootprint( wxT( "Drag Item" ), HK_DRAG_ITEM, 'G' ); static EDA_HOTKEY HkGetAndMoveFootprint( wxT( "Get and Move Footprint" ), HK_GET_AND_MOVE_FOOTPRINT, 'T' ); static EDA_HOTKEY HkLock_Unlock_Footprint( wxT( "Lock/Unlock Footprint" ), HK_LOCK_UNLOCK_FOOTPRINT, 'L' ); static EDA_HOTKEY HkDelete( wxT( "Delete Track or Footprint" ), HK_DELETE, WXK_DELETE ); From 834d54415f289340e1b6e4630543c851128a4c06 Mon Sep 17 00:00:00 2001 From: Johannes Maibaum Date: Mon, 8 Dec 2014 12:40:38 -0500 Subject: [PATCH 2/4] OSX build fixes. * Make patches/wxwidgets-3.0.2_macosx_yosemite.patch usable. There were complaints here before that the patch does not work because it is a "metapatch" that tries to patch another patch (which is not in the tree and therefore fails). With this change, it becomes a normal patch again, that can be applied to the wxWidgets source tree as described in Documentation/compiling/mac-osx.txt. * Make scripts/library-repos-install.sh compatible with OSX: This involves checking for the correct option to enable extended regular expressions in sed during detect_pretty_repos, as the script uses "-r", which is only available in GNU sed. The sed shipped with Mac OSX is an older BSD descendant sed which needs "-E". This change has been tested to work on Mac OSX 10.10.1 and on an up-to-date Arch Linux. I also changed the error message during --install-prerequisites to inform users without apt-get or yum which programs need to be installed to use the script. * Add the execute flag to scripts/osx_build_wx.sh: At the moment, after fetching the source with bzr, one has to chmod the file by hand. This change change ensures consistency between the script and the build docs for OSX, which assumes the script to be executable. --- patches/wxwidgets-3.0.2_macosx_yosemite.patch | 39 +++++-------------- scripts/library-repos-install.sh | 18 ++++++++- 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/patches/wxwidgets-3.0.2_macosx_yosemite.patch b/patches/wxwidgets-3.0.2_macosx_yosemite.patch index 1746d228bb..30e2587bee 100644 --- a/patches/wxwidgets-3.0.2_macosx_yosemite.patch +++ b/patches/wxwidgets-3.0.2_macosx_yosemite.patch @@ -1,31 +1,10 @@ -=== modified file 'patches/wxwidgets-3.0.2_macosx_yosemite.patch' ---- patches/wxwidgets-3.0.2_macosx_yosemite.patch 2014-11-04 19:24:22 +0000 -+++ patches/wxwidgets-3.0.2_macosx_yosemite.patch 2014-11-12 01:54:50 +0000 -@@ -1,15 +1,11 @@ --=== added file 'patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch' ----- patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch 1970-01-01 00:00:00 +0000 --+++ patches/wxwidgets-3.0.2_macosx_yosemite_webview_webkit.mm.patch 2014-10-29 18:17:55 +0000 --@@ -0,0 +1,11 @@ --+--- src/osx/webview_webkit.mm.orig 2014-09-16 07:27:52.000000000 -0600 --++++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600 --+@@ -28,7 +28,7 @@ --+ #include "wx/hashmap.h" --+ #include "wx/filesys.h" --+ --+-#include --++#include --+ #include --+ #include --+ -+--- src/osx/webview_webkit.mm.orig 2014-09-16 07:27:52.000000000 -0600 -++++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600 -+@@ -28,7 +28,7 @@ -+ #include "wx/hashmap.h" -+ #include "wx/filesys.h" -+ -+-#include -++#include -+ #include -+ #include -+ +--- src/osx/webview_webkit.mm.orig 2014-09-16 07:27:52.000000000 -0600 ++++ src/osx/webview_webkit.mm 2014-09-16 07:28:12.000000000 -0600 +@@ -28,7 +28,7 @@ + #include "wx/hashmap.h" + #include "wx/filesys.h" +-#include ++#include + #include + #include diff --git a/scripts/library-repos-install.sh b/scripts/library-repos-install.sh index aa129d3c8b..b02e7d2d54 100755 --- a/scripts/library-repos-install.sh +++ b/scripts/library-repos-install.sh @@ -70,7 +70,9 @@ install_prerequisites() sed else echo - echo "Incompatible System. Neither 'yum' nor 'apt-get' found. Not possible to continue." + echo "Incompatible System. Neither 'yum' nor 'apt-get' found. Not possible to" + echo "continue. Please make sure to install git, curl, and sed before using this" + echo "script." echo exit 1 fi @@ -107,11 +109,23 @@ cmake_uninstall() detect_pretty_repos() { + # Check for the correct option to enable extended regular expressions in + # sed. This is '-r' for GNU sed and '-E' for (older) BSD-like sed, as on + # Mac OSX. + if [ $(echo | sed -r '' &>/dev/null; echo $?) -eq 0 ]; then + SED_EREGEXP="-r" + elif [ $(echo | sed -E '' &>/dev/null; echo $?) -eq 0 ]; then + SED_EREGEXP="-E" + else + echo "Your sed command does not support extended regular expressions. Cannot continue." + exit 1 + fi + # Use github API to list repos for org KiCad, then subset the JSON reply for only # *.pretty repos PRETTY_REPOS=`curl https://api.github.com/orgs/KiCad/repos?per_page=2000 2> /dev/null \ | grep full_name | grep pretty \ - | sed -r 's:.+ "KiCad/(.+)",:\1:'` + | sed $SED_EREGEXP 's:.+ "KiCad/(.+)",:\1:'` #echo "PRETTY_REPOS:$PRETTY_REPOS" From 1df31338a33bef32bf2ac3eea249e253b4431747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nick=20=C3=98stergaard?= Date: Mon, 8 Dec 2014 23:41:47 +0100 Subject: [PATCH 3/4] Shortcut for fill all and unfill all zones for GAL. --- pcbnew/tools/common_actions.cpp | 6 +++++- pcbnew/tools/common_actions.h | 1 + pcbnew/tools/pcb_editor_control.cpp | 20 ++++++++++++++++++++ pcbnew/tools/pcb_editor_control.h | 1 + 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index 456a0219af..c35372ea27 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -308,13 +308,17 @@ TOOL_ACTION COMMON_ACTIONS::zoneFill( "pcbnew.EditorControl.zoneFill", "Fill", "Fill zone(s)" ); TOOL_ACTION COMMON_ACTIONS::zoneFillAll( "pcbnew.EditorControl.zoneFillAll", - AS_GLOBAL, 0, + AS_GLOBAL, int( 'B' ), "Fill all", "Fill all zones" ); TOOL_ACTION COMMON_ACTIONS::zoneUnfill( "pcbnew.EditorControl.zoneUnfill", AS_GLOBAL, 0, "Unfill", "Unfill zone(s)" ); +TOOL_ACTION COMMON_ACTIONS::zoneUnfillAll( "pcbnew.EditorControl.zoneUnfillAll", + AS_GLOBAL, int( 'N' ), + "Unfill all", "Unfill all zones" ); + // Module editor tools TOOL_ACTION COMMON_ACTIONS::placePad( "pcbnew.ModuleEditor.placePad", diff --git a/pcbnew/tools/common_actions.h b/pcbnew/tools/common_actions.h index 366f4440dd..73849a755e 100644 --- a/pcbnew/tools/common_actions.h +++ b/pcbnew/tools/common_actions.h @@ -195,6 +195,7 @@ public: static TOOL_ACTION zoneFill; static TOOL_ACTION zoneFillAll; static TOOL_ACTION zoneUnfill; + static TOOL_ACTION zoneUnfillAll; // Module editor tools /// Activation of the drawing tool (placing a PAD) diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/pcb_editor_control.cpp index f1c8fe3833..827fd4430f 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/pcb_editor_control.cpp @@ -41,6 +41,7 @@ public: Add( COMMON_ACTIONS::zoneFill ); Add( COMMON_ACTIONS::zoneFillAll ); Add( COMMON_ACTIONS::zoneUnfill ); + Add( COMMON_ACTIONS::zoneUnfillAll ); } }; @@ -219,6 +220,24 @@ int PCB_EDITOR_CONTROL::ZoneUnfill( TOOL_EVENT& aEvent ) } +int PCB_EDITOR_CONTROL::ZoneUnfillAll( TOOL_EVENT& aEvent ) +{ + BOARD* board = getModel(); + + for( int i = 0; i < board->GetAreaCount(); ++i ) + { + ZONE_CONTAINER* zone = board->GetArea( i ); + zone->SetIsFilled( false ); + zone->ClearFilledPolysList(); + zone->ViewUpdate(); + } + + setTransitions(); + + return 0; +} + + void PCB_EDITOR_CONTROL::setTransitions() { // Track & via size control @@ -231,4 +250,5 @@ void PCB_EDITOR_CONTROL::setTransitions() Go( &PCB_EDITOR_CONTROL::ZoneFill, COMMON_ACTIONS::zoneFill.MakeEvent() ); Go( &PCB_EDITOR_CONTROL::ZoneFillAll, COMMON_ACTIONS::zoneFillAll.MakeEvent() ); Go( &PCB_EDITOR_CONTROL::ZoneUnfill, COMMON_ACTIONS::zoneUnfill.MakeEvent() ); + Go( &PCB_EDITOR_CONTROL::ZoneUnfillAll, COMMON_ACTIONS::zoneUnfillAll.MakeEvent() ); } diff --git a/pcbnew/tools/pcb_editor_control.h b/pcbnew/tools/pcb_editor_control.h index 6d272884c9..9e4dc8f935 100644 --- a/pcbnew/tools/pcb_editor_control.h +++ b/pcbnew/tools/pcb_editor_control.h @@ -55,6 +55,7 @@ public: int ZoneFill( TOOL_EVENT& aEvent ); int ZoneFillAll( TOOL_EVENT& aEvent ); int ZoneUnfill( TOOL_EVENT& aEvent ); + int ZoneUnfillAll( TOOL_EVENT& aEvent ); private: ///> Sets up handlers for various events. From 7e249c758b3f8516b4c6b03b72db1e3b5bc546b4 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 10 Dec 2014 00:50:31 +0100 Subject: [PATCH 4/4] bugfix: Tools are deactivated on canvas switch. --- common/tool/tool_manager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index f3705d8ac8..35bd3af2d0 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -411,6 +411,9 @@ TOOL_BASE* TOOL_MANAGER::FindTool( const std::string& aName ) const void TOOL_MANAGER::ResetTools( TOOL_BASE::RESET_REASON aReason ) { + TOOL_EVENT evt( TC_COMMAND, TA_ACTIVATE, "" ); // deactivate the active tool + ProcessEvent( evt ); + BOOST_FOREACH( TOOL_BASE* tool, m_toolState | boost::adaptors::map_keys ) tool->Reset( aReason ); }