]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Add icons to Edit menu
[dolphin.git] / src / dolphinmainwindow.cpp
index 95b05785fbf2e5aa49b22c73cae64e498b28c6d2..280f337bc3669383a5506696200637e8ae034517 100644 (file)
@@ -33,6 +33,7 @@
 #include "panels/folders/folderspanel.h"
 #include "panels/places/placespanel.h"
 #include "panels/information/informationpanel.h"
+#include "panels/terminal/terminalpanel.h"
 #include "settings/dolphinsettingsdialog.h"
 #include "statusbar/dolphinstatusbar.h"
 #include "views/dolphinviewactionhandler.h"
 #include "views/viewproperties.h"
 #include "views/dolphinnewfilemenuobserver.h"
 
-#ifndef Q_OS_WIN
-#include "panels/terminal/terminalpanel.h"
-#endif
-
 #include "dolphin_generalsettings.h"
 
 #include <KActionCollection>
@@ -100,9 +97,7 @@ DolphinMainWindow::DolphinMainWindow() :
     m_controlButton(nullptr),
     m_updateToolBarTimer(nullptr),
     m_lastHandleUrlStatJob(nullptr),
-#ifndef Q_OS_WIN
     m_terminalPanel(nullptr),
-#endif
     m_placesPanel(nullptr),
     m_tearDownFromPlacesRequested(false)
 {
@@ -631,11 +626,9 @@ void DolphinMainWindow::togglePanelLockState()
 
 void DolphinMainWindow::slotTerminalPanelVisibilityChanged()
 {
-#ifndef Q_OS_WIN
     if (m_terminalPanel->isHiddenInVisibleWindow()) {
         m_activeViewContainer->view()->setFocus();
     }
-#endif
 }
 
 void DolphinMainWindow::goBack()
@@ -1025,7 +1018,6 @@ void DolphinMainWindow::setUrlAsCaption(const QUrl& url)
 
 void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mountPath)
 {
-#ifndef Q_OS_WIN
     if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
         m_tearDownFromPlacesRequested = true;
         m_terminalPanel->goHome();
@@ -1033,17 +1025,14 @@ void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString& mo
     } else {
         m_placesPanel->proceedWithTearDown();
     }
-#endif
 }
 
 void DolphinMainWindow::slotStorageTearDownExternallyRequested(const QString& mountPath)
 {
-#ifndef Q_OS_WIN
     if (m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) {
         m_tearDownFromPlacesRequested = false;
         m_terminalPanel->goHome();
     }
-#endif
 }
 
 void DolphinMainWindow::setupActions()
@@ -1096,11 +1085,13 @@ void DolphinMainWindow::setupActions()
 
     QAction* selectAll = actionCollection()->addAction(QStringLiteral("select_all"));
     selectAll->setText(i18nc("@action:inmenu Edit", "Select All"));
+    selectAll->setIcon(QIcon::fromTheme(QStringLiteral("edit-select-all")));
     actionCollection()->setDefaultShortcut(selectAll, Qt::CTRL | Qt::Key_A);
     connect(selectAll, &QAction::triggered, this, &DolphinMainWindow::selectAll);
 
     QAction* invertSelection = actionCollection()->addAction(QStringLiteral("invert_selection"));
     invertSelection->setText(i18nc("@action:inmenu Edit", "Invert Selection"));
+    invertSelection->setIcon(QIcon::fromTheme(QStringLiteral("edit-select-invert")));
     actionCollection()->setDefaultShortcut(invertSelection, Qt::CTRL | Qt::SHIFT | Qt::Key_A);
     connect(invertSelection, &QAction::triggered, this, &DolphinMainWindow::invertSelection);
 
@@ -1198,7 +1189,7 @@ void DolphinMainWindow::setupActions()
     KToggleAction* showMenuBar = KStandardAction::showMenubar(nullptr, nullptr, actionCollection());
     connect(showMenuBar, &KToggleAction::triggered,                   // Fixes #286822
             this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection);
-    KStandardAction::preferences(this, SLOT(editSettings()), actionCollection());
+    KStandardAction::preferences(this, &DolphinMainWindow::editSettings, actionCollection());
 
     // not in menu actions
     QList<QKeySequence> nextTabKeys = KStandardShortcut::tabNext();
@@ -1368,9 +1359,7 @@ void DolphinMainWindow::setupDockWidgets()
     panelsMenu->addAction(ac->action(QStringLiteral("show_places_panel")));
     panelsMenu->addAction(ac->action(QStringLiteral("show_information_panel")));
     panelsMenu->addAction(ac->action(QStringLiteral("show_folders_panel")));
-#ifndef Q_OS_WIN
     panelsMenu->addAction(ac->action(QStringLiteral("show_terminal_panel")));
-#endif
     panelsMenu->addSeparator();
     panelsMenu->addAction(lockLayoutAction);
 }