ui: Replace xemu_open_web_browser with SDL_OpenURL

This commit is contained in:
Matt Borgerson
2025-12-26 15:35:36 -07:00
committed by mborgerson
parent c086cd107a
commit 289e4db0bd
8 changed files with 5 additions and 28 deletions
-11
View File
@@ -84,14 +84,3 @@ const char *xemu_get_os_info(void)
return os_info;
}
void xemu_open_web_browser(const char *url)
{
char *cmd = g_strdup_printf("xdg-open %s", url);
int status = system(cmd);
if (status < 0) {
fprintf(stderr, "Failed to run: %s\n", cmd);
}
free(cmd);
}
-5
View File
@@ -25,8 +25,3 @@ const char *xemu_get_os_info(void)
{
return [[[NSProcessInfo processInfo] operatingSystemVersionString] UTF8String];
}
void xemu_open_web_browser(const char *url)
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url]]];
}
-6
View File
@@ -59,9 +59,3 @@ const char *xemu_get_os_info(void)
return buffer;
}
void xemu_open_web_browser(const char *url)
{
ShellExecute(0, "open", url, 0, 0, SW_SHOW);
}
-1
View File
@@ -25,7 +25,6 @@ extern "C" {
#endif
const char *xemu_get_os_info(void);
void xemu_open_web_browser(const char *url);
#ifndef _WIN32
#ifdef CONFIG_CPUID_H
+1 -1
View File
@@ -136,7 +136,7 @@ void CompatibilityReporter::Draw()
ImGui::PopFont();
ImGui::SameLine();
if (ImGui::Button("Get Token")) {
xemu_open_web_browser("https://reports.xemu.app");
SDL_OpenURL("https://reports.xemu.app");
}
ImGui::NextColumn();
+2 -2
View File
@@ -975,7 +975,7 @@ void MainMenuNetworkView::DrawPcapOptions(bool appearing)
ImGui::Dummy(ImVec2(0,10*g_viewport_mgr.m_scale));
ImGui::SetCursorPosX((ImGui::GetWindowWidth()-120*g_viewport_mgr.m_scale)/2);
if (ImGui::Button("Install npcap", ImVec2(120*g_viewport_mgr.m_scale, 0))) {
xemu_open_web_browser("https://nmap.org/npcap/");
SDL_OpenURL("https://nmap.org/npcap/");
}
#endif
} else {
@@ -1643,7 +1643,7 @@ void MainMenuAboutView::Draw()
ImGui::Text("Visit");
ImGui::SameLine();
if (ImGui::SmallButton("https://xemu.app")) {
xemu_open_web_browser("https://xemu.app");
SDL_OpenURL("https://xemu.app");
}
ImGui::SameLine();
ImGui::Text("for more information");
+1 -1
View File
@@ -231,7 +231,7 @@ void ShowMainMenu()
if (ImGui::BeginMenu("Help"))
{
if (ImGui::MenuItem("Help", NULL)) {
xemu_open_web_browser("https://xemu.app/docs/getting-started/");
SDL_OpenURL("https://xemu.app/docs/getting-started/");
}
ImGui::MenuItem("Report Compatibility...", NULL,
+1 -1
View File
@@ -517,7 +517,7 @@ void Hyperlink(const char *text, const char *url)
ImGui::GetWindowDrawList()->AddLine(min, max, col, 1.0 * g_viewport_mgr.m_scale);
if (ImGui::IsItemClicked()) {
xemu_open_web_browser(url);
SDL_OpenURL(url);
}
}