summaryrefslogtreecommitdiffstats
path: root/qt-ui/preferences.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-12-06 17:14:50 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-06 11:56:00 -0800
commit7436178fe0817a4c5defac28f1a395d84cf539b5 (patch)
tree88baa9df79e504a0e36c426f4ba197bb663d5cee /qt-ui/preferences.cpp
parent32264cf393d6e9e617f97b2b242845111291a576 (diff)
downloadsubsurface-7436178fe0817a4c5defac28f1a395d84cf539b5.tar.gz
Added a filter option to the Language Chooser
This patch adds a filter option to the Language Chooser. if you choose filter, only the filtered options will appear. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/preferences.cpp')
-rw-r--r--qt-ui/preferences.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 9d8aa061c..45777d320 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -4,6 +4,7 @@
#include <QDebug>
#include <QFileDialog>
#include <QMessageBox>
+#include <QSortFilterProxyModel>
PreferencesDialog* PreferencesDialog::instance()
{
@@ -105,7 +106,11 @@ void PreferencesDialog::setUiFromPrefs()
ui.vertical_speed_minutes->setChecked(prefs.units.vertical_speed_time == units::MINUTES);
ui.vertical_speed_seconds->setChecked(prefs.units.vertical_speed_time == units::SECONDS);
- ui.languageView->setModel( LanguageModel::instance() );
+ QSortFilterProxyModel *filterModel = new QSortFilterProxyModel();
+ filterModel->setSourceModel(LanguageModel::instance());
+ filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
+ ui.languageView->setModel(filterModel);
+ connect(ui.languageFilter, SIGNAL(textChanged(QString)), filterModel, SLOT(setFilterFixedString(QString)));
QSettings s;
s.beginGroup("Language");