mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
Retire WINDOW_FREEZER in favour of wxWindowUpdateLocker.
Also pulls out previous fix to a Sentry issue I can no longer find, at least until I figure out what went wrong.
This commit is contained in:
parent
bdd8790180
commit
5b91a24380
@ -26,6 +26,7 @@
|
||||
#include <dialogs/dialog_design_block_properties.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/tooltip.h>
|
||||
#include <wx/wupdlock.h>
|
||||
#include <grid_tricks.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include <bitmaps.h>
|
||||
@ -209,7 +210,7 @@ void DIALOG_DESIGN_BLOCK_PROPERTIES::OnMoveFieldDown( wxCommandEvent& event )
|
||||
|
||||
bool DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataToGrid()
|
||||
{
|
||||
WINDOW_FREEZER raiiFreezer( m_fieldsGrid );
|
||||
wxWindowUpdateLocker updateLock( m_fieldsGrid );
|
||||
|
||||
m_fieldsGrid->ClearRows();
|
||||
m_fieldsGrid->AppendRows( m_fields.size() );
|
||||
|
@ -25,19 +25,18 @@
|
||||
#include <dialogs/panel_embedded_files.h>
|
||||
#include <embedded_files.h>
|
||||
#include <font/outline_font.h>
|
||||
#include <core/raii.h>
|
||||
#include <kidialog.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include <widgets/wx_grid.h>
|
||||
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/dirdlg.h>
|
||||
#include <wx/ffile.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/menu.h>
|
||||
#include <wx/wfstream.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
/* ---------- GRID_TRICKS for embedded files grid ---------- */
|
||||
|
||||
@ -214,7 +213,7 @@ bool PANEL_EMBEDDED_FILES::TransferDataFromWindow()
|
||||
|
||||
void PANEL_EMBEDDED_FILES::onFontEmbedClick( wxCommandEvent& event )
|
||||
{
|
||||
WINDOW_FREEZER raiiFreezer( this );
|
||||
wxWindowUpdateLocker updateLock( this );
|
||||
|
||||
int row_pos = m_files_grid->GetGridCursorRow();
|
||||
int col_pos = m_files_grid->GetGridCursorCol();
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
#include <wx/wupdlock.h>
|
||||
#include <pgm_base.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <bitmaps.h>
|
||||
@ -118,7 +118,7 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( wxWindow* aParentWindow, EDA_DRA
|
||||
m_membershipPane->SetBorders( true, false, false, false );
|
||||
|
||||
// Prevent Size events from firing before we are ready
|
||||
WINDOW_FREEZER raiiFreezer( this );
|
||||
wxWindowUpdateLocker updateLock( this );
|
||||
|
||||
m_netclassGrid->BeginBatch();
|
||||
m_netclassGrid->SetUseNativeColLabels();
|
||||
|
@ -19,12 +19,11 @@
|
||||
|
||||
#include <widgets/search_pane_tab.h>
|
||||
#include <widgets/search_pane.h>
|
||||
#include <kiway.h>
|
||||
#include <vector>
|
||||
#include <string_utils.h>
|
||||
#include <wx/clipbrd.h>
|
||||
#include <wx/wupdlock.h>
|
||||
#include <core/kicad_algo.h>
|
||||
#include <core/raii.h>
|
||||
|
||||
SEARCH_PANE_LISTVIEW::SEARCH_PANE_LISTVIEW( SEARCH_HANDLER* handler, wxWindow* parent,
|
||||
wxWindowID winid, const wxPoint& pos,
|
||||
@ -204,7 +203,7 @@ std::vector<long> SEARCH_PANE_LISTVIEW::Sort()
|
||||
|
||||
void SEARCH_PANE_LISTVIEW::RefreshColumnNames()
|
||||
{
|
||||
WINDOW_FREEZER raiiFreezer( this );
|
||||
wxWindowUpdateLocker updateLock( this );
|
||||
|
||||
DeleteAllColumns();
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include <wx/statline.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/treelist.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
/**
|
||||
* Menu IDs for the hotkey context menu
|
||||
@ -585,7 +586,7 @@ void WIDGET_HOTKEY_LIST::ApplyFilterString( const wxString& aFilterStr )
|
||||
|
||||
void WIDGET_HOTKEY_LIST::ResetAllHotkeys( bool aResetToDefault )
|
||||
{
|
||||
WINDOW_FREEZER raiiFreezer( this );
|
||||
wxWindowUpdateLocker updateLock( this );
|
||||
|
||||
// Reset all the hotkeys, not just the ones shown
|
||||
// Should not need to check conflicts, as the state we're about
|
||||
@ -631,7 +632,7 @@ void WIDGET_HOTKEY_LIST::updateColumnWidths()
|
||||
|
||||
void WIDGET_HOTKEY_LIST::updateShownItems( const wxString& aFilterStr )
|
||||
{
|
||||
WINDOW_FREEZER raiiFreezer( this );
|
||||
wxWindowUpdateLocker updateLock( this );
|
||||
|
||||
DeleteAllItems();
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <gestfich.h>
|
||||
#include <sch_screen.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <schematic.h>
|
||||
#include <project.h>
|
||||
#include <kiface_base.h>
|
||||
#include <reporter.h>
|
||||
@ -41,11 +40,8 @@
|
||||
#include <erc/erc_report.h>
|
||||
#include <id.h>
|
||||
#include <confirm.h>
|
||||
#include <common.h>
|
||||
#include <widgets/wx_html_report_box.h>
|
||||
#include <dialogs/dialog_text_entry.h>
|
||||
#include <erc/erc_item.h>
|
||||
#include <eeschema_settings.h>
|
||||
#include <string_utils.h>
|
||||
#include <kiplatform/ui.h>
|
||||
|
||||
@ -53,6 +49,7 @@
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/hyperlink.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
|
||||
wxDEFINE_EVENT( EDA_EVT_CLOSE_ERC_DIALOG, wxCommandEvent );
|
||||
@ -1014,7 +1011,7 @@ void DIALOG_ERC::deleteAllMarkers( bool aIncludeExclusions )
|
||||
// Clear current selection list to avoid selection of deleted items
|
||||
// Freeze to avoid repainting the dialog, which can cause a RePaint()
|
||||
// of the screen as well
|
||||
WINDOW_FREEZER raiiFreezer( this );
|
||||
wxWindowUpdateLocker updateLock( this );
|
||||
|
||||
m_parent->GetToolManager()->RunAction( ACTIONS::selectionClear );
|
||||
|
||||
|
@ -21,8 +21,8 @@
|
||||
*/
|
||||
|
||||
#include <wx/log.h>
|
||||
#include <wx/wupdlock.h>
|
||||
#include <core/profile.h>
|
||||
#include <core/raii.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <kiface_base.h>
|
||||
#include <sch_edit_frame.h>
|
||||
@ -31,7 +31,6 @@
|
||||
#include <sch_junction.h>
|
||||
#include <sch_no_connect.h>
|
||||
#include <sch_sheet_pin.h>
|
||||
#include <schematic.h>
|
||||
#include <string_utils.h>
|
||||
#include <trace_helpers.h>
|
||||
#include <connection_graph.h>
|
||||
@ -306,8 +305,8 @@ void SCH_EDIT_FRAME::RefreshNetNavigator( const NET_NAVIGATOR_ITEM_DATA* aSelect
|
||||
bool singleSheetSchematic = m_schematic->Hierarchy().size() == 1;
|
||||
size_t nodeCnt = 0;
|
||||
|
||||
WINDOW_FREEZER raiiFreezer( m_netNavigator );
|
||||
PROF_TIMER timer;
|
||||
wxWindowUpdateLocker updateLock( m_netNavigator );
|
||||
PROF_TIMER timer;
|
||||
|
||||
if( m_highlightedConn.IsEmpty() )
|
||||
{
|
||||
|
@ -24,22 +24,16 @@
|
||||
*/
|
||||
|
||||
#include <bitmaps.h>
|
||||
#include <core/raii.h>
|
||||
#include <sch_edit_frame.h>
|
||||
#include <sch_sheet.h>
|
||||
#include <sch_sheet_path.h>
|
||||
#include <sch_commit.h>
|
||||
#include <schematic.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tools/sch_actions.h>
|
||||
|
||||
#include <hierarchy_pane.h>
|
||||
#include <kiface_base.h>
|
||||
#include <eeschema_settings.h>
|
||||
|
||||
#include <wx/object.h>
|
||||
#include <wx/generic/textdlgg.h>
|
||||
#include <wx/menu.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
/**
|
||||
* Store an SCH_SHEET_PATH of each sheet in hierarchy.
|
||||
@ -211,7 +205,7 @@ void HIERARCHY_PANE::UpdateHierarchySelection()
|
||||
|
||||
void HIERARCHY_PANE::UpdateHierarchyTree( bool aClear )
|
||||
{
|
||||
WINDOW_FREEZER raiiFreezer( this );
|
||||
wxWindowUpdateLocker updateLock( this );
|
||||
|
||||
bool eventsWereBound = m_events_bound;
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
|
||||
#include <stack>
|
||||
#include <thread>
|
||||
#include <git2.h>
|
||||
|
||||
#include <wx/regex.h>
|
||||
@ -33,6 +32,7 @@
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/textdlg.h>
|
||||
#include <wx/timer.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
#include <advanced_config.h>
|
||||
#include <bitmaps.h>
|
||||
@ -61,10 +61,6 @@
|
||||
#include <git/git_push_handler.h>
|
||||
#include <git/git_resolve_conflict_handler.h>
|
||||
#include <git/git_revert_handler.h>
|
||||
#include <git/git_switch_branch_handler.h>
|
||||
#include <git/git_compare_handler.h>
|
||||
#include <git/git_remove_vcs_handler.h>
|
||||
#include <git/git_add_to_index_handler.h>
|
||||
#include <git/git_remove_from_index_handler.h>
|
||||
#include <git/git_sync_handler.h>
|
||||
#include <git/git_clone_handler.h>
|
||||
@ -80,8 +76,6 @@
|
||||
#include "kicad_manager_frame.h"
|
||||
|
||||
#include "project_tree_pane.h"
|
||||
#include <widgets/kistatusbar.h>
|
||||
|
||||
#include <kiplatform/io.h>
|
||||
#include <kiplatform/secrets.h>
|
||||
|
||||
@ -666,10 +660,8 @@ void PROJECT_TREE_PANE::ReCreateTreePrj()
|
||||
|
||||
if( !m_TreeProject )
|
||||
m_TreeProject = new PROJECT_TREE( this );
|
||||
|
||||
WINDOW_FREEZER raiiFreezer( m_TreeProject );
|
||||
|
||||
m_TreeProject->DeleteAllItems();
|
||||
else
|
||||
m_TreeProject->DeleteAllItems();
|
||||
|
||||
if( !pro_dir ) // This is empty from PROJECT_TREE_PANE constructor
|
||||
return;
|
||||
@ -1616,8 +1608,6 @@ void PROJECT_TREE_PANE::EmptyTreePrj()
|
||||
// Make sure we don't try to inspect the tree after we've deleted its items.
|
||||
shutdownFileWatcher();
|
||||
|
||||
m_TreeProject->Freeze();
|
||||
|
||||
m_TreeProject->DeleteAllItems();
|
||||
|
||||
// Remove the git repository when the project is unloaded
|
||||
|
@ -82,26 +82,6 @@ protected:
|
||||
};
|
||||
|
||||
|
||||
// Temporarily freeze a window, and then un-freeze on destruction
|
||||
class WINDOW_FREEZER
|
||||
{
|
||||
public:
|
||||
WINDOW_FREEZER( wxWindow* aWindow )
|
||||
{
|
||||
m_window = aWindow;
|
||||
m_window->Freeze();
|
||||
}
|
||||
|
||||
~WINDOW_FREEZER()
|
||||
{
|
||||
m_window->Thaw();
|
||||
}
|
||||
|
||||
protected:
|
||||
wxWindow* m_window;
|
||||
};
|
||||
|
||||
|
||||
/// Temporarily disable a window, and then re-enable on destruction.
|
||||
class WINDOW_DISABLER
|
||||
{
|
||||
|
@ -31,13 +31,14 @@
|
||||
#include <drawing_sheet/ds_data_model.h>
|
||||
#include <drawing_sheet/ds_painter.h>
|
||||
|
||||
#include "pl_editor_frame.h"
|
||||
#include "pl_editor_id.h"
|
||||
#include "properties_frame.h"
|
||||
#include "tools/pl_actions.h"
|
||||
#include "tools/pl_editor_control.h"
|
||||
#include "tools/pl_selection_tool.h"
|
||||
#include <pl_editor_frame.h>
|
||||
#include <pl_editor_id.h>
|
||||
#include <properties_frame.h>
|
||||
#include <tools/pl_actions.h>
|
||||
#include <tools/pl_editor_control.h>
|
||||
#include <tools/pl_selection_tool.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
|
||||
bool PL_EDITOR_CONTROL::Init()
|
||||
@ -149,7 +150,7 @@ int PL_EDITOR_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
|
||||
PL_SELECTION& selection = selTool->GetSelection();
|
||||
|
||||
// The Properties frame will be updated. Avoid flicker during update:
|
||||
WINDOW_FREEZER raiiFreezer( m_frame->GetPropertiesFrame() );
|
||||
wxWindowUpdateLocker updateLock( m_frame->GetPropertiesFrame() );
|
||||
|
||||
if( selection.GetSize() == 1 )
|
||||
{
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <pgm_base.h>
|
||||
#include <widgets/grid_icon_text_helpers.h>
|
||||
#include <widgets/paged_dialog.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
PANEL_SETUP_TIME_DOMAIN_PARAMETERS::PANEL_SETUP_TIME_DOMAIN_PARAMETERS(
|
||||
wxWindow* aParentWindow, PCB_EDIT_FRAME* aFrame, BOARD* aBoard,
|
||||
@ -504,7 +505,7 @@ void PANEL_SETUP_TIME_DOMAIN_PARAMETERS::OnDelayProfileGridCellChanging( wxGridE
|
||||
|
||||
if( !oldName.IsEmpty() )
|
||||
{
|
||||
WINDOW_FREEZER raiiFreezer( m_viaPropagationGrid );
|
||||
wxWindowUpdateLocker updateLocker( m_viaPropagationGrid );
|
||||
|
||||
updateViaProfileNamesEditor( oldName, newName );
|
||||
|
||||
|
@ -35,14 +35,11 @@
|
||||
#include <footprint_edit_frame.h>
|
||||
#include <footprint_editor_settings.h>
|
||||
#include <pcbnew_id.h>
|
||||
#include <pcbnew_settings.h>
|
||||
#include "footprint_wizard_frame.h"
|
||||
#include <wx/listbox.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/numformatter.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
#include <base_units.h>
|
||||
#include <wx/wupdlock.h>
|
||||
#include <pgm_base.h>
|
||||
#include <settings/color_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
@ -50,12 +47,13 @@
|
||||
#include <tool/tool_dispatcher.h>
|
||||
#include <tool/action_toolbar.h>
|
||||
#include <tool/common_tools.h>
|
||||
#include "tools/pcb_selection_tool.h"
|
||||
#include "tools/pcb_control.h"
|
||||
#include "tools/pcb_actions.h"
|
||||
#include "tools/footprint_wizard_tools.h"
|
||||
#include <tools/pcb_selection_tool.h>
|
||||
#include <tools/pcb_control.h>
|
||||
#include <tools/pcb_actions.h>
|
||||
#include <tools/footprint_wizard_tools.h>
|
||||
#include <toolbars_footprint_wizard.h>
|
||||
#include <python/scripting/pcb_scripting_tool.h>
|
||||
#include "footprint_wizard_frame.h"
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE( FOOTPRINT_WIZARD_FRAME, PCB_BASE_EDIT_FRAME )
|
||||
@ -380,7 +378,7 @@ void FOOTPRINT_WIZARD_FRAME::ReCreateParameterList()
|
||||
if( footprintWizard == nullptr )
|
||||
return;
|
||||
|
||||
WINDOW_FREEZER raiiFreezer( m_parameterGrid );
|
||||
wxWindowUpdateLocker updateLock( m_parameterGrid );
|
||||
|
||||
m_parameterGrid->ClearGrid();
|
||||
m_parameterGridPage = m_pageList->GetSelection();
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <settings/color_settings.h>
|
||||
#include <tools/pcb_actions.h>
|
||||
#include <dpi_scaling_common.h>
|
||||
#include <core/raii.h>
|
||||
#include <wx/wupdlock.h>
|
||||
|
||||
|
||||
PCB_LAYER_BOX_SELECTOR::PCB_LAYER_BOX_SELECTOR( wxWindow* parent, wxWindowID id, const wxString& value,
|
||||
@ -56,7 +56,7 @@ void PCB_LAYER_BOX_SELECTOR::SetBoardFrame( PCB_BASE_FRAME* aFrame )
|
||||
// Reload the Layers
|
||||
void PCB_LAYER_BOX_SELECTOR::Resync()
|
||||
{
|
||||
WINDOW_FREEZER raiiFreezer( this );
|
||||
wxWindowUpdateLocker updateLock( this );
|
||||
|
||||
Clear();
|
||||
|
||||
|
@ -895,7 +895,7 @@ void PCB_NET_INSPECTOR_PANEL::updateNets( const std::vector<NETINFO_ITEM*>& aNet
|
||||
netsToUpdate.emplace_back( net );
|
||||
}
|
||||
|
||||
WINDOW_FREEZER raiiFreezer( m_netsList );
|
||||
wxWindowUpdateLocker updateLocker( m_netsList );
|
||||
|
||||
std::vector<std::unique_ptr<LIST_ITEM>> newListItems = calculateNets( aNets, true );
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <wx/debug.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/wupdlock.h>
|
||||
#include <kiface_base.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <pcbnew_settings.h>
|
||||
@ -213,7 +214,7 @@ void DIALOG_ZONE_MANAGER::onDialogResize( wxSizeEvent& event )
|
||||
|
||||
void DIALOG_ZONE_MANAGER::OnZoneSelectionChanged( ZONE* zone )
|
||||
{
|
||||
WINDOW_FREEZER raiiFreezer( this );
|
||||
wxWindowUpdateLocker updateLock( this );
|
||||
|
||||
for( ZONE_SELECTION_CHANGE_NOTIFIER* i :
|
||||
std::list<ZONE_SELECTION_CHANGE_NOTIFIER*>{ m_panelZoneProperties, m_zoneViewer } )
|
||||
|
Loading…
x
Reference in New Issue
Block a user