mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-26 15:53:35 +01:00
Handle an empty path in the game browser.
This commit is contained in:
1 parent
4aef413c13
commit
dbd3d8ca2a
2 files changed
+12
-2
No files matched your search
@@ -144,11 +144,14 @@ void PathBrowser::HandlePath() {
|
||||
|
||||
std::unique_lock<std::mutex> guard(pendingLock_);
|
||||
std::vector<File::FileInfo> 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();
|
||||
|
||||
+5
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user