2 This file is part of Faster Application Manager.
4 Faster Application Manager is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 Faster Application Manager is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with Faster Application Manager. If not, see <http://www.gnu.org/licenses/>.
17 (C) Heikki Holstila 2010
20 #include "filterselect.h"
21 #include "ui_filterselect.h"
23 FilterSelect::FilterSelect(QString title, QWidget *parent) :
25 ui(new Ui::FilterSelect)
28 connect(ui->listWidget,SIGNAL(itemActivated(QListWidgetItem*)),this,SLOT(accept()));
29 this->setWindowTitle(title);
32 FilterSelect::~FilterSelect()
37 void FilterSelect::changeEvent(QEvent *e)
39 QDialog::changeEvent(e);
41 case QEvent::LanguageChange:
42 ui->retranslateUi(this);
49 void FilterSelect::setList(QStringList labels, int selected)
51 ui->listWidget->addItems(labels);
52 ui->listWidget->item(selected)->setSelected(true);
55 int FilterSelect::selection()
57 for( int i=0; i<ui->listWidget->count(); i++)
59 if( ui->listWidget->item(i)->isSelected() )