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" | | |||
elvisangelaccio: Please remove the unrelated changes to the includes | |||||
43 | #include "views/dolphinnewfilemenuobserver.h" | 42 | #include "views/dolphinnewfilemenuobserver.h" | ||
44 | 43 | | |||
45 | #include "dolphin_generalsettings.h" | 44 | #include "dolphin_generalsettings.h" | ||
46 | 45 | | |||
47 | #include <KActionCollection> | 46 | #include <KActionCollection> | ||
48 | #include <KActionMenu> | | |||
49 | #include <KAuthorized> | 47 | #include <KAuthorized> | ||
50 | #include <KConfig> | | |||
51 | #include <kdualaction.h> | 48 | #include <kdualaction.h> | ||
52 | #include <KHelpMenu> | 49 | #include <KHelpMenu> | ||
53 | #include <KJobWidgets> | 50 | #include <KJobWidgets> | ||
54 | #include <QLineEdit> | 51 | #include <QLineEdit> | ||
55 | #include <KToolBar> | 52 | #include <KToolBar> | ||
56 | #include <KIO/JobUiDelegate> | 53 | #include <KIO/JobUiDelegate> | ||
57 | #include <KLocalizedString> | 54 | #include <KLocalizedString> | ||
58 | #include <KProtocolManager> | 55 | #include <KProtocolManager> | ||
59 | #include <KProtocolInfo> | | |||
60 | #include <QMenu> | | |||
61 | #include <KMessageBox> | 56 | #include <KMessageBox> | ||
62 | #include <KFilePlacesModel> | 57 | #include <KFilePlacesModel> | ||
63 | #include <KFileItemListProperties> | 58 | #include <KFileItemListProperties> | ||
64 | #include <KRun> | 59 | #include <KRun> | ||
65 | #include <KShell> | 60 | #include <KShell> | ||
66 | #include <KStandardAction> | | |||
67 | #include <KToggleAction> | | |||
68 | #include <KUrlNavigator> | | |||
69 | #include <KToolInvocation> | 61 | #include <KToolInvocation> | ||
70 | #include <KUrlComboBox> | 62 | #include <KUrlComboBox> | ||
71 | 63 | | |||
72 | #include <QApplication> | 64 | #include <QApplication> | ||
73 | #include <QMenuBar> | 65 | #include <QMenuBar> | ||
74 | #include <QClipboard> | 66 | #include <QClipboard> | ||
75 | #include <QToolButton> | | |||
76 | #include <QTimer> | 67 | #include <QTimer> | ||
77 | #include <QStandardPaths> | | |||
78 | #include <QPushButton> | 68 | #include <QPushButton> | ||
79 | #include <QCloseEvent> | | |||
80 | #include <QShowEvent> | | |||
81 | #include <QDialog> | | |||
82 | 69 | | |||
83 | namespace { | 70 | namespace { | ||
84 | // Used for GeneralSettings::version() to determine whether | 71 | // Used for GeneralSettings::version() to determine whether | ||
85 | // an updated version of Dolphin is running. | 72 | // an updated version of Dolphin is running. | ||
86 | const int CurrentDolphinVersion = 200; | 73 | const int CurrentDolphinVersion = 200; | ||
87 | } | 74 | } | ||
88 | 75 | | |||
89 | DolphinMainWindow::DolphinMainWindow() : | 76 | DolphinMainWindow::DolphinMainWindow() : | ||
▲ Show 20 Lines • Show All 1087 Lines • ▼ Show 20 Line(s) | |||||
1177 | 1164 | | |||
1178 | #ifndef Q_OS_WIN | 1165 | #ifndef Q_OS_WIN | ||
1179 | if (KAuthorized::authorize(QStringLiteral("shell_access"))) { | 1166 | if (KAuthorized::authorize(QStringLiteral("shell_access"))) { | ||
1180 | QAction* openTerminal = actionCollection()->addAction(QStringLiteral("open_terminal")); | 1167 | QAction* openTerminal = actionCollection()->addAction(QStringLiteral("open_terminal")); | ||
1181 | openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal")); | 1168 | openTerminal->setText(i18nc("@action:inmenu Tools", "Open Terminal")); | ||
1182 | openTerminal->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | 1169 | openTerminal->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | ||
1183 | actionCollection()->setDefaultShortcut(openTerminal, Qt::SHIFT | Qt::Key_F4); | 1170 | actionCollection()->setDefaultShortcut(openTerminal, Qt::SHIFT | Qt::Key_F4); | ||
1184 | connect(openTerminal, &QAction::triggered, this, &DolphinMainWindow::openTerminal); | 1171 | connect(openTerminal, &QAction::triggered, this, &DolphinMainWindow::openTerminal); | ||
1172 | | ||||
1173 | QAction* focusTerminal = actionCollection()->addAction(QStringLiteral("focus_terminal")); | ||||
1174 | 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… | |||||
1175 | focusTerminal->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | ||||
1176 | connect(focusTerminal, &QAction::triggered, [this]() { | ||||
1177 | if (m_terminalPanel->isVisible()) | ||||
1178 | if (m_terminalPanel->hasFocus()) | ||||
1179 | focusNextChild(); | ||||
1180 | else | ||||
1181 | m_terminalPanel->setFocus(Qt::FocusReason::ShortcutFocusReason); | ||||
1182 | else | ||||
1183 | actionCollection()->action(QStringLiteral("show_terminal_panel"))->trigger(); | ||||
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. | |||||
1184 | }); | ||||
1185 | } | 1185 | } | ||
1186 | #endif | 1186 | #endif | ||
elvisangelaccio: Please use a dedicated function. | |||||
1187 | 1187 | | |||
1188 | // setup 'Settings' menu | 1188 | // setup 'Settings' menu | ||
1189 | KToggleAction* showMenuBar = KStandardAction::showMenubar(nullptr, nullptr, actionCollection()); | 1189 | KToggleAction* showMenuBar = KStandardAction::showMenubar(nullptr, nullptr, actionCollection()); | ||
1190 | connect(showMenuBar, &KToggleAction::triggered, // Fixes #286822 | 1190 | connect(showMenuBar, &KToggleAction::triggered, // Fixes #286822 | ||
1191 | this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection); | 1191 | this, &DolphinMainWindow::toggleShowMenuBar, Qt::QueuedConnection); | ||
1192 | KStandardAction::preferences(this, &DolphinMainWindow::editSettings, actionCollection()); | 1192 | KStandardAction::preferences(this, &DolphinMainWindow::editSettings, actionCollection()); | ||
1193 | 1193 | | |||
1194 | // not in menu actions | 1194 | // not in menu actions | ||
▲ Show 20 Lines • Show All 385 Lines • ▼ Show 20 Line(s) | 1571 | { | |||
1580 | connect(dockAction, &QAction::toggled, panelAction, &QAction::setChecked); | 1580 | connect(dockAction, &QAction::toggled, panelAction, &QAction::setChecked); | ||
1581 | } | 1581 | } | ||
1582 | 1582 | | |||
1583 | DolphinMainWindow::UndoUiInterface::UndoUiInterface() : | 1583 | DolphinMainWindow::UndoUiInterface::UndoUiInterface() : | ||
1584 | KIO::FileUndoManager::UiInterface() | 1584 | KIO::FileUndoManager::UiInterface() | ||
1585 | { | 1585 | { | ||
1586 | } | 1586 | } | ||
1587 | 1587 | | |||
1588 | DolphinMainWindow::UndoUiInterface::~UndoUiInterface() | 1588 | 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… | |||||
1589 | { | 1589 | { | ||
1590 | } | 1590 | } | ||
1591 | 1591 | | |||
1592 | void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job) | 1592 | void DolphinMainWindow::UndoUiInterface::jobError(KIO::Job* job) | ||
1593 | { | 1593 | { | ||
1594 | DolphinMainWindow* mainWin= qobject_cast<DolphinMainWindow *>(parentWidget()); | 1594 | DolphinMainWindow* mainWin= qobject_cast<DolphinMainWindow *>(parentWidget()); | ||
1595 | if (mainWin) { | 1595 | if (mainWin) { | ||
1596 | DolphinViewContainer* container = mainWin->activeViewContainer(); | 1596 | DolphinViewContainer* container = mainWin->activeViewContainer(); | ||
1597 | container->showMessage(job->errorString(), DolphinViewContainer::Error); | 1597 | container->showMessage(job->errorString(), DolphinViewContainer::Error); | ||
1598 | } else { | 1598 | } else { | ||
1599 | KIO::FileUndoManager::UiInterface::jobError(job); | 1599 | KIO::FileUndoManager::UiInterface::jobError(job); | ||
1600 | } | 1600 | } | ||
1601 | } | 1601 | } | ||
1602 | 1602 | |
Please remove the unrelated changes to the includes