summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAl12rs <gabriel.cortesi@outlook.com>2018-02-15 01:56:40 +0100
committerAl12rs <gabriel.cortesi@outlook.com>2018-02-15 01:56:40 +0100
commitf7374a8525fa163fe04c0849c933318a8d7008f7 (patch)
treeb0ba6b4f6a7d337eab9d6c6dad17e94b6ccb2bdc /src/mainwindow.cpp
parentdd8f73178cab02a03320b27a36c77ff5cb77e7ad (diff)
- 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.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp18
1 files changed, 10 insertions, 8 deletions
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("<All>")));
} else if (indices.count() > 1) {
@@ -5028,3 +5024,9 @@ void MainWindow::on_clickBlankButton_clicked()
{
deselectFilters();
}
+
+void MainWindow::on_clearFiltersButton_clicked()
+{
+ deselectFilters();
+}
+