mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-14 12:49:34 +00:00
Fix git clone project dialog layout issues.
Use enable/disable instead of show/hide to prevent large areas of blank space in the dialog. Set the minimum dialog size after the initial launch to prevent controls from being cut off when resizing dialog to less than the initial size. Fix static and dialog title bar string capitalization. Add colons (:) to the end of description static text controls as is done elsewhere in KiCad. Fixes https://gitlab.com/kicad/code/kicad/-/issues/20045
This commit is contained in:
parent
7c067e25d9
commit
f538908f62
@ -70,11 +70,13 @@ DIALOG_GIT_REPOSITORY::DIALOG_GIT_REPOSITORY( wxWindow* aParent, git_repository*
|
||||
updateURLData();
|
||||
|
||||
SetupStandardButtons();
|
||||
updateAuthControls();
|
||||
|
||||
Layout();
|
||||
finishDialogSettings();
|
||||
|
||||
updateAuthControls();
|
||||
}
|
||||
|
||||
|
||||
DIALOG_GIT_REPOSITORY::~DIALOG_GIT_REPOSITORY()
|
||||
{
|
||||
if( m_tempRepo )
|
||||
@ -161,6 +163,7 @@ void DIALOG_GIT_REPOSITORY::SetEncrypted( bool aEncrypted )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::tuple<bool,wxString,wxString,wxString> DIALOG_GIT_REPOSITORY::isValidHTTPS( const wxString& url )
|
||||
{
|
||||
wxRegEx regex( R"((https?:\/\/)(([^:]+)(:([^@]+))?@)?([^\/]+\/[^\s]+))" );
|
||||
@ -331,7 +334,8 @@ void DIALOG_GIT_REPOSITORY::OnTestClick( wxCommandEvent& event )
|
||||
git_remote_disconnect( remote );
|
||||
git_remote_free( remote );
|
||||
|
||||
auto dlg = wxMessageDialog( this, wxEmptyString, _( "Test connection" ), wxOK | wxICON_INFORMATION );
|
||||
auto dlg = wxMessageDialog( this, wxEmptyString, _( "Test Connection" ),
|
||||
wxOK | wxICON_INFORMATION );
|
||||
|
||||
if( !m_failedTest )
|
||||
{
|
||||
@ -339,7 +343,8 @@ void DIALOG_GIT_REPOSITORY::OnTestClick( wxCommandEvent& event )
|
||||
}
|
||||
else
|
||||
{
|
||||
dlg.SetMessage( wxString::Format( _( "Could not connect to '%s' " ), m_txtURL->GetValue() ) );
|
||||
dlg.SetMessage( wxString::Format( _( "Could not connect to '%s' " ),
|
||||
m_txtURL->GetValue() ) );
|
||||
dlg.SetExtendedMessage( m_testError );
|
||||
}
|
||||
|
||||
@ -435,28 +440,26 @@ void DIALOG_GIT_REPOSITORY::updateAuthControls()
|
||||
{
|
||||
if( m_ConnType->GetSelection() == static_cast<int>( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_LOCAL ) )
|
||||
{
|
||||
m_panelAuth->Show( false );
|
||||
m_panelAuth->Enable( false );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_panelAuth->Show( true );
|
||||
m_panelAuth->Enable( true );
|
||||
|
||||
if( m_ConnType->GetSelection() == static_cast<int>( KIGIT_COMMON::GIT_CONN_TYPE::GIT_CONN_SSH ) )
|
||||
{
|
||||
m_fpSSHKey->Show( true );
|
||||
m_labelSSH->Show( true );
|
||||
m_labelPass1->SetLabel( _( "SSH Key Password" ) );
|
||||
m_fpSSHKey->Enable( true );
|
||||
m_labelSSH->Enable( true );
|
||||
m_labelPass1->SetLabel( _( "SSH key password:" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fpSSHKey->Show( false );
|
||||
m_labelSSH->Show( false );
|
||||
m_labelPass1->SetLabel( _( "Password" ) );
|
||||
m_fpSSHKey->Enable( false );
|
||||
m_labelSSH->Enable( false );
|
||||
m_labelPass1->SetLabel( _( "Password:" ) );
|
||||
setDefaultSSHKey();
|
||||
}
|
||||
}
|
||||
|
||||
Layout();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -13,7 +13,6 @@ DIALOG_GIT_REPOSITORY_BASE::DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWind
|
||||
{
|
||||
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bSizerMain;
|
||||
bSizerMain = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_staticText1 = new wxStaticText( this, wxID_ANY, _("Connection"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
@ -21,31 +20,31 @@ DIALOG_GIT_REPOSITORY_BASE::DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWind
|
||||
bSizerMain->Add( m_staticText1, 0, wxLEFT|wxTOP, 10 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizerMain->Add( m_staticline1, 0, wxEXPAND|wxTOP, 5 );
|
||||
bSizerMain->Add( m_staticline1, 0, wxALL|wxEXPAND, 5 );
|
||||
|
||||
wxFlexGridSizer* fgSizer2;
|
||||
fgSizer2 = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||
fgSizer2 = new wxFlexGridSizer( 0, 2, 5, 0 );
|
||||
fgSizer2->AddGrowableCol( 1 );
|
||||
fgSizer2->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Name"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText3->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticText3, 0, wxALL, 5 );
|
||||
fgSizer2->Add( m_staticText3, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
|
||||
|
||||
m_txtName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_txtName, 0, wxALL|wxEXPAND, 5 );
|
||||
fgSizer2->Add( m_txtName, 0, wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
m_staticText4 = new wxStaticText( this, wxID_ANY, _("Location"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText4 = new wxStaticText( this, wxID_ANY, _("Location:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText4->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticText4, 0, wxALL, 5 );
|
||||
fgSizer2->Add( m_staticText4, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
|
||||
|
||||
m_txtURL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSizer2->Add( m_txtURL, 0, wxALL|wxEXPAND, 5 );
|
||||
fgSizer2->Add( m_txtURL, 0, wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
m_staticText9 = new wxStaticText( this, wxID_ANY, _("Connection Type"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText9 = new wxStaticText( this, wxID_ANY, _("Connection type:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText9->Wrap( -1 );
|
||||
fgSizer2->Add( m_staticText9, 0, wxALL, 5 );
|
||||
fgSizer2->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
wxBoxSizer* bSizer3;
|
||||
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
|
||||
@ -54,84 +53,76 @@ DIALOG_GIT_REPOSITORY_BASE::DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWind
|
||||
int m_ConnTypeNChoices = sizeof( m_ConnTypeChoices ) / sizeof( wxString );
|
||||
m_ConnType = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ConnTypeNChoices, m_ConnTypeChoices, 0 );
|
||||
m_ConnType->SetSelection( 0 );
|
||||
bSizer3->Add( m_ConnType, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
bSizer3->Add( m_ConnType, 0, wxRIGHT, 5 );
|
||||
|
||||
|
||||
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
bSizer3->Add( 0, 0, 0, wxEXPAND, 5 );
|
||||
|
||||
|
||||
fgSizer2->Add( bSizer3, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( fgSizer2, 1, wxEXPAND, 5 );
|
||||
bSizerMain->Add( fgSizer2, 0, wxEXPAND, 5 );
|
||||
|
||||
m_panelAuth = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
|
||||
wxBoxSizer* m_szAuth;
|
||||
m_szAuth = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
||||
m_szAuth->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
wxBoxSizer* bSizer11;
|
||||
bSizer11 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_staticText2 = new wxStaticText( m_panelAuth, wxID_ANY, _("Authentication"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText2->Wrap( -1 );
|
||||
bSizer11->Add( m_staticText2, 0, wxLEFT|wxTOP, 10 );
|
||||
|
||||
|
||||
bSizer11->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_szAuth->Add( bSizer11, 0, wxEXPAND, 5 );
|
||||
m_szAuth->Add( m_staticText2, 0, wxLEFT|wxTOP, 10 );
|
||||
|
||||
m_staticline2 = new wxStaticLine( m_panelAuth, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
m_szAuth->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
wxFlexGridSizer* fgSshSizer;
|
||||
fgSshSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||
fgSshSizer->AddGrowableCol( 1 );
|
||||
fgSshSizer->SetFlexibleDirection( wxBOTH );
|
||||
fgSshSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
wxFlexGridSizer* fgSizer21;
|
||||
fgSizer21 = new wxFlexGridSizer( 0, 2, 5, 0 );
|
||||
fgSizer21->SetFlexibleDirection( wxBOTH );
|
||||
fgSizer21->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||
|
||||
m_labelSSH = new wxStaticText( m_panelAuth, wxID_ANY, _("SSH Private Key"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_labelSSH = new wxStaticText( m_panelAuth, wxID_ANY, _("SSH private key: "), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_labelSSH->Wrap( -1 );
|
||||
fgSshSizer->Add( m_labelSSH, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5 );
|
||||
fgSizer21->Add( m_labelSSH, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
wxBoxSizer* bSizer41;
|
||||
bSizer41 = new wxBoxSizer( wxHORIZONTAL );
|
||||
wxBoxSizer* bSizer5;
|
||||
bSizer5 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
m_fpSSHKey = new wxFilePickerCtrl( m_panelAuth, wxID_ANY, wxEmptyString, _("Select SSH private key file"), _("*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN );
|
||||
bSizer41->Add( m_fpSSHKey, 1, wxEXPAND|wxLEFT|wxRESERVE_SPACE_EVEN_IF_HIDDEN|wxRIGHT, 5 );
|
||||
m_fpSSHKey->SetMinSize( wxSize( 250,-1 ) );
|
||||
|
||||
bSizer5->Add( m_fpSSHKey, 0, wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
m_btnTest = new wxButton( m_panelAuth, wxID_ANY, _("Test"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
bSizer41->Add( m_btnTest, 0, wxLEFT|wxRIGHT, 5 );
|
||||
bSizer5->Add( m_btnTest, 0, wxRIGHT, 5 );
|
||||
|
||||
|
||||
fgSshSizer->Add( bSizer41, 1, wxEXPAND, 5 );
|
||||
fgSizer21->Add( bSizer5, 0, wxEXPAND, 5 );
|
||||
|
||||
m_staticText11 = new wxStaticText( m_panelAuth, wxID_ANY, _("Username"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText11 = new wxStaticText( m_panelAuth, wxID_ANY, _("User name:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_staticText11->Wrap( -1 );
|
||||
fgSshSizer->Add( m_staticText11, 0, wxALL, 5 );
|
||||
fgSizer21->Add( m_staticText11, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_txtUsername = new wxTextCtrl( m_panelAuth, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSshSizer->Add( m_txtUsername, 0, wxALL|wxEXPAND, 5 );
|
||||
fgSizer21->Add( m_txtUsername, 0, wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
m_labelPass1 = new wxStaticText( m_panelAuth, wxID_ANY, _("SSH Key Password"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_labelPass1 = new wxStaticText( m_panelAuth, wxID_ANY, _("SSH key password:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_labelPass1->Wrap( -1 );
|
||||
fgSshSizer->Add( m_labelPass1, 0, wxALL, 5 );
|
||||
fgSizer21->Add( m_labelPass1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_txtPassword = new wxTextCtrl( m_panelAuth, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||
fgSshSizer->Add( m_txtPassword, 0, wxALL|wxEXPAND, 5 );
|
||||
fgSizer21->Add( m_txtPassword, 0, wxEXPAND|wxRIGHT, 5 );
|
||||
|
||||
|
||||
m_szAuth->Add( fgSshSizer, 1, wxEXPAND, 5 );
|
||||
m_szAuth->Add( fgSizer21, 1, wxBOTTOM|wxEXPAND, 5 );
|
||||
|
||||
|
||||
m_panelAuth->SetSizer( m_szAuth );
|
||||
m_panelAuth->Layout();
|
||||
m_szAuth->Fit( m_panelAuth );
|
||||
bSizerMain->Add( m_panelAuth, 1, wxALL|wxEXPAND|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 0 );
|
||||
bSizerMain->Add( m_panelAuth, 0, wxEXPAND|wxTOP, 5 );
|
||||
|
||||
|
||||
bSizerMain->Add( 0, 0, 1, wxEXPAND, 5 );
|
||||
|
||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||
@ -140,11 +131,12 @@ DIALOG_GIT_REPOSITORY_BASE::DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWind
|
||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||
m_sdbSizer->Realize();
|
||||
|
||||
bSizerMain->Add( m_sdbSizer, 0, wxALL|wxEXPAND, 5 );
|
||||
bSizerMain->Add( m_sdbSizer, 0, wxBOTTOM|wxEXPAND|wxTOP, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizerMain );
|
||||
this->Layout();
|
||||
bSizerMain->Fit( this );
|
||||
|
||||
this->Centre( wxBOTH );
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.1-254-gc2ef7767)
|
||||
// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@ -31,7 +31,6 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_GIT_REPOSITORY_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -40,6 +39,7 @@ class DIALOG_GIT_REPOSITORY_BASE : public DIALOG_SHIM
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxBoxSizer* bSizerMain;
|
||||
wxStaticText* m_staticText1;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStaticText* m_staticText3;
|
||||
@ -74,7 +74,7 @@ class DIALOG_GIT_REPOSITORY_BASE : public DIALOG_SHIM
|
||||
|
||||
public:
|
||||
|
||||
DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Git Repository"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 682,598 ), long style = wxCAPTION|wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
DIALOG_GIT_REPOSITORY_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Git Repository"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxCAPTION|wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||
|
||||
~DIALOG_GIT_REPOSITORY_BASE();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user