diff options
| author | Al12rs <gabriel.cortesi@outlook.com> | 2018-02-15 01:56:40 +0100 |
|---|---|---|
| committer | Al12rs <gabriel.cortesi@outlook.com> | 2018-02-15 01:56:40 +0100 |
| commit | f7374a8525fa163fe04c0849c933318a8d7008f7 (patch) | |
| tree | b0ba6b4f6a7d337eab9d6c6dad17e94b6ccb2bdc /src | |
| parent | dd8f73178cab02a03320b27a36c77ff5cb77e7ad (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')
| -rw-r--r-- | src/mainwindow.cpp | 18 | ||||
| -rw-r--r-- | src/mainwindow.h | 1 | ||||
| -rw-r--r-- | src/mainwindow.ui | 49 |
3 files changed, 56 insertions, 12 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();
+}
+
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 @@ </item>
<item>
<widget class="QPushButton" name="clickBlankButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
<horstretch>0</horstretch>
@@ -485,6 +488,44 @@ p, li { white-space: pre-wrap; } </property>
</widget>
</item>
+ <item alignment="Qt::AlignLeft">
+ <widget class="QPushButton" name="clearFiltersButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>25</height>
+ </size>
+ </property>
+ <property name="visible">
+ <bool>false</bool>
+ </property>
+ <property name="layoutDirection">
+ <enum>Qt::RightToLeft</enum>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">border:2px solid #ff0000;</string>
+ </property>
+ <property name="text">
+ <string>Clear all Filters</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/MO/gui/edit_clear</normaloff>:/MO/gui/edit_clear</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>12</width>
+ <height>12</height>
+ </size>
+ </property>
+ </widget>
+ </item>
<item>
<widget class="QComboBox" name="groupCombo">
<property name="focusPolicy">
@@ -729,12 +770,12 @@ p, li { white-space: pre-wrap; } <layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QPushButton" name="bossButton">
+ <property name="visible">
+ <bool>true</bool>
+ </property>
<property name="text">
<string>Sort</string>
- </property>
- <property name="visible">
- <bool>true</bool>
- </property>
+ </property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/MO/gui/sort</normaloff>:/MO/gui/sort</iconset>
|
