|
KiCad PCB EDA Suite
|
#include <algorithm>#include <set>#include <wx/app.h>#include <wx/display.h>#include <wx/filedlg.h>#include <wx/filefn.h>#include <wx/filename.h>#include <wx/menu.h>#include <wx/regex.h>#include <wx/settings.h>#include <wx/stdpaths.h>#include <wx/thread.h>#include <wx/utils.h>#include <bitmaps.h>#include <confirm.h>#include <core/kicad_algo.h>#include <database/database_autofill.h>#include <database/database_lib_settings.h>#include <dialogs/dialog_database_lib_settings.h>#include <eda_draw_frame.h>#include <eeschema_settings.h>#include <grid_tricks.h>#include <i18n_utility.h>#include <kiplatform/ui.h>#include <lib_symbol.h>#include <pgm_base.h>#include <reporter.h>#include <sch_io/database/sch_io_database.h>#include <thread_pool.h>#include <scoped_set_reset.h>#include <settings/json_settings_internals.h>#include <settings/common_settings.h>#include <settings/settings_manager.h>#include <string_utils.h>#include <widgets/db_lib_preview_panel.h>#include <widgets/grid_combobox.h>#include <widgets/std_bitmap_button.h>#include <widgets/wx_grid.h>#include <widgets/wx_infobar.h>#include <wildcards_and_files_ext.h>Go to the source code of this file.
Classes | |
| struct | AUTOFILL_FIELD |
| A symbol field that autofill maps from a like-named column. More... | |
Enumerations | |
| enum class | ACCESS_PROVIDER { MISSING , PENDING , AVAILABLE } |
| enum | FIELD_COLUMNS { FIELD_COL_COLUMN = 0 , FIELD_COL_NAME , FIELD_COL_VISIBLE_ON_ADD , FIELD_COL_VISIBLE_IN_CHOOSER , FIELD_COL_SHOW_NAME , FIELD_COL_INHERIT } |
Functions | |
| static ACCESS_PROVIDER | accessProvider () |
| Whether this computer can read Access files, which never blocks. | |
| static void | relayoutPage (wxScrolledWindow *aPage) |
| Re-lays out a scrolled page and refits its scroll area after its contents change size. | |
| template<typename MAP> | |
| static bool | isAutofilled (const MAP &aAutofilled, const typename MAP::key_type &aKey, const std::string &aValue) |
| True if autofill wrote aValue for aKey and the user has not changed it since. | |
| static wxString | displayName (const DATABASE_LIB_TABLE &aTable) |
| static wxString | describeFailure (DB_FAILURE aFailure, const DATABASE_SOURCE &aSource) |
| static const std::vector< AUTOFILL_FIELD > & | autofillFields () |
| static std::string | fieldChoiceId (const char *aFieldName) |
| static DB_AUTOFILL::ROLE | autofillRole (const std::string &aChoiceId, const std::vector< wxString > &aTerms) |
| static DATABASE_FIELD_MAPPING * | findField (DATABASE_LIB_TABLE &aLib, const char *aName) |
| static void | releaseConnection (std::unique_ptr< DATABASE_CONNECTION > aConn) |
| A connection closes with a bounded wait that a dead share can use up, so the UI thread hands it to the pool while a pool thread closes it inline, as detaching from inside purge() would lock the queue twice. | |
| static wxString | accessLabel (ACCESS_PROVIDER aProvider) |
Variables | |
| static constexpr size_t | PREVIEW_ROW_LIMIT = 200 |
| Rows read for the Data page and preview; enough to judge a mapping without loading a whole table. | |
| static constexpr int | PREVIEW_MIN_WIDTH_DIP = 450 |
| Narrowest the preview next to the settings can be before its tree columns are cut off. | |
| static constexpr int | PREVIEW_DEBOUNCE_MS = 750 |
| Delay after the last edit before the preview is rebuilt. | |
| static constexpr int | PROVIDER_POLL_MS = 250 |
| How often the Access provider check is asked whether it has finished, and for how long. | |
| static constexpr int | PROVIDER_POLL_LIMIT = 80 |
| static constexpr int | CONNECT_DEBOUNCE_MS = 500 |
| Pause in typing a database file path before the connection is tried. | |
|
strong |
| Enumerator | |
|---|---|
| MISSING | |
| PENDING | |
| AVAILABLE | |
Definition at line 86 of file dialog_database_lib_settings.cpp.
| enum FIELD_COLUMNS |
| Enumerator | |
|---|---|
| FIELD_COL_COLUMN | |
| FIELD_COL_NAME | |
| FIELD_COL_VISIBLE_ON_ADD | |
| FIELD_COL_VISIBLE_IN_CHOOSER | |
| FIELD_COL_SHOW_NAME | |
| FIELD_COL_INHERIT | |
Definition at line 129 of file dialog_database_lib_settings.cpp.
|
static |
Definition at line 965 of file dialog_database_lib_settings.cpp.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::loadBackends(), and DIALOG_DATABASE_LIB_SETTINGS::onProviderTimer().
|
static |
Whether this computer can read Access files, which never blocks.
Definition at line 95 of file dialog_database_lib_settings.cpp.
References AVAILABLE, ACE_BACKEND::AVAILABLE, ACE_BACKEND::BUSY, MISSING, ACE_BACKEND::MISSING, PENDING, ACE_BACKEND::PENDING, and ACE_BACKEND::ProviderState().
Referenced by DIALOG_DATABASE_LIB_SETTINGS::loadBackends(), and DIALOG_DATABASE_LIB_SETTINGS::onProviderTimer().
|
static |
Definition at line 223 of file dialog_database_lib_settings.cpp.
References _HKI.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::autofillColumns(), and DIALOG_DATABASE_LIB_SETTINGS::OnFieldCellChanged().
|
static |
Definition at line 240 of file dialog_database_lib_settings.cpp.
References GetAppSettings(), DB_AUTOFILL::ROLE::remembered, and DB_AUTOFILL::ROLE::terms.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::autofillColumns().
|
static |
Definition at line 146 of file dialog_database_lib_settings.cpp.
References _, ACCESS, DATABASE_SOURCE::connection_string, DatabaseFileWaitSeconds(), DATABASE_SOURCE::dsn, From_UTF8(), ODBC, DATABASE_SOURCE::path, DATABASE_SOURCE::timeout, DATABASE_SOURCE::type, and DATABASE_SOURCE::type_name.
|
static |
Definition at line 140 of file dialog_database_lib_settings.cpp.
References _, From_UTF8(), and DATABASE_LIB_TABLE::name.
Referenced by RHI_VULKAN_DEVICE::CreateSurface(), LIB_SYMBOL::Deserialize(), ALLEGRO::LAYER_MAPPER::FinalizeLayers(), DIALOG_DATABASE_LIB_SETTINGS::loadLibraryList(), DIALOG_DATABASE_LIB_SETTINGS::OnLibraryChanged(), ORCAD_CONVERTER::placePowerSymbol(), DIALOG_GIT_SWITCH::PopulateBranchList(), ORCAD_CONVERTER::prepareGlobalNetNames(), SCH_EDIT_FRAME::RefreshNetNavigator(), LIB_SYMBOL::Serialize(), PANEL_FP_PROPERTIES_3D_MODEL::set3DModelRow(), SIMULATOR_FRAME_UI::ToggleSmithChart(), DIALOG_DATABASE_LIB_SETTINGS::updateDataLabels(), and DIALOG_DATABASE_LIB_SETTINGS::updatePreview().
|
static |
Definition at line 234 of file dialog_database_lib_settings.cpp.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::autofillColumns(), and DIALOG_DATABASE_LIB_SETTINGS::OnFieldCellChanged().
|
static |
Definition at line 262 of file dialog_database_lib_settings.cpp.
References DATABASE_LIB_TABLE::fields, and DATABASE_FIELD_MAPPING::name.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::autofillColumns(), PADS_SCH::PADS_SCH_SCHEMATIC_BUILDER::CreateTitleBlock(), findField(), and SCH_CONNECTIVITY::LIBRARY_SYMBOL_FACT::Matches().
|
static |
True if autofill wrote aValue for aKey and the user has not changed it since.
Definition at line 121 of file dialog_database_lib_settings.cpp.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::autofillColumns(), and DIALOG_DATABASE_LIB_SETTINGS::updateAutofillStyle().
|
static |
Re-lays out a scrolled page and refits its scroll area after its contents change size.
Definition at line 112 of file dialog_database_lib_settings.cpp.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::loadLibrary(), DIALOG_DATABASE_LIB_SETTINGS::setConnectionStatus(), DIALOG_DATABASE_LIB_SETTINGS::updateDsnDriver(), DIALOG_DATABASE_LIB_SETTINGS::updateLibraryListHints(), DIALOG_DATABASE_LIB_SETTINGS::updateSourceControls(), and DIALOG_DATABASE_LIB_SETTINGS::updateSymbolExample().
|
static |
A connection closes with a bounded wait that a dead share can use up, so the UI thread hands it to the pool while a pool thread closes it inline, as detaching from inside purge() would lock the queue twice.
Definition at line 508 of file dialog_database_lib_settings.cpp.
References GetKiCadThreadPool().
Referenced by DIALOG_DATABASE_LIB_SETTINGS::connect(), DIALOG_DATABASE_LIB_SETTINGS::CONNECT_JOB::~CONNECT_JOB(), and DIALOG_DATABASE_LIB_SETTINGS::~DIALOG_DATABASE_LIB_SETTINGS().
|
staticconstexpr |
Pause in typing a database file path before the connection is tried.
Definition at line 83 of file dialog_database_lib_settings.cpp.
|
staticconstexpr |
Delay after the last edit before the preview is rebuilt.
Definition at line 76 of file dialog_database_lib_settings.cpp.
|
staticconstexpr |
Narrowest the preview next to the settings can be before its tree columns are cut off.
Definition at line 73 of file dialog_database_lib_settings.cpp.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::onSplitterIdle().
|
staticconstexpr |
Rows read for the Data page and preview; enough to judge a mapping without loading a whole table.
Definition at line 70 of file dialog_database_lib_settings.cpp.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::ensureSample(), DIALOG_DATABASE_LIB_SETTINGS::updateDataLabels(), and DIALOG_DATABASE_LIB_SETTINGS::updatePreview().
|
staticconstexpr |
Definition at line 80 of file dialog_database_lib_settings.cpp.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::onProviderTimer().
|
staticconstexpr |
How often the Access provider check is asked whether it has finished, and for how long.
Definition at line 79 of file dialog_database_lib_settings.cpp.
Referenced by DIALOG_DATABASE_LIB_SETTINGS::loadBackends().