Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
| Show First 20 Lines • Show All 1574 Lines • ▼ Show 20 Line(s) | 1571 | { | |||
|---|---|---|---|---|---|
| 1575 | panelAction->setText(dockAction->text()); | 1575 | panelAction->setText(dockAction->text()); | ||
| 1576 | panelAction->setIcon(icon); | 1576 | panelAction->setIcon(icon); | ||
| 1577 | actionCollection()->setDefaultShortcut(panelAction, shortcut); | 1577 | actionCollection()->setDefaultShortcut(panelAction, shortcut); | ||
| 1578 | 1578 | | |||
| 1579 | connect(panelAction, &QAction::triggered, dockAction, &QAction::trigger); | 1579 | connect(panelAction, &QAction::triggered, dockAction, &QAction::trigger); | ||
| 1580 | connect(dockAction, &QAction::toggled, panelAction, &QAction::setChecked); | 1580 | connect(dockAction, &QAction::toggled, panelAction, &QAction::setChecked); | ||
| 1581 | } | 1581 | } | ||
| 1582 | 1582 | | |||
| 1583 | void DolphinMainWindow::keyPressEvent(QKeyEvent *event) | ||||
| 1584 | { | ||||
| 1585 | QWidget::keyPressEvent(event); | ||||
| 1586 | | ||||
| 1587 | static auto keys = QList<Qt::Key>{}; | ||||
| 1588 | keys.append(static_cast<Qt::Key>(event->key())); | ||||
| 1589 | | ||||
| 1590 | switch (event->key()) { | ||||
| 1591 | case Qt::Key::Key_D: | ||||
| 1592 | case Qt::Key::Key_X: | ||||
| 1593 | m_activeViewContainer->view()->trashSelectedItems(); | ||||
| 1594 | keys.clear(); | ||||
| 1595 | break; | ||||
| 1596 | case Qt::Key::Key_H: | ||||
| 1597 | if (keys.length() > 0 || keys.at(0) == Qt::Key::Key_G) { | ||||
| 1598 | goHome(); | ||||
| 1599 | } else { | ||||
| 1600 | goUp(); | ||||
| 1601 | } | ||||
| 1602 | keys.clear(); | ||||
| 1603 | break; | ||||
| 1604 | case Qt::Key::Key_P: | ||||
| 1605 | paste(); | ||||
| 1606 | keys.clear(); | ||||
| 1607 | break; | ||||
| 1608 | case Qt::Key::Key_R: | ||||
| 1609 | if (keys.length() > 0 || keys.at(0) == Qt::Key::Key_G) { | ||||
| 1610 | changeUrl(QUrl::fromLocalFile(QLatin1String("/"))); | ||||
| 1611 | } | ||||
| 1612 | keys.clear(); | ||||
| 1613 | break; | ||||
| 1614 | case Qt::Key::Key_U: | ||||
| 1615 | undo(); | ||||
| 1616 | keys.clear(); | ||||
| 1617 | break; | ||||
| 1618 | case Qt::Key::Key_Y: | ||||
| 1619 | copy(); | ||||
| 1620 | keys.clear(); | ||||
| 1621 | break; | ||||
| 1622 | default: | ||||
| 1623 | // Ignore everything else | ||||
| 1624 | break; | ||||
| 1625 | } | ||||
| 1626 | } | ||||
| 1627 | | ||||
| 1583 | DolphinMainWindow::UndoUiInterface::UndoUiInterface() : | 1628 | DolphinMainWindow::UndoUiInterface::UndoUiInterface() : | ||
| 1584 | KIO::FileUndoManager::UiInterface() | 1629 | KIO::FileUndoManager::UiInterface() | ||
| 1585 | { | 1630 | { | ||
| 1586 | } | 1631 | } | ||
| 1587 | 1632 | | |||
| 1588 | DolphinMainWindow::UndoUiInterface::~UndoUiInterface() | 1633 | DolphinMainWindow::UndoUiInterface::~UndoUiInterface() | ||
| 1589 | { | 1634 | { | ||
| 1590 | } | 1635 | } | ||
| Show All 12 Lines | |||||