Fix a few issues in the PCM dialog tune-up.

This commit is contained in:
Jeff Young 2021-11-11 00:32:50 +00:00
parent 09ec9f5bff
commit cc938e7a67
7 changed files with 30 additions and 20 deletions

View File

@ -32,7 +32,6 @@
#include "pgm_base.h" #include "pgm_base.h"
#include "settings/settings_manager.h" #include "settings/settings_manager.h"
#include "thread" #include "thread"
#include "widgets/wx_progress_reporters.h"
#include "widgets/wx_grid.h" #include "widgets/wx_grid.h"
#include <fstream> #include <fstream>
@ -136,6 +135,8 @@ DIALOG_PCM::DIALOG_PCM( wxWindow* parent ) : DIALOG_PCM_BASE( parent )
SetDefaultItem( m_sdbSizer1OK ); SetDefaultItem( m_sdbSizer1OK );
Bind( wxEVT_CLOSE_WINDOW, &DIALOG_PCM::OnCloseWindow, this );
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
KICAD_SETTINGS* app_settings = mgr.GetAppSettings<KICAD_SETTINGS>(); KICAD_SETTINGS* app_settings = mgr.GetAppSettings<KICAD_SETTINGS>();
@ -174,6 +175,14 @@ void DIALOG_PCM::OnCloseClicked( wxCommandEvent& event )
} }
void DIALOG_PCM::OnCloseWindow( wxCloseEvent& aEvent )
{
wxCommandEvent dummy;
OnCloseClicked( dummy );
}
void DIALOG_PCM::OnManageRepositoriesClicked( wxCommandEvent& event ) void DIALOG_PCM::OnManageRepositoriesClicked( wxCommandEvent& event )
{ {
DIALOG_MANAGE_REPOSITORIES* dialog = new DIALOG_MANAGE_REPOSITORIES( this, m_pcm ); DIALOG_MANAGE_REPOSITORIES* dialog = new DIALOG_MANAGE_REPOSITORIES( this, m_pcm );

View File

@ -41,6 +41,7 @@ public:
///< Closes the window, asks user confirmation if there are pending actions ///< Closes the window, asks user confirmation if there are pending actions
void OnCloseClicked( wxCommandEvent& event ) override; void OnCloseClicked( wxCommandEvent& event ) override;
void OnCloseWindow( wxCloseEvent& aEvent );
///< Opens repository management dialog, saves changes to PCM ///< Opens repository management dialog, saves changes to PCM
void OnManageRepositoriesClicked( wxCommandEvent& event ) override; void OnManageRepositoriesClicked( wxCommandEvent& event ) override;

View File

@ -42,7 +42,7 @@ DIALOG_PCM_BASE::DIALOG_PCM_BASE( wxWindow* parent, wxWindowID id, const wxStrin
m_contentNotebook = new wxNotebook( m_panelRepository, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_contentNotebook = new wxNotebook( m_panelRepository, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
bSizer4->Add( m_contentNotebook, 1, wxEXPAND | wxALL, 5 ); bSizer4->Add( m_contentNotebook, 1, wxEXPAND|wxBOTTOM, 5 );
m_panelRepository->SetSizer( bSizer4 ); m_panelRepository->SetSizer( bSizer4 );

View File

@ -335,7 +335,7 @@
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxEXPAND | wxALL</property> <property name="flag">wxEXPAND|wxBOTTOM</property>
<property name="proportion">1</property> <property name="proportion">1</property>
<object class="wxNotebook" expanded="1"> <object class="wxNotebook" expanded="1">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>

View File

@ -14,10 +14,10 @@ PANEL_PACKAGES_VIEW_BASE::PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID
wxBoxSizer* bSizer1; wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL ); bSizer1 = new wxBoxSizer( wxVERTICAL );
m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH ); m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE );
m_splitter1->SetSashGravity( 0.5 ); m_splitter1->SetSashGravity( 0.5 );
m_splitter1->Connect( wxEVT_IDLE, wxIdleEventHandler( PANEL_PACKAGES_VIEW_BASE::m_splitter1OnIdle ), NULL, this ); m_splitter1->Connect( wxEVT_IDLE, wxIdleEventHandler( PANEL_PACKAGES_VIEW_BASE::m_splitter1OnIdle ), NULL, this );
m_splitter1->SetMinimumPaneSize( 300 ); m_splitter1->SetMinimumPaneSize( 380 );
m_panelList = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelList = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bPanelListSizer; wxBoxSizer* bPanelListSizer;
@ -98,22 +98,22 @@ PANEL_PACKAGES_VIEW_BASE::PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID
bSizerVersionButtons = new wxBoxSizer( wxHORIZONTAL ); bSizerVersionButtons = new wxBoxSizer( wxHORIZONTAL );
m_showAllVersions = new wxCheckBox( m_scrolledWindow5, wxID_ANY, _("Show all versions"), wxDefaultPosition, wxDefaultSize, 0 ); m_showAllVersions = new wxCheckBox( m_scrolledWindow5, wxID_ANY, _("Show all versions"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerVersionButtons->Add( m_showAllVersions, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); bSizerVersionButtons->Add( m_showAllVersions, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
bSizerVersionButtons->Add( 0, 0, 1, wxEXPAND, 5 ); bSizerVersionButtons->Add( 0, 0, 1, wxEXPAND, 5 );
m_buttonDownload = new wxButton( m_scrolledWindow5, wxID_ANY, _("Download"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonDownload = new wxButton( m_scrolledWindow5, wxID_ANY, _("Download"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerVersionButtons->Add( m_buttonDownload, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); bSizerVersionButtons->Add( m_buttonDownload, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_buttonInstall = new wxButton( m_scrolledWindow5, wxID_ANY, _("Install"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonInstall = new wxButton( m_scrolledWindow5, wxID_ANY, _("Install"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerVersionButtons->Add( m_buttonInstall, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); bSizerVersionButtons->Add( m_buttonInstall, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_sizerVersions->Add( bSizerVersionButtons, 0, wxEXPAND|wxRIGHT, 15 ); m_sizerVersions->Add( bSizerVersionButtons, 0, wxEXPAND|wxRIGHT, 15 );
bSizerScrolledWindow->Add( m_sizerVersions, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); bSizerScrolledWindow->Add( m_sizerVersions, 0, wxEXPAND|wxRIGHT|wxLEFT, 3 );
m_scrolledWindow5->SetSizer( bSizerScrolledWindow ); m_scrolledWindow5->SetSizer( bSizerScrolledWindow );

View File

@ -43,7 +43,7 @@
<property name="minimum_size"></property> <property name="minimum_size"></property>
<property name="name">PANEL_PACKAGES_VIEW_BASE</property> <property name="name">PANEL_PACKAGES_VIEW_BASE</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size">700,400</property> <property name="size">840,400</property>
<property name="subclass">; ; forward_declare</property> <property name="subclass">; ; forward_declare</property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="window_extra_style"></property> <property name="window_extra_style"></property>
@ -89,7 +89,7 @@
<property name="max_size"></property> <property name="max_size"></property>
<property name="maximize_button">0</property> <property name="maximize_button">0</property>
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="min_pane_size">300</property> <property name="min_pane_size">380</property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size"></property>
@ -108,7 +108,7 @@
<property name="show">1</property> <property name="show">1</property>
<property name="size"></property> <property name="size"></property>
<property name="splitmode">wxSPLIT_VERTICAL</property> <property name="splitmode">wxSPLIT_VERTICAL</property>
<property name="style">wxSP_3DSASH</property> <property name="style">wxSP_3DSASH|wxSP_LIVE_UPDATE</property>
<property name="subclass">; ; forward_declare</property> <property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip"></property> <property name="tooltip"></property>
@ -339,7 +339,7 @@
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size">-1,-1</property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_panelDetails</property> <property name="name">m_panelDetails</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
@ -358,7 +358,7 @@
<property name="window_name"></property> <property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property> <property name="window_style">wxTAB_TRAVERSAL</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property> <property name="minimum_size">-1,-1</property>
<property name="name">bPanelDetailsSizer</property> <property name="name">bPanelDetailsSizer</property>
<property name="orient">wxVERTICAL</property> <property name="orient">wxVERTICAL</property>
<property name="permission">none</property> <property name="permission">none</property>
@ -399,7 +399,7 @@
<property name="maximum_size"></property> <property name="maximum_size"></property>
<property name="min_size"></property> <property name="min_size"></property>
<property name="minimize_button">0</property> <property name="minimize_button">0</property>
<property name="minimum_size"></property> <property name="minimum_size">-1,-1</property>
<property name="moveable">1</property> <property name="moveable">1</property>
<property name="name">m_scrolledWindow5</property> <property name="name">m_scrolledWindow5</property>
<property name="pane_border">1</property> <property name="pane_border">1</property>
@ -487,7 +487,7 @@
</object> </object>
</object> </object>
<object class="sizeritem" expanded="1"> <object class="sizeritem" expanded="1">
<property name="border">5</property> <property name="border">3</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property> <property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1"> <object class="wxBoxSizer" expanded="1">
@ -595,7 +595,7 @@
<property name="permission">none</property> <property name="permission">none</property>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxCheckBox" expanded="0"> <object class="wxCheckBox" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -670,7 +670,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="0"> <object class="wxButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>
@ -743,7 +743,7 @@
</object> </object>
<object class="sizeritem" expanded="0"> <object class="sizeritem" expanded="0">
<property name="border">5</property> <property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT</property> <property name="flag">wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="proportion">0</property> <property name="proportion">0</property>
<object class="wxButton" expanded="0"> <object class="wxButton" expanded="0">
<property name="BottomDockable">1</property> <property name="BottomDockable">1</property>

View File

@ -62,7 +62,7 @@ class PANEL_PACKAGES_VIEW_BASE : public wxPanel
public: public:
PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 700,400 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 840,400 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString );
~PANEL_PACKAGES_VIEW_BASE(); ~PANEL_PACKAGES_VIEW_BASE();
void m_splitter1OnIdle( wxIdleEvent& ) void m_splitter1OnIdle( wxIdleEvent& )