From c2c2ba908ff916e0ba680596bb1b565069255a67 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Thu, 16 Jun 2016 21:04:10 +0600 Subject: GUI: Hide StorageWizardDialog fields if server present --- backends/networking/sdl_net/localwebserver.cpp | 1 + gui/storagewizarddialog.cpp | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/backends/networking/sdl_net/localwebserver.cpp b/backends/networking/sdl_net/localwebserver.cpp index 21ffe6786b..d6033d1db1 100644 --- a/backends/networking/sdl_net/localwebserver.cpp +++ b/backends/networking/sdl_net/localwebserver.cpp @@ -69,6 +69,7 @@ void LocalWebserver::stopTimer() { } void LocalWebserver::start() { + _stopOnIdle = false; if (_timerStarted) return; startTimer(); diff --git a/gui/storagewizarddialog.cpp b/gui/storagewizarddialog.cpp index c2759f2ae6..88826c2fb8 100644 --- a/gui/storagewizarddialog.cpp +++ b/gui/storagewizarddialog.cpp @@ -53,11 +53,14 @@ StorageWizardDialog::StorageWizardDialog(uint32 storageId): case Cloud::kStorageOneDriveId: url += "od"; break; case Cloud::kStorageGoogleDriveId: url += "gd"; break; } +#ifdef USE_SDL_NET + url += "s"; +#endif new StaticTextWidget(this, "GlobalOptions_Cloud_ConnectionWizard.URLLine", url); - new StaticTextWidget(this, "GlobalOptions_Cloud_ConnectionWizard.ReturnLine1", _s("Obtain the code from the storage, enter it")); - new StaticTextWidget(this, "GlobalOptions_Cloud_ConnectionWizard.ReturnLine2", _s("in the following field and press 'Connect':")); + StaticTextWidget *returnLine1 = new StaticTextWidget(this, "GlobalOptions_Cloud_ConnectionWizard.ReturnLine1", _s("Obtain the code from the storage, enter it")); + StaticTextWidget *returnLine2 = new StaticTextWidget(this, "GlobalOptions_Cloud_ConnectionWizard.ReturnLine2", _s("in the following field and press 'Connect':")); for (uint32 i = 0; i < CODE_FIELDS; ++i) _codeWidget[i] = new EditTextWidget(this, "GlobalOptions_Cloud_ConnectionWizard.CodeBox" + Common::String::format("%d", i+1), "", 0, kCodeBoxCmd); _messageWidget = new StaticTextWidget(this, "GlobalOptions_Cloud_ConnectionWizard.MessageLine", ""); @@ -65,6 +68,16 @@ StorageWizardDialog::StorageWizardDialog(uint32 storageId): // Buttons new ButtonWidget(this, "GlobalOptions_Cloud_ConnectionWizard.CancelButton", _("Cancel"), 0, kCloseCmd); _connectWidget = new ButtonWidget(this, "GlobalOptions_Cloud_ConnectionWizard.ConnectButton", _("Connect"), 0, kConnectCmd); + +#ifdef USE_SDL_NET + // hide fields and even the button if local webserver is on + returnLine1->setLabel(_s("You would be navigated to ScummVM's page")); + returnLine2->setLabel(_s("when you'd allow it to use your storage.")); + for (uint32 i = 0; i < CODE_FIELDS; ++i) + _codeWidget[i]->setVisible(false); + _messageWidget->setVisible(false); + _connectWidget->setVisible(false); +#endif } void StorageWizardDialog::open() { -- cgit v1.2.3