#include <kdeversion.h>
#include <kdualaction.h>
#include <KFileDialog>
-#include <KFilePlacesModel>
#include <KGlobal>
#include <KLineEdit>
#include <KToolBar>
#include <KUrlComboBox>
#include <KToolInvocation>
-#include "views/dolphinplacesmodel.h"
-
#include <QDesktopWidget>
#include <QDBusMessage>
#include <QKeyEvent>
m_updateToolBarTimer(0),
m_lastHandleUrlStatJob(0)
{
- DolphinPlacesModel::setModel(new KFilePlacesModel(this));
- connect(DolphinPlacesModel::instance(), SIGNAL(errorMessage(QString)),
- this, SLOT(showErrorMessage(QString)));
-
// Workaround for a X11-issue in combination with KModifierInfo
// (see DolphinContextMenu::initializeModifierKeyInfo() for
// more information):
}
}
+void DolphinMainWindow::slotTerminalDirectoryChanged(const KUrl& url)
+{
+ m_activeViewContainer->setAutoGrabFocus(false);
+ changeUrl(url);
+ m_activeViewContainer->setAutoGrabFocus(true);
+}
+
void DolphinMainWindow::slotEditableStateChanged(bool editable)
{
KToggleAction* editableLocationAction =
void DolphinMainWindow::openNewMainWindow()
{
- KRun::run("dolphin", KUrl::List(), this);
+ KRun::run("dolphin %u", KUrl::List(), this);
}
void DolphinMainWindow::openNewTab()
}
if (!newWindowUrl.isEmpty()) {
- KRun::run("dolphin", KUrl::List() << newWindowUrl, this);
+ KRun::run("dolphin %u", KUrl::List() << newWindowUrl, this);
}
}
switch (command) {
case DolphinContextMenu::OpenParentFolderInNewWindow: {
- KRun::run("dolphin", KUrl::List() << item.url().upUrl(), this);
+ KRun::run("dolphin %u", KUrl::List() << item.url().upUrl(), this);
break;
}
m_updateToolBarTimer->start();
}
+void DolphinMainWindow::slotPanelErrorMessage(const QString& error)
+{
+ activeViewContainer()->showMessage(error, DolphinViewContainer::Error);
+}
+
void DolphinMainWindow::setActiveViewContainer(DolphinViewContainer* viewContainer)
{
Q_ASSERT(viewContainer);
KToggleAction* editableLocation = actionCollection()->add<KToggleAction>("editable_location");
editableLocation->setText(i18nc("@action:inmenu Navigation Bar", "Editable Location"));
- editableLocation->setShortcut(Qt::CTRL | Qt::Key_L);
+ editableLocation->setShortcut(Qt::Key_F6);
connect(editableLocation, SIGNAL(triggered()), this, SLOT(toggleEditLocation()));
KAction* replaceLocation = actionCollection()->addAction("replace_location");
replaceLocation->setText(i18nc("@action:inmenu Navigation Bar", "Replace Location"));
- replaceLocation->setShortcut(Qt::Key_F6);
+ replaceLocation->setShortcut(Qt::CTRL | Qt::Key_L);
connect(replaceLocation, SIGNAL(triggered()), this, SLOT(replaceLocation()));
// setup 'Go' menu
this, SLOT(changeUrl(KUrl)));
connect(foldersPanel, SIGNAL(folderMiddleClicked(KUrl)),
this, SLOT(openNewActivatedTab(KUrl)));
+ connect(foldersPanel, SIGNAL(errorMessage(QString)),
+ this, SLOT(slotPanelErrorMessage(QString)));
// Setup "Terminal"
#ifndef Q_OS_WIN
terminalDock->setWidget(terminalPanel);
connect(terminalPanel, SIGNAL(hideTerminalPanel()), terminalDock, SLOT(hide()));
+ connect(terminalPanel, SIGNAL(changeUrl(KUrl)), this, SLOT(slotTerminalDirectoryChanged(KUrl)));
connect(terminalDock, SIGNAL(visibilityChanged(bool)),
terminalPanel, SLOT(dockVisibilityChanged()));
placesDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
PlacesPanel* placesPanel = new PlacesPanel(placesDock);
- QAction* separator = new QAction(placesPanel);
- separator->setSeparator(true);
- QList<QAction*> placesActions;
- placesActions.append(separator);
- placesActions.append(lockLayoutAction);
- //placesPanel->addActions(placesActions);
- //placesPanel->setModel(DolphinPlacesModel::instance());
- //placesPanel->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ placesPanel->setCustomContextMenuActions(QList<QAction*>() << lockLayoutAction);
placesDock->setWidget(placesPanel);
QAction* placesAction = placesDock->toggleViewAction();
this, SLOT(changeUrl(KUrl)));
connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)),
this, SLOT(openNewActivatedTab(KUrl)));
+ connect(placesPanel, SIGNAL(errorMessage(QString)),
+ this, SLOT(slotPanelErrorMessage(QString)));
connect(this, SIGNAL(urlChanged(KUrl)),
placesPanel, SLOT(setUrl(KUrl)));
connect(placesDock, SIGNAL(visibilityChanged(bool)),