Changeset View
Changeset View
Standalone View
Standalone View
app/fileopscontextmanageritem.cpp
| Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | 117 | { | |||
|---|---|---|---|---|---|
| 133 | KActionCategory* edit = new KActionCategory(i18nc("@title actions category", "Edit"), actionCollection); | 133 | KActionCategory* edit = new KActionCategory(i18nc("@title actions category", "Edit"), actionCollection); | ||
| 134 | 134 | | |||
| 135 | mCutAction = edit->addAction(KStandardAction::Cut, this, SLOT(cut())); | 135 | mCutAction = edit->addAction(KStandardAction::Cut, this, SLOT(cut())); | ||
| 136 | mCopyAction = edit->addAction(KStandardAction::Copy, this, SLOT(copy())); | 136 | mCopyAction = edit->addAction(KStandardAction::Copy, this, SLOT(copy())); | ||
| 137 | mPasteAction = edit->addAction(KStandardAction::Paste, this, SLOT(paste())); | 137 | mPasteAction = edit->addAction(KStandardAction::Paste, this, SLOT(paste())); | ||
| 138 | 138 | | |||
| 139 | mCopyToAction = file->addAction("file_copy_to", this, SLOT(copyTo())); | 139 | mCopyToAction = file->addAction("file_copy_to", this, SLOT(copyTo())); | ||
| 140 | mCopyToAction->setText(i18nc("Verb", "Copy To...")); | 140 | mCopyToAction->setText(i18nc("Verb", "Copy To...")); | ||
| 141 | mCopyToAction->setIcon(QIcon::fromTheme("edit-copy")); | ||||
| 141 | actionCollection->setDefaultShortcut(mCopyToAction, Qt::Key_F7); | 142 | actionCollection->setDefaultShortcut(mCopyToAction, Qt::Key_F7); | ||
| 142 | 143 | | |||
| 143 | mMoveToAction = file->addAction("file_move_to", this, SLOT(moveTo())); | 144 | mMoveToAction = file->addAction("file_move_to", this, SLOT(moveTo())); | ||
| 144 | mMoveToAction->setText(i18nc("Verb", "Move To...")); | 145 | mMoveToAction->setText(i18nc("Verb", "Move To...")); | ||
| 146 | mMoveToAction->setIcon(QIcon::fromTheme("go-jump")); | ||||
| 145 | actionCollection->setDefaultShortcut(mMoveToAction, Qt::Key_F8); | 147 | actionCollection->setDefaultShortcut(mMoveToAction, Qt::Key_F8); | ||
| 146 | 148 | | |||
| 147 | mLinkToAction = file->addAction("file_link_to", this, SLOT(linkTo())); | 149 | mLinkToAction = file->addAction("file_link_to", this, SLOT(linkTo())); | ||
| 148 | mLinkToAction->setText(i18nc("Verb: create link to the file where user wants", "Link To...")); | 150 | mLinkToAction->setText(i18nc("Verb: create link to the file where user wants", "Link To...")); | ||
| 151 | mLinkToAction->setIcon(QIcon::fromTheme("link")); | ||||
| 149 | actionCollection->setDefaultShortcut(mLinkToAction, Qt::Key_F9); | 152 | actionCollection->setDefaultShortcut(mLinkToAction, Qt::Key_F9); | ||
| 150 | 153 | | |||
| 151 | mRenameAction = file->addAction("file_rename", this, SLOT(rename())); | 154 | mRenameAction = file->addAction("file_rename", this, SLOT(rename())); | ||
| 152 | mRenameAction->setText(i18nc("Verb", "Rename...")); | 155 | mRenameAction->setText(i18nc("Verb", "Rename...")); | ||
| 153 | mRenameAction->setIcon(QIcon::fromTheme("edit-rename")); | 156 | mRenameAction->setIcon(QIcon::fromTheme("edit-rename")); | ||
| 154 | actionCollection->setDefaultShortcut(mRenameAction, Qt::Key_F2); | 157 | actionCollection->setDefaultShortcut(mRenameAction, Qt::Key_F2); | ||
| 155 | 158 | | |||
| 156 | mTrashAction = file->addAction("file_trash", this, SLOT(trash())); | 159 | mTrashAction = file->addAction("file_trash", this, SLOT(trash())); | ||
| 157 | mTrashAction->setText(i18nc("Verb", "Trash")); | 160 | mTrashAction->setText(i18nc("Verb", "Trash")); | ||
| 158 | mTrashAction->setIcon(QIcon::fromTheme("user-trash")); | 161 | mTrashAction->setIcon(QIcon::fromTheme("user-trash-symbolic")); | ||
| 159 | actionCollection->setDefaultShortcut(mTrashAction, Qt::Key_Delete); | 162 | actionCollection->setDefaultShortcut(mTrashAction, Qt::Key_Delete); | ||
| 160 | 163 | | |||
| 161 | mDelAction = file->addAction(KStandardAction::DeleteFile, this, SLOT(del())); | 164 | mDelAction = file->addAction(KStandardAction::DeleteFile, this, SLOT(del())); | ||
| 162 | 165 | | |||
| 163 | mRestoreAction = file->addAction("file_restore", this, SLOT(restore())); | 166 | mRestoreAction = file->addAction("file_restore", this, SLOT(restore())); | ||
| 164 | mRestoreAction->setText(i18n("Restore")); | 167 | mRestoreAction->setText(i18n("Restore")); | ||
| 168 | mRestoreAction->setIcon(QIcon::fromTheme("edit-undo")); | ||||
| 165 | 169 | | |||
| 166 | mShowPropertiesAction = file->addAction("file_show_properties", this, SLOT(showProperties())); | 170 | mShowPropertiesAction = file->addAction("file_show_properties", this, SLOT(showProperties())); | ||
| 167 | mShowPropertiesAction->setText(i18n("Properties")); | 171 | mShowPropertiesAction->setText(i18n("Properties")); | ||
| 168 | mShowPropertiesAction->setIcon(QIcon::fromTheme("document-properties")); | 172 | mShowPropertiesAction->setIcon(QIcon::fromTheme("document-properties")); | ||
| 169 | 173 | | |||
| 170 | mCreateFolderAction = file->addAction("file_create_folder", this, SLOT(createFolder())); | 174 | mCreateFolderAction = file->addAction("file_create_folder", this, SLOT(createFolder())); | ||
| 171 | mCreateFolderAction->setText(i18n("Create Folder...")); | 175 | mCreateFolderAction->setText(i18n("Create Folder...")); | ||
| 172 | mCreateFolderAction->setIcon(QIcon::fromTheme("folder-new")); | 176 | mCreateFolderAction->setIcon(QIcon::fromTheme("folder-new")); | ||
| 173 | 177 | | |||
| 174 | mOpenWithAction = file->addAction("file_open_with"); | 178 | mOpenWithAction = file->addAction("file_open_with"); | ||
| 175 | mOpenWithAction->setText(i18n("Open With")); | 179 | mOpenWithAction->setText(i18n("Open With")); | ||
| 176 | QMenu* menu = new QMenu; | 180 | QMenu* menu = new QMenu; | ||
| 177 | mOpenWithAction->setMenu(menu); | 181 | mOpenWithAction->setMenu(menu); | ||
| 178 | connect(menu, &QMenu::aboutToShow, this, &FileOpsContextManagerItem::populateOpenMenu); | 182 | connect(menu, &QMenu::aboutToShow, this, &FileOpsContextManagerItem::populateOpenMenu); | ||
| 179 | connect(menu, &QMenu::triggered, this, &FileOpsContextManagerItem::openWith); | 183 | connect(menu, &QMenu::triggered, this, &FileOpsContextManagerItem::openWith); | ||
| 180 | 184 | | |||
| 181 | mOpenContainingFolderAction = file->addAction("file_open_containing_folder", this, SLOT(openContainingFolder())); | 185 | mOpenContainingFolderAction = file->addAction("file_open_containing_folder", this, SLOT(openContainingFolder())); | ||
| 182 | mOpenContainingFolderAction->setText(i18n("Open Containing Folder")); | 186 | mOpenContainingFolderAction->setText(i18n("Open Containing Folder")); | ||
| 187 | mOpenContainingFolderAction->setIcon(QIcon::fromTheme("folder-open-symbolic")); | ||||
| 183 | 188 | | |||
| 184 | mRegularFileActionList | 189 | mRegularFileActionList | ||
| 185 | << mRenameAction | 190 | << mRenameAction | ||
| 186 | << mTrashAction | 191 | << mTrashAction | ||
| 187 | << mDelAction | 192 | << mDelAction | ||
| 188 | << createSeparator(this) | 193 | << createSeparator(this) | ||
| 189 | << mCopyToAction | 194 | << mCopyToAction | ||
| 190 | << mMoveToAction | 195 | << mMoveToAction | ||
| ▲ Show 20 Lines • Show All 227 Lines • Show Last 20 Lines | |||||