Fix uninitialized var.

(Also follow Mac GUI guidelines, odd as they are.)
This commit is contained in:
Jeff Young 2023-07-16 19:29:38 +01:00
parent eaa3543d67
commit b7d53e4b18
2 changed files with 12 additions and 7 deletions

View File

@ -50,6 +50,7 @@ PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aSho
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ),
m_auxiliaryButton( nullptr ), m_auxiliaryButton( nullptr ),
m_resetButton( nullptr ), m_resetButton( nullptr ),
m_openPrefsDirButton( nullptr ),
m_cancelButton( nullptr ), m_cancelButton( nullptr ),
m_title( aTitle ) m_title( aTitle )
{ {
@ -86,8 +87,12 @@ PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aSho
if( aShowOpenFolder ) if( aShowOpenFolder )
{ {
m_openPreferencesButton = new wxButton( this, wxID_ANY, _( "Open preferences folder" ) ); #ifdef __WXMAC__
m_buttonsSizer->Add( m_openPreferencesButton, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 ); m_openPrefsDirButton = new wxButton( this, wxID_ANY, _( "Reveal Preferences in Finder" ) );
#else
m_openPrefsDirButton = new wxButton( this, wxID_ANY, _( "Open Preferences Directory" ) );
#endif
m_buttonsSizer->Add( m_openPrefsDirButton, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT | wxLEFT, 5 );
} }
@ -127,9 +132,9 @@ PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aSho
m_resetButton->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onResetButton, this ); m_resetButton->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onResetButton, this );
} }
if( m_openPreferencesButton ) if( m_openPrefsDirButton )
{ {
m_openPreferencesButton->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onOpenPreferencesButton, this ); m_openPrefsDirButton->Bind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onOpenPreferencesButton, this );
} }
m_treebook->Bind( wxEVT_CHAR_HOOK, &PAGED_DIALOG::onCharHook, this ); m_treebook->Bind( wxEVT_CHAR_HOOK, &PAGED_DIALOG::onCharHook, this );
@ -199,9 +204,9 @@ PAGED_DIALOG::~PAGED_DIALOG()
m_resetButton->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onResetButton, this ); m_resetButton->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onResetButton, this );
} }
if( m_openPreferencesButton ) if( m_openPrefsDirButton )
{ {
m_openPreferencesButton->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onOpenPreferencesButton, this ); m_openPrefsDirButton->Unbind( wxEVT_COMMAND_BUTTON_CLICKED, &PAGED_DIALOG::onOpenPreferencesButton, this );
} }
m_treebook->Unbind( wxEVT_CHAR_HOOK, &PAGED_DIALOG::onCharHook, this ); m_treebook->Unbind( wxEVT_CHAR_HOOK, &PAGED_DIALOG::onCharHook, this );

View File

@ -68,7 +68,7 @@ protected:
WX_TREEBOOK* m_treebook; WX_TREEBOOK* m_treebook;
wxButton* m_auxiliaryButton; wxButton* m_auxiliaryButton;
wxButton* m_resetButton; wxButton* m_resetButton;
wxButton* m_openPreferencesButton; wxButton* m_openPrefsDirButton;
wxButton* m_cancelButton; wxButton* m_cancelButton;
WX_INFOBAR* m_infoBar; WX_INFOBAR* m_infoBar;