Skip to content
Permalink
Browse files

Ask for template name if missing

  • Loading branch information
m-kuhn committed May 15, 2019
1 parent 8a24d14 commit 81771dddb9ecf0358aae45f8c68854c1f11cd401
Showing with 16 additions and 1 deletion.
  1. +16 −1 src/app/qgisapp.cpp
QgsApplication::qgisSettingsDirPath() + "project_templates" ).toString();

const QString originalFilename = QgsProject::instance()->fileName();
const QString templateName = QFileInfo( originalFilename ).baseName();
QString templateName = QFileInfo( originalFilename ).baseName();

if ( templateName.isEmpty() )
{
bool ok;
templateName = QInputDialog::getText( this, tr( "Template Name" ),
tr( "Name for the template" ), QLineEdit::Normal,
QString(), &ok );

if ( !ok )
return;
if ( templateName.isEmpty() )
{
messageBar()->pushInfo( tr( "Template not saved" ), tr( "The template can not have an empty name." ) );
}
}
const QString filePath = templateDirName + QDir::separator() + templateName + QStringLiteral( ".qgz" );
if ( QFileInfo( filePath ).exists() )
{

0 comments on commit 81771dd

Please sign in to comment.
You can’t perform that action at this time.