mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-25 16:46:17 +00:00
CHANGED: #1471 Partially implemented save-as(only the project file is saved for now )
This commit is contained in:
parent
28c82a1ef8
commit
a7deee3af3
1 changed files with 28 additions and 1 deletions
|
@ -184,7 +184,13 @@ namespace GUIEditor
|
||||||
|
|
||||||
CProjectFileSerializer serializer;
|
CProjectFileSerializer serializer;
|
||||||
serializer.setFile( currentProjectFile.toStdString() );
|
serializer.setFile( currentProjectFile.toStdString() );
|
||||||
serializer.serialize( projectFiles );
|
if( !serializer.serialize( projectFiles ) )
|
||||||
|
{
|
||||||
|
QMessageBox::critical( this,
|
||||||
|
tr( "Failed to save project" ),
|
||||||
|
tr( "There was an error while trying to save the project." ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Can't save old projects any further, since the widgets are in multiple files in them
|
// Can't save old projects any further, since the widgets are in multiple files in them
|
||||||
// using templates, styles and whatnot. There's no way to restore the original XML structure
|
// using templates, styles and whatnot. There's no way to restore the original XML structure
|
||||||
|
@ -198,6 +204,27 @@ namespace GUIEditor
|
||||||
if( currentProject.isEmpty() )
|
if( currentProject.isEmpty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
QString dir =
|
||||||
|
QFileDialog::getExistingDirectory( this, tr( "Save project as..." ) );
|
||||||
|
|
||||||
|
if( dir.isEmpty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
projectFiles.guiFiles.clear();
|
||||||
|
projectFiles.guiFiles.push_back( "ui_" + projectFiles.projectName + ".xml" );
|
||||||
|
projectFiles.version = NEW;
|
||||||
|
|
||||||
|
QString newFile = dir + "/" + projectFiles.projectName.c_str() + ".xml";
|
||||||
|
CProjectFileSerializer serializer;
|
||||||
|
serializer.setFile( newFile.toStdString() );
|
||||||
|
if( !serializer.serialize( projectFiles ) )
|
||||||
|
{
|
||||||
|
QMessageBox::critical( this,
|
||||||
|
tr( "Failed to save project" ),
|
||||||
|
tr( "There was an error while trying to save the project." ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUIEditorWindow::close()
|
void GUIEditorWindow::close()
|
||||||
|
|
Loading…
Reference in a new issue