Skip to content

Commit

Permalink
RemoteISO screens: Make them dialogs so ESC works to exit them on PC.
Browse files Browse the repository at this point in the history
Also fix the background on the main one, and in savedata manager.

See #16605
  • Loading branch information
hrydgard committed Jan 1, 2023
1 parent 9f85323 commit 360de9a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
4 changes: 3 additions & 1 deletion UI/DevScreens.h
Expand Up @@ -106,8 +106,10 @@ class LogLevelScreen : public ListPopupScreen {
void OnCompleted(DialogResult result) override;
};

class SystemInfoScreen : public UIDialogScreenWithBackground {
class SystemInfoScreen : public UIDialogScreenWithGameBackground {
public:
SystemInfoScreen(const Path &filename) : UIDialogScreenWithGameBackground(filename) {}

const char *tag() const override { return "SystemInfo"; }

void CreateViews() override;
Expand Down
6 changes: 3 additions & 3 deletions UI/GameSettingsScreen.cpp
Expand Up @@ -1635,7 +1635,7 @@ UI::EventReturn GameSettingsScreen::OnDeveloperTools(UI::EventParams &e) {
}

UI::EventReturn GameSettingsScreen::OnRemoteISO(UI::EventParams &e) {
screenManager()->push(new RemoteISOScreen());
screenManager()->push(new RemoteISOScreen(gamePath_));
return UI::EVENT_DONE;
}

Expand Down Expand Up @@ -1667,13 +1667,13 @@ UI::EventReturn GameSettingsScreen::OnTiltCustomize(UI::EventParams &e) {
};

UI::EventReturn GameSettingsScreen::OnSavedataManager(UI::EventParams &e) {
auto saveData = new SavedataScreen(Path());
auto saveData = new SavedataScreen(gamePath_);
screenManager()->push(saveData);
return UI::EVENT_DONE;
}

UI::EventReturn GameSettingsScreen::OnSysInfo(UI::EventParams &e) {
screenManager()->push(new SystemInfoScreen());
screenManager()->push(new SystemInfoScreen(gamePath_));
return UI::EVENT_DONE;
}

Expand Down
7 changes: 3 additions & 4 deletions UI/RemoteISOScreen.cpp
Expand Up @@ -263,11 +263,10 @@ static bool LoadGameList(const Path &url, std::vector<Path> &games) {
return !games.empty();
}

RemoteISOScreen::RemoteISOScreen() {
}
RemoteISOScreen::RemoteISOScreen(const Path &filename) : UIDialogScreenWithGameBackground(filename) {}

void RemoteISOScreen::update() {
UIScreenWithBackground::update();
UIDialogScreenWithBackground::update();

if (!WebServerStopped(WebServerFlags::DISCS)) {
auto result = IsServerAllowed(g_Config.iRemoteISOPort);
Expand Down Expand Up @@ -414,7 +413,7 @@ void RemoteISOConnectScreen::CreateViews() {
void RemoteISOConnectScreen::update() {
auto ri = GetI18NCategory("RemoteISO");

UIScreenWithBackground::update();
UIDialogScreenWithBackground::update();

ScanStatus s = GetStatus();
switch (s) {
Expand Down
10 changes: 5 additions & 5 deletions UI/RemoteISOScreen.h
Expand Up @@ -25,9 +25,9 @@
#include "UI/MiscScreens.h"
#include "UI/MainScreen.h"

class RemoteISOScreen : public UIScreenWithBackground {
class RemoteISOScreen : public UIDialogScreenWithGameBackground {
public:
RemoteISOScreen();
RemoteISOScreen(const Path &filename);

const char *tag() const override { return "RemoteISO"; }

Expand All @@ -54,7 +54,7 @@ enum class ScanStatus {
LOADED,
};

class RemoteISOConnectScreen : public UIScreenWithBackground {
class RemoteISOConnectScreen : public UIDialogScreenWithBackground {
public:
RemoteISOConnectScreen();
~RemoteISOConnectScreen();
Expand All @@ -70,15 +70,15 @@ class RemoteISOConnectScreen : public UIScreenWithBackground {
void ExecuteLoad();
bool FindServer(std::string &resultHost, int &resultPort);

UI::TextView *statusView_;
UI::TextView *statusView_ = nullptr;

ScanStatus status_ = ScanStatus::SCANNING;
std::string statusMessage_;
double nextRetry_ = 0.0;
std::thread *scanThread_;
std::mutex statusLock_;
std::string host_;
int port_;
int port_ = -1;
std::string url_;
std::vector<Path> games_;
};
Expand Down

0 comments on commit 360de9a

Please sign in to comment.