Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
kicad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
KiCad
KiCad Source Code
kicad
Commits
2d4bcc65
Commit
2d4bcc65
authored
2 years ago
by
Jeff Young
Browse files
Options
Downloads
Patches
Plain Diff
Move cvpcb filter to a timer.
Fixes
#12445
(cherry picked from commit
1fcd7d62
)
parent
ba72676e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cvpcb/cvpcb_mainframe.cpp
+10
-10
10 additions, 10 deletions
cvpcb/cvpcb_mainframe.cpp
cvpcb/cvpcb_mainframe.h
+2
-2
2 additions, 2 deletions
cvpcb/cvpcb_mainframe.h
with
12 additions
and
12 deletions
cvpcb/cvpcb_mainframe.cpp
+
10
−
10
View file @
2d4bcc65
...
...
@@ -62,7 +62,6 @@
CVPCB_MAINFRAME
::
CVPCB_MAINFRAME
(
KIWAY
*
aKiway
,
wxWindow
*
aParent
)
:
KIWAY_PLAYER
(
aKiway
,
aParent
,
FRAME_CVPCB
,
_
(
"Assign Footprints"
),
wxDefaultPosition
,
wxDefaultSize
,
KICAD_DEFAULT_DRAWFRAME_STYLE
,
CVPCB_MAINFRAME_NAME
),
m_footprintListPendingUpdate
(
false
),
m_viewerPendingUpdate
(
false
)
{
m_symbolsListBox
=
nullptr
;
...
...
@@ -211,12 +210,17 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
// Start the main processing loop
m_toolManager
->
InvokeTool
(
"cvpcb.Control"
);
m_filterTimer
->
StartOnce
(
100
);
KIPLATFORM
::
APP
::
SetShutdownBlockReason
(
this
,
_
(
"Symbol to footprint changes are unsaved"
)
);
}
CVPCB_MAINFRAME
::~
CVPCB_MAINFRAME
()
{
// Stop the timer during destruction early to avoid potential race conditions (that do happen)
m_filterTimer
->
Stop
();
// Shutdown all running tools
if
(
m_toolManager
)
m_toolManager
->
ShutdownAllTools
();
...
...
@@ -372,6 +376,9 @@ void CVPCB_MAINFRAME::setupEventHandlers()
// Attach the events to the tool dispatcher
Bind
(
wxEVT_CHAR
,
&
TOOL_DISPATCHER
::
DispatchWxEvent
,
m_toolDispatcher
);
Bind
(
wxEVT_CHAR_HOOK
,
&
TOOL_DISPATCHER
::
DispatchWxEvent
,
m_toolDispatcher
);
m_filterTimer
=
new
wxTimer
(
this
);
Bind
(
wxEVT_TIMER
,
&
CVPCB_MAINFRAME
::
onTextFilterChangedTimer
,
this
,
m_filterTimer
->
GetId
()
);
}
...
...
@@ -422,19 +429,12 @@ void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent )
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN is set, update the list
// of available footprints which match the filter
if
(
!
m_footprintListPendingUpdate
)
{
Bind
(
wxEVT_IDLE
,
&
CVPCB_MAINFRAME
::
updateFootprintListOnIdle
,
this
);
m_footprintListPendingUpdate
=
true
;
}
m_filterTimer
->
StartOnce
(
200
);
}
void
CVPCB_MAINFRAME
::
updateFootprintListOnIdle
(
wxIdle
Event
&
aEvent
)
void
CVPCB_MAINFRAME
::
onTextFilterChangedTimer
(
wxTimer
Event
&
aEvent
)
{
Unbind
(
wxEVT_IDLE
,
&
CVPCB_MAINFRAME
::
updateFootprintListOnIdle
,
this
);
m_footprintListPendingUpdate
=
false
;
// GTK loses the search-control's focus on a Refresh event, so we record the focus and
// insertion point here and then restore them at the end.
bool
searchCtrlHasFocus
=
m_tcFilterString
->
HasFocus
();
...
...
This diff is collapsed.
Click to expand it.
cvpcb/cvpcb_mainframe.h
+
2
−
2
View file @
2d4bcc65
...
...
@@ -357,7 +357,7 @@ private:
void
updateFootprintViewerOnIdle
(
wxIdleEvent
&
aEvent
);
void
updateFootprintListOnIdle
(
wxIdle
Event
&
aEvent
);
void
onTextFilterChangedTimer
(
wxTimer
Event
&
aEvent
);
/**
* Read the .equ files and populate the list of equivalents.
...
...
@@ -409,7 +409,7 @@ private:
CVPCB_UNDO_REDO_LIST
m_undoList
;
CVPCB_UNDO_REDO_LIST
m_redoList
;
bool
m_f
ootprintListPendingUpdate
;
wxTimer
*
m_f
ilterTimer
;
bool
m_viewerPendingUpdate
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment