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 ++++++++++-------- src/mainwindow.h | 1 + src/mainwindow.ui | 49 +++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 56 insertions(+), 12 deletions(-) (limited to 'src') 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(); +} + diff --git a/src/mainwindow.h b/src/mainwindow.h index d7708da6..b7eca72e 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -549,6 +549,7 @@ private slots: // ui slots void on_actionUpdate_triggered(); void on_actionEndorseMO_triggered(); + void on_clearFiltersButton_clicked(); void on_btnRefreshData_clicked(); void on_categoriesList_customContextMenuRequested(const QPoint &pos); void on_conflictsCheckBox_toggled(bool checked); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index d9667ed7..49f313ca 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -96,6 +96,9 @@ + + false + 0 @@ -485,6 +488,44 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 0 + + + + + 0 + 25 + + + + false + + + Qt::RightToLeft + + + border:2px solid #ff0000; + + + Clear all Filters + + + + :/MO/gui/edit_clear:/MO/gui/edit_clear + + + + 12 + 12 + + + + @@ -729,12 +770,12 @@ p, li { white-space: pre-wrap; } + + true + Sort - - - true - + :/MO/gui/sort:/MO/gui/sort -- cgit v1.3.1