save and restore last used net inspector settings
This commit is contained in:
parent
196e05bc51
commit
5a1b30ea42
|
@ -40,6 +40,9 @@
|
|||
#include <validators.h>
|
||||
#include <bitmaps.h>
|
||||
#include <widgets/std_bitmap_button.h>
|
||||
#include "pcbnew_settings.h"
|
||||
#include <settings/settings_manager.h>
|
||||
#include <pgm_base.h>
|
||||
|
||||
#include <wx/tokenzr.h>
|
||||
#include <wx/filedlg.h>
|
||||
|
@ -1086,8 +1089,17 @@ DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR( PCB_EDIT_FRAME* aParent ) :
|
|||
|
||||
m_textCtrlFilter->SetValue( g_settings.filter_string );
|
||||
m_cbShowZeroPad->SetValue( g_settings.show_zero_pad_nets );
|
||||
|
||||
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
PCBNEW_SETTINGS* app_settings = mgr.GetAppSettings<PCBNEW_SETTINGS>();
|
||||
g_settings.group_by_text = app_settings->m_NetInspector.group_by_text;
|
||||
g_settings.group_by = app_settings->m_NetInspector.group_by;
|
||||
g_settings.group_by_kind = app_settings->m_NetInspector.group_by_kind;
|
||||
|
||||
m_groupBy->SetValue( g_settings.group_by );
|
||||
m_groupByKind->SetSelection( g_settings.group_by_kind );
|
||||
|
||||
m_groupByText->SetValue( g_settings.group_by_text );
|
||||
|
||||
m_filter_change_no_rebuild = false;
|
||||
|
@ -1150,6 +1162,12 @@ DIALOG_NET_INSPECTOR::~DIALOG_NET_INSPECTOR()
|
|||
g_settings.sort_order_asc = sorting_column ? sorting_column->IsSortOrderAscending() : true;
|
||||
g_settings.column_order = column_order;
|
||||
|
||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||
PCBNEW_SETTINGS* app_settings = mgr.GetAppSettings<PCBNEW_SETTINGS>();
|
||||
app_settings->m_NetInspector.group_by_text = g_settings.group_by_text;
|
||||
app_settings->m_NetInspector.group_by = g_settings.group_by;
|
||||
app_settings->m_NetInspector.group_by_kind = g_settings.group_by_kind;
|
||||
|
||||
// the displayed list elements are going to be deleted before the list view itself.
|
||||
// in some cases it might still do queries on the data model, which would crash
|
||||
// from now on. so just disassociate it.
|
||||
|
|
|
@ -567,6 +567,13 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
|
|||
m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_report_file_name",
|
||||
&m_Reannotate.report_file_name, "" ) );
|
||||
|
||||
m_params.emplace_back( new PARAM<wxString>( "net_inspector_dialog.group_by_text",
|
||||
&m_NetInspector.group_by_text, "" ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "net_inspector_dialog.group_by",
|
||||
&m_NetInspector.group_by, false ) );
|
||||
m_params.emplace_back( new PARAM<int>( "net_inspector_dialog.group_by_kind",
|
||||
&m_NetInspector.group_by_kind, 0 ) );
|
||||
|
||||
m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "action_plugins",
|
||||
[&]() -> nlohmann::json
|
||||
{
|
||||
|
|
|
@ -301,6 +301,13 @@ public:
|
|||
wxString report_file_name;
|
||||
};
|
||||
|
||||
struct DIALOG_NET_INSPECTOR
|
||||
{
|
||||
wxString group_by_text;
|
||||
bool group_by;
|
||||
int group_by_kind;
|
||||
};
|
||||
|
||||
struct FOOTPRINT_CHOOSER
|
||||
{
|
||||
int width;
|
||||
|
@ -380,6 +387,8 @@ public:
|
|||
|
||||
DIALOG_REANNOTATE m_Reannotate;
|
||||
|
||||
DIALOG_NET_INSPECTOR m_NetInspector;
|
||||
|
||||
FOOTPRINT_CHOOSER m_FootprintChooser;
|
||||
|
||||
ZONES m_Zones;
|
||||
|
|
Loading…
Reference in New Issue