Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinviewactionhandler.cpp
Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Line(s) | 90 | { | |||
---|---|---|---|---|---|
197 | connect(zoomResetAction, &QAction::triggered, this, &DolphinViewActionHandler::zoomReset); | 197 | connect(zoomResetAction, &QAction::triggered, this, &DolphinViewActionHandler::zoomReset); | ||
198 | 198 | | |||
199 | QAction* zoomOutAction = KStandardAction::zoomOut(this, | 199 | QAction* zoomOutAction = KStandardAction::zoomOut(this, | ||
200 | &DolphinViewActionHandler::zoomOut, | 200 | &DolphinViewActionHandler::zoomOut, | ||
201 | m_actionCollection); | 201 | m_actionCollection); | ||
202 | zoomOutAction->setWhatsThis(i18nc("@info:whatsthis zoom out", "This reduces the icon size.")); | 202 | zoomOutAction->setWhatsThis(i18nc("@info:whatsthis zoom out", "This reduces the icon size.")); | ||
203 | 203 | | |||
204 | KToggleAction* showPreview = m_actionCollection->add<KToggleAction>(QStringLiteral("show_preview")); | 204 | KToggleAction* showPreview = m_actionCollection->add<KToggleAction>(QStringLiteral("show_preview")); | ||
205 | showPreview->setText(i18nc("@action:intoolbar", "Preview")); | 205 | showPreview->setText(i18nc("@action:intoolbar", "Show Previews")); | ||
206 | showPreview->setToolTip(i18nc("@info", "Show preview of files and folders")); | 206 | showPreview->setToolTip(i18nc("@info", "Show preview of files and folders")); | ||
207 | showPreview->setWhatsThis(xi18nc("@info:whatsthis", "When this is " | 207 | showPreview->setWhatsThis(xi18nc("@info:whatsthis", "When this is " | ||
208 | "enabled, the icons are based on the actual file or folder " | 208 | "enabled, the icons are based on the actual file or folder " | ||
209 | "contents.<nl/>For example the icons of images become scaled " | 209 | "contents.<nl/>For example the icons of images become scaled " | ||
210 | "down versions of the images.")); | 210 | "down versions of the images.")); | ||
211 | showPreview->setIcon(QIcon::fromTheme(QStringLiteral("view-preview"))); | 211 | showPreview->setIcon(QIcon::fromTheme(QStringLiteral("view-preview"))); | ||
212 | connect(showPreview, &KToggleAction::triggered, this, &DolphinViewActionHandler::togglePreview); | 212 | connect(showPreview, &KToggleAction::triggered, this, &DolphinViewActionHandler::togglePreview); | ||
213 | 213 | | |||
Show All 34 Lines | |||||
248 | sortByActionMenu->addAction(descendingAction); | 248 | sortByActionMenu->addAction(descendingAction); | ||
249 | sortByActionMenu->addSeparator(); | 249 | sortByActionMenu->addSeparator(); | ||
250 | sortByActionMenu->addAction(sortFoldersFirst); | 250 | sortByActionMenu->addAction(sortFoldersFirst); | ||
251 | 251 | | |||
252 | // View -> Additional Information | 252 | // View -> Additional Information | ||
253 | QActionGroup* visibleRolesGroup = createFileItemRolesActionGroup(QStringLiteral("show_")); | 253 | QActionGroup* visibleRolesGroup = createFileItemRolesActionGroup(QStringLiteral("show_")); | ||
254 | 254 | | |||
255 | KActionMenu* visibleRolesMenu = m_actionCollection->add<KActionMenu>(QStringLiteral("additional_info")); | 255 | KActionMenu* visibleRolesMenu = m_actionCollection->add<KActionMenu>(QStringLiteral("additional_info")); | ||
256 | visibleRolesMenu->setText(i18nc("@action:inmenu View", "Additional Information")); | 256 | visibleRolesMenu->setText(i18nc("@action:inmenu View", "Show Additional Information")); | ||
257 | visibleRolesMenu->setIcon(QIcon::fromTheme(QStringLiteral("documentinfo"))); | ||||
257 | visibleRolesMenu->setDelayed(false); | 258 | visibleRolesMenu->setDelayed(false); | ||
258 | 259 | | |||
259 | foreach (QAction* action, visibleRolesGroup->actions()) { | 260 | foreach (QAction* action, visibleRolesGroup->actions()) { | ||
260 | visibleRolesMenu->addAction(action); | 261 | visibleRolesMenu->addAction(action); | ||
261 | } | 262 | } | ||
262 | 263 | | |||
263 | KToggleAction* showInGroups = m_actionCollection->add<KToggleAction>(QStringLiteral("show_in_groups")); | 264 | KToggleAction* showInGroups = m_actionCollection->add<KToggleAction>(QStringLiteral("show_in_groups")); | ||
264 | showInGroups->setIcon(QIcon::fromTheme(QStringLiteral("view-group"))); | 265 | showInGroups->setIcon(QIcon::fromTheme(QStringLiteral("view-group"))); | ||
265 | showInGroups->setText(i18nc("@action:inmenu View", "Show in Groups")); | 266 | showInGroups->setText(i18nc("@action:inmenu View", "Show in Groups")); | ||
266 | showInGroups->setWhatsThis(i18nc("@info:whatsthis", "This groups files and folders by their first letter.")); | 267 | showInGroups->setWhatsThis(i18nc("@info:whatsthis", "This groups files and folders by their first letter.")); | ||
267 | connect(showInGroups, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleGroupedSorting); | 268 | connect(showInGroups, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleGroupedSorting); | ||
268 | 269 | | |||
269 | KToggleAction* showHiddenFiles = m_actionCollection->add<KToggleAction>(QStringLiteral("show_hidden_files")); | 270 | KToggleAction* showHiddenFiles = m_actionCollection->add<KToggleAction>(QStringLiteral("show_hidden_files")); | ||
270 | showHiddenFiles->setText(i18nc("@action:inmenu View", "Hidden Files")); | 271 | showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files")); | ||
271 | showHiddenFiles->setToolTip(i18nc("@info", "Visibility of hidden files and folders")); | 272 | showHiddenFiles->setToolTip(i18nc("@info", "Visibility of hidden files and folders")); | ||
272 | showHiddenFiles->setWhatsThis(xi18nc("@info:whatsthis", "<para>When " | 273 | showHiddenFiles->setWhatsThis(xi18nc("@info:whatsthis", "<para>When " | ||
273 | "this is enabled <emphasis>hidden</emphasis> files and folders " | 274 | "this is enabled <emphasis>hidden</emphasis> files and folders " | ||
274 | "are visible. They will be displayed semi-transparent.</para>" | 275 | "are visible. They will be displayed semi-transparent.</para>" | ||
275 | "<para>Hidden items only differ from other ones in that their " | 276 | "<para>Hidden items only differ from other ones in that their " | ||
276 | "name starts with a \".\". In general there is no need for " | 277 | "name starts with a \".\". In general there is no need for " | ||
277 | "users to access them which is why they are hidden.</para>")); | 278 | "users to access them which is why they are hidden.</para>")); | ||
278 | m_actionCollection->setDefaultShortcuts(showHiddenFiles, {Qt::ALT + Qt::Key_Period, Qt::CTRL + Qt::Key_H, Qt::Key_F8}); | 279 | m_actionCollection->setDefaultShortcuts(showHiddenFiles, {Qt::ALT + Qt::Key_Period, Qt::CTRL + Qt::Key_H, Qt::Key_F8}); | ||
279 | connect(showHiddenFiles, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleShowHiddenFiles); | 280 | connect(showHiddenFiles, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleShowHiddenFiles); | ||
280 | 281 | | |||
281 | QAction* adjustViewProps = m_actionCollection->addAction(QStringLiteral("view_properties")); | 282 | QAction* adjustViewProps = m_actionCollection->addAction(QStringLiteral("view_properties")); | ||
282 | adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Properties...")); | 283 | adjustViewProps->setText(i18nc("@action:inmenu View", "Adjust View Properties...")); | ||
284 | adjustViewProps->setIcon(QIcon::fromTheme(QStringLiteral("view-choose"))); | ||||
283 | adjustViewProps->setWhatsThis(i18nc("@info:whatsthis", "This opens a window " | 285 | adjustViewProps->setWhatsThis(i18nc("@info:whatsthis", "This opens a window " | ||
284 | "in which all folder view properties can be adjusted.")); | 286 | "in which all folder view properties can be adjusted.")); | ||
285 | connect(adjustViewProps, &QAction::triggered, this, &DolphinViewActionHandler::slotAdjustViewProperties); | 287 | connect(adjustViewProps, &QAction::triggered, this, &DolphinViewActionHandler::slotAdjustViewProperties); | ||
286 | } | 288 | } | ||
287 | 289 | | |||
288 | QActionGroup* DolphinViewActionHandler::createFileItemRolesActionGroup(const QString& groupPrefix) | 290 | QActionGroup* DolphinViewActionHandler::createFileItemRolesActionGroup(const QString& groupPrefix) | ||
289 | { | 291 | { | ||
290 | const bool isSortGroup = (groupPrefix == QLatin1String("sort_by_")); | 292 | const bool isSortGroup = (groupPrefix == QLatin1String("sort_by_")); | ||
▲ Show 20 Lines • Show All 406 Lines • Show Last 20 Lines |