Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
Show All 33 Lines | |||||
34 | #include "panels/places/placespanel.h" | 34 | #include "panels/places/placespanel.h" | ||
35 | #include "panels/information/informationpanel.h" | 35 | #include "panels/information/informationpanel.h" | ||
36 | #include "panels/terminal/terminalpanel.h" | 36 | #include "panels/terminal/terminalpanel.h" | ||
37 | #include "settings/dolphinsettingsdialog.h" | 37 | #include "settings/dolphinsettingsdialog.h" | ||
38 | #include "statusbar/dolphinstatusbar.h" | 38 | #include "statusbar/dolphinstatusbar.h" | ||
39 | #include "views/dolphinviewactionhandler.h" | 39 | #include "views/dolphinviewactionhandler.h" | ||
40 | #include "views/dolphinremoteencoding.h" | 40 | #include "views/dolphinremoteencoding.h" | ||
41 | #include "views/draganddrophelper.h" | 41 | #include "views/draganddrophelper.h" | ||
42 | #include "views/viewproperties.h" | 42 | #include "views/viewproperties.h" | ||
elvisangelaccio: Please remove the unrelated changes to the includes | |||||
43 | #include "views/dolphinnewfilemenuobserver.h" | 43 | #include "views/dolphinnewfilemenuobserver.h" | ||
44 | #include "dolphin_generalsettings.h" | 44 | #include "dolphin_generalsettings.h" | ||
45 | 45 | | |||
46 | #include <KActionCollection> | 46 | #include <KActionCollection> | ||
47 | #include <KActionMenu> | 47 | #include <KActionMenu> | ||
48 | #include <KAuthorized> | 48 | #include <KAuthorized> | ||
49 | #include <KConfig> | 49 | #include <KConfig> | ||
50 | #include <KFileItemListProperties> | 50 | #include <KFileItemListProperties> | ||
▲ Show 20 Lines • Show All 1127 Lines • ▼ Show 20 Line(s) | |||||
1178 | 1178 | | |||
1179 | #ifndef Q_OS_WIN | 1179 | #ifndef Q_OS_WIN | ||
1180 | if (KAuthorized::authorize(QStringLiteral("shell_access"))) { | 1180 | if (KAuthorized::authorize(QStringLiteral("shell_access"))) { | ||
1181 | QAction* openTerminal = actionCollection()->addAction(QStringLiteral("open_terminal")); | 1181 | QAction* openTerminal = actionCollection()->addAction(QStringLiteral("open_terminal")); | ||
1182 | openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal")); | 1182 | openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal")); | ||
1183 | openTerminal->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | 1183 | openTerminal->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | ||
1184 | actionCollection()->setDefaultShortcut(openTerminal, Qt::SHIFT + Qt::Key_F4); | 1184 | actionCollection()->setDefaultShortcut(openTerminal, Qt::SHIFT + Qt::Key_F4); | ||
1185 | connect(openTerminal, &QAction::triggered, this, &DolphinMainWindow::openTerminal); | 1185 | connect(openTerminal, &QAction::triggered, this, &DolphinMainWindow::openTerminal); | ||
1186 | | ||||
1187 | QAction* focusTerminal = actionCollection()->addAction(QStringLiteral("focus_terminal")); | ||||
1188 | focusTerminal->setText(i18nc("@action:inmenu Tools", "Focus Terminal")); | ||||
This action is not the Tools menu. Either add it there or remove Tools from the translation context ;) elvisangelaccio: This action is not the Tools menu. Either add it there or remove Tools from the translation… | |||||
1189 | focusTerminal->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | ||||
1190 | connect(focusTerminal, &QAction::triggered, [this]() { | ||||
1191 | if (m_terminalPanel->isVisible()) { | ||||
1192 | if (m_terminalPanel->hasFocus()) { | ||||
1193 | m_activeViewContainer->view()->setFocus(Qt::FocusReason::ShortcutFocusReason); | ||||
1194 | } else { | ||||
1195 | m_terminalPanel->setFocus(Qt::FocusReason::ShortcutFocusReason); | ||||
1196 | } | ||||
1197 | } else { | ||||
Please add braces. Maybe this could also go in a private slot rathern than a lambda. elvisangelaccio: Please add braces. Maybe this could also go in a private slot rathern than a lambda. | |||||
1198 | actionCollection()->action(QStringLiteral("show_terminal_panel"))->trigger(); | ||||
1199 | } | ||||
1200 | }); | ||||
elvisangelaccio: Please use a dedicated function. | |||||
1186 | } | 1201 | } | ||
1187 | #endif | 1202 | #endif | ||
1188 | 1203 | | |||
1189 | // setup 'Settings' menu | 1204 | // setup 'Settings' menu | ||
1190 | KToggleAction* showMenuBar = KStandardAction::showMenubar(nullptr, nullptr, actionCollection()); | 1205 | KToggleAction* showMenuBar = KStandardAction::showMenubar(nullptr, nullptr, actionCollection()); | ||
1191 | connect(showMenuBar, &KToggleAction::triggered, // Fixes #286822 | 1206 | connect(showMenuBar, &KToggleAction::triggered, // Fixes #286822 | ||
1192 | this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection); | 1207 | this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection); | ||
1193 | KStandardAction::preferences(this, &DolphinMainWindow::editSettings, actionCollection()); | 1208 | KStandardAction::preferences(this, &DolphinMainWindow::editSettings, actionCollection()); | ||
▲ Show 20 Lines • Show All 387 Lines • ▼ Show 20 Line(s) | 1587 | { | |||
1581 | connect(dockAction, &QAction::toggled, panelAction, &QAction::setChecked); | 1596 | connect(dockAction, &QAction::toggled, panelAction, &QAction::setChecked); | ||
1582 | } | 1597 | } | ||
1583 | 1598 | | |||
1584 | DolphinMainWindow::UndoUiInterface::UndoUiInterface() : | 1599 | DolphinMainWindow::UndoUiInterface::UndoUiInterface() : | ||
1585 | KIO::FileUndoManager::UiInterface() | 1600 | KIO::FileUndoManager::UiInterface() | ||
1586 | { | 1601 | { | ||
1587 | } | 1602 | } | ||
1588 | 1603 | | |||
1589 | DolphinMainWindow::UndoUiInterface::~UndoUiInterface() | 1604 | DolphinMainWindow::UndoUiInterface::~UndoUiInterface() | ||
Please use the same context we use above ("@action:inmenu Tools") Same for the i18n calls below. elvisangelaccio: Please use the same context we use above ("@action:inmenu Tools")
Same for the i18n calls… | |||||
1590 | { | 1605 | { | ||
1591 | } | 1606 | } | ||
1592 | 1607 | | |||
1593 | void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job) | 1608 | void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job) | ||
1594 | { | 1609 | { | ||
1595 | DolphinMainWindow* mainWin= qobject_cast<DolphinMainWindow *>(parentWidget()); | 1610 | DolphinMainWindow* mainWin= qobject_cast<DolphinMainWindow *>(parentWidget()); | ||
1596 | if (mainWin) { | 1611 | if (mainWin) { | ||
1597 | DolphinViewContainer* container = mainWin->activeViewContainer(); | 1612 | DolphinViewContainer* container = mainWin->activeViewContainer(); | ||
1598 | container->showMessage(job->errorString(), DolphinViewContainer::Error); | 1613 | container->showMessage(job->errorString(), DolphinViewContainer::Error); | ||
1599 | } else { | 1614 | } else { | ||
1600 | KIO::FileUndoManager::UiInterface::jobError(job); | 1615 | KIO::FileUndoManager::UiInterface::jobError(job); | ||
1601 | } | 1616 | } | ||
1602 | } | 1617 | } | ||
1603 | 1618 | |
Please remove the unrelated changes to the includes