diff options
Diffstat (limited to 'ui/qt/interface_sort_filter_model.cpp')
-rw-r--r-- | ui/qt/interface_sort_filter_model.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/qt/interface_sort_filter_model.cpp b/ui/qt/interface_sort_filter_model.cpp index b96674eea7..f0265e1a7a 100644 --- a/ui/qt/interface_sort_filter_model.cpp +++ b/ui/qt/interface_sort_filter_model.cpp @@ -146,6 +146,7 @@ void InterfaceSortFilterModel::setInterfaceTypeVisible(int ifType, bool visible) prefs_main_write(); + invalidateFilter(); invalidate(); } @@ -238,6 +239,20 @@ QModelIndex InterfaceSortFilterModel::mapFromSource(const QModelIndex &sourceInd return index(newIndex.row(), _columns.indexOf((InterfaceTreeColumns) sourceIndex.column())); } +QString InterfaceSortFilterModel::interfaceError() +{ + QString result; + + InterfaceTreeModel * sourceModel = dynamic_cast<InterfaceTreeModel *>(this->sourceModel()); + if ( sourceModel != NULL ) + result = sourceModel->interfaceError(); + + if ( result.size() == 0 && rowCount() == 0 ) + result = QString(tr("No interfaces to be displayed. %1 interfaces filtered.")).arg(interfacesHidden()); + + return result; +} + /* * Editor modelines * |