Fixed issues from @MKleusber's review

New view name validated with isNull().

Text in information box reworded.

Column names are preserved in the new view, except for the ones with
display formats, for which an underline is appended in order to fix the
reported filtering defect.
This commit is contained in:
mgrojo
2017-12-01 19:28:57 +01:00
parent c1f2306106
commit 5da3d14ee3
2 changed files with 11 additions and 9 deletions

View File

@@ -2727,7 +2727,7 @@ void MainWindow::saveAsView(QString query)
while(true)
{
name = QInputDialog::getText(this, qApp->applicationName(), tr("Please specify the view name")).trimmed();
if(name.isEmpty())
if(name.isNull())
return;
if(db.getObjectByName(sqlb::ObjectIdentifier("main", name)) != nullptr)
QMessageBox::warning(this, qApp->applicationName(), tr("There is already an object with that name. Please choose a different name."));
@@ -2749,6 +2749,5 @@ void MainWindow::saveFilterAsView()
// Save as view a custom query without rowid
saveAsView(m_browseTableModel->customQuery(false));
else
QMessageBox::information(this, qApp->applicationName(), tr("There is not any filter set for this table. View will not be created."));
QMessageBox::information(this, qApp->applicationName(), tr("There is no filter set for this table. View will not be created."));
}