Fix remark 1 in Bug #1393277 (the option "use absolute paths" acts reversed: ticked exports relative paths, unticked exports absolute paths)

This commit is contained in:
jean-pierre charras 2014-11-17 14:55:26 +01:00
parent 1dc5178095
commit 1ebaf1371a
6 changed files with 20 additions and 19 deletions

View File

@ -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 );

View File

@ -2412,7 +2412,7 @@
<property name="style">wxRA_SPECIFY_COLS</property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Choose the board layer to place the outline.&#x0A;The 2 invisible fields reference and value and always placed on the silk screen layer.</property>
<property name="tooltip">Choose the board layer to place the outline.&#x0A;The 2 invisible fields reference and value are always placed on the silk screen layer.</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>

View File

@ -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;

View File

@ -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 );

View File

@ -574,7 +574,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">1</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -589,7 +589,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_USE_ABS_PATH</property>
<property name="label">Use absolute paths to model files in board VRML file</property>
<property name="label">Use relative paths to model files in board VRML file</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
@ -597,7 +597,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_cbUseAbsolutePaths</property>
<property name="name">m_cbUseRelativePaths</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
@ -610,7 +610,7 @@
<property name="style"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="tooltip">Use paths for model files in board VRML file relative to the vrml file</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>

View File

@ -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;