mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -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:
@ -59,6 +59,8 @@ be accessed from Core::GetWindowHandle().
|
||||
|
||||
#include <wx/datetime.h> // wxWidgets
|
||||
|
||||
// ugly that this lib included code from the main
|
||||
#include "../../DolphinWX/Src/WxUtils.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Resources
|
||||
@ -624,10 +626,10 @@ void CFrame::OnHelp(wxCommandEvent& event)
|
||||
break;
|
||||
}
|
||||
case IDM_HELPWEBSITE:
|
||||
File::Launch("http://www.dolphin-emu.com/");
|
||||
WxUtils::Launch("http://www.dolphin-emu.com/");
|
||||
break;
|
||||
case IDM_HELPGOOGLECODE:
|
||||
File::Launch("http://code.google.com/p/dolphin-emu/");
|
||||
WxUtils::Launch("http://code.google.com/p/dolphin-emu/");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -23,13 +23,13 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "FileSearch.h"
|
||||
#include "FileUtil.h"
|
||||
#include "StringUtil.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "GameListCtrl.h"
|
||||
#include "Blob.h"
|
||||
#include "ISOProperties.h"
|
||||
#include "IniFile.h"
|
||||
#include "FileUtil.h"
|
||||
|
||||
#if USE_XPM_BITMAPS
|
||||
#include "../resources/Flag_Europe.xpm"
|
||||
@ -38,6 +38,9 @@
|
||||
#include "../resources/Flag_USA.xpm"
|
||||
#endif // USE_XPM_BITMAPS
|
||||
|
||||
// ugly that this lib included code from the main
|
||||
#include "../../DolphinWX/Src/WxUtils.h"
|
||||
|
||||
size_t CGameListCtrl::m_currentItem = 0;
|
||||
size_t CGameListCtrl::m_numberItem = 0;
|
||||
std::string CGameListCtrl::m_currentFilename;
|
||||
@ -636,7 +639,7 @@ void CGameListCtrl::OnOpenContainingFolder(wxCommandEvent& WXUNUSED (event))
|
||||
return;
|
||||
std::string path;
|
||||
SplitPath(iso->GetFileName(), &path, 0, 0);
|
||||
File::Explore(path.c_str());
|
||||
WxUtils::Explore(path.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,6 +35,7 @@ if wxenv['HAVE_WX']:
|
||||
'stdafx.cpp',
|
||||
'FrameWiimote.cpp',
|
||||
'SDCardWindow.cpp',
|
||||
'WxUtils.cpp',
|
||||
]
|
||||
|
||||
CPPDEFINES = [
|
||||
|
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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
12
Source/Core/DolphinWX/Src/WxUtils.h
Normal file
12
Source/Core/DolphinWX/Src/WxUtils.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef WXUTILS_H
|
||||
#define WXUTILS_H
|
||||
|
||||
namespace WxUtils {
|
||||
// Launch a file according to its mime type
|
||||
void Launch(const char *filename);
|
||||
|
||||
// Launch an file explorer window on a certain path
|
||||
void Explore(const char *path);
|
||||
|
||||
} // NameSpace WxUtils
|
||||
#endif // WXUTILS
|
Reference in New Issue
Block a user