mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 06:21:19 +12:00
Portable way of opening URLs and directories (#156)
Replaced every instance of ShellExecute with wxLaunchDefaultBrowser
This commit is contained in:
parent
f3c70e69b4
commit
1a1de370e4
5 changed files with 15 additions and 67 deletions
|
@ -20,9 +20,6 @@
|
|||
#include "../wxHelper.h"
|
||||
|
||||
#include <functional>
|
||||
#ifdef _WIN32
|
||||
#include <shellapi.h>
|
||||
#endif
|
||||
|
||||
#include "config/ActiveSettings.h"
|
||||
#include "gui/ChecksumTool.h"
|
||||
|
@ -853,14 +850,10 @@ void wxTitleManagerList::OnContextMenuSelected(wxCommandEvent& event)
|
|||
switch (event.GetId())
|
||||
{
|
||||
case kContextMenuOpenDirectory:
|
||||
{
|
||||
const auto path = fs::is_directory(entry->path) ? entry->path : entry->path.parent_path();
|
||||
#ifdef _WIN32
|
||||
ShellExecuteW(GetHWND(), L"open", path.generic_wstring().c_str(), nullptr, nullptr, SW_SHOWNORMAL);
|
||||
#else
|
||||
assert_dbg();
|
||||
#endif
|
||||
}
|
||||
{
|
||||
const auto path = fs::is_directory(entry->path) ? entry->path : entry->path.parent_path();
|
||||
wxLaunchDefaultBrowser(fmt::format("file:{}", _utf8Wrapper(path)));
|
||||
}
|
||||
break;
|
||||
case kContextMenuDelete:
|
||||
m_context_worker = std::async(std::launch::async, &wxTitleManagerList::DeleteEntry, this, selection, entry.value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue