mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Folder/file browser tweaks
This commit is contained in:
parent
dd6a04a525
commit
1ff7710854
@ -168,24 +168,26 @@ void PathBrowser::HandlePath() {
|
||||
break;
|
||||
}
|
||||
lastPath = pendingPath_;
|
||||
bool success = false;
|
||||
if (lastPath.Type() == PathType::HTTP) {
|
||||
guard.unlock();
|
||||
results.clear();
|
||||
success = LoadRemoteFileList(lastPath, userAgent_, &pendingCancel_, results);
|
||||
success_ = LoadRemoteFileList(lastPath, userAgent_, &pendingCancel_, results);
|
||||
guard.lock();
|
||||
} else if (lastPath.empty()) {
|
||||
results.clear();
|
||||
success = true;
|
||||
success_ = true;
|
||||
} else {
|
||||
guard.unlock();
|
||||
results.clear();
|
||||
success = File::GetFilesInDir(lastPath, &results, nullptr);
|
||||
success_ = File::GetFilesInDir(lastPath, &results, nullptr);
|
||||
if (!success_) {
|
||||
WARN_LOG(IO, "PathBrowser: Failed to list directory: %s", lastPath.c_str());
|
||||
}
|
||||
guard.lock();
|
||||
}
|
||||
|
||||
if (pendingPath_ == lastPath) {
|
||||
if (success && !pendingCancel_) {
|
||||
if (success_ && !pendingCancel_) {
|
||||
pendingFiles_ = results;
|
||||
}
|
||||
pendingPath_.clear();
|
||||
|
@ -47,6 +47,9 @@ public:
|
||||
bool empty() const {
|
||||
return path_.empty();
|
||||
}
|
||||
bool Success() const {
|
||||
return success_;
|
||||
}
|
||||
|
||||
private:
|
||||
void HandlePath();
|
||||
@ -67,5 +70,6 @@ private:
|
||||
bool pendingCancel_ = false;
|
||||
bool pendingStop_ = false;
|
||||
bool ready_ = false;
|
||||
bool success_ = true;
|
||||
};
|
||||
|
||||
|
@ -773,7 +773,11 @@ void GameBrowser::Refresh() {
|
||||
if (System_GetPropertyBool(SYSPROP_HAS_ADDITIONAL_STORAGE)) {
|
||||
topBar->Add(new Choice(ImageID("I_SDCARD"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Handle(this, &GameBrowser::StorageClick);
|
||||
}
|
||||
#if PPSSPP_PLATFORM(IOS) || PPSSPP_PLATFORM(MAC)
|
||||
#if PPSSPP_PLATFORM(IOS_APP_STORE)
|
||||
// Don't show a browse button, not meaningful to browse outside the documents folder it seems,
|
||||
// as we can't list things like document folders of another app, as far as I can tell.
|
||||
// However, we do show a Load.. button for picking individual files, that seems to work.
|
||||
#elif PPSSPP_PLATFORM(IOS) || PPSSPP_PLATFORM(MAC)
|
||||
// on Darwin, we don't show the 'Browse' text alongside the image
|
||||
// we show just the image, because we don't need to emphasize the button on Darwin
|
||||
topBar->Add(new Choice(ImageID("I_FOLDER_OPEN"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Handle(this, &GameBrowser::BrowseClick);
|
||||
@ -849,6 +853,8 @@ void GameBrowser::Refresh() {
|
||||
|
||||
listingPending_ = !path_.IsListingReady();
|
||||
|
||||
// TODO: If listing failed, show a special error message.
|
||||
|
||||
std::vector<Path> filenames;
|
||||
if (HasSpecialFiles(filenames)) {
|
||||
for (size_t i = 0; i < filenames.size(); i++) {
|
||||
|
@ -339,6 +339,10 @@ float System_GetPropertyFloat(SystemProperty prop) {
|
||||
|
||||
bool System_GetPropertyBool(SystemProperty prop) {
|
||||
switch (prop) {
|
||||
case SYSPROP_HAS_FILE_BROWSER:
|
||||
return true;
|
||||
case SYSPROP_HAS_FOLDER_BROWSER:
|
||||
return true;
|
||||
case SYSPROP_HAS_OPEN_DIRECTORY:
|
||||
return false;
|
||||
case SYSPROP_HAS_BACK_BUTTON:
|
||||
|
Loading…
Reference in New Issue
Block a user