+ // prevent the switching if it would leave the user without a visible UrlNavigator
+ if (locationInToolbar && !toolBar()->actions().contains(urlNavigatorWidgetAction)) {
+ QAction *configureToolbars = actionCollection()->action(KStandardAction::name(KStandardAction::ConfigureToolbars));
+ KMessageWidget *messageWidget = m_activeViewContainer->showMessage(
+ xi18nc("@info 2 is the visible text on a button just below the message",
+ "The location could not be moved onto the toolbar because there is currently "
+ "no \"%1\" item on the toolbar. Select <interface>%2</interface> and add the "
+ "\"%1\" item. Then this will work.", urlNavigatorWidgetAction->iconText(),
+ configureToolbars->iconText()), DolphinViewContainer::Information);
+ messageWidget->addAction(configureToolbars);
+ messageWidget->addAction(locationInToolbarAction);
+ locationInToolbarAction->setChecked(false);
+ return;
+ }
+