┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinmainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dolphinmainwindow.cpp')
-rw-r--r--src/dolphinmainwindow.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index c1d6cef39..160c423ec 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -26,6 +26,7 @@
#include <config-nepomuk.h>
#include "dolphinapplication.h"
+#include "dolphinfileplacesview.h"
#include "dolphinnewmenu.h"
#include "dolphinsettings.h"
#include "dolphinsettingsdialog.h"
@@ -36,11 +37,8 @@
#include "mainwindowadaptor.h"
#include "terminalsidebarpage.h"
#include "treeviewsidebarpage.h"
-#include "kurlnavigator.h"
#include "viewpropertiesdialog.h"
#include "viewproperties.h"
-#include "kfileplacesmodel.h"
-#include "kfileplacesview.h"
#include "dolphin_generalsettings.h"
#include "dolphin_iconsmodesettings.h"
@@ -51,6 +49,7 @@
#include <kdesktopfile.h>
#include <kdeversion.h>
#include <kfiledialog.h>
+#include <kfileplacesmodel.h>
#include <kglobal.h>
#include <kicon.h>
#include <kiconloader.h>
@@ -60,6 +59,7 @@
#include <kmenu.h>
#include <kmenubar.h>
#include <kmessagebox.h>
+#include <kurlnavigator.h>
#include <konqmimedata.h>
#include <kpropertiesdialog.h>
#include <kprotocolinfo.h>
@@ -224,6 +224,13 @@ void DolphinMainWindow::slotSortingChanged(DolphinView::Sorting sorting)
}
}
+void DolphinMainWindow::slotEditableStateChanged(bool editable)
+{
+ KToggleAction* editableLocationAction =
+ static_cast<KToggleAction*>(actionCollection()->action("editable_location"));
+ editableLocationAction->setChecked(editable);
+}
+
void DolphinMainWindow::slotSelectionChanged(const KFileItemList& selection)
{
updateEditActions();
@@ -368,7 +375,7 @@ void DolphinMainWindow::slotHandlePlacesError(const QString &message)
void DolphinMainWindow::slotUndoAvailable(bool available)
{
- QAction* undoAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Undo));
+ QAction* undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo));
if (undoAction != 0) {
undoAction->setEnabled(available);
}
@@ -412,7 +419,7 @@ void DolphinMainWindow::slotUndoAvailable(bool available)
void DolphinMainWindow::slotUndoTextChanged(const QString& text)
{
- QAction* undoAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Undo));
+ QAction* undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo));
if (undoAction != 0) {
undoAction->setText(text);
}
@@ -441,7 +448,7 @@ void DolphinMainWindow::paste()
void DolphinMainWindow::updatePasteAction()
{
- QAction* pasteAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Paste));
+ QAction* pasteAction = actionCollection()->action(KStandardAction::name(KStandardAction::Paste));
if (pasteAction == 0) {
return;
}
@@ -815,8 +822,8 @@ void DolphinMainWindow::setupActions()
SLOT(undo()),
actionCollection());
- //Need to remove shift+del from cut action, else the shortcut for deletejob
- //doesn't work
+ // need to remove shift+del from cut action, else the shortcut for deletejob
+ // doesn't work
KAction* cut = KStandardAction::cut(this, SLOT(cut()), actionCollection());
KShortcut cutShortcut = cut->shortcut();
cutShortcut.remove(Qt::SHIFT + Qt::Key_Delete, KShortcut::KeepEmpty);
@@ -932,9 +939,7 @@ void DolphinMainWindow::setupActions()
stop->setIcon(KIcon("process-stop"));
connect(stop, SIGNAL(triggered()), this, SLOT(stopLoading()));
- // TODO: the URL navigator must emit a signal if the editable state has been
- // changed, so that the corresponding showFullLocation action is updated. Also
- // the naming "Show full Location" is currently confusing...
+ // TODO: the naming "Show full Location" is currently confusing...
KToggleAction* showFullLocation = actionCollection()->add<KToggleAction>("editable_location");
showFullLocation->setText(i18nc("@action:inmenu Navigation Bar", "Show Full Location"));
showFullLocation->setShortcut(Qt::CTRL | Qt::Key_L);
@@ -1051,7 +1056,8 @@ void DolphinMainWindow::setupDockWidgets()
QDockWidget* placesDock = new QDockWidget(i18nc("@title:window", "Places"));
placesDock->setObjectName("placesDock");
placesDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
- KFilePlacesView* placesView = new KFilePlacesView(placesDock);
+
+ DolphinFilePlacesView* placesView = new DolphinFilePlacesView(placesDock);
placesDock->setWidget(placesView);
placesView->setModel(DolphinSettings::instance().placesModel());
placesView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -1139,7 +1145,7 @@ void DolphinMainWindow::updateViewActions()
void DolphinMainWindow::updateGoActions()
{
- QAction* goUpAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Up));
+ QAction* goUpAction = actionCollection()->action(KStandardAction::name(KStandardAction::Up));
const KUrl& currentUrl = m_activeViewContainer->url();
goUpAction->setEnabled(currentUrl.upUrl() != currentUrl);
}
@@ -1174,6 +1180,8 @@ void DolphinMainWindow::connectViewSignals(int viewIndex)
this, SLOT(changeUrl(const KUrl&)));
connect(navigator, SIGNAL(historyChanged()),
this, SLOT(slotHistoryChanged()));
+ connect(navigator, SIGNAL(editableStateChanged(bool)),
+ this, SLOT(slotEditableStateChanged(bool)));
}
void DolphinMainWindow::updateSplitAction()