mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 15:31:17 +01:00
Merge pull request #2326 from JosJuice/isoproperties-config-block
ISOProperties: Don't block when opening default INI in text editor
This commit is contained in:
commit
b0b5f4d10d
@ -1181,7 +1181,7 @@ bool CISOProperties::SaveGameConfig()
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CISOProperties::LaunchExternalEditor(const std::string& filename)
|
void CISOProperties::LaunchExternalEditor(const std::string& filename, bool wait_until_closed)
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
// wxTheMimeTypesManager is not yet implemented for wxCocoa
|
// wxTheMimeTypesManager is not yet implemented for wxCocoa
|
||||||
@ -1204,18 +1204,25 @@ void CISOProperties::LaunchExternalEditor(const std::string& filename)
|
|||||||
if (OpenCommand.IsEmpty())
|
if (OpenCommand.IsEmpty())
|
||||||
{
|
{
|
||||||
WxUtils::ShowErrorDialog(_("Couldn't find open command for extension 'ini'!"));
|
WxUtils::ShowErrorDialog(_("Couldn't find open command for extension 'ini'!"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long result;
|
||||||
|
|
||||||
|
if (wait_until_closed)
|
||||||
|
result = wxExecute(OpenCommand, wxEXEC_SYNC);
|
||||||
else
|
else
|
||||||
|
result = wxExecute(OpenCommand);
|
||||||
|
|
||||||
|
if (result == -1)
|
||||||
{
|
{
|
||||||
if (wxExecute(OpenCommand, wxEXEC_SYNC) == -1)
|
WxUtils::ShowErrorDialog(_("wxExecute returned -1 on application run!"));
|
||||||
WxUtils::ShowErrorDialog(_("wxExecute returned -1 on application run!"));
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wait_until_closed)
|
||||||
|
bRefreshList = true; // Just in case
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bRefreshList = true; // Just in case
|
|
||||||
|
|
||||||
// Once we're done with the ini edit, give the focus back to Dolphin
|
|
||||||
SetFocus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
|
void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
|
||||||
@ -1227,7 +1234,7 @@ void CISOProperties::OnEditConfig(wxCommandEvent& WXUNUSED (event))
|
|||||||
std::fstream blankFile(GameIniFileLocal, std::ios::out);
|
std::fstream blankFile(GameIniFileLocal, std::ios::out);
|
||||||
blankFile.close();
|
blankFile.close();
|
||||||
}
|
}
|
||||||
LaunchExternalEditor(GameIniFileLocal);
|
LaunchExternalEditor(GameIniFileLocal, true);
|
||||||
GameIniLocal.Load(GameIniFileLocal);
|
GameIniLocal.Load(GameIniFileLocal);
|
||||||
LoadGameConfig();
|
LoadGameConfig();
|
||||||
}
|
}
|
||||||
@ -1284,7 +1291,7 @@ void CISOProperties::OnShowDefaultConfig(wxCommandEvent& WXUNUSED (event))
|
|||||||
{
|
{
|
||||||
std::string path = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + filename;
|
std::string path = File::GetSysDirectory() + GAMESETTINGS_DIR DIR_SEP + filename;
|
||||||
if (File::Exists(path))
|
if (File::Exists(path))
|
||||||
LaunchExternalEditor(path);
|
LaunchExternalEditor(path, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ private:
|
|||||||
IDM_BNRSAVEAS
|
IDM_BNRSAVEAS
|
||||||
};
|
};
|
||||||
|
|
||||||
void LaunchExternalEditor(const std::string& filename);
|
void LaunchExternalEditor(const std::string& filename, bool wait_until_closed);
|
||||||
|
|
||||||
void CreateGUIControls();
|
void CreateGUIControls();
|
||||||
void OnClose(wxCloseEvent& event);
|
void OnClose(wxCloseEvent& event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user