Remove unnecessary checks and message boxes

This removes a couple of checks whether the database is opened. They
are not really necessary because the respective buttons are disabled
anyway in case no database is loaded. This was inconsistent anyway since
not all functions were checking for this. It also gets rid of a string
which translators have to deal with even though it is never going to be
displayed.
This commit is contained in:
Martin Kleusberg
2019-08-25 21:01:01 +02:00
parent 6d9b8418ce
commit ad2aa8ca88

View File

@@ -752,11 +752,6 @@ void MainWindow::refresh()
void MainWindow::createTable()
{
if (!db.isOpen()){
QMessageBox::information( this, QApplication::applicationName(), tr("There is no database opened. Please open or create a new database file."));
return;
}
EditTableDialog dialog(db, sqlb::ObjectIdentifier(), true, this);
if(dialog.exec())
{
@@ -766,11 +761,6 @@ void MainWindow::createTable()
void MainWindow::createIndex()
{
if (!db.isOpen()){
QMessageBox::information( this, QApplication::applicationName(), tr("There is no database opened. Please open or create a new database file."));
return;
}
EditIndexDialog dialog(db, sqlb::ObjectIdentifier(), true, this);
if(dialog.exec())
populateTable();