this, SLOT(slotSortRoleChanged(QByteArray)));
connect(view, SIGNAL(zoomLevelChanged(int,int)),
this, SLOT(slotZoomLevelChanged(int,int)));
+ connect(view, SIGNAL(writeStateChanged(bool)),
+ this, SLOT(slotWriteStateChanged(bool)));
}
DolphinView* DolphinViewActionHandler::currentView()
newDirAction->setText(i18nc("@action", "Create Folder..."));
newDirAction->setShortcut(Qt::Key_F10);
newDirAction->setIcon(KIcon("folder-new"));
+ newDirAction->setEnabled(false); // Will be enabled in slotWriteStateChanged(bool) if the current URL is writable
connect(newDirAction, SIGNAL(triggered()), this, SIGNAL(createDirectory()));
// File menu
showHiddenFilesAction->setChecked(shown);
}
+void DolphinViewActionHandler::slotWriteStateChanged(bool isFolderWritable)
+{
+ m_actionCollection->action("create_dir")->setEnabled(isFolderWritable);
+}
+
KToggleAction* DolphinViewActionHandler::iconsModeAction()
{
KToggleAction* iconsView = m_actionCollection->add<KToggleAction>("icons");
*/
void slotHiddenFilesShownChanged(bool shown);
+ /**
+ * Updates the state of the 'Create Folder...' action.
+ */
+ void slotWriteStateChanged(bool isFolderWritable);
+
/**
* Opens the view properties dialog, which allows to modify the properties
* of the currently active view.