mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-13 10:18:40 +12:00
OpenGameFolder simplified
Added menu separators
This commit is contained in:
parent
6b471d50eb
commit
c1a98f76cd
1 changed files with 16 additions and 18 deletions
|
@ -68,8 +68,10 @@ void GameViewer::InitPopupMenu()
|
||||||
#endif
|
#endif
|
||||||
m_popup->Append(boot_item);
|
m_popup->Append(boot_item);
|
||||||
m_popup->Append(1, _T("Configure"));
|
m_popup->Append(1, _T("Configure"));
|
||||||
|
m_popup->AppendSeparator();
|
||||||
m_popup->Append(2, _T("Remove Game"));
|
m_popup->Append(2, _T("Remove Game"));
|
||||||
m_popup->Append(3, _T("Remove Custom Configuration"));
|
m_popup->Append(3, _T("Remove Custom Configuration"));
|
||||||
|
m_popup->AppendSeparator();
|
||||||
m_popup->Append(4, _T("Open Game Folder"));
|
m_popup->Append(4, _T("Open Game Folder"));
|
||||||
Bind(wxEVT_MENU, &GameViewer::BootGame, this, 0);
|
Bind(wxEVT_MENU, &GameViewer::BootGame, this, 0);
|
||||||
Bind(wxEVT_MENU, &GameViewer::ConfigureGame, this, 1);
|
Bind(wxEVT_MENU, &GameViewer::ConfigureGame, this, 1);
|
||||||
|
@ -260,29 +262,25 @@ void GameViewer::RemoveGameConfig(wxCommandEvent& event)
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void open_dir(const std::string& spath)
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
std::string command = "explorer " + spath;
|
||||||
|
std::replace(command.begin(), command.end(), '/', '\\');
|
||||||
|
#elif __APPLE__
|
||||||
|
std::string command = "open " + spath;
|
||||||
|
#elif __linux__
|
||||||
|
std::string command = "xdg-open " + spath;
|
||||||
|
#endif
|
||||||
|
wxExecute(fmt::FromUTF8(command));
|
||||||
|
}
|
||||||
|
|
||||||
void GameViewer::OpenGameFolder(wxCommandEvent& event)
|
void GameViewer::OpenGameFolder(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
long i = GetFirstSelected();
|
long i = GetFirstSelected();
|
||||||
if (i < 0) return;
|
if (i < 0) return;
|
||||||
|
|
||||||
const std::string& spath = Emu.GetGameDir() + m_game_data[i].root;
|
open_dir(Emu.GetGameDir() + m_game_data[i].root);
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
std::string command = "explorer " + spath;
|
|
||||||
std::string oldc("/"), newc("\\");
|
|
||||||
size_t pos = 0;
|
|
||||||
while ((pos = command.find(oldc, pos)) != std::string::npos) {
|
|
||||||
command.replace(pos, oldc.length(), newc);
|
|
||||||
pos += newc.length();
|
|
||||||
}
|
|
||||||
wxExecute(fmt::FromUTF8(command));
|
|
||||||
#elif __APPLE__
|
|
||||||
std::string command = "open " + spath;
|
|
||||||
wxExecute(fmt::FromUTF8(command));
|
|
||||||
#elif __Linux
|
|
||||||
std::string command = "xdg-open " + spath;
|
|
||||||
wxExecute(fmt::FromUTF8(command));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnsArr::ColumnsArr()
|
ColumnsArr::ColumnsArr()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue