diff options
| author | Peter Penz <[email protected]> | 2008-11-08 16:22:30 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-11-08 16:22:30 +0000 |
| commit | a7838db28e24e9618a39954524f055dc3335f7a9 (patch) | |
| tree | c4c653405a259e87ac34163efd0d51db07ba242d /src/dolphinmainwindow.cpp | |
| parent | d5bc6cfa74e21668788d42721dcdb4818a072366 (diff) | |
* 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
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
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 <kaction.h> #include <kactioncollection.h> @@ -82,8 +83,6 @@ #include <QSplitter> #include <QDockWidget> -#include <kdebug.h> - 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)); |
