mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
30 lines
566 B
C++
30 lines
566 B
C++
|
#include "Common.h"
|
||
|
#include <wx/wx.h>
|
||
|
#include <wx/string.h>
|
||
|
namespace WxUtils {
|
||
|
|
||
|
// Launch a file according to its mime type
|
||
|
void Launch(const char *filename)
|
||
|
{
|
||
|
if (! ::wxLaunchDefaultBrowser(wxString::FromAscii(filename))) {
|
||
|
// WARN_LOG
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Launch an file explorer window on a certain path
|
||
|
void Explore(const char *path)
|
||
|
{
|
||
|
wxString wxPath = wxString::FromAscii(path);
|
||
|
|
||
|
// Default to file
|
||
|
if (! wxPath.Contains(wxT("://"))) {
|
||
|
wxPath = wxT("file://") + wxPath;
|
||
|
}
|
||
|
|
||
|
if (! ::wxLaunchDefaultBrowser(wxPath)) {
|
||
|
// WARN_LOG
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|