aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/module.mk27
-rw-r--r--backends/networking/browser/openurl-android.cpp35
-rw-r--r--backends/networking/browser/openurl-default.cpp36
-rw-r--r--backends/networking/browser/openurl-osx.cpp49
-rw-r--r--backends/networking/browser/openurl-posix.cpp77
-rw-r--r--backends/networking/browser/openurl-windows.cpp42
-rw-r--r--backends/networking/browser/openurl.h41
-rw-r--r--backends/platform/android/android.cpp7
-rw-r--r--backends/platform/android/android.h1
-rw-r--r--backends/platform/sdl/macosx/macosx.cpp9
-rw-r--r--backends/platform/sdl/macosx/macosx.h2
-rw-r--r--backends/platform/sdl/posix/posix.cpp51
-rw-r--r--backends/platform/sdl/posix/posix.h4
-rw-r--r--backends/platform/sdl/win32/win32.cpp12
-rw-r--r--backends/platform/sdl/win32/win32.h2
-rw-r--r--common/system.h24
-rw-r--r--devtools/create_project/xcode.cpp10
-rw-r--r--engines/testbed/misc.cpp3
-rw-r--r--engines/testbed/webserver.cpp13
-rw-r--r--gui/storagewizarddialog.cpp3
20 files changed, 115 insertions, 333 deletions
diff --git a/backends/module.mk b/backends/module.mk
index c402a10a90..9ee61ea388 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -150,33 +150,6 @@ MODULE_OBJS += \
endif
endif
-# openUrl
-ifeq ($(BACKEND),android)
-MODULE_OBJS += \
- networking/browser/openurl-android.o
-else
-ifdef MACOSX
-MODULE_OBJS += \
- networking/browser/openurl-osx.o
-else
-ifdef WIN32
-MODULE_OBJS += \
- networking/browser/openurl-windows.o
-else
- ifdef POSIX
- MODULE_OBJS += \
- networking/browser/openurl-posix.o
- else
- # create_project doesn't know something about `else`
- ifndef WIN32
- MODULE_OBJS += \
- networking/browser/openurl-default.o
- endif
- endif
-endif
-endif
-endif
-
# Connection::isLimited
ifeq ($(BACKEND),android)
MODULE_OBJS += \
diff --git a/backends/networking/browser/openurl-android.cpp b/backends/networking/browser/openurl-android.cpp
deleted file mode 100644
index 64e683238b..0000000000
--- a/backends/networking/browser/openurl-android.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "backends/networking/browser/openurl.h"
-#include "backends/platform/android/jni.h"
-
-namespace Networking {
-namespace Browser {
-
-bool openUrl(const Common::String &url) {
- return JNI::openUrl(url.c_str());
-}
-
-} // End of namespace Browser
-} // End of namespace Networking
-
diff --git a/backends/networking/browser/openurl-default.cpp b/backends/networking/browser/openurl-default.cpp
deleted file mode 100644
index c430953196..0000000000
--- a/backends/networking/browser/openurl-default.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "backends/networking/browser/openurl.h"
-#include "common/textconsole.h"
-
-namespace Networking {
-namespace Browser {
-
-bool openUrl(const Common::String &url) {
- warning("Networking::Browser::openUrl(): not implemented");
- return false;
-}
-
-} // End of namespace Browser
-} // End of namespace Networking
-
diff --git a/backends/networking/browser/openurl-osx.cpp b/backends/networking/browser/openurl-osx.cpp
deleted file mode 100644
index 8d786d7fd2..0000000000
--- a/backends/networking/browser/openurl-osx.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-#include "backends/networking/browser/openurl.h"
-#include <CoreFoundation/CFBundle.h>
-#include <ApplicationServices/ApplicationServices.h>
-
-namespace Networking {
-namespace Browser {
-
-using namespace std;
-
-bool openUrl(const Common::String &url) {
- CFURLRef urlRef = CFURLCreateWithBytes (
- NULL,
- (UInt8*)url.c_str(),
- url.size(),
- kCFStringEncodingASCII,
- NULL
- );
- int result = LSOpenCFURLRef(urlRef, 0);
- CFRelease(urlRef);
- return result == 0;
-}
-
-} // End of namespace Browser
-} // End of namespace Networking
-
diff --git a/backends/networking/browser/openurl-posix.cpp b/backends/networking/browser/openurl-posix.cpp
deleted file mode 100644
index 429a379fcf..0000000000
--- a/backends/networking/browser/openurl-posix.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-#include "backends/networking/browser/openurl.h"
-#include "common/textconsole.h"
-#include <stdlib.h>
-
-namespace Networking {
-namespace Browser {
-
-namespace {
-bool launch(const Common::String client, const Common::String &url) {
- // FIXME: system's input must be heavily escaped
- // well, when url's specified by user
- // it's OK now (urls are hardcoded somewhere in GUI)
- Common::String cmd = client + " " + url;
- return (system(cmd.c_str()) != -1);
-}
-}
-
-bool openUrl(const Common::String &url) {
- // inspired by Qt's "qdesktopservices_x11.cpp"
-
- // try "standards"
- if (launch("xdg-open", url))
- return true;
- if (launch(getenv("DEFAULT_BROWSER"), url))
- return true;
- if (launch(getenv("BROWSER"), url))
- return true;
-
- // try desktop environment specific tools
- if (launch("gnome-open", url)) // gnome
- return true;
- if (launch("kfmclient openURL", url)) // kde
- return true;
- if (launch("exo-open", url)) // xfce
- return true;
-
- // try browser names
- if (launch("firefox", url))
- return true;
- if (launch("mozilla", url))
- return true;
- if (launch("netscape", url))
- return true;
- if (launch("opera", url))
- return true;
-
- warning("Networking::Browser::openUrl() (POSIX) failed to open URL");
- return false;
-}
-
-} // End of namespace Browser
-} // End of namespace Networking
-
diff --git a/backends/networking/browser/openurl-windows.cpp b/backends/networking/browser/openurl-windows.cpp
deleted file mode 100644
index b78c9fa7ed..0000000000
--- a/backends/networking/browser/openurl-windows.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "backends/networking/browser/openurl.h"
-#include "common/textconsole.h"
-#include <windows.h>
-#include <shellapi.h>
-
-namespace Networking {
-namespace Browser {
-
-bool openUrl(const Common::String &url) {
- const uint64 result = (uint64)ShellExecute(0, 0, /*(wchar_t*)nativeFilePath.utf16()*/url.c_str(), 0, 0, SW_SHOWNORMAL);
- // ShellExecute returns a value greater than 32 if successful
- if (result <= 32) {
- warning("ShellExecute failed: error = %u", result);
- return false;
- }
- return true;
-}
-
-} // End of namespace Browser
-} // End of namespace Networking
diff --git a/backends/networking/browser/openurl.h b/backends/networking/browser/openurl.h
deleted file mode 100644
index 15b4bf385b..0000000000
--- a/backends/networking/browser/openurl.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef NETWORKING_BROWSER_OPENURL_H
-#define NETWORKING_BROWSER_OPENURL_H
-
-#include "common/str.h"
-
-namespace Networking {
-namespace Browser {
-
-/**
- * Opens URL in default browser (if available on the target system).
- *
- * Returns true on success.
- */
-bool openUrl(const Common::String &url);
-
-} // End of namespace Browser
-} // End of namespace Networking
-
-#endif /*NETWORKING_BROWSER_OPENURL_H*/
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index 798772cc24..4e4417400c 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -401,7 +401,8 @@ bool OSystem_Android::hasFeature(Feature f) {
f == kFeatureAspectRatioCorrection ||
f == kFeatureCursorPalette ||
f == kFeatureVirtualKeyboard ||
- f == kFeatureOverlaySupportsAlpha);
+ f == kFeatureOverlaySupportsAlpha ||
+ f == kFeatureOpenUrl);
}
void OSystem_Android::setFeatureState(Feature f, bool enable) {
@@ -586,6 +587,10 @@ Common::String OSystem_Android::getSystemLanguage() const {
getSystemProperty("persist.sys.country").c_str());
}
+bool OSystem_Android::openUrl(const Common::String &url) {
+ return JNI::openUrl(url.c_str());
+}
+
Common::String OSystem_Android::getSystemProperty(const char *name) const {
char value[PROP_VALUE_MAX];
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index ade84dd42d..2935d96381 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -286,6 +286,7 @@ public:
virtual void logMessage(LogMessageType::Type type, const char *message);
virtual void addSysArchivesToSearchSet(Common::SearchSet &s,
int priority = 0);
+ virtual bool openUrl(const Common::String &url);
virtual Common::String getSystemLanguage() const;
};
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index c4e83dc9d3..212af6723e 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -107,7 +107,7 @@ void OSystem_MacOSX::addSysArchivesToSearchSet(Common::SearchSet &s, int priorit
}
bool OSystem_MacOSX::hasFeature(Feature f) {
- if (f == kFeatureDisplayLogFile || f == kFeatureClipboardSupport)
+ if (f == kFeatureDisplayLogFile || f == kFeatureClipboardSupport || f == kFeatureOpenUrl)
return true;
return OSystem_POSIX::hasFeature(f);
}
@@ -133,6 +133,13 @@ Common::String OSystem_MacOSX::getTextFromClipboard() {
return getTextFromClipboardMacOSX();
}
+bool OSystem_MacOSX::openUrl(const Common::String &url) {
+ CFURLRef urlRef = CFURLCreateWithBytes (NULL, (UInt8*)url.c_str(), url.size(), kCFStringEncodingASCII, NULL);
+ OSStatus err = LSOpenCFURLRef(urlRef, NULL);
+ CFRelease(urlRef);
+ return err != noErr;
+}
+
Common::String OSystem_MacOSX::getSystemLanguage() const {
#if defined(USE_DETECTLANG) && defined(USE_TRANSLATION)
CFArrayRef availableLocalizations = CFBundleCopyBundleLocalizations(CFBundleGetMainBundle());
diff --git a/backends/platform/sdl/macosx/macosx.h b/backends/platform/sdl/macosx/macosx.h
index 0c755cbf6d..929f2f91fa 100644
--- a/backends/platform/sdl/macosx/macosx.h
+++ b/backends/platform/sdl/macosx/macosx.h
@@ -35,6 +35,8 @@ public:
virtual bool hasTextInClipboard();
virtual Common::String getTextFromClipboard();
+
+ virtual bool openUrl(const Common::String &url);
virtual Common::String getSystemLanguage() const;
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index 0d5f39736a..b805a452cf 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -25,6 +25,7 @@
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h
#define FORBIDDEN_SYMBOL_EXCEPTION_time_h //On IRIX, sys/stat.h includes sys/time.h
+#define FORBIDDEN_SYMBOL_EXCEPTION_system
#include "common/scummsys.h"
@@ -40,6 +41,9 @@
#include "backends/audiocd/linux/linux-audiocd.h"
#endif
+#include "common/textconsole.h"
+
+#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -78,7 +82,7 @@ void OSystem_POSIX::initBackend() {
}
bool OSystem_POSIX::hasFeature(Feature f) {
- if (f == kFeatureDisplayLogFile)
+ if (f == kFeatureDisplayLogFile || f == kFeatureOpenUrl)
return true;
return OSystem_SDL::hasFeature(f);
}
@@ -261,6 +265,51 @@ bool OSystem_POSIX::displayLogFile() {
return WIFEXITED(status) && WEXITSTATUS(status) == 0;
}
+bool OSystem_POSIX::openUrl(const Common::String &url) {
+ // inspired by Qt's "qdesktopservices_x11.cpp"
+
+ // try "standards"
+ if (launchBrowser("xdg-open", url))
+ return true;
+ if (launchBrowser(getenv("DEFAULT_BROWSER"), url))
+ return true;
+ if (launchBrowser(getenv("BROWSER"), url))
+ return true;
+
+ // try desktop environment specific tools
+ if (launchBrowser("gnome-open", url)) // gnome
+ return true;
+ if (launchBrowser("kfmclient openURL", url)) // kde
+ return true;
+ if (launchBrowser("exo-open", url)) // xfce
+ return true;
+
+ // try browser names
+ if (launchBrowser("firefox", url))
+ return true;
+ if (launchBrowser("mozilla", url))
+ return true;
+ if (launchBrowser("netscape", url))
+ return true;
+ if (launchBrowser("opera", url))
+ return true;
+ if (launchBrowser("chromium-browser", url))
+ return true;
+ if (launchBrowser("google-chrome", url))
+ return true;
+
+ warning("openUrl() (POSIX) failed to open URL");
+ return false;
+}
+
+bool OSystem_POSIX::launchBrowser(const Common::String& client, const Common::String &url) {
+ // FIXME: system's input must be heavily escaped
+ // well, when url's specified by user
+ // it's OK now (urls are hardcoded somewhere in GUI)
+ Common::String cmd = client + " " + url;
+ return (system(cmd.c_str()) != -1);
+}
+
AudioCDManager *OSystem_POSIX::createAudioCDManager() {
#ifdef USE_LINUXCD
diff --git a/backends/platform/sdl/posix/posix.h b/backends/platform/sdl/posix/posix.h
index 050463c273..e5110ff632 100644
--- a/backends/platform/sdl/posix/posix.h
+++ b/backends/platform/sdl/posix/posix.h
@@ -35,6 +35,8 @@ public:
virtual bool displayLogFile();
+ virtual bool openUrl(const Common::String &url);
+
virtual void init();
virtual void initBackend();
@@ -63,6 +65,8 @@ protected:
virtual Common::WriteStream *createLogFile();
virtual AudioCDManager *createAudioCDManager();
+
+ bool launchBrowser(const Common::String& client, const Common::String &url);
};
#endif
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index fcc0849624..99c71a49e0 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -94,7 +94,7 @@ void OSystem_Win32::initBackend() {
bool OSystem_Win32::hasFeature(Feature f) {
- if (f == kFeatureDisplayLogFile)
+ if (f == kFeatureDisplayLogFile || f == kFeatureOpenUrl)
return true;
return OSystem_SDL::hasFeature(f);
@@ -135,6 +135,16 @@ bool OSystem_Win32::displayLogFile() {
return false;
}
+bool OSystem_Win32::openUrl(const Common::String &url) {
+ const uint64 result = (uint64)ShellExecute(0, 0, /*(wchar_t*)nativeFilePath.utf16()*/url.c_str(), 0, 0, SW_SHOWNORMAL);
+ // ShellExecute returns a value greater than 32 if successful
+ if (result <= 32) {
+ warning("ShellExecute failed: error = %u", result);
+ return false;
+ }
+ return true;
+}
+
Common::String OSystem_Win32::getDefaultConfigFileName() {
char configFile[MAXPATHLEN];
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index ca0843e834..636ebae88f 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -36,6 +36,8 @@ public:
virtual bool displayLogFile();
+ virtual bool openUrl(const Common::String &url);
+
protected:
/**
* The path of the currently open log file, if any.
diff --git a/common/system.h b/common/system.h
index 8a05a9664b..eb9a39bbdf 100644
--- a/common/system.h
+++ b/common/system.h
@@ -322,7 +322,15 @@ public:
*
* This feature has no associated state.
*/
- kFeatureClipboardSupport
+ kFeatureClipboardSupport,
+
+ /**
+ * The presence of this feature indicates whether the openUrl()
+ * call is supported.
+ *
+ * This feature has no associated state.
+ */
+ kFeatureOpenUrl
};
/**
@@ -1269,6 +1277,20 @@ public:
virtual Common::String getTextFromClipboard() { return ""; }
/**
+ * Open the given Url in the default browser (if available on the target
+ * system).
+ *
+ * @return true on success, false otherwise.
+ *
+ * @note It is up to the backend to ensure that the system is in a state
+ * that allows the user to actually see the web page. This might for
+ * example require leaving fullscreen mode.
+ *
+ * @parem url the URL to open
+ */
+ virtual bool openUrl(const Common::String &url) {return false; }
+
+ /**
* Returns the locale of the system.
*
* This returns the currently set up locale of the system, on which
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index 18dc74f799..21fc25643f 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -113,11 +113,6 @@ bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targe
splitFilename(fileName, name, ext);
if (targetIsIOS(targetName)) {
- // networking backend for iOS is openurl-default
- if (name == "openurl-posix" || name == "openurl-osx") {
- return true;
- }
-
// iOS target: we skip all files with the "_osx" suffix
if (name.length() > 4 && name.substr(name.length() - 4) == "_osx") {
return true;
@@ -156,11 +151,6 @@ bool shouldSkipFileForTarget(const std::string &fileID, const std::string &targe
if (directory.length() > iphone_directory.length() && directory.substr(directory.length() - iphone_directory.length()) == iphone_directory) {
return true;
}
-
- // networking backend for macOS is openurl-osx
- if (name == "openurl-default" || name == "openurl-posix") {
- return true;
- }
}
return false;
}
diff --git a/engines/testbed/misc.cpp b/engines/testbed/misc.cpp
index a463d9e4d0..bda0a361a7 100644
--- a/engines/testbed/misc.cpp
+++ b/engines/testbed/misc.cpp
@@ -22,7 +22,6 @@
#include "testbed/misc.h"
#include "common/timer.h"
-#include "backends/networking/browser/openurl.h"
namespace Testbed {
@@ -170,7 +169,7 @@ TestExitStatus MiscTests::testOpenUrl() {
return kTestSkipped;
}
- if (!Networking::Browser::openUrl("http://scummvm.org/")) {
+ if (!g_system->openUrl("http://scummvm.org/")) {
Testsuite::logPrintf("Info! openUrl() says it couldn't open the url (probably not supported on this platform)\n");
return kTestFailed;
}
diff --git a/engines/testbed/webserver.cpp b/engines/testbed/webserver.cpp
index b4c69b278d..d46cea5585 100644
--- a/engines/testbed/webserver.cpp
+++ b/engines/testbed/webserver.cpp
@@ -23,7 +23,6 @@
#include "testbed/webserver.h"
#include "backends/networking/sdl_net/localwebserver.h"
#include "common/config-manager.h"
-#include "backends/networking/browser/openurl.h"
namespace Testbed {
@@ -92,7 +91,7 @@ TestExitStatus WebserverTests::testIndexPage() {
return kTestSkipped;
}
- Networking::Browser::openUrl(LocalServer.getAddress());
+ g_system->openUrl(LocalServer.getAddress());
if (Testsuite::handleInteractiveInput(
Common::String::format("The %s page opens well?", LocalServer.getAddress().c_str()),
"Yes", "No", kOptionRight)) {
@@ -118,7 +117,7 @@ TestExitStatus WebserverTests::testFilesPageInvalidParameterValue() {
return kTestSkipped;
}
- Networking::Browser::openUrl(LocalServer.getAddress()+"files?path=error");
+ g_system->openUrl(LocalServer.getAddress()+"files?path=error");
if (Testsuite::handleInteractiveInput(
Common::String::format("The %sfiles?path=error page displays error message?", LocalServer.getAddress().c_str()),
"Yes", "No", kOptionRight)) {
@@ -144,7 +143,7 @@ TestExitStatus WebserverTests::testFilesPageCreateDirectory() {
return kTestSkipped;
}
- Networking::Browser::openUrl(LocalServer.getAddress() + "files?path=/root/");
+ g_system->openUrl(LocalServer.getAddress() + "files?path=/root/");
if (Testsuite::handleInteractiveInput(
Common::String::format("You could go to %sfiles page, navigate to some directory with write access and create a directory there?", LocalServer.getAddress().c_str()),
"Yes", "No", kOptionRight)) {
@@ -170,7 +169,7 @@ TestExitStatus WebserverTests::testFilesPageUploadFile() {
return kTestSkipped;
}
- Networking::Browser::openUrl(LocalServer.getAddress() + "files?path=/root/");
+ g_system->openUrl(LocalServer.getAddress() + "files?path=/root/");
if (Testsuite::handleInteractiveInput(
Common::String::format("You're able to upload a file in some directory with write access through %sfiles page?", LocalServer.getAddress().c_str()),
"Yes", "No", kOptionRight)) {
@@ -196,7 +195,7 @@ TestExitStatus WebserverTests::testFilesPageUploadDirectory() {
return kTestSkipped;
}
- Networking::Browser::openUrl(LocalServer.getAddress() + "files?path=/root/");
+ g_system->openUrl(LocalServer.getAddress() + "files?path=/root/");
if (Testsuite::handleInteractiveInput(
Common::String::format("You're able to upload a directory into some directory with write access through %sfiles page using Chrome?", LocalServer.getAddress().c_str()),
"Yes", "No", kOptionRight)) {
@@ -222,7 +221,7 @@ TestExitStatus WebserverTests::testFilesPageDownloadFile() {
return kTestSkipped;
}
- Networking::Browser::openUrl(LocalServer.getAddress() + "files?path=/root/");
+ g_system->openUrl(LocalServer.getAddress() + "files?path=/root/");
if (Testsuite::handleInteractiveInput(
Common::String::format("You're able to download a file through %sfiles page?", LocalServer.getAddress().c_str()),
"Yes", "No", kOptionRight)) {
diff --git a/gui/storagewizarddialog.cpp b/gui/storagewizarddialog.cpp
index 9d6ba38109..a207c7b9f5 100644
--- a/gui/storagewizarddialog.cpp
+++ b/gui/storagewizarddialog.cpp
@@ -30,7 +30,6 @@
#ifdef USE_SDL_NET
#include "backends/networking/sdl_net/localwebserver.h"
#endif
-#include "backends/networking/browser/openurl.h"
#include "common/translation.h"
namespace GUI {
@@ -206,7 +205,7 @@ void StorageWizardDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
break;
}
case kOpenUrlCmd: {
- if (!Networking::Browser::openUrl(getUrl())) {
+ if (!g_system->openUrl(getUrl())) {
MessageDialog alert(_("Failed to open URL!\nPlease navigate to this page manually."));
alert.runModal();
}