┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
authorChris Rizzitello <[email protected]>2018-11-17 08:39:38 -0500
committerChris Rizzitello <[email protected]>2018-11-17 08:39:38 -0500
commit76c4698870658155aedfbba80904f4b199fdb460 (patch)
tree4c62f51190d62dfce7508ff8ff858bb34c576ee5 /src/dolphinmainwindow.cpp
parent06747d5e5b1cb5c403c1e93c65b2890e1bbcfbd5 (diff)
parentc900f7d255aa8fb326cf20f598a5de1a1edbcfe9 (diff)
Merge remote-tracking branch 'origin/Applications/18.12'
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index b14f5289c..3ff2ad1e9 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -1335,6 +1335,20 @@ void DolphinMainWindow::setupDockWidgets()
this, &DolphinMainWindow::slotStorageTearDownExternallyRequested);
m_tabWidget->slotPlacesPanelVisibilityChanged(m_placesPanel->isVisible());
+ auto actionShowAllPlaces = new QAction(QIcon::fromTheme(QStringLiteral("hint")), i18nc("@item:inmenu", "Show Hidden Places"), this);
+ actionShowAllPlaces->setCheckable(true);
+ actionShowAllPlaces->setDisabled(true);
+
+ connect(actionShowAllPlaces, &QAction::triggered, this, [actionShowAllPlaces, this](bool checked){
+ actionShowAllPlaces->setIcon(QIcon::fromTheme(checked ? QStringLiteral("visibility") : QStringLiteral("hint")));
+ m_placesPanel->showHiddenEntries(checked);
+ });
+
+ connect(m_placesPanel, &PlacesPanel::showHiddenEntriesChanged, this, [actionShowAllPlaces] (bool checked){
+ actionShowAllPlaces->setChecked(checked);
+ actionShowAllPlaces->setIcon(QIcon::fromTheme(checked ? QStringLiteral("visibility") : QStringLiteral("hint")));
+ });
+
// Add actions into the "Panels" menu
KActionMenu* panelsMenu = new KActionMenu(i18nc("@action:inmenu View", "Panels"), this);
actionCollection()->addAction(QStringLiteral("panels"), panelsMenu);
@@ -1347,7 +1361,12 @@ void DolphinMainWindow::setupDockWidgets()
panelsMenu->addAction(ac->action(QStringLiteral("show_folders_panel")));
panelsMenu->addAction(ac->action(QStringLiteral("show_terminal_panel")));
panelsMenu->addSeparator();
+ panelsMenu->addAction(actionShowAllPlaces);
panelsMenu->addAction(lockLayoutAction);
+
+ connect(panelsMenu->menu(), &QMenu::aboutToShow, this, [actionShowAllPlaces, this]{
+ actionShowAllPlaces->setEnabled(m_placesPanel->hiddenListCount());
+ });
}
void DolphinMainWindow::updateEditActions()