From a7838db28e24e9618a39954524f055dc3335f7a9 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 8 Nov 2008 16:22:30 +0000 Subject: * implement the DragAndDropHelper as singleton derived from QObject, so that emitting of signals is possible * show an information message in the statusbar, if items are dragged into the same directory TODO: although the signal seems to get connected correctly, the slot DolphinMainWindow::showInformationMessage() is not invoked when the signal is emitted -> will debug this later, it is important that the new string is added before the message freeze svn path=/trunk/KDE/kdebase/apps/; revision=881627 --- src/dolphinmainwindow.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 0dc2ecb57..3f0b215cc 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -43,6 +43,7 @@ #include "dolphin_generalsettings.h" #include "dolphin_iconsmodesettings.h" +#include "draganddrophelper.h" #include #include @@ -82,8 +83,6 @@ #include #include -#include - DolphinMainWindow::DolphinMainWindow(int id) : KXmlGuiWindow(0), m_newMenu(0), @@ -115,7 +114,9 @@ DolphinMainWindow::DolphinMainWindow(int id) : connect(undoManager, SIGNAL(jobRecordingFinished(CommandType)), this, SLOT(showCommand(CommandType))); connect(DolphinSettings::instance().placesModel(), SIGNAL(errorMessage(const QString&)), - this, SLOT(slotHandlePlacesError(const QString&))); + this, SLOT(showErrorMessage(const QString&))); + connect(&DragAndDropHelper::instance(), SIGNAL(informationMessage(const QString&)), + this, SLOT(showInformationMessage(const QString&))); } DolphinMainWindow::~DolphinMainWindow() @@ -441,7 +442,7 @@ void DolphinMainWindow::quit() close(); } -void DolphinMainWindow::slotHandlePlacesError(const QString &message) +void DolphinMainWindow::showErrorMessage(const QString& message) { if (!message.isEmpty()) { DolphinStatusBar* statusBar = m_activeViewContainer->statusBar(); @@ -449,6 +450,14 @@ void DolphinMainWindow::slotHandlePlacesError(const QString &message) } } +void DolphinMainWindow::showInformationMessage(const QString& message) +{ + if (!message.isEmpty()) { + DolphinStatusBar* statusBar = m_activeViewContainer->statusBar(); + statusBar->setMessage(message, DolphinStatusBar::Information); + } +} + void DolphinMainWindow::slotUndoAvailable(bool available) { QAction* undoAction = actionCollection()->action(KStandardAction::name(KStandardAction::Undo)); -- cgit v1.3