Commit b14f98de authored by Nate Graham's avatar Nate Graham Committed by Elvis Angelaccio
Browse files

Make it more obvious that you can connect to servers on remote:/ page

Right now it is not super obvious how you connect to a remote server
in Dolphin when you already know the URL. Users will go to the
"Network" item in the Places panel, but from there it is not totally
clear. The "Add Network Folder" icon in the view opens a complicated
wizard and it's also a bit of an odd UX to have it living in the view as
opposed to being a toolbar button.

Old hands and developers know that the URL navigator is, well, a URL
navigator, and as such, it accepts arbitrary URLs from any view.
However this may not be obvious to other more casual users, for
two reasons:
1. The URL navigator is in breadcrumbs view nearly all of the time and
   by default, so may users may not know that it can accept text at all
2. Even when it's displaying URLs, they are almost always local paths,
   so users may not make the connection that it can accept remote URLs
   rather that just local paths

To improve the discoverability of this feature, this commit makes the
following change:

When the view is displaying the remote:/ ioslave (i.e. the "Networks"
place), the URL navigator is put into URL entry mode and given some
placeholder text that hints at what it can do. It reverts to breadcrumbs
mode when you leave.

BUG: 414670
FIXED-IN: 21.04
parent 88d3f92d
Pipeline #45482 passed with stage
in 7 minutes and 2 seconds
......@@ -212,11 +212,24 @@ QWidget *DolphinNavigatorsWidgetAction::createNavigatorWidget(Side side) const
auto emptyTrashButton = newEmptyTrashButton(urlNavigator, navigatorWidget);
connect(urlNavigator, &KUrlNavigator::urlChanged, this, [this]() {
connect(urlNavigator, &KUrlNavigator::urlChanged, this, [urlNavigator, this]() {
// Update URL navigator to show a server URL entry placeholder text if we
// just loaded the remote:/ page, to make it easier for users to figure out
// that they can enter arbitrary remote URLs. See bug 414670
if (urlNavigator->locationUrl().scheme() == QLatin1String("remote")) {
if (!urlNavigator->isUrlEditable()) {
urlNavigator->setPlaceholderText(i18n("Enter server URL (e.g. smb://[ip address])"));
} else {
// We have to wait for DolphinUrlNavigator::sizeHint() to update which
// happens a little bit later than when urlChanged is emitted.
}, Qt::QueuedConnection);
auto trailingSpacing = new QWidget{navigatorWidget};
......@@ -101,6 +101,16 @@ void DolphinUrlNavigator::setVisualState(const VisualState& visualState)
void DolphinUrlNavigator::clearText() const
void DolphinUrlNavigator::setPlaceholderText(const QString &text)
void DolphinUrlNavigator::slotReturnPressed()
if (!GeneralSettings::editableUrl()) {
......@@ -66,6 +66,16 @@ public:
void setVisualState(const VisualState &visualState);
* Clears the text in the text field
void clearText() const;
* Displays placeholder text in the URL navigator
void setPlaceholderText(const QString &text);
public slots:
* Switches to "breadcrumb" mode if the editable mode is not set to be
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment