- auto wIt = this->m_Workspaces.find( wname );
- if( wIt != this->m_Workspaces.end( ) )
- {
- if( this->m_LastSaveFileName == "" || force )
- {
- QFileDialog dlg( this );
- dlg.setFileMode( QFileDialog::AnyFile );
- dlg.setDirectory( "." );
- dlg.setAcceptMode( QFileDialog::AcceptSave );
- dlg.setNameFilter(
- QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
- );
- dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
- dlg.setWindowTitle(
- (
- std::string( "Saving \"" ) + wIt->first + std::string( "\"..." )
- ).c_str( )
- );
- if( dlg.exec( ) )
- this->_saveWorkspace(
- wIt->first, dlg.selectedFiles( ).begin( )->toStdString( )
- );
- }
- else
- this->_saveWorkspace( wIt->first, this->m_LastSaveFileName );
- }
- else
- QMessageBox::critical(
- this,
- "Error saving workspace",
- (
- std::string( "Workspace \"" ) + wname +
- std::string( "\" does not exist." )
- ).c_str( )
- );