| 122 | } |
| 123 | |
| 124 | void FileManager::setupActions() |
| 125 | { |
| 126 | auto* acmBookmarks = new KActionMenu(QIcon::fromTheme(QStringLiteral("bookmarks")), i18nc("@title:menu", "Bookmarks"), this); |
| 127 | acmBookmarks->setPopupMode(QToolButton::InstantPopup); |
| 128 | m_bookmarkHandler = new BookmarkHandler(this, acmBookmarks->menu()); |
| 129 | acmBookmarks->setShortcutContext(Qt::WidgetWithChildrenShortcut); |
| 130 | |
| 131 | auto* action = new QAction(this); |
| 132 | action->setShortcutContext(Qt::WidgetWithChildrenShortcut); |
| 133 | action->setText(i18nc("@action switch to directory of current document", "Current Document Directory")); |
| 134 | action->setIcon(QIcon::fromTheme(QStringLiteral("dirsync"))); |
| 135 | connect(action, &QAction::triggered, this, &FileManager::syncCurrentDocumentDirectory); |
| 136 | |
| 137 | tbActions = { |
| 138 | dirop->action(KDirOperator::Back), |
| 139 | dirop->action(KDirOperator::Up), |
| 140 | dirop->action(KDirOperator::Home), |
| 141 | dirop->action(KDirOperator::Forward), |
| 142 | dirop->action(KDirOperator::Reload), |
| 143 | acmBookmarks, |
| 144 | action, |
| 145 | dirop->action(KDirOperator::SortMenu), |
| 146 | dirop->action(KDirOperator::ShowHiddenFiles), |
| 147 | }; |
| 148 | |
| 149 | newFileAction = new QAction(this); |
| 150 | newFileAction->setText(i18nc("@action", "New File...")); |
| 151 | newFileAction->setIcon(QIcon::fromTheme(QStringLiteral("document-new"))); |
| 152 | connect(newFileAction, &QAction::triggered, this, &FileManager::createNewFile); |
| 153 | } |
| 154 | |
| 155 | void FileManager::createNewFile() |
| 156 | { |