Show message box when editing a table column fails

When editing a column of an existing table, this process might fail for
all sorts of reasons. Instead of printing an error message to stdout
this commit changes it to show a message box, so the user knows the
editing failed.
This commit is contained in:
Martin Kleusberg
2017-01-04 19:21:32 +01:00
parent a40fe0b0ed
commit 63ba2c5059
2 changed files with 4 additions and 8 deletions

View File

@@ -449,7 +449,10 @@ void EditTableDialog::itemChanged(QTreeWidgetItem *item, int column)
}
if(callRenameColumn)
pdb.renameColumn(m_table, oldFieldName, field);
{
if(!pdb.renameColumn(m_table, oldFieldName, field))
QMessageBox::warning(this, qApp->applicationName(), tr("Modifying this column failed. Error returned from database:\n%1").arg(pdb.lastErrorMessage));
}
}
checkInput();