From 1ebaf1371a298435559059ab4c7553b75dc6b927 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 17 Nov 2014 14:55:26 +0100 Subject: [PATCH] Fix remark 1 in Bug #1393277 (the option "use absolute paths" acts reversed: ticked exports relative paths, unticked exports absolute paths) --- bitmap2component/bitmap2cmp_gui_base.cpp | 2 +- bitmap2component/bitmap2cmp_gui_base.fbp | 2 +- pcbnew/dialogs/dialog_export_vrml.cpp | 18 +++++++++--------- pcbnew/dialogs/dialog_export_vrml_base.cpp | 7 ++++--- pcbnew/dialogs/dialog_export_vrml_base.fbp | 8 ++++---- pcbnew/dialogs/dialog_export_vrml_base.h | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/bitmap2component/bitmap2cmp_gui_base.cpp b/bitmap2component/bitmap2cmp_gui_base.cpp index be48e480d3..975f6ed2f9 100644 --- a/bitmap2component/bitmap2cmp_gui_base.cpp +++ b/bitmap2component/bitmap2cmp_gui_base.cpp @@ -151,7 +151,7 @@ BM2CMP_FRAME_BASE::BM2CMP_FRAME_BASE( wxWindow* parent, wxWindowID id, const wxS int m_radio_PCBLayerNChoices = sizeof( m_radio_PCBLayerChoices ) / sizeof( wxString ); m_radio_PCBLayer = new wxRadioBox( m_panelRight, wxID_ANY, _("Board Layer for Outline:"), wxDefaultPosition, wxDefaultSize, m_radio_PCBLayerNChoices, m_radio_PCBLayerChoices, 1, wxRA_SPECIFY_COLS ); m_radio_PCBLayer->SetSelection( 0 ); - m_radio_PCBLayer->SetToolTip( _("Choose the board layer to place the outline.\nThe 2 invisible fields reference and value and always placed on the silk screen layer.") ); + m_radio_PCBLayer->SetToolTip( _("Choose the board layer to place the outline.\nThe 2 invisible fields reference and value are always placed on the silk screen layer.") ); brightSizer->Add( m_radio_PCBLayer, 0, wxALL|wxEXPAND, 5 ); diff --git a/bitmap2component/bitmap2cmp_gui_base.fbp b/bitmap2component/bitmap2cmp_gui_base.fbp index 4c0193b481..5dc72324bf 100644 --- a/bitmap2component/bitmap2cmp_gui_base.fbp +++ b/bitmap2component/bitmap2cmp_gui_base.fbp @@ -2412,7 +2412,7 @@ wxRA_SPECIFY_COLS 0 - Choose the board layer to place the outline. The 2 invisible fields reference and value and always placed on the silk screen layer. + Choose the board layer to place the outline. The 2 invisible fields reference and value are always placed on the silk screen layer. wxFILTER_NONE wxDefaultValidator diff --git a/pcbnew/dialogs/dialog_export_vrml.cpp b/pcbnew/dialogs/dialog_export_vrml.cpp index 75598b3ecc..47b4cb1d34 100644 --- a/pcbnew/dialogs/dialog_export_vrml.cpp +++ b/pcbnew/dialogs/dialog_export_vrml.cpp @@ -40,7 +40,7 @@ #define OPTKEY_OUTPUT_UNIT wxT( "VrmlExportUnit" ) #define OPTKEY_3DFILES_OPT wxT( "VrmlExportCopyFiles" ) -#define OPTKEY_USE_ABS_PATHS wxT( "VrmlUseRelativePaths" ) +#define OPTKEY_USE_RELATIVE_PATHS wxT( "VrmlUseRelativePaths" ) class DIALOG_EXPORT_3DFILE : public DIALOG_EXPORT_3DFILE_BASE @@ -61,10 +61,10 @@ public: m_filePicker->SetFocus(); m_config->Read( OPTKEY_OUTPUT_UNIT, &m_unitsOpt ); m_config->Read( OPTKEY_3DFILES_OPT, &m_copy3DFilesOpt ); - m_config->Read( OPTKEY_USE_ABS_PATHS, &m_useRelativePathsOpt ); + m_config->Read( OPTKEY_USE_RELATIVE_PATHS, &m_useRelativePathsOpt ); m_rbSelectUnits->SetSelection( m_unitsOpt ); m_cbCopyFiles->SetValue( m_copy3DFilesOpt ); - m_cbUseAbsolutePaths->SetValue( m_useRelativePathsOpt ); + m_cbUseRelativePaths->SetValue( m_useRelativePathsOpt ); wxButton* okButton = (wxButton*) FindWindowByLabel( wxT( "OK" ) ); if( okButton ) @@ -74,7 +74,7 @@ public: Centre(); Connect( ID_USE_ABS_PATH, wxEVT_UPDATE_UI, - wxUpdateUIEventHandler( DIALOG_EXPORT_3DFILE::OnUpdateUseAbsolutPath ) ); + wxUpdateUIEventHandler( DIALOG_EXPORT_3DFILE::OnUpdateUseRelativePath ) ); } ~DIALOG_EXPORT_3DFILE() @@ -83,7 +83,7 @@ public: m_copy3DFilesOpt = GetCopyFilesOption(); m_config->Write( OPTKEY_OUTPUT_UNIT, m_unitsOpt ); m_config->Write( OPTKEY_3DFILES_OPT, m_copy3DFilesOpt ); - m_config->Write( OPTKEY_USE_ABS_PATHS, m_useRelativePathsOpt ); + m_config->Write( OPTKEY_USE_RELATIVE_PATHS, m_useRelativePathsOpt ); }; void SetSubdir( const wxString & aDir ) @@ -111,12 +111,12 @@ public: return m_copy3DFilesOpt = m_cbCopyFiles->GetValue(); } - bool GetUseAbsolutePathsOption() + bool GetUseRelativePathsOption() { - return m_useRelativePathsOpt = m_cbUseAbsolutePaths->GetValue(); + return m_useRelativePathsOpt = m_cbUseRelativePaths->GetValue(); } - void OnUpdateUseAbsolutPath( wxUpdateUIEvent& event ) + void OnUpdateUseRelativePath( wxUpdateUIEvent& event ) { // Making path relative or absolute has no meaning when VRML files are not copied. event.Enable( m_cbCopyFiles->GetValue() ); @@ -157,7 +157,7 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event ) double scale = scaleList[dlg.GetUnits()]; // final scale export bool export3DFiles = dlg.GetCopyFilesOption(); - bool useRelativePaths = dlg.GetUseAbsolutePathsOption(); + bool useRelativePaths = dlg.GetUseRelativePathsOption(); wxString fullFilename = dlg.FilePicker()->GetPath(); wxFileName modelPath = fullFilename; wxBusyCursor dummy; diff --git a/pcbnew/dialogs/dialog_export_vrml_base.cpp b/pcbnew/dialogs/dialog_export_vrml_base.cpp index c9bf5afbbd..ba37d8fdcf 100644 --- a/pcbnew/dialogs/dialog_export_vrml_base.cpp +++ b/pcbnew/dialogs/dialog_export_vrml_base.cpp @@ -47,9 +47,10 @@ DIALOG_EXPORT_3DFILE_BASE::DIALOG_EXPORT_3DFILE_BASE( wxWindow* parent, wxWindow m_cbCopyFiles->SetValue(true); bSizer4->Add( m_cbCopyFiles, 0, wxALL, 5 ); - m_cbUseAbsolutePaths = new wxCheckBox( this, ID_USE_ABS_PATH, _("Use absolute paths to model files in board VRML file"), wxDefaultPosition, wxDefaultSize, 0 ); - m_cbUseAbsolutePaths->SetValue(true); - bSizer4->Add( m_cbUseAbsolutePaths, 0, wxALL, 5 ); + m_cbUseRelativePaths = new wxCheckBox( this, ID_USE_ABS_PATH, _("Use relative paths to model files in board VRML file"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbUseRelativePaths->SetToolTip( _("Use paths for model files in board VRML file relative to the vrml file") ); + + bSizer4->Add( m_cbUseRelativePaths, 0, wxALL, 5 ); bLowerSizer->Add( bSizer4, 3, wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_export_vrml_base.fbp b/pcbnew/dialogs/dialog_export_vrml_base.fbp index 39c1b430d4..8e056bc0a8 100644 --- a/pcbnew/dialogs/dialog_export_vrml_base.fbp +++ b/pcbnew/dialogs/dialog_export_vrml_base.fbp @@ -574,7 +574,7 @@ 1 0 - 1 + 0 1 1 @@ -589,7 +589,7 @@ 0 0 ID_USE_ABS_PATH - Use absolute paths to model files in board VRML file + Use relative paths to model files in board VRML file 0 @@ -597,7 +597,7 @@ 0 1 - m_cbUseAbsolutePaths + m_cbUseRelativePaths 1 @@ -610,7 +610,7 @@ 0 - + Use paths for model files in board VRML file relative to the vrml file wxFILTER_NONE wxDefaultValidator diff --git a/pcbnew/dialogs/dialog_export_vrml_base.h b/pcbnew/dialogs/dialog_export_vrml_base.h index e1af897a06..2116ff82cb 100644 --- a/pcbnew/dialogs/dialog_export_vrml_base.h +++ b/pcbnew/dialogs/dialog_export_vrml_base.h @@ -49,7 +49,7 @@ class DIALOG_EXPORT_3DFILE_BASE : public DIALOG_SHIM wxStaticText* m_staticText3; wxTextCtrl* m_SubdirNameCtrl; wxCheckBox* m_cbCopyFiles; - wxCheckBox* m_cbUseAbsolutePaths; + wxCheckBox* m_cbUseRelativePaths; wxRadioBox* m_rbSelectUnits; wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_sdbSizer1;