diff --git a/src/CMakeData-os.cmake b/src/CMakeData-os.cmake index abe3752af1..c94c1bb2aa 100644 --- a/src/CMakeData-os.cmake +++ b/src/CMakeData-os.cmake @@ -51,7 +51,6 @@ else() "archutils/Win32/DirectXHelpers.cpp" "archutils/Win32/ErrorStrings.cpp" "archutils/Win32/GetFileInformation.cpp" - "archutils/Win32/GotoURL.cpp" "archutils/Win32/GraphicsWindow.cpp" "archutils/Win32/MessageWindow.cpp" "archutils/Win32/RegistryAccess.cpp" @@ -76,7 +75,6 @@ else() "archutils/Win32/DirectXHelpers.h" "archutils/Win32/ErrorStrings.h" "archutils/Win32/GetFileInformation.h" - "archutils/Win32/GotoURL.h" "archutils/Win32/GraphicsWindow.h" "archutils/Win32/MessageWindow.h" "archutils/Win32/RegistryAccess.h" diff --git a/src/GameCommand.cpp b/src/GameCommand.cpp index be2f77cf52..25b12abc81 100644 --- a/src/GameCommand.cpp +++ b/src/GameCommand.cpp @@ -832,16 +832,6 @@ void GameCommand::ApplySelf( const std::vector &vpns ) const if( !m_sProfileID.empty() ) for (PlayerNumber const &pn : vpns) ProfileManager::m_sDefaultLocalProfileID[pn].Set( m_sProfileID ); - if( !m_sUrl.empty() ) - { - if( HOOKS->GoToURL( m_sUrl ) ) - { - if( m_bUrlExits ) - SCREENMAN->SetNewScreen( "ScreenExit" ); - } - else - ScreenPrompt::Prompt( SM_None, COULD_NOT_LAUNCH_BROWSER ); - } /* If we're going to stop music, do so before preparing new screens, so we * don't stop music between preparing screens and loading screens. */ diff --git a/src/ScreenInstallOverlay.cpp b/src/ScreenInstallOverlay.cpp index 2b04d39105..6c4043e0a9 100644 --- a/src/ScreenInstallOverlay.cpp +++ b/src/ScreenInstallOverlay.cpp @@ -157,14 +157,6 @@ void ScreenInstallOverlay::Init() bool ScreenInstallOverlay::Input( const InputEventPlus &input ) { - /* - if( input.DeviceI.button == g_buttonLogin && input.type == IET_FIRST_PRESS ) - { - HOOKS->GoToURL("http://www.stepmania.com/launch.php"); - return true; - } - */ - return Screen::Input(input); } diff --git a/src/arch/ArchHooks/ArchHooks.cpp b/src/arch/ArchHooks/ArchHooks.cpp index a47f6125d4..130793f27b 100644 --- a/src/arch/ArchHooks/ArchHooks.cpp +++ b/src/arch/ArchHooks/ArchHooks.cpp @@ -51,11 +51,6 @@ bool ArchHooks::AppFocusChanged() return bFocusChanged; } -bool ArchHooks::GoToURL( RString sUrl ) -{ - return false; -} - ArchHooks *ArchHooks::Create() { return new ARCH_HOOKS; diff --git a/src/arch/ArchHooks/ArchHooks.h b/src/arch/ArchHooks/ArchHooks.h index b378444cbd..3bb8326895 100644 --- a/src/arch/ArchHooks/ArchHooks.h +++ b/src/arch/ArchHooks/ArchHooks.h @@ -114,11 +114,6 @@ public: */ bool AppFocusChanged(); - /* - * Open a URL in the default web browser - */ - virtual bool GoToURL( RString sUrl ); - virtual float GetDisplayAspectRatio() = 0; /** @brief Fetch the contents of the system clipboard. */ diff --git a/src/arch/ArchHooks/ArchHooks_MacOSX.h b/src/arch/ArchHooks/ArchHooks_MacOSX.h index 5440b4d66e..36bca05aea 100644 --- a/src/arch/ArchHooks/ArchHooks_MacOSX.h +++ b/src/arch/ArchHooks/ArchHooks_MacOSX.h @@ -10,7 +10,6 @@ public: RString GetArchName() const; void DumpDebugInfo(); RString GetPreferredLanguage(); - bool GoToURL( RString sUrl ); float GetDisplayAspectRatio(); }; diff --git a/src/arch/ArchHooks/ArchHooks_MacOSX.mm b/src/arch/ArchHooks/ArchHooks_MacOSX.mm index 7c19aa7edf..8804079246 100644 --- a/src/arch/ArchHooks/ArchHooks_MacOSX.mm +++ b/src/arch/ArchHooks/ArchHooks_MacOSX.mm @@ -248,16 +248,6 @@ RString ArchHooks::GetPreferredLanguage() return ret; } -bool ArchHooks_MacOSX::GoToURL( RString sUrl ) -{ - CFURLRef url = CFURLCreateWithBytes( kCFAllocatorDefault, (const UInt8*)sUrl.data(), - sUrl.length(), kCFStringEncodingUTF8, nil); - OSStatus result = LSOpenCFURLRef( url, nil); - - CFRelease( url ); - return result == 0; -} - int64_t ArchHooks::GetSystemTimeInMicroseconds() { // http://developer.apple.com/qa/qa2004/qa1398.html diff --git a/src/arch/ArchHooks/ArchHooks_Unix.cpp b/src/arch/ArchHooks/ArchHooks_Unix.cpp index feb4b5d484..9700a85d90 100644 --- a/src/arch/ArchHooks/ArchHooks_Unix.cpp +++ b/src/arch/ArchHooks/ArchHooks_Unix.cpp @@ -226,31 +226,6 @@ void ArchHooks_Unix::Init() #endif } -bool ArchHooks_Unix::GoToURL( RString sUrl ) -{ - int status; - pid_t p = fork(); - if ( p == -1 ) - { - // Call to fork failed - return false; - } - else if ( p == 0 ) - { - // Child - const char * const argv[] = { "xdg-open", sUrl.c_str(), nullptr }; - execv( "/usr/bin/xdg-open", const_cast( argv )); - // If we reach here, the call to execvp failed - exit( 1 ); - } - else - { - // Parent - waitpid( p, &status, 0 ); - return WEXITSTATUS( status ) == 0; - } -} - #ifndef _CS_GNU_LIBC_VERSION #define _CS_GNU_LIBC_VERSION 2 #endif diff --git a/src/arch/ArchHooks/ArchHooks_Unix.h b/src/arch/ArchHooks/ArchHooks_Unix.h index 29d9b0f6ec..39e099e54a 100644 --- a/src/arch/ArchHooks/ArchHooks_Unix.h +++ b/src/arch/ArchHooks/ArchHooks_Unix.h @@ -18,8 +18,6 @@ public: void MountInitialFilesystems( const RString &sDirOfExecutable ); float GetDisplayAspectRatio() { return 4.0f/3; } - bool GoToURL( RString sUrl ); - static clockid_t GetClock(); RString GetClipboard(); diff --git a/src/arch/ArchHooks/ArchHooks_Win32.cpp b/src/arch/ArchHooks/ArchHooks_Win32.cpp index 2c26eabb8c..02f16f442e 100644 --- a/src/arch/ArchHooks/ArchHooks_Win32.cpp +++ b/src/arch/ArchHooks/ArchHooks_Win32.cpp @@ -9,7 +9,6 @@ #include "archutils/win32/DebugInfoHunt.h" #include "archutils/win32/ErrorStrings.h" #include "archutils/win32/RestartProgram.h" -#include "archutils/win32/GotoURL.h" #include "archutils/Win32/RegistryAccess.h" #include "VersionHelpers.h" @@ -171,11 +170,6 @@ void ArchHooks_Win32::SetupConcurrentRenderingThread() SetThreadPriority( GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL ); } -bool ArchHooks_Win32::GoToURL( RString sUrl ) -{ - return ::GotoURL( sUrl ); -} - float ArchHooks_Win32::GetDisplayAspectRatio() { DEVMODE dm; diff --git a/src/arch/ArchHooks/ArchHooks_Win32.h b/src/arch/ArchHooks/ArchHooks_Win32.h index 3afa17f315..17fc408fd6 100644 --- a/src/arch/ArchHooks/ArchHooks_Win32.h +++ b/src/arch/ArchHooks/ArchHooks_Win32.h @@ -20,7 +20,6 @@ public: void UnBoostPriority(); void SetupConcurrentRenderingThread(); - bool GoToURL( RString sUrl ); virtual float GetDisplayAspectRatio(); RString GetClipboard(); }; diff --git a/src/arch/Dialog/DialogDriver_Win32.cpp b/src/arch/Dialog/DialogDriver_Win32.cpp index 5ab4f885fc..c4913fbe1f 100644 --- a/src/arch/Dialog/DialogDriver_Win32.cpp +++ b/src/arch/Dialog/DialogDriver_Win32.cpp @@ -9,7 +9,6 @@ #include "archutils/win32/AppInstance.h" #include "archutils/win32/ErrorStrings.h" -#include "archutils/win32/GotoURL.h" #include "archutils/win32/RestartProgram.h" #include "archutils/Win32/SpecialDirs.h" #if !defined(SMPACKAGE) @@ -179,7 +178,7 @@ static INT_PTR CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM } break; case IDC_BUTTON_REPORT: - GotoURL( REPORT_BUG_URL ); + // safe to remove this button? break; case IDC_BUTTON_RESTART: Win32RestartProgram(); diff --git a/src/archutils/Darwin/Crash.mm b/src/archutils/Darwin/Crash.mm index 6ddf09df61..e00d718176 100644 --- a/src/archutils/Darwin/Crash.mm +++ b/src/archutils/Darwin/Crash.mm @@ -54,11 +54,9 @@ void CrashHandler::InformUserOfCrash( const RString& sPath ) switch( response ) { case kCFUserNotificationDefaultResponse: - HOOKS->GoToURL( REPORT_BUG_URL ); // Fall through. case kCFUserNotificationOtherResponse: - // Open the file with the default application (probably TextEdit). - HOOKS->GoToURL( "file://" + sPath ); + // Open the file with the default application (probably TextEdit). [unimplemented] break; } CFRelease( sBody ); diff --git a/src/archutils/Win32/CrashHandlerChild.cpp b/src/archutils/Win32/CrashHandlerChild.cpp index 3dffc421ee..e7a6832d3a 100644 --- a/src/archutils/Win32/CrashHandlerChild.cpp +++ b/src/archutils/Win32/CrashHandlerChild.cpp @@ -6,7 +6,6 @@ #include "archutils/Win32/WindowsResources.h" #include "archutils/Win32/DialogUtil.h" #include "archutils/Win32/ErrorStrings.h" -#include "archutils/Win32/GotoURL.h" #include "archutils/Win32/RestartProgram.h" #include "archutils/Win32/CrashHandlerNetworking.h" #include "archutils/Win32/WindowsDialogBox.h" @@ -766,35 +765,10 @@ INT_PTR CrashDialog::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ) EndDialog( hDlg, FALSE ); break; case IDC_BUTTON_REPORT: - GotoURL( REPORT_BUG_URL ); + // safe to remove button? break; case IDC_BUTTON_AUTO_REPORT: - if( !m_sUpdateURL.empty() ) - { - /* We already sent the report, were told that there's an update, - * and substituted the URL. */ - GotoURL( m_sUpdateURL ); - break; - } - - ShowWindow( GetDlgItem(hDlg, IDC_BUTTON_AUTO_REPORT), false ); - ShowWindow( GetDlgItem(hDlg, IDC_PROGRESS), true ); - SetWindowText( GetDlgItem(hDlg, IDC_MAIN_TEXT), REPORTING_THE_PROBLEM.GetValue() ); - SetWindowText( GetDlgItem(hDlg, IDC_BUTTON_CLOSE), CANCEL.GetValue() ); - SendDlgItemMessage( hDlg, IDC_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM(0,100) ); - SendDlgItemMessage( hDlg, IDC_PROGRESS, PBM_SETPOS, 0, 0 ); - - // Create the form data to send. - m_pPost = new NetworkPostData; - m_pPost->SetData( "Product", PRODUCT_ID ); - m_pPost->SetData( "Version", product_version ); - m_pPost->SetData( "Arch", HOOKS->GetArchName().c_str() ); - m_pPost->SetData( "Report", m_sCrashReport ); - m_pPost->SetData( "Reason", m_CrashData.m_CrashInfo.m_CrashReason ); - - m_pPost->Start( CRASH_REPORT_HOST, CRASH_REPORT_PORT, CRASH_REPORT_PATH ); - - SetTimer( hDlg, 0, 100, nullptr ); + // same here break; } break; diff --git a/src/archutils/Win32/GotoURL.cpp b/src/archutils/Win32/GotoURL.cpp deleted file mode 100644 index b5e4955a28..0000000000 --- a/src/archutils/Win32/GotoURL.cpp +++ /dev/null @@ -1,127 +0,0 @@ -#include "global.h" -#include "GotoURL.h" - -#include - -#include -#include -#include -#include -#include -#include - -static std::wstring ConvertToWString(const std::string& str) -{ - int size_needed = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.size(), nullptr, 0); - std::wstring wstrTo(size_needed, 0); - MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.size(), &wstrTo[0], size_needed); - return wstrTo; -} - -static LONG GetRegKey(HKEY key, const std::wstring& subkey, std::wstring& retdata) -{ - HKEY hKey; - LONG iRet = RegOpenKeyExW(key, subkey.c_str(), 0, KEY_QUERY_VALUE, &hKey); - - if (iRet != ERROR_SUCCESS) - { - return iRet; - } - - DWORD iDataSize = 0; - iRet = RegQueryValueExW(hKey, L"emulation", nullptr, nullptr, nullptr, &iDataSize); - if (iRet != ERROR_SUCCESS) - { - RegCloseKey(hKey); - return iRet; - } - - std::vector data(iDataSize / sizeof(wchar_t)); - iRet = RegQueryValueExW(hKey, L"emulation", nullptr, nullptr, reinterpret_cast(data.data()), &iDataSize); - if (iRet == ERROR_SUCCESS) - { - retdata.assign(data.begin(), data.end() - 1); - } - - RegCloseKey(hKey); - return iRet; -} - -bool GotoURL(const RString& sUrl) -{ - // Convert RString to std::wstring - std::wstring iUrl = ConvertToWString(sUrl); - - // First try ShellExecuteEx - SHELLEXECUTEINFOW sei = { sizeof(sei) }; - sei.lpVerb = L"open"; - sei.lpFile = iUrl.c_str(); - sei.nShow = SW_SHOWDEFAULT; - sei.fMask = SEE_MASK_FLAG_NO_UI; - - if (ShellExecuteExW(&sei) && reinterpret_cast(sei.hInstApp) > 32) - return true; - - // If it failed, get the .htm regkey and lookup the program - std::wstring key; - if (GetRegKey(HKEY_CLASSES_ROOT, L".htm", key) != ERROR_SUCCESS) - return false; - - key += L"\\shell\\open\\command"; - - if( GetRegKey(HKEY_CLASSES_ROOT, key, key) != ERROR_SUCCESS ) - return false; - - size_t pos = key.find(L"\"%1\""); - if (pos == std::wstring::npos) - { - // No quotes found. Check for %1 without quotes - pos = key.find(L"%1"); - if (pos == std::wstring::npos) - pos = key.length() - 1; // No parameter. - else - key.erase(pos); // Remove the parameter - } - else - { - key.erase(pos); // Remove the parameter - } - - key += L" " + iUrl; - - STARTUPINFOW si = { sizeof(si) }; - PROCESS_INFORMATION pi; - if (CreateProcessW(nullptr, &key[0], nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi)) - { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - return true; - } - - return false; -} - -/* - * (c) 2002-2004 Chris Danford - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/archutils/Win32/GotoURL.h b/src/archutils/Win32/GotoURL.h deleted file mode 100644 index f2b18967fb..0000000000 --- a/src/archutils/Win32/GotoURL.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef GOTO_URL_H -#define GOTO_URL_H - -/** @brief Open URLs in a browser. */ -bool GotoURL( const RString& sUrl ); - -#endif - -/* - * (c) 2002-2004 Chris Danford - * All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, and/or sell copies of the Software, and to permit persons to - * whom the Software is furnished to do so, provided that the above - * copyright notice(s) and this permission notice appear in all copies of - * the Software and that both the above copyright notice(s) and this - * permission notice appear in supporting documentation. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF - * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS - * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT - * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ diff --git a/src/smpackage/LanguagesDlg.cpp b/src/smpackage/LanguagesDlg.cpp index c38cfd603e..0c9497680d 100644 --- a/src/smpackage/LanguagesDlg.cpp +++ b/src/smpackage/LanguagesDlg.cpp @@ -20,7 +20,6 @@ #include "LocalizedString.h" #include "arch/Dialog/Dialog.h" #include "archutils/Win32/SpecialDirs.h" -#include "archutils/Win32/GotoURL.h" #include "archutils/Win32/ErrorStrings.h" #include @@ -646,6 +645,4 @@ void LanguagesDlg::OnBnClickedCheckLanguage() } file.Close(); - - GotoURL( ssprintf("file://%s", sFullFile.c_str()) ); }