From f7374a8525fa163fe04c0849c933318a8d7008f7 Mon Sep 17 00:00:00 2001 From: Al12rs Date: Thu, 15 Feb 2018 01:56:40 +0100 Subject: - Added "Clear all Filters" button with red outline that only shows up if one or more filters are selected. - Fixed a bug that would not allow the already present "Clear" button under the filters tab to clear "contains" type of filters. - Fixed a bug that enabled the "Clear" button at the start even if there were no filters selected. --- src/mainwindow.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index abad054b..abac9317 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3063,8 +3063,6 @@ void MainWindow::exportModListCSV() //selection.addChoice(tr("Visible"), tr("All mods visible in the mod list are included"), 2); QDialog selection(this); - //QLabel descriptionLabel("Choose what to export"); - //selection->(descriptionLabel); QGridLayout *grid = new QGridLayout; selection.setWindowTitle(tr("Export to csv")); @@ -3132,8 +3130,6 @@ void MainWindow::exportModListCSV() selection.setLayout(grid); - //connect(ok, SIGNAL(released()), this, SLOT(accept())); - //connect(cancel, SIGNAL(released()), this, SLOT(reject())); if (selection.exec() == QDialog::Accepted) { @@ -3165,9 +3161,6 @@ void MainWindow::exportModListCSV() if (download_File_Name->isChecked()) fields.push_back(std::make_pair(QString("#Download_File_Name"), CSVBuilder::TYPE_STRING)); - - - // fields.push_back(std::make_pair(QString("file_category"), CSVBuilder::TYPE_INTEGER)); builder.setFields(fields); builder.writeHeader(); @@ -3403,7 +3396,10 @@ void MainWindow::on_categoriesList_itemSelectionChanged() m_ModListSortProxy->setCategoryFilter(categories); m_ModListSortProxy->setContentFilter(content); - ui->clickBlankButton->setEnabled(categories.size() > 0); + ui->clickBlankButton->setEnabled(categories.size() > 0 || content.size() >0); + //ui->clearFiltersButton->setStyleSheet("border:5px solid #ff0000;"); + ui->clearFiltersButton->setVisible(categories.size() > 0 || content.size() > 0); + if (indices.count() == 0) { ui->currentCategoryLabel->setText(QString("(%1)").arg(tr(""))); } else if (indices.count() > 1) { @@ -5028,3 +5024,9 @@ void MainWindow::on_clickBlankButton_clicked() { deselectFilters(); } + +void MainWindow::on_clearFiltersButton_clicked() +{ + deselectFilters(); +} + -- cgit v1.3.1