Skip to content

Commit

Permalink
Search, if session open fails to find mlv
Browse files Browse the repository at this point in the history
  • Loading branch information
masc4ii committed Mar 21, 2024
1 parent c86b416 commit f400aa0
Showing 1 changed file with 40 additions and 13 deletions.
53 changes: 40 additions & 13 deletions platform/qt/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3328,6 +3328,46 @@ void MainWindow::openSession(QString fileNameSession)
fileName = QDir( QFileInfo( fileNameSession ).path() ).filePath( relativeName );
}
}

while( !QFile( fileName ).exists() && !skipAll )
{
if( !skipAll )
{
int ret = QMessageBox::critical( this,
tr( "Open Session Error" ),
tr( "File not found: \r\n%1" ).arg( fileName ),
tr( "Skip" ),
tr( "Skip all"),
tr( "Search" )/*,
tr( "Abort" ) */);
if( ret == 1 )
{
skipAll = true;
break;
}
else if( ret == 2 )
{
QString fn = QFileDialog::getOpenFileName( this,
tr("Search MLV path"),
fileName,
QFileInfo( fileName ).fileName() );
if( QFile( fn ).exists() )
{
fileName = fn;
}
}
/*else if( ret == 3 )
{
abort = true;
break;
}*/
else
{
break;
}
}
}

//Mark
uint8_t mark = 0;
if( Rxml.attributes().hasAttribute( "mark" ) )
Expand Down Expand Up @@ -3355,19 +3395,6 @@ void MainWindow::openSession(QString fileNameSession)
}
else
{
if( !skipAll )
{
int ret = QMessageBox::critical( this, tr( "Open Session Error" ), tr( "File not found: \r\n%1" ).arg( fileName ), tr( "Skip" ), tr( "Skip all"), tr( "Abort" ) );
if( ret == 1 )
{
skipAll = true;
}
else if( ret == 2 )
{
abort = true;
}
}

//If file does not exist we just parse uninteresting data in the right way
while( !Rxml.atEnd() && !Rxml.isEndElement() )
{
Expand Down

0 comments on commit f400aa0

Please sign in to comment.