┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2013-12-29 09:50:17 +0100
committerFrank Reininghaus <[email protected]>2013-12-29 09:50:17 +0100
commit4ddc3cfdde7a52f5880928f7cc8ee8896ded686d (patch)
tree0fa9c1633e00ec713b463ebc3c4828a44c0dc193
parent9866e4826e7a9e7bc80a0fe6142662da52f75e84 (diff)
parent280fa647f15faf8fdd415328d7ff1fd15c621fc9 (diff)
Merge remote-tracking branch 'origin/KDE/4.12'
-rw-r--r--src/views/dolphinviewactionhandler.cpp8
-rw-r--r--src/views/dolphinviewactionhandler.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp
index 9a9718c33..051174f6d 100644
--- a/src/views/dolphinviewactionhandler.cpp
+++ b/src/views/dolphinviewactionhandler.cpp
@@ -84,6 +84,8 @@ void DolphinViewActionHandler::setCurrentView(DolphinView* view)
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()
@@ -99,6 +101,7 @@ void DolphinViewActionHandler::createActions()
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
@@ -482,6 +485,11 @@ void DolphinViewActionHandler::slotHiddenFilesShownChanged(bool shown)
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");
diff --git a/src/views/dolphinviewactionhandler.h b/src/views/dolphinviewactionhandler.h
index edbe41b90..e80ffc0df 100644
--- a/src/views/dolphinviewactionhandler.h
+++ b/src/views/dolphinviewactionhandler.h
@@ -197,6 +197,11 @@ private Q_SLOTS:
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.
*/