Fix the naming of the kicad filedlg customize headers

This commit is contained in:
Marek Roszko 2022-06-11 23:03:29 -04:00
parent 08dbc3a53c
commit 415af260a4
3 changed files with 17 additions and 17 deletions

View File

@ -42,9 +42,9 @@
#include "dialog_pcm.h"
#if wxCHECK_VERSION( 3, 1, 7 )
#include "widgets/filedlg_hook_new_project.h"
#include "widgets/filedlg_new_project.h"
#else
#include "widgets/legacy_dir_checkbox.h"
#include "widgets/legacyfiledlg_new_project.h"
#endif
KICAD_MANAGER_CONTROL::KICAD_MANAGER_CONTROL() :
@ -68,10 +68,10 @@ int KICAD_MANAGER_CONTROL::NewProject( const TOOL_EVENT& aEvent )
// Add a "Create a new directory" checkbox
#if wxCHECK_VERSION( 3, 1, 7 )
FILEDLG_HOOK_NEW_PROJECT newProjectHook;
FILEDLG_NEW_PROJECT newProjectHook;
dlg.SetCustomizeHook( newProjectHook );
#else
dlg.SetExtraControlCreator( &DIR_CHECKBOX::Create );
dlg.SetExtraControlCreator( &LEGACYFILEDLG_NEW_PROJECT::Create );
#endif
if( dlg.ShowModal() == wxID_CANCEL )
@ -95,7 +95,7 @@ int KICAD_MANAGER_CONTROL::NewProject( const TOOL_EVENT& aEvent )
#if wxCHECK_VERSION( 3, 1, 7 )
createNewDir = newProjectHook.GetCreateNewDir();
#else
createNewDir = static_cast<DIR_CHECKBOX*>( dlg.GetExtraControl() )->CreateNewDir();
createNewDir = static_cast<LEGACYFILEDLG_NEW_PROJECT*>( dlg.GetExtraControl() )->CreateNewDir();
#endif
if( createNewDir )
@ -178,10 +178,10 @@ int KICAD_MANAGER_CONTROL::NewFromTemplate( const TOOL_EVENT& aEvent )
// Add a "Create a new directory" checkbox
#if wxCHECK_VERSION( 3, 1, 7 )
FILEDLG_HOOK_NEW_PROJECT newProjectHook;
FILEDLG_NEW_PROJECT newProjectHook;
dlg.SetCustomizeHook( newProjectHook );
#else
dlg.SetExtraControlCreator( &DIR_CHECKBOX::Create );
dlg.SetExtraControlCreator( &LEGACYFILEDLG_NEW_PROJECT::Create );
#endif
@ -204,7 +204,7 @@ int KICAD_MANAGER_CONTROL::NewFromTemplate( const TOOL_EVENT& aEvent )
#if wxCHECK_VERSION( 3, 1, 7 )
createNewDir = newProjectHook.GetCreateNewDir();
#else
createNewDir = static_cast<DIR_CHECKBOX*>( dlg.GetExtraControl() )->CreateNewDir();
createNewDir = static_cast<LEGACYFILEDLG_NEW_PROJECT*>( dlg.GetExtraControl() )->CreateNewDir();
#endif
// Append a new directory with the same name of the project file.

View File

@ -17,15 +17,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FILEDLG_HOOK_NEW_PROJECT_H
#define FILEDLG_HOOK_NEW_PROJECT_H
#ifndef FILEDLG_NEW_PROJECT_H_
#define FILEDLG_NEW_PROJECT_H_
#include <wx/filedlgcustomize.h>
class FILEDLG_HOOK_NEW_PROJECT : public wxFileDialogCustomizeHook
class FILEDLG_NEW_PROJECT : public wxFileDialogCustomizeHook
{
public:
FILEDLG_HOOK_NEW_PROJECT(){};
FILEDLG_NEW_PROJECT(){};
virtual void AddCustomControls( wxFileDialogCustomize& customizer ) override
{
@ -46,7 +46,7 @@ private:
wxFileDialogCheckBox* m_cb;
wxDECLARE_NO_COPY_CLASS( FILEDLG_HOOK_NEW_PROJECT );
wxDECLARE_NO_COPY_CLASS( FILEDLG_NEW_PROJECT );
};
#endif

View File

@ -17,18 +17,18 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LEGACY_DIR_CHECKBOX_H
#define LEGACY_DIR_CHECKBOX_H
#ifndef LEGACY_DIR_CHECKBOX_H_
#define LEGACY_DIR_CHECKBOX_H_
#include <wx/checkbox.h>
#include <wx/panel.h>
#include <wx/sizer.h>
///> Helper widget to select whether a new directory should be created for a project.
class DIR_CHECKBOX : public wxPanel
class LEGACYFILEDLG_NEW_PROJECT : public wxPanel
{
public:
DIR_CHECKBOX( wxWindow* aParent ) : wxPanel( aParent )
LEGACYFILEDLG_NEW_PROJECT( wxWindow* aParent ) : wxPanel( aParent )
{
m_cbCreateDir =
new wxCheckBox( this, wxID_ANY, _( "Create a new folder for the project" ) );