#include <KIcon>
#include <KIconLoader>
#include <KIO/NetAccess>
+#include <KIO/JobUiDelegate>
#include <KInputDialog>
#include <KLocale>
#include <KProtocolManager>
DolphinStatusBar* statusBar = m_activeViewContainer->statusBar();
switch (command) {
case KIO::FileUndoManager::Copy:
- statusBar->setMessage(i18nc("@info:status", "Successfully copied."),
- DolphinStatusBar::OperationCompleted);
+ statusBar->setText(i18nc("@info:status", "Successfully copied."));
break;
case KIO::FileUndoManager::Move:
- statusBar->setMessage(i18nc("@info:status", "Successfully moved."),
- DolphinStatusBar::OperationCompleted);
+ statusBar->setText(i18nc("@info:status", "Successfully moved."));
break;
case KIO::FileUndoManager::Link:
- statusBar->setMessage(i18nc("@info:status", "Successfully linked."),
- DolphinStatusBar::OperationCompleted);
+ statusBar->setText(i18nc("@info:status", "Successfully linked."));
break;
case KIO::FileUndoManager::Trash:
- statusBar->setMessage(i18nc("@info:status", "Successfully moved to trash."),
- DolphinStatusBar::OperationCompleted);
+ statusBar->setText(i18nc("@info:status", "Successfully moved to trash."));
break;
case KIO::FileUndoManager::Rename:
- statusBar->setMessage(i18nc("@info:status", "Successfully renamed."),
- DolphinStatusBar::OperationCompleted);
+ statusBar->setText(i18nc("@info:status", "Successfully renamed."));
break;
case KIO::FileUndoManager::Mkdir:
- statusBar->setMessage(i18nc("@info:status", "Created folder."),
- DolphinStatusBar::OperationCompleted);
+ statusBar->setText(i18nc("@info:status", "Created folder."));
break;
default:
}
}
+void DolphinMainWindow::openNewActivatedTab(const KUrl& url)
+{
+ openNewTab(url);
+ m_tabBar->setCurrentIndex(m_viewTab.count() - 1);
+}
+
void DolphinMainWindow::activateNextTab()
{
if (m_viewTab.count() >= 2) {
void DolphinMainWindow::showErrorMessage(const QString& message)
{
- if (!message.isEmpty()) {
- DolphinStatusBar* statusBar = m_activeViewContainer->statusBar();
- statusBar->setMessage(message, DolphinStatusBar::Error);
- }
+ m_activeViewContainer->showMessage(message, DolphinViewContainer::Error);
}
void DolphinMainWindow::slotUndoAvailable(bool available)
m_tabIndex = m_tabBar->currentIndex();
}
-void DolphinMainWindow::handlePlacesClick(const KUrl& url, Qt::MouseButtons buttons)
-{
- if (buttons & Qt::MidButton) {
- openNewTab(url);
- m_tabBar->setCurrentIndex(m_viewTab.count() - 1);
- } else {
- changeUrl(url);
- }
-}
-
void DolphinMainWindow::slotTestCanDecode(const QDragMoveEvent* event, bool& canDecode)
{
canDecode = KUrl::List::canDecode(event->mimeData());
} else if (KProtocolManager::supportsListing(url)) {
// stat the URL to see if it is a dir or not
m_lastHandleUrlStatJob = KIO::stat(url, KIO::HideProgressInfo);
+ if (m_lastHandleUrlStatJob->ui()) {
+ m_lastHandleUrlStatJob->ui()->setWindow(this);
+ }
connect(m_lastHandleUrlStatJob, SIGNAL(result(KJob*)),
this, SLOT(slotHandleUrlStatFinished(KJob*)));
} else {
- new KRun(url, this);
+ new KRun(url, this); // Automatically deletes itself after being finished
}
}
if (entry.isDir()) {
activeViewContainer()->setUrl(url);
} else {
- new KRun(url, this);
+ new KRun(url, this); // Automatically deletes itself after being finished
}
}
const ViewTab& viewTab = m_viewTab[tab];
const DolphinView* view = viewTab.isPrimaryViewActive ? viewTab.primaryView->view()
: viewTab.secondaryView->view();
- DragAndDropHelper::dropUrls(view->rootItem(), view->url(), event);
+ const QString error = DragAndDropHelper::dropUrls(view->rootItem(), view->url(), event);
+ if (!error.isEmpty()) {
+ activeViewContainer()->showMessage(error, DolphinViewContainer::Error);
+ }
}
}
addDockWidget(Qt::LeftDockWidgetArea, foldersDock);
connect(this, SIGNAL(urlChanged(KUrl)),
foldersPanel, SLOT(setUrl(KUrl)));
- connect(foldersPanel, SIGNAL(changeUrl(KUrl,Qt::MouseButtons)),
- this, SLOT(handlePlacesClick(KUrl,Qt::MouseButtons)));
+ connect(foldersPanel, SIGNAL(folderActivated(KUrl)),
+ this, SLOT(changeUrl(KUrl)));
+ connect(foldersPanel, SIGNAL(folderMiddleClicked(KUrl)),
+ this, SLOT(openNewActivatedTab(KUrl)));
// Setup "Terminal"
#ifndef Q_OS_WIN
QList<QAction*> placesActions;
placesActions.append(separator);
placesActions.append(lockLayoutAction);
- placesPanel->addActions(placesActions);
- placesPanel->setModel(DolphinPlacesModel::instance());
- placesPanel->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ //placesPanel->addActions(placesActions);
+ //placesPanel->setModel(DolphinPlacesModel::instance());
+ //placesPanel->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
placesDock->setWidget(placesPanel);
QAction* placesAction = placesDock->toggleViewAction();
createPanelAction(KIcon("bookmarks"), Qt::Key_F9, placesAction, "show_places_panel");
addDockWidget(Qt::LeftDockWidgetArea, placesDock);
- connect(placesPanel, SIGNAL(urlChanged(KUrl,Qt::MouseButtons)),
- this, SLOT(handlePlacesClick(KUrl,Qt::MouseButtons)));
+ connect(placesPanel, SIGNAL(placeActivated(KUrl)),
+ this, SLOT(changeUrl(KUrl)));
+ connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)),
+ this, SLOT(openNewActivatedTab(KUrl)));
connect(this, SIGNAL(urlChanged(KUrl)),
placesPanel, SLOT(setUrl(KUrl)));
connect(placesDock, SIGNAL(visibilityChanged(bool)),
void DolphinMainWindow::clearStatusBar()
{
- m_activeViewContainer->statusBar()->clear();
+ m_activeViewContainer->statusBar()->resetToDefaultText();
}
void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
this, SLOT(openNewTab(KUrl)));
connect(view, SIGNAL(requestContextMenu(QPoint,KFileItem,KUrl,QList<QAction*>)),
this, SLOT(openContextMenu(QPoint,KFileItem,KUrl,QList<QAction*>)));
- connect(view, SIGNAL(startedPathLoading(KUrl)),
+ connect(view, SIGNAL(directoryLoadingStarted()),
this, SLOT(enableStopAction()));
- connect(view, SIGNAL(finishedPathLoading(KUrl)),
+ connect(view, SIGNAL(directoryLoadingCompleted()),
this, SLOT(disableStopAction()));
connect(view, SIGNAL(goBackRequested()),
this, SLOT(goBack()));
{
DolphinMainWindow* mainWin= qobject_cast<DolphinMainWindow *>(parentWidget());
if (mainWin) {
- DolphinStatusBar* statusBar = mainWin->activeViewContainer()->statusBar();
- statusBar->setMessage(job->errorString(), DolphinStatusBar::Error);
+ DolphinViewContainer* container = mainWin->activeViewContainer();
+ container->showMessage(job->errorString(), DolphinViewContainer::Error);
} else {
KIO::FileUndoManager::UiInterface::jobError(job);
}