Disable entire toolbars and frames in Table Browser

The Show/Hide Style Toolbar button and the find bar buttons were not
being disabled when the database was closed. The Find Next button even made
the application crashed in that state.

This change ensures we don't forget to disable new buttons in the toolbars
and frames of the Table Browser.

The layout where the navigation buttons are inserted does not, apparently,
disable the children widget, so cannot be used in the same way.

See related issues #1976 and #1608.
This commit is contained in:
mgrojo
2019-11-03 20:22:27 +01:00
parent 74befa368b
commit b3b1ac6946

View File

@@ -361,19 +361,17 @@ QModelIndex TableBrowser::currentIndex() const
void TableBrowser::setEnabled(bool enable)
{
ui->browseToolbar->setEnabled(enable);
ui->editGlobalFilter->setEnabled(enable);
ui->formatFrame->setEnabled(enable);
ui->frameFind->setEnabled(enable);
ui->buttonNext->setEnabled(enable);
ui->buttonPrevious->setEnabled(enable);
ui->buttonBegin->setEnabled(enable);
ui->buttonEnd->setEnabled(enable);
ui->buttonGoto->setEnabled(enable);
ui->editGoto->setEnabled(enable);
ui->actionSaveFilterAsPopup->setEnabled(enable);
ui->actionClearFilters->setEnabled(enable);
ui->actionClearSorting->setEnabled(enable);
ui->actionRefresh->setEnabled(enable);
ui->actionPrintTable->setEnabled(enable);
ui->editGlobalFilter->setEnabled(enable);
ui->actionFind->setEnabled(enable);
updateInsertDeleteRecordButton();
}