CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/UI/MemStickScreen.h
Views: 1401
// Copyright (c) 2013- PPSSPP Project.12// This program is free software: you can redistribute it and/or modify3// it under the terms of the GNU General Public License as published by4// the Free Software Foundation, version 2.0 or later versions.56// This program is distributed in the hope that it will be useful,7// but WITHOUT ANY WARRANTY; without even the implied warranty of8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9// GNU General Public License 2.0 for more details.1011// A copy of the GPL 2.0 should have been included with the program.12// If not, see http://www.gnu.org/licenses/1314// Official git repository and contact information can be found at15// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.1617#pragma once1819#include <functional>20#include <string>21#include <atomic>2223#include "ppsspp_config.h"2425#include "Common/File/Path.h"26#include "Common/UI/UIScreen.h"27#include "Common/Thread/Promise.h"2829#include "Core/Util/MemStick.h"3031#include "UI/MiscScreens.h"3233class NoticeView;3435// MemStickScreen - let's you configure your memory stick directory.36// Currently only useful for Android.37class MemStickScreen : public UIDialogScreenWithBackground {38public:39MemStickScreen(bool initialSetup);40~MemStickScreen() {}4142const char *tag() const override { return "MemStick"; }4344enum Choice {45CHOICE_BROWSE_FOLDER,46CHOICE_PRIVATE_DIRECTORY,47CHOICE_STORAGE_ROOT,48CHOICE_SET_MANUAL,49};5051protected:52void CreateViews() override;5354void dialogFinished(const Screen *dialog, DialogResult result) override;55void update() override;56ScreenRenderFlags render(ScreenRenderMode mode) override {57// Simple anti-flicker due to delayed finish.58if (!done_) {59// render as usual.60return UIDialogScreenWithBackground::render(mode);61} else {62// no render. black frame insertion is better than flicker.63}64return ScreenRenderFlags::NONE;65}6667private:68// Event handlers69UI::EventReturn OnHelp(UI::EventParams &e);7071// Confirm button sub handlers72UI::EventReturn Browse(UI::EventParams &e);73UI::EventReturn UseInternalStorage(UI::EventParams ¶ms);74UI::EventReturn UseStorageRoot(UI::EventParams ¶ms);75UI::EventReturn SetFolderManually(UI::EventParams ¶ms);7677// Button handlers.78UI::EventReturn OnConfirmClick(UI::EventParams ¶ms);79UI::EventReturn OnChoiceClick(UI::EventParams ¶ms);8081SettingInfoMessage *settingInfo_ = nullptr;82NoticeView *errorNoticeView_ = nullptr;8384bool initialSetup_;85bool storageBrowserWorking_;86bool done_ = false;8788#if PPSSPP_PLATFORM(UWP) && !defined(__LIBRETRO__)89int choice_ = CHOICE_PRIVATE_DIRECTORY;90#else91int choice_ = 0;92#endif93};9495class ConfirmMemstickMoveScreen : public UIDialogScreenWithBackground {96public:97ConfirmMemstickMoveScreen(Path newMemstickFolder, bool initialSetup);98~ConfirmMemstickMoveScreen();99100const char *tag() const override { return "ConfirmMemstickMove"; }101102protected:103void update() override;104void CreateViews() override;105106private:107UI::EventReturn OnMoveDataClick(UI::EventParams ¶ms);108void FinishFolderMove();109110UI::EventReturn OnConfirm(UI::EventParams ¶ms);111112Path newMemstickFolder_;113bool existingFilesInNewFolder_;114#if PPSSPP_PLATFORM(UWP) && !defined(__LIBRETRO__)115bool moveData_ = false;116#else117bool moveData_ = true;118#endif119bool initialSetup_;120121MoveProgressReporter progressReporter_;122UI::TextView *progressView_ = nullptr;123124Promise<MoveResult *> *moveDataTask_ = nullptr;125126std::string error_;127};128129130