Skip to content

Commit

Permalink
Fix error message not being properly localized.
Browse files Browse the repository at this point in the history
WHen spec file is to large to save in DB, the WString was being turned into UTF-8 string outside event loop, so wasnt being localized.
  • Loading branch information
wcjohns committed Sep 3, 2024
1 parent 7024e72 commit f9c842f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/SpecMeasManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5820,7 +5820,7 @@ void SpecMeasManager::showPreviousSpecFileUsesDialog( std::shared_ptr<SpectraFil
}//void showPreviousSpecFileUsesDialog(..)


void postErrorMessage( const string msg, const WarningWidget::WarningMsgLevel level )
void postErrorMessage( const WString msg, const WarningWidget::WarningMsgLevel level )
{
passMessage( msg, level );
wApp->triggerUpdate();
Expand Down Expand Up @@ -5919,10 +5919,9 @@ void SpecMeasManager::checkIfPreviouslyOpened( const std::string sessionID,
}catch( FileToLargeForDbException &e )
{
WString msg = WString::tr("smm-cant-save").arg(e.what());
cerr << msg.toUTF8() << endl;

WServer::instance()->post( sessionID,
boost::bind( &postErrorMessage, msg.toUTF8(), WarningWidget::WarningMsgHigh ) );
boost::bind( &postErrorMessage, msg, WarningWidget::WarningMsgHigh ) );
}
return;
}//if( this is a new-to-us file )
Expand Down Expand Up @@ -5954,7 +5953,7 @@ void SpecMeasManager::checkIfPreviouslyOpened( const std::string sessionID,
cerr << "Error checking if this file had been opened previously: " << e.what() << endl;
WServer::instance()->post( sessionID,
boost::bind( &postErrorMessage,
string("Error checking if this file had been opened previously"),
WString("Error checking if this file had been opened previously"),
WarningWidget::WarningMsgHigh ) );
}//try / catch
}//void checkIfPreviouslyOpened(...)
Expand Down

0 comments on commit f9c842f

Please sign in to comment.