this, SLOT(showCommand(CommandType)));
connect(DolphinSettings::instance().placesModel(), SIGNAL(errorMessage(const QString&)),
this, SLOT(showErrorMessage(const QString&)));
- connect(&DragAndDropHelper::instance(), SIGNAL(informationMessage(const QString&)),
- this, SLOT(showInformationMessage(const QString&)));
+ connect(&DragAndDropHelper::instance(), SIGNAL(errorMessage(const QString&)),
+ this, SLOT(showErrorMessage(const QString&)));
}
DolphinMainWindow::~DolphinMainWindow()
}
}
-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));
/** Shows the error message in the status bar of the active view. */
void showErrorMessage(const QString& message);
- /** Shows the information message in the status bar of the active view. */
- void showInformationMessage(const QString& message);
-
/**
* Updates the state of the 'Undo' menu action dependent
* from the parameter \a available.
QDBusConnection::sessionBus().call(message);
} else {
const KUrl::List urls = KUrl::List::fromMimeData(event->mimeData());
- const KUrl sourceDir = KUrl(urls.first().directory());
- if (sourceDir == destination) {
+ const KUrl source = urls.first();
+ const KUrl sourceDir = KUrl(source.directory());
+
+ if ((urls.count() == 1) && (source == destination)) {
+ emit errorMessage(i18nc("@info:status", "A folder cannot dropped on to itself"));
+ } else if (sourceDir == destination) {
const QString msg = i18ncp("@info:status",
- "The dropped item is already inside the folder %2",
- "The dropped items are already inside the folder %2",
- urls.count(), destination.fileName());
- emit informationMessage(msg);
+ "The dropped item <filename>%2</filename> is already inside the folder <filename>%3</filename>",
+ "The dropped items are already inside the folder <filename>%3</filename>",
+ urls.count(), source.fileName(), destination.fileName());
+ emit errorMessage(msg);
} else if (dropToItem) {
KonqOperations::doDrop(destItem, destination, event, widget);
} else {
QDropEvent* event,
QWidget* widget);
signals:
- void informationMessage(const QString& msg);
+ void errorMessage(const QString& msg);
private:
DragAndDropHelper();