Skip to content

Commit 328dfc5

Browse files
author
allywarner
committed
Error message for overwrite
Temporary
1 parent 8a3947e commit 328dfc5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Interface/Application/SegmentationExportWizard.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,24 @@ bool SegmentationSelectionPage::validatePage()
397397

398398
//Error checks for segmentation export
399399
QString filename = this->private_->filename_path_lineEdit_->text();
400+
boost::filesystem::path full_path =
401+
boost::filesystem::path( filename.toStdString() ) /
402+
boost::filesystem::path( this->private_->filename_name_lineEdit_->text().toStdString() );
403+
404+
if( boost::filesystem::exists( full_path ) )
405+
{
406+
int ret = QMessageBox::warning( this,
407+
"A project with this name already exists!",
408+
"A project with this name already exists!\n"
409+
"Please rename the file or delete the existing file.\n",
410+
QMessageBox::Ok);
411+
412+
if( ret == QMessageBox::Ok )
413+
{
414+
return false;
415+
}
416+
}
417+
400418

401419
if( !QFileInfo( filename ).exists() )
402420
{

0 commit comments

Comments
 (0)