diff --git a/Common/File/PathBrowser.cpp b/Common/File/PathBrowser.cpp index ab85e2422b..756f0f74b3 100644 --- a/Common/File/PathBrowser.cpp +++ b/Common/File/PathBrowser.cpp @@ -144,11 +144,14 @@ void PathBrowser::HandlePath() { std::unique_lock guard(pendingLock_); std::vector results; - Path lastPath; + Path lastPath("NONSENSE THAT WONT EQUAL A PATH"); while (!pendingStop_) { while (lastPath == pendingPath_ && !pendingCancel_) { pendingCond_.wait(guard); } + if (pendingStop_) { + break; + } lastPath = pendingPath_; bool success = false; if (lastPath.Type() == PathType::HTTP) { @@ -156,6 +159,9 @@ void PathBrowser::HandlePath() { results.clear(); success = LoadRemoteFileList(lastPath, &pendingCancel_, results); guard.lock(); + } else if (lastPath.empty()) { + results.clear(); + success = true; } else { guard.unlock(); results.clear(); diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index bc07677ac5..4009dc7c42 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -816,7 +816,7 @@ void GameBrowser::Refresh() { } // Show a button to toggle pinning at the very end. - if (browseFlags_ & BrowseFlags::PIN) { + if ((browseFlags_ & BrowseFlags::PIN) && !path_.GetPath().empty()) { std::string caption = IsCurrentPathPinned() ? "-" : "+"; if (!*gridStyle_) { caption = IsCurrentPathPinned() ? mm->T("UnpinPath", "Unpin") : mm->T("PinPath", "Pin"); @@ -825,6 +825,10 @@ void GameBrowser::Refresh() { OnClick.Handle(this, &GameBrowser::PinToggleClick); } + if (path_.GetPath().empty()) { + Add(new TextView(mm->T("UseBrowseOrLoad", "Use Browse to choose a folder, or Load to choose a file."))); + } + if (!lastText_.empty() && gameButtons.empty()) { Add(new Spacer()); Add(new Choice(lastText_, new UI::LinearLayoutParams(UI::WRAP_CONTENT, UI::WRAP_CONTENT)))->OnClick.Handle(this, &GameBrowser::LastClick);