Changeset View
Changeset View
Standalone View
Standalone View
src/views/dolphinviewactionhandler.cpp
Show First 20 Lines • Show All 324 Lines • ▼ Show 20 Line(s) | 323 | { | |||
---|---|---|---|---|---|
325 | // It is not enough to update the 'Show Preview' action, also | 325 | // It is not enough to update the 'Show Preview' action, also | ||
326 | // the 'Zoom In' and 'Zoom Out' actions must be adapted. | 326 | // the 'Zoom In' and 'Zoom Out' actions must be adapted. | ||
327 | updateViewActions(); | 327 | updateViewActions(); | ||
328 | } | 328 | } | ||
329 | 329 | | |||
330 | QString DolphinViewActionHandler::currentViewModeActionName() const | 330 | QString DolphinViewActionHandler::currentViewModeActionName() const | ||
331 | { | 331 | { | ||
332 | switch (m_currentView->mode()) { | 332 | switch (m_currentView->mode()) { | ||
333 | case DolphinView::IconsView: | 333 | case DolphinView::Mode::IconsView: | ||
334 | return QStringLiteral("icons"); | 334 | return QStringLiteral("icons"); | ||
335 | case DolphinView::DetailsView: | 335 | case DolphinView::Mode::DetailsView: | ||
336 | return QStringLiteral("details"); | 336 | return QStringLiteral("details"); | ||
337 | case DolphinView::CompactView: | 337 | case DolphinView::Mode::CompactView: | ||
338 | return QStringLiteral("compact"); | 338 | return QStringLiteral("compact"); | ||
339 | default: | 339 | default: | ||
340 | Q_ASSERT(false); | 340 | Q_ASSERT(false); | ||
341 | break; | 341 | break; | ||
342 | } | 342 | } | ||
343 | return QString(); // can't happen | 343 | return QString(); // can't happen | ||
344 | } | 344 | } | ||
345 | 345 | | |||
▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | |||||
488 | 488 | | |||
489 | KToggleAction* DolphinViewActionHandler::iconsModeAction() | 489 | KToggleAction* DolphinViewActionHandler::iconsModeAction() | ||
490 | { | 490 | { | ||
491 | KToggleAction* iconsView = m_actionCollection->add<KToggleAction>(QStringLiteral("icons")); | 491 | KToggleAction* iconsView = m_actionCollection->add<KToggleAction>(QStringLiteral("icons")); | ||
492 | iconsView->setText(i18nc("@action:inmenu View Mode", "Icons")); | 492 | iconsView->setText(i18nc("@action:inmenu View Mode", "Icons")); | ||
493 | iconsView->setToolTip(i18nc("@info", "Icons view mode")); | 493 | iconsView->setToolTip(i18nc("@info", "Icons view mode")); | ||
494 | m_actionCollection->setDefaultShortcut(iconsView, Qt::CTRL + Qt::Key_1); | 494 | m_actionCollection->setDefaultShortcut(iconsView, Qt::CTRL + Qt::Key_1); | ||
495 | iconsView->setIcon(QIcon::fromTheme(QStringLiteral("view-list-icons"))); | 495 | iconsView->setIcon(QIcon::fromTheme(QStringLiteral("view-list-icons"))); | ||
496 | iconsView->setData(QVariant::fromValue(DolphinView::IconsView)); | 496 | iconsView->setData(QVariant::fromValue(DolphinView::Mode::IconsView)); | ||
497 | return iconsView; | 497 | return iconsView; | ||
498 | } | 498 | } | ||
499 | 499 | | |||
500 | KToggleAction* DolphinViewActionHandler::compactModeAction() | 500 | KToggleAction* DolphinViewActionHandler::compactModeAction() | ||
501 | { | 501 | { | ||
502 | KToggleAction* iconsView = m_actionCollection->add<KToggleAction>(QStringLiteral("compact")); | 502 | KToggleAction* iconsView = m_actionCollection->add<KToggleAction>(QStringLiteral("compact")); | ||
503 | iconsView->setText(i18nc("@action:inmenu View Mode", "Compact")); | 503 | iconsView->setText(i18nc("@action:inmenu View Mode", "Compact")); | ||
504 | iconsView->setToolTip(i18nc("@info", "Compact view mode")); | 504 | iconsView->setToolTip(i18nc("@info", "Compact view mode")); | ||
505 | m_actionCollection->setDefaultShortcut(iconsView, Qt::CTRL + Qt::Key_2); | 505 | m_actionCollection->setDefaultShortcut(iconsView, Qt::CTRL + Qt::Key_2); | ||
506 | iconsView->setIcon(QIcon::fromTheme(QStringLiteral("view-list-details"))); // TODO: discuss with Oxygen-team the wrong (?) name | 506 | iconsView->setIcon(QIcon::fromTheme(QStringLiteral("view-list-details"))); // TODO: discuss with Oxygen-team the wrong (?) name | ||
507 | iconsView->setData(QVariant::fromValue(DolphinView::CompactView)); | 507 | iconsView->setData(QVariant::fromValue(DolphinView::Mode::CompactView)); | ||
508 | return iconsView; | 508 | return iconsView; | ||
509 | } | 509 | } | ||
510 | 510 | | |||
511 | KToggleAction* DolphinViewActionHandler::detailsModeAction() | 511 | KToggleAction* DolphinViewActionHandler::detailsModeAction() | ||
512 | { | 512 | { | ||
513 | KToggleAction* detailsView = m_actionCollection->add<KToggleAction>(QStringLiteral("details")); | 513 | KToggleAction* detailsView = m_actionCollection->add<KToggleAction>(QStringLiteral("details")); | ||
514 | detailsView->setText(i18nc("@action:inmenu View Mode", "Details")); | 514 | detailsView->setText(i18nc("@action:inmenu View Mode", "Details")); | ||
515 | detailsView->setToolTip(i18nc("@info", "Details view mode")); | 515 | detailsView->setToolTip(i18nc("@info", "Details view mode")); | ||
516 | m_actionCollection->setDefaultShortcut(detailsView, Qt::CTRL + Qt::Key_3); | 516 | m_actionCollection->setDefaultShortcut(detailsView, Qt::CTRL + Qt::Key_3); | ||
517 | detailsView->setIcon(QIcon::fromTheme(QStringLiteral("view-list-tree"))); | 517 | detailsView->setIcon(QIcon::fromTheme(QStringLiteral("view-list-tree"))); | ||
518 | detailsView->setData(QVariant::fromValue(DolphinView::DetailsView)); | 518 | detailsView->setData(QVariant::fromValue(DolphinView::Mode::DetailsView)); | ||
519 | return detailsView; | 519 | return detailsView; | ||
520 | } | 520 | } | ||
521 | 521 | | |||
522 | void DolphinViewActionHandler::slotSortRoleChanged(const QByteArray& role) | 522 | void DolphinViewActionHandler::slotSortRoleChanged(const QByteArray& role) | ||
523 | { | 523 | { | ||
524 | KToggleAction* action = m_sortByActions.value(role); | 524 | KToggleAction* action = m_sortByActions.value(role); | ||
525 | if (action) { | 525 | if (action) { | ||
526 | action->setChecked(true); | 526 | action->setChecked(true); | ||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |