Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 1889 Lines • ▼ Show 20 Line(s) | 1889 | { | |||
---|---|---|---|---|---|
1890 | const KFileItemList list = m_activeViewContainer->view()->selectedItems(); | 1890 | const KFileItemList list = m_activeViewContainer->view()->selectedItems(); | ||
1891 | const KActionCollection* col = actionCollection(); | 1891 | const KActionCollection* col = actionCollection(); | ||
1892 | QAction* addToPlacesAction = col->action(QStringLiteral("add_to_places")); | 1892 | QAction* addToPlacesAction = col->action(QStringLiteral("add_to_places")); | ||
1893 | 1893 | | |||
1894 | if (list.isEmpty()) { | 1894 | if (list.isEmpty()) { | ||
1895 | stateChanged(QStringLiteral("has_no_selection")); | 1895 | stateChanged(QStringLiteral("has_no_selection")); | ||
1896 | 1896 | | |||
1897 | addToPlacesAction->setEnabled(true); | 1897 | addToPlacesAction->setEnabled(true); | ||
1898 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add '%1' to Places", m_activeViewContainer->placesText())); | 1898 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places", m_activeViewContainer->placesText())); | ||
1899 | } else { | 1899 | } else { | ||
1900 | stateChanged(QStringLiteral("has_selection")); | 1900 | stateChanged(QStringLiteral("has_selection")); | ||
1901 | 1901 | | |||
1902 | QAction* renameAction = col->action(KStandardAction::name(KStandardAction::RenameFile)); | 1902 | QAction* renameAction = col->action(KStandardAction::name(KStandardAction::RenameFile)); | ||
1903 | QAction* moveToTrashAction = col->action(KStandardAction::name(KStandardAction::MoveToTrash)); | 1903 | QAction* moveToTrashAction = col->action(KStandardAction::name(KStandardAction::MoveToTrash)); | ||
1904 | QAction* deleteAction = col->action(KStandardAction::name(KStandardAction::DeleteFile)); | 1904 | QAction* deleteAction = col->action(KStandardAction::name(KStandardAction::DeleteFile)); | ||
1905 | QAction* cutAction = col->action(KStandardAction::name(KStandardAction::Cut)); | 1905 | QAction* cutAction = col->action(KStandardAction::name(KStandardAction::Cut)); | ||
1906 | QAction* deleteWithTrashShortcut = col->action(QStringLiteral("delete_shortcut")); // see DolphinViewActionHandler | 1906 | QAction* deleteWithTrashShortcut = col->action(QStringLiteral("delete_shortcut")); // see DolphinViewActionHandler | ||
1907 | QAction* showTarget = col->action(QStringLiteral("show_target")); | 1907 | QAction* showTarget = col->action(QStringLiteral("show_target")); | ||
1908 | 1908 | | |||
1909 | if (list.length() == 1 && list.first().isDir()) { | 1909 | if (list.length() == 1 && list.first().isDir()) { | ||
1910 | addToPlacesAction->setEnabled(true); | 1910 | addToPlacesAction->setEnabled(true); | ||
1911 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add '%1' to Places", list.first().name())); | 1911 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places")); | ||
1912 | } else { | 1912 | } else { | ||
1913 | addToPlacesAction->setEnabled(false); | 1913 | addToPlacesAction->setEnabled(false); | ||
1914 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places")); | | |||
1915 | } | 1914 | } | ||
1916 | 1915 | | |||
1917 | KFileItemListProperties capabilities(list); | 1916 | KFileItemListProperties capabilities(list); | ||
1918 | const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving(); | 1917 | const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving(); | ||
1919 | 1918 | | |||
1920 | renameAction->setEnabled(capabilities.supportsMoving()); | 1919 | renameAction->setEnabled(capabilities.supportsMoving()); | ||
1921 | moveToTrashAction->setEnabled(enableMoveToTrash); | 1920 | moveToTrashAction->setEnabled(enableMoveToTrash); | ||
1922 | deleteAction->setEnabled(capabilities.supportsDeleting()); | 1921 | deleteAction->setEnabled(capabilities.supportsDeleting()); | ||
▲ Show 20 Lines • Show All 432 Lines • Show Last 20 Lines |