mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
jobsets: fix Replace button to overwrite existing files (#19900)
This commit is contained in:
parent
2eb7ba2fb9
commit
5fb55ccb30
@ -228,6 +228,18 @@ int KICAD_MANAGER_CONTROL::NewJobsetFile( const TOOL_EVENT& aEvent )
|
||||
|
||||
wxFileName jobsetFn( dlg.GetPath() );
|
||||
|
||||
// Check if the file already exists
|
||||
bool fileExists = wxFileExists( jobsetFn.GetFullPath() );
|
||||
|
||||
if( fileExists )
|
||||
{
|
||||
// Remove the existing file so that a new one can be created
|
||||
if( !wxRemoveFile( jobsetFn.GetFullPath() ) )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
m_frame->OpenJobsFile( jobsetFn.GetFullPath(), true );
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user