Changeset View
Changeset View
Standalone View
Standalone View
src/dolphinmainwindow.cpp
Show First 20 Lines • Show All 1311 Lines • ▼ Show 20 Line(s) | 1311 | newTab->setWhatsThis(xi18nc("@info:whatsthis", "This opens a new " | |||
---|---|---|---|---|---|
1312 | "<emphasis>Tab</emphasis> with the current location and view.<nl/>" | 1312 | "<emphasis>Tab</emphasis> with the current location and view.<nl/>" | ||
1313 | "A tab is an additional view within this window. " | 1313 | "A tab is an additional view within this window. " | ||
1314 | "You can drag and drop items between tabs.")); | 1314 | "You can drag and drop items between tabs.")); | ||
1315 | actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL + Qt::Key_T, Qt::CTRL + Qt::SHIFT + Qt::Key_N}); | 1315 | actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL + Qt::Key_T, Qt::CTRL + Qt::SHIFT + Qt::Key_N}); | ||
1316 | connect(newTab, &QAction::triggered, this, &DolphinMainWindow::openNewActivatedTab); | 1316 | connect(newTab, &QAction::triggered, this, &DolphinMainWindow::openNewActivatedTab); | ||
1317 | 1317 | | |||
1318 | QAction* addToPlaces = actionCollection()->addAction(QStringLiteral("add_to_places")); | 1318 | QAction* addToPlaces = actionCollection()->addAction(QStringLiteral("add_to_places")); | ||
1319 | addToPlaces->setIcon(QIcon::fromTheme(QStringLiteral("bookmark-new"))); | 1319 | addToPlaces->setIcon(QIcon::fromTheme(QStringLiteral("bookmark-new"))); | ||
1320 | addToPlaces->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places")); | ||||
1320 | addToPlaces->setWhatsThis(xi18nc("@info:whatsthis", "This adds the selected folder " | 1321 | addToPlaces->setWhatsThis(xi18nc("@info:whatsthis", "This adds the selected folder " | ||
1321 | "to the Places panel.")); | 1322 | "to the Places panel.")); | ||
1322 | connect(addToPlaces, &QAction::triggered, this, &DolphinMainWindow::addToPlaces); | 1323 | connect(addToPlaces, &QAction::triggered, this, &DolphinMainWindow::addToPlaces); | ||
1323 | 1324 | | |||
1324 | QAction* closeTab = KStandardAction::close(m_tabWidget, QOverload<>::of(&DolphinTabWidget::closeTab), actionCollection()); | 1325 | QAction* closeTab = KStandardAction::close(m_tabWidget, QOverload<>::of(&DolphinTabWidget::closeTab), actionCollection()); | ||
1325 | closeTab->setText(i18nc("@action:inmenu File", "Close Tab")); | 1326 | closeTab->setText(i18nc("@action:inmenu File", "Close Tab")); | ||
1326 | closeTab->setWhatsThis(i18nc("@info:whatsthis", "This closes the " | 1327 | closeTab->setWhatsThis(i18nc("@info:whatsthis", "This closes the " | ||
1327 | "currently viewed tab. If no more tabs are left this window " | 1328 | "currently viewed tab. If no more tabs are left this window " | ||
▲ Show 20 Lines • Show All 562 Lines • ▼ Show 20 Line(s) | 1890 | { | |||
1890 | const KFileItemList list = m_activeViewContainer->view()->selectedItems(); | 1891 | const KFileItemList list = m_activeViewContainer->view()->selectedItems(); | ||
1891 | const KActionCollection* col = actionCollection(); | 1892 | const KActionCollection* col = actionCollection(); | ||
1892 | QAction* addToPlacesAction = col->action(QStringLiteral("add_to_places")); | 1893 | QAction* addToPlacesAction = col->action(QStringLiteral("add_to_places")); | ||
1893 | 1894 | | |||
1894 | if (list.isEmpty()) { | 1895 | if (list.isEmpty()) { | ||
1895 | stateChanged(QStringLiteral("has_no_selection")); | 1896 | stateChanged(QStringLiteral("has_no_selection")); | ||
1896 | 1897 | | |||
1897 | addToPlacesAction->setEnabled(true); | 1898 | addToPlacesAction->setEnabled(true); | ||
1898 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add '%1' 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())); | | |||
1912 | } else { | 1911 | } else { | ||
1913 | addToPlacesAction->setEnabled(false); | 1912 | addToPlacesAction->setEnabled(false); | ||
1914 | addToPlacesAction->setText(i18nc("@action:inmenu Add current folder to places", "Add to Places")); | | |||
1915 | } | 1913 | } | ||
1916 | 1914 | | |||
1917 | KFileItemListProperties capabilities(list); | 1915 | KFileItemListProperties capabilities(list); | ||
1918 | const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving(); | 1916 | const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving(); | ||
1919 | 1917 | | |||
1920 | renameAction->setEnabled(capabilities.supportsMoving()); | 1918 | renameAction->setEnabled(capabilities.supportsMoving()); | ||
1921 | moveToTrashAction->setEnabled(enableMoveToTrash); | 1919 | moveToTrashAction->setEnabled(enableMoveToTrash); | ||
1922 | deleteAction->setEnabled(capabilities.supportsDeleting()); | 1920 | deleteAction->setEnabled(capabilities.supportsDeleting()); | ||
▲ Show 20 Lines • Show All 432 Lines • Show Last 20 Lines |