Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinviewactionhandler.cpp
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 90 | { | |||
---|---|---|---|---|---|
131 | // so that the Edit menu isn't affected. | 131 | // so that the Edit menu isn't affected. | ||
132 | QAction* deleteWithTrashShortcut = m_actionCollection->addAction(QStringLiteral("delete_shortcut")); | 132 | QAction* deleteWithTrashShortcut = m_actionCollection->addAction(QStringLiteral("delete_shortcut")); | ||
133 | // The descriptive text is just for the shortcuts editor. | 133 | // The descriptive text is just for the shortcuts editor. | ||
134 | deleteWithTrashShortcut->setText(i18nc("@action \"Move to Trash\" for non-local files, etc.", "Delete (using shortcut for Trash)")); | 134 | deleteWithTrashShortcut->setText(i18nc("@action \"Move to Trash\" for non-local files, etc.", "Delete (using shortcut for Trash)")); | ||
135 | m_actionCollection->setDefaultShortcuts(deleteWithTrashShortcut, KStandardShortcut::moveToTrash()); | 135 | m_actionCollection->setDefaultShortcuts(deleteWithTrashShortcut, KStandardShortcut::moveToTrash()); | ||
136 | deleteWithTrashShortcut->setEnabled(false); | 136 | deleteWithTrashShortcut->setEnabled(false); | ||
137 | connect(deleteWithTrashShortcut, &QAction::triggered, this, &DolphinViewActionHandler::slotDeleteItems); | 137 | connect(deleteWithTrashShortcut, &QAction::triggered, this, &DolphinViewActionHandler::slotDeleteItems); | ||
138 | 138 | | |||
139 | QAction* duplicateAction = m_actionCollection->addAction(QStringLiteral("duplicate")); | ||||
140 | duplicateAction->setText(i18nc("@action:inmenu File", "Duplicate")); | ||||
141 | duplicateAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-duplicate"))); | ||||
142 | m_actionCollection->setDefaultShortcut(duplicateAction, Qt::CTRL | Qt::Key_D); | ||||
143 | duplicateAction->setEnabled(false); | ||||
144 | connect(duplicateAction, &QAction::triggered, this, &DolphinViewActionHandler::slotDuplicate); | ||||
145 | | ||||
139 | QAction *propertiesAction = m_actionCollection->addAction( QStringLiteral("properties") ); | 146 | QAction *propertiesAction = m_actionCollection->addAction( QStringLiteral("properties") ); | ||
140 | // Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :) | 147 | // Well, it's the File menu in dolphinmainwindow and the Edit menu in dolphinpart... :) | ||
141 | propertiesAction->setText( i18nc("@action:inmenu File", "Properties") ); | 148 | propertiesAction->setText( i18nc("@action:inmenu File", "Properties") ); | ||
142 | propertiesAction->setWhatsThis(xi18nc("@info:whatsthis properties", | 149 | propertiesAction->setWhatsThis(xi18nc("@info:whatsthis properties", | ||
143 | "This shows a complete list of properties of the currently " | 150 | "This shows a complete list of properties of the currently " | ||
144 | "selected items in a new window.<nl/>If nothing is selected the " | 151 | "selected items in a new window.<nl/>If nothing is selected the " | ||
145 | "window will be about the currently viewed folder instead.<nl/>" | 152 | "window will be about the currently viewed folder instead.<nl/>" | ||
146 | "You can configure advanced options there like managing " | 153 | "You can configure advanced options there like managing " | ||
▲ Show 20 Lines • Show All 528 Lines • ▼ Show 20 Line(s) | |||||
675 | void DolphinViewActionHandler::slotAdjustViewProperties() | 682 | void DolphinViewActionHandler::slotAdjustViewProperties() | ||
676 | { | 683 | { | ||
677 | emit actionBeingHandled(); | 684 | emit actionBeingHandled(); | ||
678 | QPointer<ViewPropertiesDialog> dialog = new ViewPropertiesDialog(m_currentView); | 685 | QPointer<ViewPropertiesDialog> dialog = new ViewPropertiesDialog(m_currentView); | ||
679 | dialog->exec(); | 686 | dialog->exec(); | ||
680 | delete dialog; | 687 | delete dialog; | ||
681 | } | 688 | } | ||
682 | 689 | | |||
690 | void DolphinViewActionHandler::slotDuplicate() | ||||
691 | { | ||||
692 | emit actionBeingHandled(); | ||||
693 | m_currentView->duplicateSelectedItems(); | ||||
694 | } | ||||
695 | | ||||
683 | void DolphinViewActionHandler::slotProperties() | 696 | void DolphinViewActionHandler::slotProperties() | ||
684 | { | 697 | { | ||
685 | KPropertiesDialog* dialog = nullptr; | 698 | KPropertiesDialog* dialog = nullptr; | ||
686 | const KFileItemList list = m_currentView->selectedItems(); | 699 | const KFileItemList list = m_currentView->selectedItems(); | ||
687 | if (list.isEmpty()) { | 700 | if (list.isEmpty()) { | ||
688 | const QUrl url = m_currentView->url(); | 701 | const QUrl url = m_currentView->url(); | ||
689 | dialog = new KPropertiesDialog(url, m_currentView); | 702 | dialog = new KPropertiesDialog(url, m_currentView); | ||
690 | } else { | 703 | } else { | ||
691 | dialog = new KPropertiesDialog(list, m_currentView); | 704 | dialog = new KPropertiesDialog(list, m_currentView); | ||
692 | } | 705 | } | ||
693 | 706 | | |||
694 | dialog->setAttribute(Qt::WA_DeleteOnClose); | 707 | dialog->setAttribute(Qt::WA_DeleteOnClose); | ||
695 | dialog->show(); | 708 | dialog->show(); | ||
696 | dialog->raise(); | 709 | dialog->raise(); | ||
697 | dialog->activateWindow(); | 710 | dialog->activateWindow(); | ||
698 | } | 711 | } |