mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Only enable filter actions when Extended Table has filter lines
When the filter lines have not been generated for a Extended Table (currently the case for Execute SQL tables), the filter actions make no sense, so they are disabled. See issue #1469
This commit is contained in:
@@ -213,6 +213,11 @@ ExtendedTableWidget::ExtendedTableWidget(QWidget* parent) :
|
||||
copyWithHeadersAction->setEnabled(enabled);
|
||||
copyAsSQLAction->setEnabled(enabled);
|
||||
|
||||
// Hide filter actions when there isn't any filters
|
||||
bool hasFilters = m_tableHeader->hasFilters();
|
||||
filterAction->setVisible(hasFilters);
|
||||
filterMenu->menuAction()->setVisible(hasFilters);
|
||||
|
||||
// Try to find out whether the current view is editable and (de)activate menu options according to that
|
||||
bool editable = editTriggers() != QAbstractItemView::NoEditTriggers;
|
||||
nullAction->setEnabled(enabled && editable);
|
||||
|
||||
Reference in New Issue
Block a user