Adds "Show Hidden Content" checkbox (#7309)

* Adds "Show Hidden Content Dialogue"

* Update FileBrowser.cpp

* Automatically rearrange layout to fit check boxes

* check if files are hidden in a cross platform manner

* put the hidden files checkbox below the user and factory check boxes at all times

* removed layout rearrangement code

* moved checkbox code to FileBrowser

* Removed unused include

* Cleanup in FileBrowser

Move the method `addContentCheckBox` to the other private methods.
Remove the method parameters because it can use the members.

Remove the conditional when adding the "Hidden content" checkbox because
it was always true.

---------

Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
This commit is contained in:
Andrew Wiltshire
2024-06-30 21:23:19 +01:00
committed by GitHub
parent edf6bf8dfe
commit fb5268ebae
2 changed files with 61 additions and 32 deletions

View File

@@ -90,7 +90,7 @@ public:
};
return s_excludedPaths;
}
static QDir::Filters dirFilters() { return QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot; }
static QDir::Filters dirFilters() { return QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot | QDir::Hidden; }
static QDir::SortFlags sortFlags() { return QDir::LocaleAware | QDir::DirsFirst | QDir::Name | QDir::IgnoreCase; }
private slots:
@@ -111,6 +111,8 @@ private:
void onSearch(const QString& filter);
void displaySearch(bool on);
void addContentCheckBox();
FileBrowserTreeWidget * m_fileBrowserTreeWidget;
FileBrowserTreeWidget * m_searchTreeWidget;
@@ -124,9 +126,13 @@ private:
bool m_dirsAsItems;
void addContentCheckBox();
QCheckBox* m_showUserContent = nullptr;
QCheckBox* m_showFactoryContent = nullptr;
QCheckBox* m_showHiddenContent = nullptr;
QBoxLayout *filterWidgetLayout = nullptr;
QBoxLayout *hiddenWidgetLayout = nullptr;
QBoxLayout *outerLayout = nullptr;
QString m_userDir;
QString m_factoryDir;
QList<QString> m_savedExpandedDirs;