mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Ported wxutils from soap branch (Should make launch and explore work in Linux and osx as well) please test on windows.
Fixed a compile bug and a small bug in the cdutils(thanks lp). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2420 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
29
Source/Core/DolphinWX/Src/WxUtils.cpp
Normal file
29
Source/Core/DolphinWX/Src/WxUtils.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user