m_newFileMenu->setViewShowsHiddenFiles(activeViewContainer()->view()->hiddenFilesShown());
m_newFileMenu->checkUpToDate();
m_newFileMenu->setPopupFiles(activeViewContainer()->url());
+
+ // If we're in the trash, also disable all the 'create new' items
+ // TODO: remove this once https://phabricator.kde.org/T8234 is implemented
+ slotWriteStateChanged(m_activeViewContainer->view()->url().scheme() != QLatin1String("trash"));
}
void DolphinMainWindow::createDirectory()
void DolphinMainWindow::slotWriteStateChanged(bool isFolderWritable)
{
- newFileMenu()->setEnabled(isFolderWritable);
+ const auto actions = m_newFileMenu->menu()->actions();
+ for (auto menuItem : actions) {
+ menuItem->setEnabled(isFolderWritable);
+ }
}
void DolphinMainWindow::openContextMenu(const QPoint& pos,
menu->addSeparator();
}
- added = addActionToMenu(ac->action(QStringLiteral("view_mode")), menu) |
- addActionToMenu(ac->action(QStringLiteral("sort")), menu) |
+ added = addActionToMenu(ac->action(QStringLiteral("sort")), menu) |
+ addActionToMenu(ac->action(QStringLiteral("view_mode")), menu) |
addActionToMenu(ac->action(QStringLiteral("additional_info")), menu) |
addActionToMenu(ac->action(QStringLiteral("show_preview")), menu) |
addActionToMenu(ac->action(QStringLiteral("show_in_groups")), menu) |
QAction* newTab = actionCollection()->addAction(QStringLiteral("new_tab"));
newTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-new")));
newTab->setText(i18nc("@action:inmenu File", "New Tab"));
- actionCollection()->setDefaultShortcuts(newTab, {Qt::CTRL + Qt::Key_T, QKeySequence::AddTab});
+ actionCollection()->setDefaultShortcuts(newTab, {QKeySequence::AddTab});
connect(newTab, &QAction::triggered, this, static_cast<void(DolphinMainWindow::*)()>(&DolphinMainWindow::openNewActivatedTab));
QAction* closeTab = KStandardAction::close(